diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3d1bf0ae..de0960ab 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.11.2" + ".": "1.12.0" } \ No newline at end of file diff --git a/.rubocop.yml b/.rubocop.yml index 6688b6c6..c001bd7d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -121,6 +121,10 @@ Metrics/BlockLength: Metrics/ClassLength: Enabled: false +Metrics/CollectionLiteralLength: + Exclude: + - "test/**/*" + Metrics/CyclomaticComplexity: Enabled: false diff --git a/.stats.yml b/.stats.yml index 69ee938b..1d5af75a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 118 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-4f31d46f5ba187fc4d702c9f9f1573dacb891edbd086f935707578d7c4f5fed8.yml -openapi_spec_hash: 25b1019f20a47b8af665aae5f8fd0025 -config_hash: d8a0d696f3250ab096fac87b6b0eab53 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-ee9adb19e1aafbee7edb5b95348a1629c1de6ca9625f3b49f6064ae10d863bfc.yml +openapi_spec_hash: 42006f5fb95364855be09dc4432073c0 +config_hash: 1f73a949b649ecfe6ec68ba1bb459dc2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fc104bc..be0c6efb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,54 @@ # Changelog +## 1.12.0 (2025-10-10) + +Full Changelog: [v1.11.2...v1.12.0](https://github.com/orbcorp/orb-ruby/compare/v1.11.2...v1.12.0) + +### ⚠ BREAKING CHANGES + +* **api:** define shared model ConversionRateConfig + +### Features + +* **api:** api update ([182e255](https://github.com/orbcorp/orb-ruby/commit/182e255a2ed9a39f774afb700320ff762da40e6d)) +* **api:** api update ([87ab4bb](https://github.com/orbcorp/orb-ruby/commit/87ab4bb08910a9c6e5a7995ca307e8a80c737c39)) +* **api:** api update ([dbeafc7](https://github.com/orbcorp/orb-ruby/commit/dbeafc76cc391a10d8cb21f5db2ef8bb825aee1c)) +* **api:** api update ([f8b2792](https://github.com/orbcorp/orb-ruby/commit/f8b27927f181b45c2196de229a35b5eae6122f46)) +* **api:** api update ([f8c9f2c](https://github.com/orbcorp/orb-ruby/commit/f8c9f2c57e94d09130d68b080b0adc5ae38bbd30)) +* **api:** api update ([d1fc414](https://github.com/orbcorp/orb-ruby/commit/d1fc414cb976afe6bb19dc284dceb7ed7bfa38c2)) +* **api:** api update ([83a6ffd](https://github.com/orbcorp/orb-ruby/commit/83a6ffda9613b6571029f01235d673d179294c94)) +* **api:** api update ([343fa0b](https://github.com/orbcorp/orb-ruby/commit/343fa0b8a9a724b73f8abe5e9de34795f232e065)) +* **api:** api update ([b89ea6d](https://github.com/orbcorp/orb-ruby/commit/b89ea6d10a12909e77c76617d11068ade5cf6fc8)) +* **api:** api update ([be80854](https://github.com/orbcorp/orb-ruby/commit/be80854305b7dd24350c0a955de536d37233bc35)) +* **api:** api update ([8e3ac4b](https://github.com/orbcorp/orb-ruby/commit/8e3ac4b248b2aca6ac6d5360f34be8521b05bc83)) +* **api:** api update ([246283d](https://github.com/orbcorp/orb-ruby/commit/246283dc41fd3d9b128ac44ccd8550ae7b987578)) +* **api:** api update ([bc6c8f9](https://github.com/orbcorp/orb-ruby/commit/bc6c8f9914220783adeb80fa6a9eb87d009fa58d)) +* **api:** api update ([394af82](https://github.com/orbcorp/orb-ruby/commit/394af826a5ba3cd462447304c8ec659038e67617)) +* **api:** define shared model ConversionRateConfig ([aa669fe](https://github.com/orbcorp/orb-ruby/commit/aa669fef9079dbac856be83d56cabd826e3c47c0)) +* expose response headers for both streams and errors ([cafba93](https://github.com/orbcorp/orb-ruby/commit/cafba93f8798a84815c9c9d1183327e498cb6b95)) +* extract minimum composite to type ([3bd8a47](https://github.com/orbcorp/orb-ruby/commit/3bd8a47a7c0601ccb9c43b472131562319a59e51)) + + +### Bug Fixes + +* always send `filename=...` for multipart requests where a file is expected ([aefe58f](https://github.com/orbcorp/orb-ruby/commit/aefe58f92b1296aa30172ce8206f84723a3a326c)) +* coroutine leaks from connection pool ([a4faf55](https://github.com/orbcorp/orb-ruby/commit/a4faf55a381bcdaae01f0a22cd8922038af38f69)) +* **internal:** use null byte as file separator in the fast formatting script ([58f092f](https://github.com/orbcorp/orb-ruby/commit/58f092f32214ae8deb17db5e002f10fafd60378e)) +* shorten multipart boundary sep to less than RFC specificed max length ([984b6ad](https://github.com/orbcorp/orb-ruby/commit/984b6ad403302ab97275136e145dce322ce82e9b)) + + +### Performance Improvements + +* faster code formatting ([9538971](https://github.com/orbcorp/orb-ruby/commit/95389713d7c3b97ec3cf0963b86211d5fba72fe4)) + + +### Chores + +* allow fast-format to use bsd sed as well ([6566897](https://github.com/orbcorp/orb-ruby/commit/6566897b0797bdbad69e21ed05d97f4ce1509f07)) +* do not install brew dependencies in ./scripts/bootstrap by default ([c7d1331](https://github.com/orbcorp/orb-ruby/commit/c7d13317194914b406f35048eb198c715e3645da)) +* ignore linter error for tests having large collections ([717bc2e](https://github.com/orbcorp/orb-ruby/commit/717bc2e5e09f3c6cea641189a2a9eb516dcbf0ec)) +* **internal:** codegen related update ([d7dd0b8](https://github.com/orbcorp/orb-ruby/commit/d7dd0b8380fd9ec066388c3327ed16fdba9f7fa6)) + ## 1.11.2 (2025-08-29) Full Changelog: [v1.11.1...v1.11.2](https://github.com/orbcorp/orb-ruby/compare/v1.11.1...v1.11.2) diff --git a/Gemfile.lock b/Gemfile.lock index 2e05053f..d0aaf930 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - orb-billing (1.11.2) + orb-billing (1.12.0) connection_pool GEM diff --git a/README.md b/README.md index d6d4dd76..af62afe5 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "orb-billing", "~> 1.11.2" +gem "orb-billing", "~> 1.12.0" ``` diff --git a/Rakefile b/Rakefile index 4da7115a..f874b088 100644 --- a/Rakefile +++ b/Rakefile @@ -12,6 +12,8 @@ tapioca = "sorbet/tapioca" examples = "examples" ignore_file = ".ignore" +FILES_ENV = "FORMAT_FILE" + CLEAN.push(*%w[.idea/ .ruby-lsp/ .yardoc/ doc/], *FileList["*.gem"], ignore_file) CLOBBER.push(*%w[sorbet/rbi/annotations/ sorbet/rbi/gems/], tapioca) @@ -38,6 +40,14 @@ end xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --max-args=300 --] ruby_opt = {"RUBYOPT" => [ENV["RUBYOPT"], "--encoding=UTF-8"].compact.join(" ")} +filtered = ->(ext, dirs) do + if ENV.key?(FILES_ENV) + %w[sed -E -n -e] << "/\\.#{ext}$/p" << "--" << ENV.fetch(FILES_ENV) + else + (%w[find] + dirs + %w[-type f -and -name]) << "*.#{ext}" << "-print0" + end +end + desc("Lint `*.rb(i)`") multitask(:"lint:rubocop") do find = %w[find ./lib ./test ./rbi ./examples -type f -and ( -name *.rb -or -name *.rbi ) -print0] @@ -52,24 +62,26 @@ multitask(:"lint:rubocop") do sh("#{find.shelljoin} | #{lint.shelljoin}") end +norm_lines = %w[tr -- \n \0].shelljoin + desc("Format `*.rb`") multitask(:"format:rb") do # while `syntax_tree` is much faster than `rubocop`, `rubocop` is the only formatter with full syntax support - find = %w[find ./lib ./test ./examples -type f -and -name *.rb -print0] + files = filtered["rb", %w[./lib ./test ./examples]] fmt = xargs + %w[rubocop --fail-level F --autocorrect --format simple --] - sh("#{find.shelljoin} | #{fmt.shelljoin}") + sh("#{files.shelljoin} | #{norm_lines} | #{fmt.shelljoin}") end desc("Format `*.rbi`") multitask(:"format:rbi") do - find = %w[find ./rbi -type f -and -name *.rbi -print0] + files = filtered["rbi", %w[./rbi]] fmt = xargs + %w[stree write --] - sh(ruby_opt, "#{find.shelljoin} | #{fmt.shelljoin}") + sh(ruby_opt, "#{files.shelljoin} | #{norm_lines} | #{fmt.shelljoin}") end desc("Format `*.rbs`") multitask(:"format:rbs") do - find = %w[find ./sig -type f -name *.rbs -print0] + files = filtered["rbs", %w[./sig]] inplace = /darwin|bsd/ =~ RUBY_PLATFORM ? ["-i", ""] : %w[-i] uuid = SecureRandom.uuid @@ -98,13 +110,13 @@ multitask(:"format:rbs") do success = false # transform class aliases to type aliases, which syntax tree has no trouble with - sh("#{find.shelljoin} | #{pre.shelljoin}") + sh("#{files.shelljoin} | #{norm_lines} | #{pre.shelljoin}") # run syntax tree to format `*.rbs` files - sh(ruby_opt, "#{find.shelljoin} | #{fmt.shelljoin}") do + sh(ruby_opt, "#{files.shelljoin} | #{norm_lines} | #{fmt.shelljoin}") do success = _1 end # transform type aliases back to class aliases - sh("#{find.shelljoin} | #{pst.shelljoin}") + sh("#{files.shelljoin} | #{norm_lines} | #{pst.shelljoin}") # always run post-processing to remove comment marker fail unless success diff --git a/lib/orb.rb b/lib/orb.rb index a8aaf838..0daea809 100644 --- a/lib/orb.rb +++ b/lib/orb.rb @@ -79,10 +79,6 @@ require_relative "orb/models/billing_cycle_anchor_configuration" require_relative "orb/models/billing_cycle_configuration" require_relative "orb/models/billing_cycle_relative_date" -require_relative "orb/models/bps_config" -require_relative "orb/models/bps_tier" -require_relative "orb/models/bulk_bps_config" -require_relative "orb/models/bulk_bps_tier" require_relative "orb/models/bulk_config" require_relative "orb/models/bulk_tier" require_relative "orb/models/changed_subscription_resources" @@ -234,8 +230,6 @@ require_relative "orb/models/new_avalara_tax_configuration" require_relative "orb/models/new_billing_cycle_configuration" require_relative "orb/models/new_dimensional_price_configuration" -require_relative "orb/models/new_floating_bps_price" -require_relative "orb/models/new_floating_bulk_bps_price" require_relative "orb/models/new_floating_bulk_price" require_relative "orb/models/new_floating_bulk_with_proration_price" require_relative "orb/models/new_floating_cumulative_grouped_bulk_price" @@ -248,12 +242,12 @@ require_relative "orb/models/new_floating_matrix_with_allocation_price" require_relative "orb/models/new_floating_matrix_with_display_name_price" require_relative "orb/models/new_floating_max_group_tiered_package_price" +require_relative "orb/models/new_floating_minimum_composite_price" require_relative "orb/models/new_floating_package_price" require_relative "orb/models/new_floating_package_with_allocation_price" require_relative "orb/models/new_floating_scalable_matrix_with_tiered_pricing_price" require_relative "orb/models/new_floating_scalable_matrix_with_unit_pricing_price" require_relative "orb/models/new_floating_threshold_total_amount_price" -require_relative "orb/models/new_floating_tiered_bps_price" require_relative "orb/models/new_floating_tiered_package_price" require_relative "orb/models/new_floating_tiered_package_with_minimum_price" require_relative "orb/models/new_floating_tiered_price" @@ -265,8 +259,6 @@ require_relative "orb/models/new_maximum" require_relative "orb/models/new_minimum" require_relative "orb/models/new_percentage_discount" -require_relative "orb/models/new_plan_bps_price" -require_relative "orb/models/new_plan_bulk_bps_price" require_relative "orb/models/new_plan_bulk_price" require_relative "orb/models/new_plan_bulk_with_proration_price" require_relative "orb/models/new_plan_cumulative_grouped_bulk_price" @@ -279,24 +271,21 @@ require_relative "orb/models/new_plan_matrix_with_allocation_price" require_relative "orb/models/new_plan_matrix_with_display_name_price" require_relative "orb/models/new_plan_max_group_tiered_package_price" +require_relative "orb/models/new_plan_minimum_composite_price" require_relative "orb/models/new_plan_package_price" require_relative "orb/models/new_plan_package_with_allocation_price" require_relative "orb/models/new_plan_scalable_matrix_with_tiered_pricing_price" require_relative "orb/models/new_plan_scalable_matrix_with_unit_pricing_price" require_relative "orb/models/new_plan_threshold_total_amount_price" -require_relative "orb/models/new_plan_tiered_bps_price" require_relative "orb/models/new_plan_tiered_package_price" require_relative "orb/models/new_plan_tiered_package_with_minimum_price" require_relative "orb/models/new_plan_tiered_price" require_relative "orb/models/new_plan_tiered_with_minimum_price" -require_relative "orb/models/new_plan_tier_with_proration_price" require_relative "orb/models/new_plan_unit_price" require_relative "orb/models/new_plan_unit_with_percent_price" require_relative "orb/models/new_plan_unit_with_proration_price" require_relative "orb/models/new_reporting_configuration" require_relative "orb/models/new_sphere_configuration" -require_relative "orb/models/new_subscription_bps_price" -require_relative "orb/models/new_subscription_bulk_bps_price" require_relative "orb/models/new_subscription_bulk_price" require_relative "orb/models/new_subscription_bulk_with_proration_price" require_relative "orb/models/new_subscription_cumulative_grouped_bulk_price" @@ -309,17 +298,16 @@ require_relative "orb/models/new_subscription_matrix_with_allocation_price" require_relative "orb/models/new_subscription_matrix_with_display_name_price" require_relative "orb/models/new_subscription_max_group_tiered_package_price" +require_relative "orb/models/new_subscription_minimum_composite_price" require_relative "orb/models/new_subscription_package_price" require_relative "orb/models/new_subscription_package_with_allocation_price" require_relative "orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price" require_relative "orb/models/new_subscription_scalable_matrix_with_unit_pricing_price" require_relative "orb/models/new_subscription_threshold_total_amount_price" -require_relative "orb/models/new_subscription_tiered_bps_price" require_relative "orb/models/new_subscription_tiered_package_price" require_relative "orb/models/new_subscription_tiered_package_with_minimum_price" require_relative "orb/models/new_subscription_tiered_price" require_relative "orb/models/new_subscription_tiered_with_minimum_price" -require_relative "orb/models/new_subscription_tier_with_proration_price" require_relative "orb/models/new_subscription_unit_price" require_relative "orb/models/new_subscription_unit_with_percent_price" require_relative "orb/models/new_subscription_unit_with_proration_price" @@ -395,8 +383,6 @@ require_relative "orb/models/tax_amount" require_relative "orb/models/threshold" require_relative "orb/models/tier" -require_relative "orb/models/tier_config" -require_relative "orb/models/tiered_bps_config" require_relative "orb/models/tiered_config" require_relative "orb/models/tiered_conversion_rate_config" require_relative "orb/models/tier_sub_line_item" diff --git a/lib/orb/errors.rb b/lib/orb/errors.rb index db0cb388..a1725eb1 100644 --- a/lib/orb/errors.rb +++ b/lib/orb/errors.rb @@ -40,6 +40,9 @@ class APIError < Orb::Errors::Error # @return [Integer, nil] attr_accessor :status + # @return [Hash{String=>String}, nil] + attr_accessor :headers + # @return [Object, nil] attr_accessor :body @@ -47,13 +50,15 @@ class APIError < Orb::Errors::Error # # @param url [URI::Generic] # @param status [Integer, nil] + # @param headers [Hash{String=>String}, nil] # @param body [Object, nil] # @param request [nil] # @param response [nil] # @param message [String, nil] - def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: nil) + def initialize(url:, status: nil, headers: nil, body: nil, request: nil, response: nil, message: nil) @url = url @status = status + @headers = headers @body = body @request = request @response = response @@ -74,6 +79,7 @@ class APIConnectionError < Orb::Errors::APIError # # @param url [URI::Generic] # @param status [nil] + # @param headers [Hash{String=>String}, nil] # @param body [nil] # @param request [nil] # @param response [nil] @@ -81,6 +87,7 @@ class APIConnectionError < Orb::Errors::APIError def initialize( url:, status: nil, + headers: nil, body: nil, request: nil, response: nil, @@ -95,6 +102,7 @@ class APITimeoutError < Orb::Errors::APIConnectionError # # @param url [URI::Generic] # @param status [nil] + # @param headers [Hash{String=>String}, nil] # @param body [nil] # @param request [nil] # @param response [nil] @@ -102,6 +110,7 @@ class APITimeoutError < Orb::Errors::APIConnectionError def initialize( url:, status: nil, + headers: nil, body: nil, request: nil, response: nil, @@ -116,22 +125,25 @@ class APIStatusError < Orb::Errors::APIError # # @param url [URI::Generic] # @param status [Integer] + # @param headers [Hash{String=>String}, nil] # @param body [Object, nil] # @param request [nil] # @param response [nil] # @param message [String, nil] # # @return [self] - def self.for(url:, status:, body:, request:, response:, message: nil) + def self.for(url:, status:, headers:, body:, request:, response:, message: nil) key = Orb::Internal::Util.dig(body, :type) - kwargs = { - url: url, - status: status, - body: body, - request: request, - response: response, - message: message - } + kwargs = + { + url: url, + status: status, + headers: headers, + body: body, + request: request, + response: response, + message: message + } case [status, key] in [400, Orb::Errors::ConstraintViolation::TYPE] @@ -187,15 +199,17 @@ def self.for(url:, status:, body:, request:, response:, message: nil) # # @param url [URI::Generic] # @param status [Integer] + # @param headers [Hash{String=>String}, nil] # @param body [Object, nil] # @param request [nil] # @param response [nil] # @param message [String, nil] - def initialize(url:, status:, body:, request:, response:, message: nil) + def initialize(url:, status:, headers:, body:, request:, response:, message: nil) message ||= {url: url.to_s, status: status, body: body} super( url: url, status: status, + headers: headers, body: body, request: request, response: response, diff --git a/lib/orb/file_part.rb b/lib/orb/file_part.rb index e96e727a..e2b9f1a2 100644 --- a/lib/orb/file_part.rb +++ b/lib/orb/file_part.rb @@ -38,18 +38,21 @@ def to_json(*a) = read.to_json(*a) def to_yaml(*a) = read.to_yaml(*a) # @param content [Pathname, StringIO, IO, String] - # @param filename [String, nil] + # @param filename [Pathname, String, nil] # @param content_type [String, nil] def initialize(content, filename: nil, content_type: nil) - @content = content + @content_type = content_type @filename = - case content - in Pathname - filename.nil? ? content.basename.to_path : ::File.basename(filename) + case [filename, (@content = content)] + in [String | Pathname, _] + ::File.basename(filename) + in [nil, Pathname] + content.basename.to_path + in [nil, IO] + content.to_path else - filename.nil? ? nil : ::File.basename(filename) + filename end - @content_type = content_type end end end diff --git a/lib/orb/internal/page.rb b/lib/orb/internal/page.rb index d9e38211..8d458355 100644 --- a/lib/orb/internal/page.rb +++ b/lib/orb/internal/page.rb @@ -60,7 +60,7 @@ def auto_paging_each(&blk) # # @param client [Orb::Internal::Transport::BaseClient] # @param req [Hash{Symbol=>Object}] - # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param headers [Hash{String=>String}] # @param page_data [Hash{Symbol=>Object}] def initialize(client:, req:, headers:, page_data:) super diff --git a/lib/orb/internal/transport/base_client.rb b/lib/orb/internal/transport/base_client.rb index 84dc98c7..a1b369a1 100644 --- a/lib/orb/internal/transport/base_client.rb +++ b/lib/orb/internal/transport/base_client.rb @@ -47,7 +47,7 @@ def validate!(req) # @api private # # @param status [Integer] - # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param headers [Hash{String=>String}] # # @return [Boolean] def should_retry?(status, headers:) @@ -85,7 +85,7 @@ def should_retry?(status, headers:) # # @param status [Integer] # - # @param response_headers [Hash{String=>String}, Net::HTTPHeader] + # @param response_headers [Hash{String=>String}] # # @return [Hash{Symbol=>Object}] def follow_redirect(request, status:, response_headers:) @@ -375,6 +375,7 @@ def send_request(request, redirect_count:, retry_count:, send_retry_header:) rescue Orb::Errors::APIConnectionError => e status = e end + headers = Orb::Internal::Util.normalized_headers(response&.each_header&.to_h) case status in ..299 @@ -387,7 +388,7 @@ def send_request(request, redirect_count:, retry_count:, send_retry_header:) in 300..399 self.class.reap_connection!(status, stream: stream) - request = self.class.follow_redirect(request, status: status, response_headers: response) + request = self.class.follow_redirect(request, status: status, response_headers: headers) send_request( request, redirect_count: redirect_count + 1, @@ -396,9 +397,9 @@ def send_request(request, redirect_count:, retry_count:, send_retry_header:) ) in Orb::Errors::APIConnectionError if retry_count >= max_retries raise status - in (400..) if retry_count >= max_retries || !self.class.should_retry?(status, headers: response) + in (400..) if retry_count >= max_retries || !self.class.should_retry?(status, headers: headers) decoded = Kernel.then do - Orb::Internal::Util.decode_content(response, stream: stream, suppress_error: true) + Orb::Internal::Util.decode_content(headers, stream: stream, suppress_error: true) ensure self.class.reap_connection!(status, stream: stream) end @@ -406,6 +407,7 @@ def send_request(request, redirect_count:, retry_count:, send_retry_header:) raise Orb::Errors::APIStatusError.for( url: url, status: status, + headers: headers, body: decoded, request: nil, response: response @@ -482,19 +484,21 @@ def request(req) send_retry_header: send_retry_header ) - decoded = Orb::Internal::Util.decode_content(response, stream: stream) + headers = Orb::Internal::Util.normalized_headers(response.each_header.to_h) + decoded = Orb::Internal::Util.decode_content(headers, stream: stream) case req in {stream: Class => st} st.new( model: model, url: url, status: status, + headers: headers, response: response, unwrap: unwrap, stream: decoded ) in {page: Class => page} - page.new(client: self, req: req, headers: response, page_data: decoded) + page.new(client: self, req: req, headers: headers, page_data: decoded) else unwrapped = Orb::Internal::Util.dig(decoded, unwrap) Orb::Internal::Type::Converter.coerce(model, unwrapped) diff --git a/lib/orb/internal/transport/pooled_net_requester.rb b/lib/orb/internal/transport/pooled_net_requester.rb index d18f8262..8016381f 100644 --- a/lib/orb/internal/transport/pooled_net_requester.rb +++ b/lib/orb/internal/transport/pooled_net_requester.rb @@ -134,9 +134,9 @@ def execute(request) # rubocop:disable Metrics/BlockLength enum = Enumerator.new do |y| - with_pool(url, deadline: deadline) do |conn| - next if finished + next if finished + with_pool(url, deadline: deadline) do |conn| req, closing = self.class.build_request(request) do self.class.calibrate_socket_timeout(conn, deadline) end @@ -149,7 +149,7 @@ def execute(request) self.class.calibrate_socket_timeout(conn, deadline) conn.request(req) do |rsp| - y << [conn, req, rsp] + y << [req, rsp] break if finished rsp.read_body do |bytes| @@ -160,6 +160,8 @@ def execute(request) end eof = true end + ensure + conn.finish if !eof && conn&.started? end rescue Timeout::Error raise Orb::Errors::APITimeoutError.new(url: url, request: req) @@ -168,16 +170,11 @@ def execute(request) end # rubocop:enable Metrics/BlockLength - conn, _, response = enum.next + _, response = enum.next body = Orb::Internal::Util.fused_enum(enum, external: true) do finished = true - tap do - enum.next - rescue StopIteration - nil - end + loop { enum.next } ensure - conn.finish if !eof && conn&.started? closing&.call end [Integer(response.code), response, body] diff --git a/lib/orb/internal/type/base_page.rb b/lib/orb/internal/type/base_page.rb index 8585169c..4df77ad6 100644 --- a/lib/orb/internal/type/base_page.rb +++ b/lib/orb/internal/type/base_page.rb @@ -39,7 +39,7 @@ def to_enum = super(:auto_paging_each) # # @param client [Orb::Internal::Transport::BaseClient] # @param req [Hash{Symbol=>Object}] - # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param headers [Hash{String=>String}] # @param page_data [Object] def initialize(client:, req:, headers:, page_data:) @client = client diff --git a/lib/orb/internal/type/file_input.rb b/lib/orb/internal/type/file_input.rb index f6742b3b..db81fd24 100644 --- a/lib/orb/internal/type/file_input.rb +++ b/lib/orb/internal/type/file_input.rb @@ -81,17 +81,20 @@ def coerce(value, state:) # # @return [Pathname, StringIO, IO, String, Object] def dump(value, state:) - # rubocop:disable Lint/DuplicateBranch case value + in StringIO | String + # https://datatracker.ietf.org/doc/html/rfc7578#section-4.2 + # while not required, a filename is recommended, and in practice many servers do expect this + Orb::FilePart.new(value, filename: "upload") in IO state[:can_retry] = false + value.to_path.nil? ? Orb::FilePart.new(value, filename: "upload") : value in Orb::FilePart if value.content.is_a?(IO) state[:can_retry] = false + value else + value end - # rubocop:enable Lint/DuplicateBranch - - value end # @api private diff --git a/lib/orb/internal/util.rb b/lib/orb/internal/util.rb index 88501161..f4a0e2ec 100644 --- a/lib/orb/internal/util.rb +++ b/lib/orb/internal/util.rb @@ -566,7 +566,8 @@ class << self # # @return [Array(String, Enumerable)] private def encode_multipart_streaming(body) - boundary = SecureRandom.urlsafe_base64(60) + # RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length + boundary = SecureRandom.urlsafe_base64(46) closing = [] strio = writable_enum do |y| @@ -645,7 +646,7 @@ def force_charset!(content_type, text:) # # Assumes each chunk in stream has `Encoding::BINARY`. # - # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param headers [Hash{String=>String}] # @param stream [Enumerable] # @param suppress_error [Boolean] # diff --git a/lib/orb/models.rb b/lib/orb/models.rb index 72de570f..9de4470a 100644 --- a/lib/orb/models.rb +++ b/lib/orb/models.rb @@ -91,14 +91,6 @@ module Orb BillingCycleRelativeDate = Orb::Models::BillingCycleRelativeDate - BPSConfig = Orb::Models::BPSConfig - - BPSTier = Orb::Models::BPSTier - - BulkBPSConfig = Orb::Models::BulkBPSConfig - - BulkBPSTier = Orb::Models::BulkBPSTier - BulkConfig = Orb::Models::BulkConfig BulkTier = Orb::Models::BulkTier @@ -290,10 +282,6 @@ module Orb NewDimensionalPriceConfiguration = Orb::Models::NewDimensionalPriceConfiguration - NewFloatingBPSPrice = Orb::Models::NewFloatingBPSPrice - - NewFloatingBulkBPSPrice = Orb::Models::NewFloatingBulkBPSPrice - NewFloatingBulkPrice = Orb::Models::NewFloatingBulkPrice NewFloatingBulkWithProrationPrice = Orb::Models::NewFloatingBulkWithProrationPrice @@ -318,6 +306,8 @@ module Orb NewFloatingMaxGroupTieredPackagePrice = Orb::Models::NewFloatingMaxGroupTieredPackagePrice + NewFloatingMinimumCompositePrice = Orb::Models::NewFloatingMinimumCompositePrice + NewFloatingPackagePrice = Orb::Models::NewFloatingPackagePrice NewFloatingPackageWithAllocationPrice = Orb::Models::NewFloatingPackageWithAllocationPrice @@ -330,8 +320,6 @@ module Orb NewFloatingThresholdTotalAmountPrice = Orb::Models::NewFloatingThresholdTotalAmountPrice - NewFloatingTieredBPSPrice = Orb::Models::NewFloatingTieredBPSPrice - NewFloatingTieredPackagePrice = Orb::Models::NewFloatingTieredPackagePrice NewFloatingTieredPackageWithMinimumPrice = Orb::Models::NewFloatingTieredPackageWithMinimumPrice @@ -354,10 +342,6 @@ module Orb NewPercentageDiscount = Orb::Models::NewPercentageDiscount - NewPlanBPSPrice = Orb::Models::NewPlanBPSPrice - - NewPlanBulkBPSPrice = Orb::Models::NewPlanBulkBPSPrice - NewPlanBulkPrice = Orb::Models::NewPlanBulkPrice NewPlanBulkWithProrationPrice = Orb::Models::NewPlanBulkWithProrationPrice @@ -382,6 +366,8 @@ module Orb NewPlanMaxGroupTieredPackagePrice = Orb::Models::NewPlanMaxGroupTieredPackagePrice + NewPlanMinimumCompositePrice = Orb::Models::NewPlanMinimumCompositePrice + NewPlanPackagePrice = Orb::Models::NewPlanPackagePrice NewPlanPackageWithAllocationPrice = Orb::Models::NewPlanPackageWithAllocationPrice @@ -392,8 +378,6 @@ module Orb NewPlanThresholdTotalAmountPrice = Orb::Models::NewPlanThresholdTotalAmountPrice - NewPlanTieredBPSPrice = Orb::Models::NewPlanTieredBPSPrice - NewPlanTieredPackagePrice = Orb::Models::NewPlanTieredPackagePrice NewPlanTieredPackageWithMinimumPrice = Orb::Models::NewPlanTieredPackageWithMinimumPrice @@ -402,8 +386,6 @@ module Orb NewPlanTieredWithMinimumPrice = Orb::Models::NewPlanTieredWithMinimumPrice - NewPlanTierWithProrationPrice = Orb::Models::NewPlanTierWithProrationPrice - NewPlanUnitPrice = Orb::Models::NewPlanUnitPrice NewPlanUnitWithPercentPrice = Orb::Models::NewPlanUnitWithPercentPrice @@ -414,10 +396,6 @@ module Orb NewSphereConfiguration = Orb::Models::NewSphereConfiguration - NewSubscriptionBPSPrice = Orb::Models::NewSubscriptionBPSPrice - - NewSubscriptionBulkBPSPrice = Orb::Models::NewSubscriptionBulkBPSPrice - NewSubscriptionBulkPrice = Orb::Models::NewSubscriptionBulkPrice NewSubscriptionBulkWithProrationPrice = Orb::Models::NewSubscriptionBulkWithProrationPrice @@ -444,6 +422,8 @@ module Orb NewSubscriptionMaxGroupTieredPackagePrice = Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice + NewSubscriptionMinimumCompositePrice = Orb::Models::NewSubscriptionMinimumCompositePrice + NewSubscriptionPackagePrice = Orb::Models::NewSubscriptionPackagePrice NewSubscriptionPackageWithAllocationPrice = Orb::Models::NewSubscriptionPackageWithAllocationPrice @@ -456,8 +436,6 @@ module Orb NewSubscriptionThresholdTotalAmountPrice = Orb::Models::NewSubscriptionThresholdTotalAmountPrice - NewSubscriptionTieredBPSPrice = Orb::Models::NewSubscriptionTieredBPSPrice - NewSubscriptionTieredPackagePrice = Orb::Models::NewSubscriptionTieredPackagePrice NewSubscriptionTieredPackageWithMinimumPrice = Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice @@ -466,8 +444,6 @@ module Orb NewSubscriptionTieredWithMinimumPrice = Orb::Models::NewSubscriptionTieredWithMinimumPrice - NewSubscriptionTierWithProrationPrice = Orb::Models::NewSubscriptionTierWithProrationPrice - NewSubscriptionUnitPrice = Orb::Models::NewSubscriptionUnitPrice NewSubscriptionUnitWithPercentPrice = Orb::Models::NewSubscriptionUnitWithPercentPrice @@ -600,10 +576,6 @@ module Orb Tier = Orb::Models::Tier - TierConfig = Orb::Models::TierConfig - - TieredBPSConfig = Orb::Models::TieredBPSConfig - TieredConfig = Orb::Models::TieredConfig TieredConversionRateConfig = Orb::Models::TieredConversionRateConfig diff --git a/lib/orb/models/beta/external_plan_id_create_plan_version_params.rb b/lib/orb/models/beta/external_plan_id_create_plan_version_params.rb index 2d58ac35..7b05148e 100644 --- a/lib/orb/models/beta/external_plan_id_create_plan_version_params.rb +++ b/lib/orb/models/beta/external_plan_id_create_plan_version_params.rb @@ -155,9 +155,9 @@ class AddPrice < Orb::Internal::Type::BaseModel optional :plan_phase_order, Integer, nil?: true # @!attribute price - # The price to add to the plan + # New plan price request body params. # - # @return [Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanTieredBPSPrice, Orb::Models::NewPlanBPSPrice, Orb::Models::NewPlanBulkBPSPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanTierWithProrationPrice, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::NewPlanGroupedTieredPrice, nil] + # @return [Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanGroupedTieredPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanMinimumCompositePrice, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput, nil] optional :price, union: -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price }, nil?: true @@ -167,9 +167,9 @@ class AddPrice < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] The phase to add this price to. # - # @param price [Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanTieredBPSPrice, Orb::Models::NewPlanBPSPrice, Orb::Models::NewPlanBulkBPSPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanTierWithProrationPrice, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::NewPlanGroupedTieredPrice, nil] The price to add to the plan + # @param price [Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanGroupedTieredPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanMinimumCompositePrice, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput, nil] New plan price request body params. - # The price to add to the plan + # New plan price request body params. # # @see Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice#price module Price @@ -179,19 +179,13 @@ module Price variant :unit, -> { Orb::NewPlanUnitPrice } - variant :package, -> { Orb::NewPlanPackagePrice } - - variant :matrix, -> { Orb::NewPlanMatrixPrice } - variant :tiered, -> { Orb::NewPlanTieredPrice } - variant :tiered_bps, -> { Orb::NewPlanTieredBPSPrice } - - variant :bps, -> { Orb::NewPlanBPSPrice } + variant :bulk, -> { Orb::NewPlanBulkPrice } - variant :bulk_bps, -> { Orb::NewPlanBulkBPSPrice } + variant :package, -> { Orb::NewPlanPackagePrice } - variant :bulk, -> { Orb::NewPlanBulkPrice } + variant :matrix, -> { Orb::NewPlanMatrixPrice } variant :threshold_total_amount, -> { Orb::NewPlanThresholdTotalAmountPrice } @@ -199,23 +193,33 @@ module Price variant :tiered_with_minimum, -> { Orb::NewPlanTieredWithMinimumPrice } - variant :unit_with_percent, -> { Orb::NewPlanUnitWithPercentPrice } + variant :grouped_tiered, -> { Orb::NewPlanGroupedTieredPrice } + + variant :tiered_package_with_minimum, -> { Orb::NewPlanTieredPackageWithMinimumPrice } variant :package_with_allocation, -> { Orb::NewPlanPackageWithAllocationPrice } - variant :tiered_with_proration, -> { Orb::NewPlanTierWithProrationPrice } + variant :unit_with_percent, -> { Orb::NewPlanUnitWithPercentPrice } + + variant :matrix_with_allocation, -> { Orb::NewPlanMatrixWithAllocationPrice } + + variant :tiered_with_proration, + -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration } variant :unit_with_proration, -> { Orb::NewPlanUnitWithProrationPrice } variant :grouped_allocation, -> { Orb::NewPlanGroupedAllocationPrice } + variant :bulk_with_proration, -> { Orb::NewPlanBulkWithProrationPrice } + variant :grouped_with_prorated_minimum, -> { Orb::NewPlanGroupedWithProratedMinimumPrice } variant :grouped_with_metered_minimum, -> { Orb::NewPlanGroupedWithMeteredMinimumPrice } - variant :matrix_with_display_name, -> { Orb::NewPlanMatrixWithDisplayNamePrice } + variant :grouped_with_min_max_thresholds, + -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds } - variant :bulk_with_proration, -> { Orb::NewPlanBulkWithProrationPrice } + variant :matrix_with_display_name, -> { Orb::NewPlanMatrixWithDisplayNamePrice } variant :grouped_tiered_package, -> { Orb::NewPlanGroupedTieredPackagePrice } @@ -227,14 +231,887 @@ module Price variant :cumulative_grouped_bulk, -> { Orb::NewPlanCumulativeGroupedBulkPrice } - variant :tiered_package_with_minimum, -> { Orb::NewPlanTieredPackageWithMinimumPrice } - - variant :matrix_with_allocation, -> { Orb::NewPlanMatrixWithAllocationPrice } - - variant :grouped_tiered, -> { Orb::NewPlanGroupedTieredPrice } + variant :minimum, -> { Orb::NewPlanMinimumCompositePrice } + + variant :percent, -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent } + + variant :event_output, + -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput } + + class TieredWithProration < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence] + required :cadence, + enum: -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :tiered_with_proration] + required :model_type, const: :tiered_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_proration_config + # Configuration for tiered_with_proration pricing + # + # @return [Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig] + required :tiered_with_proration_config, + -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, item_id:, name:, tiered_with_proration_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :tiered_with_proration) + # Some parameter documentations has been truncated, see + # {Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration} + # for more details. + # + # @param cadence [Symbol, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence] The cadence to bill for this price on. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param tiered_with_proration_config [Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig] Configuration for tiered_with_proration pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :tiered_with_proration] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration#tiered_with_proration_config + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Tiers for rating based on total usage quantities into the specified tier with + # proration + # + # @return [Array] + required :tiers, + -> do + Orb::Internal::Type::ArrayOf[ + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + end + + # @!method initialize(tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig} + # for more details. + # + # Configuration for tiered_with_proration pricing + # + # @param tiers [Array] Tiers for rating based on total usage quantities into the specified tier with pr + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Inclusive tier starting value + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tiered with proration tier + # + # @param tier_lower_bound [String] Inclusive tier starting value + # + # @param unit_amount [String] Amount per unit + end + end + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence] + required :cadence, + enum: -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence } + + # @!attribute grouped_with_min_max_thresholds_config + # Configuration for grouped_with_min_max_thresholds pricing + # + # @return [Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] + required :grouped_with_min_max_thresholds_config, + -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :grouped_with_min_max_thresholds] + required :model_type, const: :grouped_with_min_max_thresholds + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, grouped_with_min_max_thresholds_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :grouped_with_min_max_thresholds) + # Some parameter documentations has been truncated, see + # {Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds} + # for more details. + # + # @param cadence [Symbol, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence] The cadence to bill for this price on. + # + # @param grouped_with_min_max_thresholds_config [Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] Configuration for grouped_with_min_max_thresholds pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :grouped_with_min_max_thresholds] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds#grouped_with_min_max_thresholds_config + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before applying thresholds + # + # @return [String] + required :grouping_key, String + + # @!attribute maximum_charge + # The maximum amount to charge each group + # + # @return [String] + required :maximum_charge, String + + # @!attribute minimum_charge + # The minimum amount to charge each group, regardless of usage + # + # @return [String] + required :minimum_charge, String + + # @!attribute per_unit_rate + # The base price charged per group + # + # @return [String] + required :per_unit_rate, String + + # @!method initialize(grouping_key:, maximum_charge:, minimum_charge:, per_unit_rate:) + # Configuration for grouped_with_min_max_thresholds pricing + # + # @param grouping_key [String] The event property used to group before applying thresholds + # + # @param maximum_charge [String] The maximum amount to charge each group + # + # @param minimum_charge [String] The minimum amount to charge each group, regardless of usage + # + # @param per_unit_rate [String] The base price charged per group + end + end + + class Percent < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::Cadence] + required :cadence, + enum: -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::Cadence } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :percent] + required :model_type, const: :percent + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute percent_config + # Configuration for percent pricing + # + # @return [Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig] + required :percent_config, + -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, item_id:, name:, percent_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :percent) + # Some parameter documentations has been truncated, see + # {Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent} + # for more details. + # + # @param cadence [Symbol, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::Cadence] The cadence to bill for this price on. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param percent_config [Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig] Configuration for percent pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :percent] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent#percent_config + class PercentConfig < Orb::Internal::Type::BaseModel + # @!attribute percent + # What percent of the component subtotals to charge + # + # @return [Float] + required :percent, Float + + # @!method initialize(percent:) + # Configuration for percent pricing + # + # @param percent [Float] What percent of the component subtotals to charge + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence] + required :cadence, + enum: -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence } + + # @!attribute event_output_config + # Configuration for event_output pricing + # + # @return [Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig] + required :event_output_config, + -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :event_output] + required :model_type, const: :event_output + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, event_output_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :event_output) + # Some parameter documentations has been truncated, see + # {Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput} + # for more details. + # + # @param cadence [Symbol, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence] The cadence to bill for this price on. + # + # @param event_output_config [Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig] Configuration for event_output pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :event_output] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput#event_output_config + class EventOutputConfig < Orb::Internal::Type::BaseModel + # @!attribute unit_rating_key + # The key in the event data to extract the unit rate from. + # + # @return [String] + required :unit_rating_key, String + + # @!attribute grouping_key + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + # + # @return [String, nil] + optional :grouping_key, String, nil?: true + + # @!method initialize(unit_rating_key:, grouping_key: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig} + # for more details. + # + # Configuration for event_output pricing + # + # @param unit_rating_key [String] The key in the event data to extract the unit rate from. + # + # @param grouping_key [String, nil] An optional key in the event data to group by (e.g., event ID). All events will + end + end # @!method self.variants - # @return [Array(Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanTieredBPSPrice, Orb::Models::NewPlanBPSPrice, Orb::Models::NewPlanBulkBPSPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanTierWithProrationPrice, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::NewPlanGroupedTieredPrice)] + # @return [Array(Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanGroupedTieredPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanMinimumCompositePrice, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput)] end end @@ -346,9 +1223,9 @@ class ReplacePrice < Orb::Internal::Type::BaseModel optional :plan_phase_order, Integer, nil?: true # @!attribute price - # The price to add to the plan + # New plan price request body params. # - # @return [Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanTieredBPSPrice, Orb::Models::NewPlanBPSPrice, Orb::Models::NewPlanBulkBPSPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanTierWithProrationPrice, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::NewPlanGroupedTieredPrice, nil] + # @return [Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanGroupedTieredPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanMinimumCompositePrice, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput, nil] optional :price, union: -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price }, nil?: true @@ -360,9 +1237,9 @@ class ReplacePrice < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] The phase to replace this price from. # - # @param price [Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanTieredBPSPrice, Orb::Models::NewPlanBPSPrice, Orb::Models::NewPlanBulkBPSPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanTierWithProrationPrice, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::NewPlanGroupedTieredPrice, nil] The price to add to the plan + # @param price [Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanGroupedTieredPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanMinimumCompositePrice, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput, nil] New plan price request body params. - # The price to add to the plan + # New plan price request body params. # # @see Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice#price module Price @@ -372,19 +1249,13 @@ module Price variant :unit, -> { Orb::NewPlanUnitPrice } - variant :package, -> { Orb::NewPlanPackagePrice } - - variant :matrix, -> { Orb::NewPlanMatrixPrice } - variant :tiered, -> { Orb::NewPlanTieredPrice } - variant :tiered_bps, -> { Orb::NewPlanTieredBPSPrice } - - variant :bps, -> { Orb::NewPlanBPSPrice } + variant :bulk, -> { Orb::NewPlanBulkPrice } - variant :bulk_bps, -> { Orb::NewPlanBulkBPSPrice } + variant :package, -> { Orb::NewPlanPackagePrice } - variant :bulk, -> { Orb::NewPlanBulkPrice } + variant :matrix, -> { Orb::NewPlanMatrixPrice } variant :threshold_total_amount, -> { Orb::NewPlanThresholdTotalAmountPrice } @@ -392,23 +1263,33 @@ module Price variant :tiered_with_minimum, -> { Orb::NewPlanTieredWithMinimumPrice } - variant :unit_with_percent, -> { Orb::NewPlanUnitWithPercentPrice } + variant :grouped_tiered, -> { Orb::NewPlanGroupedTieredPrice } + + variant :tiered_package_with_minimum, -> { Orb::NewPlanTieredPackageWithMinimumPrice } variant :package_with_allocation, -> { Orb::NewPlanPackageWithAllocationPrice } - variant :tiered_with_proration, -> { Orb::NewPlanTierWithProrationPrice } + variant :unit_with_percent, -> { Orb::NewPlanUnitWithPercentPrice } + + variant :matrix_with_allocation, -> { Orb::NewPlanMatrixWithAllocationPrice } + + variant :tiered_with_proration, + -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration } variant :unit_with_proration, -> { Orb::NewPlanUnitWithProrationPrice } variant :grouped_allocation, -> { Orb::NewPlanGroupedAllocationPrice } + variant :bulk_with_proration, -> { Orb::NewPlanBulkWithProrationPrice } + variant :grouped_with_prorated_minimum, -> { Orb::NewPlanGroupedWithProratedMinimumPrice } variant :grouped_with_metered_minimum, -> { Orb::NewPlanGroupedWithMeteredMinimumPrice } - variant :matrix_with_display_name, -> { Orb::NewPlanMatrixWithDisplayNamePrice } + variant :grouped_with_min_max_thresholds, + -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds } - variant :bulk_with_proration, -> { Orb::NewPlanBulkWithProrationPrice } + variant :matrix_with_display_name, -> { Orb::NewPlanMatrixWithDisplayNamePrice } variant :grouped_tiered_package, -> { Orb::NewPlanGroupedTieredPackagePrice } @@ -420,14 +1301,887 @@ module Price variant :cumulative_grouped_bulk, -> { Orb::NewPlanCumulativeGroupedBulkPrice } - variant :tiered_package_with_minimum, -> { Orb::NewPlanTieredPackageWithMinimumPrice } - - variant :matrix_with_allocation, -> { Orb::NewPlanMatrixWithAllocationPrice } - - variant :grouped_tiered, -> { Orb::NewPlanGroupedTieredPrice } + variant :minimum, -> { Orb::NewPlanMinimumCompositePrice } + + variant :percent, -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent } + + variant :event_output, + -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput } + + class TieredWithProration < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence] + required :cadence, + enum: -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :tiered_with_proration] + required :model_type, const: :tiered_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_proration_config + # Configuration for tiered_with_proration pricing + # + # @return [Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig] + required :tiered_with_proration_config, + -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, item_id:, name:, tiered_with_proration_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :tiered_with_proration) + # Some parameter documentations has been truncated, see + # {Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration} + # for more details. + # + # @param cadence [Symbol, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence] The cadence to bill for this price on. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param tiered_with_proration_config [Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig] Configuration for tiered_with_proration pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :tiered_with_proration] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration#tiered_with_proration_config + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Tiers for rating based on total usage quantities into the specified tier with + # proration + # + # @return [Array] + required :tiers, + -> do + Orb::Internal::Type::ArrayOf[ + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + end + + # @!method initialize(tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig} + # for more details. + # + # Configuration for tiered_with_proration pricing + # + # @param tiers [Array] Tiers for rating based on total usage quantities into the specified tier with pr + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Inclusive tier starting value + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tiered with proration tier + # + # @param tier_lower_bound [String] Inclusive tier starting value + # + # @param unit_amount [String] Amount per unit + end + end + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence] + required :cadence, + enum: -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence } + + # @!attribute grouped_with_min_max_thresholds_config + # Configuration for grouped_with_min_max_thresholds pricing + # + # @return [Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] + required :grouped_with_min_max_thresholds_config, + -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :grouped_with_min_max_thresholds] + required :model_type, const: :grouped_with_min_max_thresholds + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, grouped_with_min_max_thresholds_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :grouped_with_min_max_thresholds) + # Some parameter documentations has been truncated, see + # {Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds} + # for more details. + # + # @param cadence [Symbol, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence] The cadence to bill for this price on. + # + # @param grouped_with_min_max_thresholds_config [Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] Configuration for grouped_with_min_max_thresholds pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :grouped_with_min_max_thresholds] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds#grouped_with_min_max_thresholds_config + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before applying thresholds + # + # @return [String] + required :grouping_key, String + + # @!attribute maximum_charge + # The maximum amount to charge each group + # + # @return [String] + required :maximum_charge, String + + # @!attribute minimum_charge + # The minimum amount to charge each group, regardless of usage + # + # @return [String] + required :minimum_charge, String + + # @!attribute per_unit_rate + # The base price charged per group + # + # @return [String] + required :per_unit_rate, String + + # @!method initialize(grouping_key:, maximum_charge:, minimum_charge:, per_unit_rate:) + # Configuration for grouped_with_min_max_thresholds pricing + # + # @param grouping_key [String] The event property used to group before applying thresholds + # + # @param maximum_charge [String] The maximum amount to charge each group + # + # @param minimum_charge [String] The minimum amount to charge each group, regardless of usage + # + # @param per_unit_rate [String] The base price charged per group + end + end + + class Percent < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence] + required :cadence, + enum: -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :percent] + required :model_type, const: :percent + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute percent_config + # Configuration for percent pricing + # + # @return [Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig] + required :percent_config, + -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, item_id:, name:, percent_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :percent) + # Some parameter documentations has been truncated, see + # {Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent} + # for more details. + # + # @param cadence [Symbol, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence] The cadence to bill for this price on. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param percent_config [Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig] Configuration for percent pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :percent] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent#percent_config + class PercentConfig < Orb::Internal::Type::BaseModel + # @!attribute percent + # What percent of the component subtotals to charge + # + # @return [Float] + required :percent, Float + + # @!method initialize(percent:) + # Configuration for percent pricing + # + # @param percent [Float] What percent of the component subtotals to charge + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence] + required :cadence, + enum: -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence } + + # @!attribute event_output_config + # Configuration for event_output pricing + # + # @return [Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig] + required :event_output_config, + -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :event_output] + required :model_type, const: :event_output + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, event_output_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :event_output) + # Some parameter documentations has been truncated, see + # {Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput} + # for more details. + # + # @param cadence [Symbol, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence] The cadence to bill for this price on. + # + # @param event_output_config [Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig] Configuration for event_output pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :event_output] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput#event_output_config + class EventOutputConfig < Orb::Internal::Type::BaseModel + # @!attribute unit_rating_key + # The key in the event data to extract the unit rate from. + # + # @return [String] + required :unit_rating_key, String + + # @!attribute grouping_key + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + # + # @return [String, nil] + optional :grouping_key, String, nil?: true + + # @!method initialize(unit_rating_key:, grouping_key: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig} + # for more details. + # + # Configuration for event_output pricing + # + # @param unit_rating_key [String] The key in the event data to extract the unit rate from. + # + # @param grouping_key [String, nil] An optional key in the event data to group by (e.g., event ID). All events will + end + end # @!method self.variants - # @return [Array(Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanTieredBPSPrice, Orb::Models::NewPlanBPSPrice, Orb::Models::NewPlanBulkBPSPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanTierWithProrationPrice, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::NewPlanGroupedTieredPrice)] + # @return [Array(Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanGroupedTieredPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanMinimumCompositePrice, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent, Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput)] end end end diff --git a/lib/orb/models/beta_create_plan_version_params.rb b/lib/orb/models/beta_create_plan_version_params.rb index 8e8c158d..d8ea1879 100644 --- a/lib/orb/models/beta_create_plan_version_params.rb +++ b/lib/orb/models/beta_create_plan_version_params.rb @@ -141,9 +141,9 @@ class AddPrice < Orb::Internal::Type::BaseModel optional :plan_phase_order, Integer, nil?: true # @!attribute price - # The price to add to the plan + # New plan price request body params. # - # @return [Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanTieredBPSPrice, Orb::Models::NewPlanBPSPrice, Orb::Models::NewPlanBulkBPSPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanTierWithProrationPrice, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::NewPlanGroupedTieredPrice, nil] + # @return [Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanGroupedTieredPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanMinimumCompositePrice, Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::Percent, Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput, nil] optional :price, union: -> { Orb::BetaCreatePlanVersionParams::AddPrice::Price }, nil?: true # @!method initialize(allocation_price: nil, plan_phase_order: nil, price: nil) @@ -151,9 +151,9 @@ class AddPrice < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] The phase to add this price to. # - # @param price [Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanTieredBPSPrice, Orb::Models::NewPlanBPSPrice, Orb::Models::NewPlanBulkBPSPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanTierWithProrationPrice, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::NewPlanGroupedTieredPrice, nil] The price to add to the plan + # @param price [Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanGroupedTieredPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanMinimumCompositePrice, Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::Percent, Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput, nil] New plan price request body params. - # The price to add to the plan + # New plan price request body params. # # @see Orb::Models::BetaCreatePlanVersionParams::AddPrice#price module Price @@ -163,19 +163,13 @@ module Price variant :unit, -> { Orb::NewPlanUnitPrice } - variant :package, -> { Orb::NewPlanPackagePrice } - - variant :matrix, -> { Orb::NewPlanMatrixPrice } - variant :tiered, -> { Orb::NewPlanTieredPrice } - variant :tiered_bps, -> { Orb::NewPlanTieredBPSPrice } - - variant :bps, -> { Orb::NewPlanBPSPrice } + variant :bulk, -> { Orb::NewPlanBulkPrice } - variant :bulk_bps, -> { Orb::NewPlanBulkBPSPrice } + variant :package, -> { Orb::NewPlanPackagePrice } - variant :bulk, -> { Orb::NewPlanBulkPrice } + variant :matrix, -> { Orb::NewPlanMatrixPrice } variant :threshold_total_amount, -> { Orb::NewPlanThresholdTotalAmountPrice } @@ -183,23 +177,33 @@ module Price variant :tiered_with_minimum, -> { Orb::NewPlanTieredWithMinimumPrice } - variant :unit_with_percent, -> { Orb::NewPlanUnitWithPercentPrice } + variant :grouped_tiered, -> { Orb::NewPlanGroupedTieredPrice } + + variant :tiered_package_with_minimum, -> { Orb::NewPlanTieredPackageWithMinimumPrice } variant :package_with_allocation, -> { Orb::NewPlanPackageWithAllocationPrice } - variant :tiered_with_proration, -> { Orb::NewPlanTierWithProrationPrice } + variant :unit_with_percent, -> { Orb::NewPlanUnitWithPercentPrice } + + variant :matrix_with_allocation, -> { Orb::NewPlanMatrixWithAllocationPrice } + + variant :tiered_with_proration, + -> { Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration } variant :unit_with_proration, -> { Orb::NewPlanUnitWithProrationPrice } variant :grouped_allocation, -> { Orb::NewPlanGroupedAllocationPrice } + variant :bulk_with_proration, -> { Orb::NewPlanBulkWithProrationPrice } + variant :grouped_with_prorated_minimum, -> { Orb::NewPlanGroupedWithProratedMinimumPrice } variant :grouped_with_metered_minimum, -> { Orb::NewPlanGroupedWithMeteredMinimumPrice } - variant :matrix_with_display_name, -> { Orb::NewPlanMatrixWithDisplayNamePrice } + variant :grouped_with_min_max_thresholds, + -> { Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds } - variant :bulk_with_proration, -> { Orb::NewPlanBulkWithProrationPrice } + variant :matrix_with_display_name, -> { Orb::NewPlanMatrixWithDisplayNamePrice } variant :grouped_tiered_package, -> { Orb::NewPlanGroupedTieredPackagePrice } @@ -211,14 +215,879 @@ module Price variant :cumulative_grouped_bulk, -> { Orb::NewPlanCumulativeGroupedBulkPrice } - variant :tiered_package_with_minimum, -> { Orb::NewPlanTieredPackageWithMinimumPrice } - - variant :matrix_with_allocation, -> { Orb::NewPlanMatrixWithAllocationPrice } - - variant :grouped_tiered, -> { Orb::NewPlanGroupedTieredPrice } + variant :minimum, -> { Orb::NewPlanMinimumCompositePrice } + + variant :percent, -> { Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent } + + variant :event_output, -> { Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput } + + class TieredWithProration < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence] + required :cadence, + enum: -> { Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :tiered_with_proration] + required :model_type, const: :tiered_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_proration_config + # Configuration for tiered_with_proration pricing + # + # @return [Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig] + required :tiered_with_proration_config, + -> { Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, item_id:, name:, tiered_with_proration_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :tiered_with_proration) + # Some parameter documentations has been truncated, see + # {Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration} + # for more details. + # + # @param cadence [Symbol, Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence] The cadence to bill for this price on. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param tiered_with_proration_config [Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig] Configuration for tiered_with_proration pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :tiered_with_proration] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration#tiered_with_proration_config + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Tiers for rating based on total usage quantities into the specified tier with + # proration + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] } + + # @!method initialize(tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig} + # for more details. + # + # Configuration for tiered_with_proration pricing + # + # @param tiers [Array] Tiers for rating based on total usage quantities into the specified tier with pr + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Inclusive tier starting value + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tiered with proration tier + # + # @param tier_lower_bound [String] Inclusive tier starting value + # + # @param unit_amount [String] Amount per unit + end + end + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence] + required :cadence, + enum: -> { Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence } + + # @!attribute grouped_with_min_max_thresholds_config + # Configuration for grouped_with_min_max_thresholds pricing + # + # @return [Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] + required :grouped_with_min_max_thresholds_config, + -> { Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :grouped_with_min_max_thresholds] + required :model_type, const: :grouped_with_min_max_thresholds + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, grouped_with_min_max_thresholds_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :grouped_with_min_max_thresholds) + # Some parameter documentations has been truncated, see + # {Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds} + # for more details. + # + # @param cadence [Symbol, Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence] The cadence to bill for this price on. + # + # @param grouped_with_min_max_thresholds_config [Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] Configuration for grouped_with_min_max_thresholds pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :grouped_with_min_max_thresholds] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds#grouped_with_min_max_thresholds_config + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before applying thresholds + # + # @return [String] + required :grouping_key, String + + # @!attribute maximum_charge + # The maximum amount to charge each group + # + # @return [String] + required :maximum_charge, String + + # @!attribute minimum_charge + # The minimum amount to charge each group, regardless of usage + # + # @return [String] + required :minimum_charge, String + + # @!attribute per_unit_rate + # The base price charged per group + # + # @return [String] + required :per_unit_rate, String + + # @!method initialize(grouping_key:, maximum_charge:, minimum_charge:, per_unit_rate:) + # Configuration for grouped_with_min_max_thresholds pricing + # + # @param grouping_key [String] The event property used to group before applying thresholds + # + # @param maximum_charge [String] The maximum amount to charge each group + # + # @param minimum_charge [String] The minimum amount to charge each group, regardless of usage + # + # @param per_unit_rate [String] The base price charged per group + end + end + + class Percent < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::Percent::Cadence] + required :cadence, enum: -> { Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::Cadence } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :percent] + required :model_type, const: :percent + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute percent_config + # Configuration for percent pricing + # + # @return [Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig] + required :percent_config, -> { Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, item_id:, name:, percent_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :percent) + # Some parameter documentations has been truncated, see + # {Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::Percent} for more + # details. + # + # @param cadence [Symbol, Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::Percent::Cadence] The cadence to bill for this price on. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param percent_config [Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig] Configuration for percent pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :percent] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::Percent#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::Percent#percent_config + class PercentConfig < Orb::Internal::Type::BaseModel + # @!attribute percent + # What percent of the component subtotals to charge + # + # @return [Float] + required :percent, Float + + # @!method initialize(percent:) + # Configuration for percent pricing + # + # @param percent [Float] What percent of the component subtotals to charge + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence] + required :cadence, enum: -> { Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence } + + # @!attribute event_output_config + # Configuration for event_output pricing + # + # @return [Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig] + required :event_output_config, + -> { Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :event_output] + required :model_type, const: :event_output + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, event_output_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :event_output) + # Some parameter documentations has been truncated, see + # {Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput} for + # more details. + # + # @param cadence [Symbol, Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence] The cadence to bill for this price on. + # + # @param event_output_config [Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig] Configuration for event_output pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :event_output] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput#event_output_config + class EventOutputConfig < Orb::Internal::Type::BaseModel + # @!attribute unit_rating_key + # The key in the event data to extract the unit rate from. + # + # @return [String] + required :unit_rating_key, String + + # @!attribute grouping_key + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + # + # @return [String, nil] + optional :grouping_key, String, nil?: true + + # @!method initialize(unit_rating_key:, grouping_key: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig} + # for more details. + # + # Configuration for event_output pricing + # + # @param unit_rating_key [String] The key in the event data to extract the unit rate from. + # + # @param grouping_key [String, nil] An optional key in the event data to group by (e.g., event ID). All events will + end + end # @!method self.variants - # @return [Array(Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanTieredBPSPrice, Orb::Models::NewPlanBPSPrice, Orb::Models::NewPlanBulkBPSPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanTierWithProrationPrice, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::NewPlanGroupedTieredPrice)] + # @return [Array(Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanGroupedTieredPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanMinimumCompositePrice, Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::Percent, Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput)] end end @@ -329,9 +1198,9 @@ class ReplacePrice < Orb::Internal::Type::BaseModel optional :plan_phase_order, Integer, nil?: true # @!attribute price - # The price to add to the plan + # New plan price request body params. # - # @return [Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanTieredBPSPrice, Orb::Models::NewPlanBPSPrice, Orb::Models::NewPlanBulkBPSPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanTierWithProrationPrice, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::NewPlanGroupedTieredPrice, nil] + # @return [Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanGroupedTieredPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanMinimumCompositePrice, Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent, Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput, nil] optional :price, union: -> { Orb::BetaCreatePlanVersionParams::ReplacePrice::Price }, nil?: true # @!method initialize(replaces_price_id:, allocation_price: nil, plan_phase_order: nil, price: nil) @@ -341,9 +1210,9 @@ class ReplacePrice < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] The phase to replace this price from. # - # @param price [Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanTieredBPSPrice, Orb::Models::NewPlanBPSPrice, Orb::Models::NewPlanBulkBPSPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanTierWithProrationPrice, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::NewPlanGroupedTieredPrice, nil] The price to add to the plan + # @param price [Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanGroupedTieredPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanMinimumCompositePrice, Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent, Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput, nil] New plan price request body params. - # The price to add to the plan + # New plan price request body params. # # @see Orb::Models::BetaCreatePlanVersionParams::ReplacePrice#price module Price @@ -353,19 +1222,13 @@ module Price variant :unit, -> { Orb::NewPlanUnitPrice } - variant :package, -> { Orb::NewPlanPackagePrice } - - variant :matrix, -> { Orb::NewPlanMatrixPrice } - variant :tiered, -> { Orb::NewPlanTieredPrice } - variant :tiered_bps, -> { Orb::NewPlanTieredBPSPrice } - - variant :bps, -> { Orb::NewPlanBPSPrice } + variant :bulk, -> { Orb::NewPlanBulkPrice } - variant :bulk_bps, -> { Orb::NewPlanBulkBPSPrice } + variant :package, -> { Orb::NewPlanPackagePrice } - variant :bulk, -> { Orb::NewPlanBulkPrice } + variant :matrix, -> { Orb::NewPlanMatrixPrice } variant :threshold_total_amount, -> { Orb::NewPlanThresholdTotalAmountPrice } @@ -373,23 +1236,33 @@ module Price variant :tiered_with_minimum, -> { Orb::NewPlanTieredWithMinimumPrice } - variant :unit_with_percent, -> { Orb::NewPlanUnitWithPercentPrice } + variant :grouped_tiered, -> { Orb::NewPlanGroupedTieredPrice } + + variant :tiered_package_with_minimum, -> { Orb::NewPlanTieredPackageWithMinimumPrice } variant :package_with_allocation, -> { Orb::NewPlanPackageWithAllocationPrice } - variant :tiered_with_proration, -> { Orb::NewPlanTierWithProrationPrice } + variant :unit_with_percent, -> { Orb::NewPlanUnitWithPercentPrice } + + variant :matrix_with_allocation, -> { Orb::NewPlanMatrixWithAllocationPrice } + + variant :tiered_with_proration, + -> { Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration } variant :unit_with_proration, -> { Orb::NewPlanUnitWithProrationPrice } variant :grouped_allocation, -> { Orb::NewPlanGroupedAllocationPrice } + variant :bulk_with_proration, -> { Orb::NewPlanBulkWithProrationPrice } + variant :grouped_with_prorated_minimum, -> { Orb::NewPlanGroupedWithProratedMinimumPrice } variant :grouped_with_metered_minimum, -> { Orb::NewPlanGroupedWithMeteredMinimumPrice } - variant :matrix_with_display_name, -> { Orb::NewPlanMatrixWithDisplayNamePrice } + variant :grouped_with_min_max_thresholds, + -> { Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds } - variant :bulk_with_proration, -> { Orb::NewPlanBulkWithProrationPrice } + variant :matrix_with_display_name, -> { Orb::NewPlanMatrixWithDisplayNamePrice } variant :grouped_tiered_package, -> { Orb::NewPlanGroupedTieredPackagePrice } @@ -401,14 +1274,885 @@ module Price variant :cumulative_grouped_bulk, -> { Orb::NewPlanCumulativeGroupedBulkPrice } - variant :tiered_package_with_minimum, -> { Orb::NewPlanTieredPackageWithMinimumPrice } - - variant :matrix_with_allocation, -> { Orb::NewPlanMatrixWithAllocationPrice } - - variant :grouped_tiered, -> { Orb::NewPlanGroupedTieredPrice } + variant :minimum, -> { Orb::NewPlanMinimumCompositePrice } + + variant :percent, -> { Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent } + + variant :event_output, -> { Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput } + + class TieredWithProration < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence] + required :cadence, + enum: -> { Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :tiered_with_proration] + required :model_type, const: :tiered_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_proration_config + # Configuration for tiered_with_proration pricing + # + # @return [Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig] + required :tiered_with_proration_config, + -> { Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, item_id:, name:, tiered_with_proration_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :tiered_with_proration) + # Some parameter documentations has been truncated, see + # {Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration} + # for more details. + # + # @param cadence [Symbol, Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence] The cadence to bill for this price on. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param tiered_with_proration_config [Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig] Configuration for tiered_with_proration pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :tiered_with_proration] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration#tiered_with_proration_config + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Tiers for rating based on total usage quantities into the specified tier with + # proration + # + # @return [Array] + required :tiers, + -> do + Orb::Internal::Type::ArrayOf[ + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + end + + # @!method initialize(tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig} + # for more details. + # + # Configuration for tiered_with_proration pricing + # + # @param tiers [Array] Tiers for rating based on total usage quantities into the specified tier with pr + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Inclusive tier starting value + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tiered with proration tier + # + # @param tier_lower_bound [String] Inclusive tier starting value + # + # @param unit_amount [String] Amount per unit + end + end + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence] + required :cadence, + enum: -> { Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence } + + # @!attribute grouped_with_min_max_thresholds_config + # Configuration for grouped_with_min_max_thresholds pricing + # + # @return [Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] + required :grouped_with_min_max_thresholds_config, + -> { Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :grouped_with_min_max_thresholds] + required :model_type, const: :grouped_with_min_max_thresholds + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, grouped_with_min_max_thresholds_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :grouped_with_min_max_thresholds) + # Some parameter documentations has been truncated, see + # {Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds} + # for more details. + # + # @param cadence [Symbol, Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence] The cadence to bill for this price on. + # + # @param grouped_with_min_max_thresholds_config [Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] Configuration for grouped_with_min_max_thresholds pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :grouped_with_min_max_thresholds] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds#grouped_with_min_max_thresholds_config + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before applying thresholds + # + # @return [String] + required :grouping_key, String + + # @!attribute maximum_charge + # The maximum amount to charge each group + # + # @return [String] + required :maximum_charge, String + + # @!attribute minimum_charge + # The minimum amount to charge each group, regardless of usage + # + # @return [String] + required :minimum_charge, String + + # @!attribute per_unit_rate + # The base price charged per group + # + # @return [String] + required :per_unit_rate, String + + # @!method initialize(grouping_key:, maximum_charge:, minimum_charge:, per_unit_rate:) + # Configuration for grouped_with_min_max_thresholds pricing + # + # @param grouping_key [String] The event property used to group before applying thresholds + # + # @param maximum_charge [String] The maximum amount to charge each group + # + # @param minimum_charge [String] The minimum amount to charge each group, regardless of usage + # + # @param per_unit_rate [String] The base price charged per group + end + end + + class Percent < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence] + required :cadence, enum: -> { Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :percent] + required :model_type, const: :percent + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute percent_config + # Configuration for percent pricing + # + # @return [Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig] + required :percent_config, + -> { Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, item_id:, name:, percent_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :percent) + # Some parameter documentations has been truncated, see + # {Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent} for + # more details. + # + # @param cadence [Symbol, Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence] The cadence to bill for this price on. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param percent_config [Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig] Configuration for percent pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :percent] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent#percent_config + class PercentConfig < Orb::Internal::Type::BaseModel + # @!attribute percent + # What percent of the component subtotals to charge + # + # @return [Float] + required :percent, Float + + # @!method initialize(percent:) + # Configuration for percent pricing + # + # @param percent [Float] What percent of the component subtotals to charge + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence] + required :cadence, + enum: -> { Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence } + + # @!attribute event_output_config + # Configuration for event_output pricing + # + # @return [Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig] + required :event_output_config, + -> { Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :event_output] + required :model_type, const: :event_output + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, event_output_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :event_output) + # Some parameter documentations has been truncated, see + # {Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput} for + # more details. + # + # @param cadence [Symbol, Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence] The cadence to bill for this price on. + # + # @param event_output_config [Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig] Configuration for event_output pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :event_output] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput#event_output_config + class EventOutputConfig < Orb::Internal::Type::BaseModel + # @!attribute unit_rating_key + # The key in the event data to extract the unit rate from. + # + # @return [String] + required :unit_rating_key, String + + # @!attribute grouping_key + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + # + # @return [String, nil] + optional :grouping_key, String, nil?: true + + # @!method initialize(unit_rating_key:, grouping_key: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig} + # for more details. + # + # Configuration for event_output pricing + # + # @param unit_rating_key [String] The key in the event data to extract the unit rate from. + # + # @param grouping_key [String, nil] An optional key in the event data to group by (e.g., event ID). All events will + end + end # @!method self.variants - # @return [Array(Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanTieredBPSPrice, Orb::Models::NewPlanBPSPrice, Orb::Models::NewPlanBulkBPSPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanTierWithProrationPrice, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::NewPlanGroupedTieredPrice)] + # @return [Array(Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanGroupedTieredPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanMinimumCompositePrice, Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent, Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput)] end end end diff --git a/lib/orb/models/bps_config.rb b/lib/orb/models/bps_config.rb deleted file mode 100644 index d9d816af..00000000 --- a/lib/orb/models/bps_config.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -module Orb - module Models - class BPSConfig < Orb::Internal::Type::BaseModel - # @!attribute bps - # Basis point take rate per event - # - # @return [Float] - required :bps, Float - - # @!attribute per_unit_maximum - # Optional currency amount maximum to cap spend per event - # - # @return [String, nil] - optional :per_unit_maximum, String, nil?: true - - # @!method initialize(bps:, per_unit_maximum: nil) - # @param bps [Float] Basis point take rate per event - # - # @param per_unit_maximum [String, nil] Optional currency amount maximum to cap spend per event - end - end -end diff --git a/lib/orb/models/bps_tier.rb b/lib/orb/models/bps_tier.rb deleted file mode 100644 index 97af3177..00000000 --- a/lib/orb/models/bps_tier.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -module Orb - module Models - class BPSTier < Orb::Internal::Type::BaseModel - # @!attribute bps - # Per-event basis point rate - # - # @return [Float] - required :bps, Float - - # @!attribute minimum_amount - # Exclusive tier starting value - # - # @return [String] - required :minimum_amount, String - - # @!attribute maximum_amount - # Inclusive tier ending value - # - # @return [String, nil] - optional :maximum_amount, String, nil?: true - - # @!attribute per_unit_maximum - # Per unit maximum to charge - # - # @return [String, nil] - optional :per_unit_maximum, String, nil?: true - - # @!method initialize(bps:, minimum_amount:, maximum_amount: nil, per_unit_maximum: nil) - # @param bps [Float] Per-event basis point rate - # - # @param minimum_amount [String] Exclusive tier starting value - # - # @param maximum_amount [String, nil] Inclusive tier ending value - # - # @param per_unit_maximum [String, nil] Per unit maximum to charge - end - end -end diff --git a/lib/orb/models/bulk_bps_config.rb b/lib/orb/models/bulk_bps_config.rb deleted file mode 100644 index 5c3e0974..00000000 --- a/lib/orb/models/bulk_bps_config.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module Orb - module Models - class BulkBPSConfig < Orb::Internal::Type::BaseModel - # @!attribute tiers - # Tiers for a bulk BPS pricing model where all usage is aggregated to a single - # tier based on total volume - # - # @return [Array] - required :tiers, -> { Orb::Internal::Type::ArrayOf[Orb::BulkBPSTier] } - - # @!method initialize(tiers:) - # Some parameter documentations has been truncated, see - # {Orb::Models::BulkBPSConfig} for more details. - # - # @param tiers [Array] Tiers for a bulk BPS pricing model where all usage is aggregated to a single tie - end - end -end diff --git a/lib/orb/models/bulk_bps_tier.rb b/lib/orb/models/bulk_bps_tier.rb deleted file mode 100644 index c84be573..00000000 --- a/lib/orb/models/bulk_bps_tier.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -module Orb - module Models - class BulkBPSTier < Orb::Internal::Type::BaseModel - # @!attribute bps - # Basis points to rate on - # - # @return [Float] - required :bps, Float - - # @!attribute maximum_amount - # Upper bound for tier - # - # @return [String, nil] - optional :maximum_amount, String, nil?: true - - # @!attribute per_unit_maximum - # The maximum amount to charge for any one event - # - # @return [String, nil] - optional :per_unit_maximum, String, nil?: true - - # @!method initialize(bps:, maximum_amount: nil, per_unit_maximum: nil) - # @param bps [Float] Basis points to rate on - # - # @param maximum_amount [String, nil] Upper bound for tier - # - # @param per_unit_maximum [String, nil] The maximum amount to charge for any one event - end - end -end diff --git a/lib/orb/models/bulk_config.rb b/lib/orb/models/bulk_config.rb index ec86d7eb..d476d7fe 100644 --- a/lib/orb/models/bulk_config.rb +++ b/lib/orb/models/bulk_config.rb @@ -10,6 +10,8 @@ class BulkConfig < Orb::Internal::Type::BaseModel required :tiers, -> { Orb::Internal::Type::ArrayOf[Orb::BulkTier] } # @!method initialize(tiers:) + # Configuration for bulk pricing + # # @param tiers [Array] Bulk tiers for rating based on total usage volume end end diff --git a/lib/orb/models/bulk_tier.rb b/lib/orb/models/bulk_tier.rb index 29f1890c..18d41ab6 100644 --- a/lib/orb/models/bulk_tier.rb +++ b/lib/orb/models/bulk_tier.rb @@ -16,6 +16,8 @@ class BulkTier < Orb::Internal::Type::BaseModel optional :maximum_units, Float, nil?: true # @!method initialize(unit_amount:, maximum_units: nil) + # Configuration for a single bulk pricing tier + # # @param unit_amount [String] Amount per unit # # @param maximum_units [Float, nil] Upper bound for this tier diff --git a/lib/orb/models/changed_subscription_resources.rb b/lib/orb/models/changed_subscription_resources.rb index e5248008..11feccc7 100644 --- a/lib/orb/models/changed_subscription_resources.rb +++ b/lib/orb/models/changed_subscription_resources.rb @@ -12,8 +12,9 @@ class ChangedSubscriptionResources < Orb::Internal::Type::BaseModel # @!attribute created_invoices # The invoices that were created as part of this operation. # - # @return [Array] - required :created_invoices, -> { Orb::Internal::Type::ArrayOf[Orb::Invoice] } + # @return [Array] + required :created_invoices, + -> { Orb::Internal::Type::ArrayOf[Orb::ChangedSubscriptionResources::CreatedInvoice] } # @!attribute voided_credit_notes # The credit notes that were voided as part of this operation. @@ -30,11 +31,1086 @@ class ChangedSubscriptionResources < Orb::Internal::Type::BaseModel # @!method initialize(created_credit_notes:, created_invoices:, voided_credit_notes:, voided_invoices:) # @param created_credit_notes [Array] The credit notes that were created as part of this operation. # - # @param created_invoices [Array] The invoices that were created as part of this operation. + # @param created_invoices [Array] The invoices that were created as part of this operation. # # @param voided_credit_notes [Array] The credit notes that were voided as part of this operation. # # @param voided_invoices [Array] The invoices that were voided as part of this operation. + + class CreatedInvoice < Orb::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount_due + # This is the final amount required to be charged to the customer and reflects the + # application of the customer balance to the `total` of the invoice. + # + # @return [String] + required :amount_due, String + + # @!attribute auto_collection + # + # @return [Orb::Models::ChangedSubscriptionResources::CreatedInvoice::AutoCollection] + required :auto_collection, -> { Orb::ChangedSubscriptionResources::CreatedInvoice::AutoCollection } + + # @!attribute billing_address + # + # @return [Orb::Models::Address, nil] + required :billing_address, -> { Orb::Address }, nil?: true + + # @!attribute created_at + # The creation time of the resource in Orb. + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_notes + # A list of credit notes associated with the invoice + # + # @return [Array] + required :credit_notes, + -> { Orb::Internal::Type::ArrayOf[Orb::ChangedSubscriptionResources::CreatedInvoice::CreditNote] } + + # @!attribute currency + # An ISO 4217 currency string or `credits` + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::CustomerMinified] + required :customer, -> { Orb::CustomerMinified } + + # @!attribute customer_balance_transactions + # + # @return [Array] + required :customer_balance_transactions, + -> { Orb::Internal::Type::ArrayOf[Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction] } + + # @!attribute customer_tax_id + # Tax IDs are commonly required to be displayed on customer invoices, which are + # added to the headers of invoices. + # + # ### Supported Tax ID Countries and Types + # + # | Country | Type | Description | + # | ---------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + # | Albania | `al_tin` | Albania Tax Identification Number | + # | Andorra | `ad_nrt` | Andorran NRT Number | + # | Angola | `ao_tin` | Angola Tax Identification Number | + # | Argentina | `ar_cuit` | Argentinian Tax ID Number | + # | Armenia | `am_tin` | Armenia Tax Identification Number | + # | Aruba | `aw_tin` | Aruba Tax Identification Number | + # | Australia | `au_abn` | Australian Business Number (AU ABN) | + # | Australia | `au_arn` | Australian Taxation Office Reference Number | + # | Austria | `eu_vat` | European VAT Number | + # | Azerbaijan | `az_tin` | Azerbaijan Tax Identification Number | + # | Bahamas | `bs_tin` | Bahamas Tax Identification Number | + # | Bahrain | `bh_vat` | Bahraini VAT Number | + # | Bangladesh | `bd_bin` | Bangladesh Business Identification Number | + # | Barbados | `bb_tin` | Barbados Tax Identification Number | + # | Belarus | `by_tin` | Belarus TIN Number | + # | Belgium | `eu_vat` | European VAT Number | + # | Benin | `bj_ifu` | Benin Tax Identification Number (Identifiant Fiscal Unique) | + # | Bolivia | `bo_tin` | Bolivian Tax ID | + # | Bosnia and Herzegovina | `ba_tin` | Bosnia and Herzegovina Tax Identification Number | + # | Brazil | `br_cnpj` | Brazilian CNPJ Number | + # | Brazil | `br_cpf` | Brazilian CPF Number | + # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + # | Bulgaria | `eu_vat` | European VAT Number | + # | Burkina Faso | `bf_ifu` | Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) | + # | Cambodia | `kh_tin` | Cambodia Tax Identification Number | + # | Cameroon | `cm_niu` | Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) | + # | Canada | `ca_bn` | Canadian BN | + # | Canada | `ca_gst_hst` | Canadian GST/HST Number | + # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + # | Canada | `ca_qst` | Canadian QST Number (Québec) | + # | Cape Verde | `cv_nif` | Cape Verde Tax Identification Number (Número de Identificação Fiscal) | + # | Chile | `cl_tin` | Chilean TIN | + # | China | `cn_tin` | Chinese Tax ID | + # | Colombia | `co_nit` | Colombian NIT Number | + # | Congo-Kinshasa | `cd_nif` | Congo (DR) Tax Identification Number (Número de Identificação Fiscal) | + # | Costa Rica | `cr_tin` | Costa Rican Tax ID | + # | Croatia | `eu_vat` | European VAT Number | + # | Croatia | `hr_oib` | Croatian Personal Identification Number (OIB) | + # | Cyprus | `eu_vat` | European VAT Number | + # | Czech Republic | `eu_vat` | European VAT Number | + # | Denmark | `eu_vat` | European VAT Number | + # | Dominican Republic | `do_rcn` | Dominican RCN Number | + # | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + # | Egypt | `eg_tin` | Egyptian Tax Identification Number | + # | El Salvador | `sv_nit` | El Salvadorian NIT Number | + # | Estonia | `eu_vat` | European VAT Number | + # | Ethiopia | `et_tin` | Ethiopia Tax Identification Number | + # | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + # | Finland | `eu_vat` | European VAT Number | + # | France | `eu_vat` | European VAT Number | + # | Georgia | `ge_vat` | Georgian VAT | + # | Germany | `de_stn` | German Tax Number (Steuernummer) | + # | Germany | `eu_vat` | European VAT Number | + # | Greece | `eu_vat` | European VAT Number | + # | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) | + # | Hong Kong | `hk_br` | Hong Kong BR Number | + # | Hungary | `eu_vat` | European VAT Number | + # | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + # | Iceland | `is_vat` | Icelandic VAT | + # | India | `in_gst` | Indian GST Number | + # | Indonesia | `id_npwp` | Indonesian NPWP Number | + # | Ireland | `eu_vat` | European VAT Number | + # | Israel | `il_vat` | Israel VAT | + # | Italy | `eu_vat` | European VAT Number | + # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + # | Kyrgyzstan | `kg_tin` | Kyrgyzstan Tax Identification Number | + # | Laos | `la_tin` | Laos Tax Identification Number | + # | Latvia | `eu_vat` | European VAT Number | + # | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + # | Liechtenstein | `li_vat` | Liechtenstein VAT Number | + # | Lithuania | `eu_vat` | European VAT Number | + # | Luxembourg | `eu_vat` | European VAT Number | + # | Malaysia | `my_frp` | Malaysian FRP Number | + # | Malaysia | `my_itn` | Malaysian ITN | + # | Malaysia | `my_sst` | Malaysian SST Number | + # | Malta | `eu_vat` | European VAT Number | + # | Mauritania | `mr_nif` | Mauritania Tax Identification Number (Número de Identificação Fiscal) | + # | Mexico | `mx_rfc` | Mexican RFC Number | + # | Moldova | `md_vat` | Moldova VAT Number | + # | Montenegro | `me_pib` | Montenegro PIB Number | + # | Morocco | `ma_vat` | Morocco VAT Number | + # | Nepal | `np_pan` | Nepal PAN Number | + # | Netherlands | `eu_vat` | European VAT Number | + # | New Zealand | `nz_gst` | New Zealand GST Number | + # | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + # | North Macedonia | `mk_vat` | North Macedonia VAT Number | + # | Northern Ireland | `eu_vat` | Northern Ireland VAT Number | + # | Norway | `no_vat` | Norwegian VAT Number | + # | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + # | Oman | `om_vat` | Omani VAT Number | + # | Peru | `pe_ruc` | Peruvian RUC Number | + # | Philippines | `ph_tin` | Philippines Tax Identification Number | + # | Poland | `eu_vat` | European VAT Number | + # | Portugal | `eu_vat` | European VAT Number | + # | Romania | `eu_vat` | European VAT Number | + # | Romania | `ro_tin` | Romanian Tax ID Number | + # | Russia | `ru_inn` | Russian INN | + # | Russia | `ru_kpp` | Russian KPP | + # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + # | Senegal | `sn_ninea` | Senegal NINEA Number | + # | Serbia | `rs_pib` | Serbian PIB Number | + # | Singapore | `sg_gst` | Singaporean GST | + # | Singapore | `sg_uen` | Singaporean UEN | + # | Slovakia | `eu_vat` | European VAT Number | + # | Slovenia | `eu_vat` | European VAT Number | + # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + # | South Africa | `za_vat` | South African VAT Number | + # | South Korea | `kr_brn` | Korean BRN | + # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + # | Spain | `eu_vat` | European VAT Number | + # | Suriname | `sr_fin` | Suriname FIN Number | + # | Sweden | `eu_vat` | European VAT Number | + # | Switzerland | `ch_uid` | Switzerland UID Number | + # | Switzerland | `ch_vat` | Switzerland VAT Number | + # | Taiwan | `tw_vat` | Taiwanese VAT | + # | Tajikistan | `tj_tin` | Tajikistan Tax Identification Number | + # | Tanzania | `tz_vat` | Tanzania VAT Number | + # | Thailand | `th_vat` | Thai VAT | + # | Turkey | `tr_tin` | Turkish Tax Identification Number | + # | Uganda | `ug_tin` | Uganda Tax Identification Number | + # | Ukraine | `ua_vat` | Ukrainian VAT | + # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + # | United Kingdom | `gb_vat` | United Kingdom VAT Number | + # | United States | `us_ein` | United States EIN | + # | Uruguay | `uy_ruc` | Uruguayan RUC Number | + # | Uzbekistan | `uz_tin` | Uzbekistan TIN Number | + # | Uzbekistan | `uz_vat` | Uzbekistan VAT Number | + # | Venezuela | `ve_rif` | Venezuelan RIF Number | + # | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + # | Zambia | `zm_tin` | Zambia Tax Identification Number | + # | Zimbabwe | `zw_tin` | Zimbabwe Tax Identification Number | + # + # @return [Orb::Models::CustomerTaxID, nil] + required :customer_tax_id, -> { Orb::CustomerTaxID }, nil?: true + + # @!attribute discount + # @deprecated + # + # This field is deprecated in favor of `discounts`. If a `discounts` list is + # provided, the first discount in the list will be returned. If the list is empty, + # `None` will be returned. + # + # @return [Object] + required :discount, Orb::Internal::Type::Unknown + + # @!attribute discounts + # + # @return [Array] + required :discounts, -> { Orb::Internal::Type::ArrayOf[union: Orb::InvoiceLevelDiscount] } + + # @!attribute due_date + # When the invoice payment is due. The due date is null if the invoice is not yet + # finalized. + # + # @return [Time, nil] + required :due_date, Time, nil?: true + + # @!attribute eligible_to_issue_at + # If the invoice has a status of `draft`, this will be the time that the invoice + # will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is + # true, the invoice will automatically begin issuing at this time. + # + # @return [Time, nil] + required :eligible_to_issue_at, Time, nil?: true + + # @!attribute hosted_invoice_url + # A URL for the customer-facing invoice portal. This URL expires 30 days after the + # invoice's due date, or 60 days after being re-generated through the UI. + # + # @return [String, nil] + required :hosted_invoice_url, String, nil?: true + + # @!attribute invoice_date + # The scheduled date of the invoice + # + # @return [Time] + required :invoice_date, Time + + # @!attribute invoice_number + # Automatically generated invoice number to help track and reconcile invoices. + # Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per + # account or customer. + # + # @return [String] + required :invoice_number, String + + # @!attribute invoice_pdf + # The link to download the PDF representation of the `Invoice`. + # + # @return [String, nil] + required :invoice_pdf, String, nil?: true + + # @!attribute invoice_source + # + # @return [Symbol, Orb::Models::ChangedSubscriptionResources::CreatedInvoice::InvoiceSource] + required :invoice_source, enum: -> { Orb::ChangedSubscriptionResources::CreatedInvoice::InvoiceSource } + + # @!attribute is_payable_now + # True if the invoice has only in-advance fixed fees and is payable now + # + # @return [Boolean] + required :is_payable_now, Orb::Internal::Type::Boolean + + # @!attribute issue_failed_at + # If the invoice failed to issue, this will be the last time it failed to issue + # (even if it is now in a different state.) + # + # @return [Time, nil] + required :issue_failed_at, Time, nil?: true + + # @!attribute issued_at + # If the invoice has been issued, this will be the time it transitioned to + # `issued` (even if it is now in a different state.) + # + # @return [Time, nil] + required :issued_at, Time, nil?: true + + # @!attribute line_items + # The breakdown of prices in this invoice. + # + # @return [Array] + required :line_items, + -> { Orb::Internal::Type::ArrayOf[Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem] } + + # @!attribute maximum + # + # @return [Orb::Models::Maximum, nil] + required :maximum, -> { Orb::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute memo + # Free-form text which is available on the invoice PDF and the Orb invoice portal. + # + # @return [String, nil] + required :memo, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::Internal::Type::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Minimum, nil] + required :minimum, -> { Orb::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute paid_at + # If the invoice has a status of `paid`, this gives a timestamp when the invoice + # was paid. + # + # @return [Time, nil] + required :paid_at, Time, nil?: true + + # @!attribute payment_attempts + # A list of payment attempts associated with the invoice + # + # @return [Array] + required :payment_attempts, + -> { Orb::Internal::Type::ArrayOf[Orb::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt] } + + # @!attribute payment_failed_at + # If payment was attempted on this invoice but failed, this will be the time of + # the most recent attempt. + # + # @return [Time, nil] + required :payment_failed_at, Time, nil?: true + + # @!attribute payment_started_at + # If payment was attempted on this invoice, this will be the start time of the + # most recent attempt. This field is especially useful for delayed-notification + # payment mechanisms (like bank transfers), where payment can take 3 days or more. + # + # @return [Time, nil] + required :payment_started_at, Time, nil?: true + + # @!attribute scheduled_issue_at + # If the invoice is in draft, this timestamp will reflect when the invoice is + # scheduled to be issued. + # + # @return [Time, nil] + required :scheduled_issue_at, Time, nil?: true + + # @!attribute shipping_address + # + # @return [Orb::Models::Address, nil] + required :shipping_address, -> { Orb::Address }, nil?: true + + # @!attribute status + # + # @return [Symbol, Orb::Models::ChangedSubscriptionResources::CreatedInvoice::Status] + required :status, enum: -> { Orb::ChangedSubscriptionResources::CreatedInvoice::Status } + + # @!attribute subscription + # + # @return [Orb::Models::SubscriptionMinified, nil] + required :subscription, -> { Orb::SubscriptionMinified }, nil?: true + + # @!attribute subtotal + # The total before any discounts and minimums are applied. + # + # @return [String] + required :subtotal, String + + # @!attribute sync_failed_at + # If the invoice failed to sync, this will be the last time an external invoicing + # provider sync was attempted. This field will always be `null` for invoices using + # Orb Invoicing. + # + # @return [Time, nil] + required :sync_failed_at, Time, nil?: true + + # @!attribute total + # The total after any minimums and discounts have been applied. + # + # @return [String] + required :total, String + + # @!attribute voided_at + # If the invoice has a status of `void`, this gives a timestamp when the invoice + # was voided. + # + # @return [Time, nil] + required :voided_at, Time, nil?: true + + # @!attribute will_auto_issue + # This is true if the invoice will be automatically issued in the future, and + # false otherwise. + # + # @return [Boolean] + required :will_auto_issue, Orb::Internal::Type::Boolean + + # @!method initialize(id:, amount_due:, auto_collection:, billing_address:, created_at:, credit_notes:, currency:, customer:, customer_balance_transactions:, customer_tax_id:, discount:, discounts:, due_date:, eligible_to_issue_at:, hosted_invoice_url:, invoice_date:, invoice_number:, invoice_pdf:, invoice_source:, is_payable_now:, issue_failed_at:, issued_at:, line_items:, maximum:, maximum_amount:, memo:, metadata:, minimum:, minimum_amount:, paid_at:, payment_attempts:, payment_failed_at:, payment_started_at:, scheduled_issue_at:, shipping_address:, status:, subscription:, subtotal:, sync_failed_at:, total:, voided_at:, will_auto_issue:) + # Some parameter documentations has been truncated, see + # {Orb::Models::ChangedSubscriptionResources::CreatedInvoice} for more details. + # + # @param id [String] + # + # @param amount_due [String] This is the final amount required to be charged to the customer and reflects the + # + # @param auto_collection [Orb::Models::ChangedSubscriptionResources::CreatedInvoice::AutoCollection] + # + # @param billing_address [Orb::Models::Address, nil] + # + # @param created_at [Time] The creation time of the resource in Orb. + # + # @param credit_notes [Array] A list of credit notes associated with the invoice + # + # @param currency [String] An ISO 4217 currency string or `credits` + # + # @param customer [Orb::Models::CustomerMinified] + # + # @param customer_balance_transactions [Array] + # + # @param customer_tax_id [Orb::Models::CustomerTaxID, nil] Tax IDs are commonly required to be displayed on customer invoices, which are ad + # + # @param discount [Object] This field is deprecated in favor of `discounts`. If a `discounts` list is provi + # + # @param discounts [Array] + # + # @param due_date [Time, nil] When the invoice payment is due. The due date is null if the invoice is not yet + # + # @param eligible_to_issue_at [Time, nil] If the invoice has a status of `draft`, this will be the time that the invoice w + # + # @param hosted_invoice_url [String, nil] A URL for the customer-facing invoice portal. This URL expires 30 days after the + # + # @param invoice_date [Time] The scheduled date of the invoice + # + # @param invoice_number [String] Automatically generated invoice number to help track and reconcile invoices. Inv + # + # @param invoice_pdf [String, nil] The link to download the PDF representation of the `Invoice`. + # + # @param invoice_source [Symbol, Orb::Models::ChangedSubscriptionResources::CreatedInvoice::InvoiceSource] + # + # @param is_payable_now [Boolean] True if the invoice has only in-advance fixed fees and is payable now + # + # @param issue_failed_at [Time, nil] If the invoice failed to issue, this will be the last time it failed to issue (e + # + # @param issued_at [Time, nil] If the invoice has been issued, this will be the time it transitioned to `issued + # + # @param line_items [Array] The breakdown of prices in this invoice. + # + # @param maximum [Orb::Models::Maximum, nil] + # + # @param maximum_amount [String, nil] + # + # @param memo [String, nil] Free-form text which is available on the invoice PDF and the Orb invoice portal. + # + # @param metadata [Hash{Symbol=>String}] User specified key-value pairs for the resource. If not present, this defaults t + # + # @param minimum [Orb::Models::Minimum, nil] + # + # @param minimum_amount [String, nil] + # + # @param paid_at [Time, nil] If the invoice has a status of `paid`, this gives a timestamp when the invoice w + # + # @param payment_attempts [Array] A list of payment attempts associated with the invoice + # + # @param payment_failed_at [Time, nil] If payment was attempted on this invoice but failed, this will be the time of th + # + # @param payment_started_at [Time, nil] If payment was attempted on this invoice, this will be the start time of the mos + # + # @param scheduled_issue_at [Time, nil] If the invoice is in draft, this timestamp will reflect when the invoice is sche + # + # @param shipping_address [Orb::Models::Address, nil] + # + # @param status [Symbol, Orb::Models::ChangedSubscriptionResources::CreatedInvoice::Status] + # + # @param subscription [Orb::Models::SubscriptionMinified, nil] + # + # @param subtotal [String] The total before any discounts and minimums are applied. + # + # @param sync_failed_at [Time, nil] If the invoice failed to sync, this will be the last time an external invoicing + # + # @param total [String] The total after any minimums and discounts have been applied. + # + # @param voided_at [Time, nil] If the invoice has a status of `void`, this gives a timestamp when the invoice w + # + # @param will_auto_issue [Boolean] This is true if the invoice will be automatically issued in the future, and fals + + # @see Orb::Models::ChangedSubscriptionResources::CreatedInvoice#auto_collection + class AutoCollection < Orb::Internal::Type::BaseModel + # @!attribute enabled + # True only if auto-collection is enabled for this invoice. + # + # @return [Boolean, nil] + required :enabled, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute next_attempt_at + # If the invoice is scheduled for auto-collection, this field will reflect when + # the next attempt will occur. If dunning has been exhausted, or auto-collection + # is not enabled for this invoice, this field will be `null`. + # + # @return [Time, nil] + required :next_attempt_at, Time, nil?: true + + # @!attribute num_attempts + # Number of auto-collection payment attempts. + # + # @return [Integer, nil] + required :num_attempts, Integer, nil?: true + + # @!attribute previously_attempted_at + # If Orb has ever attempted payment auto-collection for this invoice, this field + # will reflect when that attempt occurred. In conjunction with `next_attempt_at`, + # this can be used to tell whether the invoice is currently in dunning (that is, + # `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or + # if dunning has been exhausted (`previously_attempted_at` is non-null, but + # `next_attempt_time` is null). + # + # @return [Time, nil] + required :previously_attempted_at, Time, nil?: true + + # @!method initialize(enabled:, next_attempt_at:, num_attempts:, previously_attempted_at:) + # Some parameter documentations has been truncated, see + # {Orb::Models::ChangedSubscriptionResources::CreatedInvoice::AutoCollection} for + # more details. + # + # @param enabled [Boolean, nil] True only if auto-collection is enabled for this invoice. + # + # @param next_attempt_at [Time, nil] If the invoice is scheduled for auto-collection, this field will reflect when th + # + # @param num_attempts [Integer, nil] Number of auto-collection payment attempts. + # + # @param previously_attempted_at [Time, nil] If Orb has ever attempted payment auto-collection for this invoice, this field w + end + + class CreditNote < Orb::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute credit_note_number + # + # @return [String] + required :credit_note_number, String + + # @!attribute memo + # An optional memo supplied on the credit note. + # + # @return [String, nil] + required :memo, String, nil?: true + + # @!attribute reason + # + # @return [String] + required :reason, String + + # @!attribute total + # + # @return [String] + required :total, String + + # @!attribute type + # + # @return [String] + required :type, String + + # @!attribute voided_at + # If the credit note has a status of `void`, this gives a timestamp when the + # credit note was voided. + # + # @return [Time, nil] + required :voided_at, Time, nil?: true + + # @!method initialize(id:, credit_note_number:, memo:, reason:, total:, type:, voided_at:) + # Some parameter documentations has been truncated, see + # {Orb::Models::ChangedSubscriptionResources::CreatedInvoice::CreditNote} for more + # details. + # + # @param id [String] + # + # @param credit_note_number [String] + # + # @param memo [String, nil] An optional memo supplied on the credit note. + # + # @param reason [String] + # + # @param total [String] + # + # @param type [String] + # + # @param voided_at [Time, nil] If the credit note has a status of `void`, this gives a timestamp when the credi + end + + class CustomerBalanceTransaction < Orb::Internal::Type::BaseModel + # @!attribute id + # A unique id for this transaction. + # + # @return [String] + required :id, String + + # @!attribute action + # + # @return [Symbol, Orb::Models::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Action] + required :action, + enum: -> { Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Action } + + # @!attribute amount + # The value of the amount changed in the transaction. + # + # @return [String] + required :amount, String + + # @!attribute created_at + # The creation time of this transaction. + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_note + # + # @return [Orb::Models::CreditNoteTiny, nil] + required :credit_note, -> { Orb::CreditNoteTiny }, nil?: true + + # @!attribute description + # An optional description provided for manual customer balance adjustments. + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # The new value of the customer's balance prior to the transaction, in the + # customer's currency. + # + # @return [String] + required :ending_balance, String + + # @!attribute invoice + # + # @return [Orb::Models::InvoiceTiny, nil] + required :invoice, -> { Orb::InvoiceTiny }, nil?: true + + # @!attribute starting_balance + # The original value of the customer's balance prior to the transaction, in the + # customer's currency. + # + # @return [String] + required :starting_balance, String + + # @!attribute type + # + # @return [Symbol, Orb::Models::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Type] + required :type, + enum: -> { Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Type } + + # @!method initialize(id:, action:, amount:, created_at:, credit_note:, description:, ending_balance:, invoice:, starting_balance:, type:) + # Some parameter documentations has been truncated, see + # {Orb::Models::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction} + # for more details. + # + # @param id [String] A unique id for this transaction. + # + # @param action [Symbol, Orb::Models::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Action] + # + # @param amount [String] The value of the amount changed in the transaction. + # + # @param created_at [Time] The creation time of this transaction. + # + # @param credit_note [Orb::Models::CreditNoteTiny, nil] + # + # @param description [String, nil] An optional description provided for manual customer balance adjustments. + # + # @param ending_balance [String] The new value of the customer's balance prior to the transaction, in the custome + # + # @param invoice [Orb::Models::InvoiceTiny, nil] + # + # @param starting_balance [String] The original value of the customer's balance prior to the transaction, in the cu + # + # @param type [Symbol, Orb::Models::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Type] + + # @see Orb::Models::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction#action + module Action + extend Orb::Internal::Type::Enum + + APPLIED_TO_INVOICE = :applied_to_invoice + MANUAL_ADJUSTMENT = :manual_adjustment + PRORATED_REFUND = :prorated_refund + REVERT_PRORATED_REFUND = :revert_prorated_refund + RETURN_FROM_VOIDING = :return_from_voiding + CREDIT_NOTE_APPLIED = :credit_note_applied + CREDIT_NOTE_VOIDED = :credit_note_voided + OVERPAYMENT_REFUND = :overpayment_refund + EXTERNAL_PAYMENT = :external_payment + SMALL_INVOICE_CARRYOVER = :small_invoice_carryover + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction#type + module Type + extend Orb::Internal::Type::Enum + + INCREMENT = :increment + DECREMENT = :decrement + + # @!method self.values + # @return [Array] + end + end + + # @see Orb::Models::ChangedSubscriptionResources::CreatedInvoice#invoice_source + module InvoiceSource + extend Orb::Internal::Type::Enum + + SUBSCRIPTION = :subscription + PARTIAL = :partial + ONE_OFF = :one_off + + # @!method self.values + # @return [Array] + end + + class LineItem < Orb::Internal::Type::BaseModel + # @!attribute id + # A unique ID for this line item. + # + # @return [String] + required :id, String + + # @!attribute adjusted_subtotal + # The line amount after any adjustments and before overage conversion, credits and + # partial invoicing. + # + # @return [String] + required :adjusted_subtotal, String + + # @!attribute adjustments + # All adjustments applied to the line item in the order they were applied based on + # invoice calculations (ie. usage discounts -> amount discounts -> percentage + # discounts -> minimums -> maximums). + # + # @return [Array] + required :adjustments, + -> { Orb::Internal::Type::ArrayOf[union: Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment] } + + # @!attribute amount + # The final amount for a line item after all adjustments and pre paid credits have + # been applied. + # + # @return [String] + required :amount, String + + # @!attribute credits_applied + # The number of prepaid credits applied. + # + # @return [String] + required :credits_applied, String + + # @!attribute discount + # @deprecated + # + # This field is deprecated in favor of `adjustments` + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Discount }, nil?: true + + # @!attribute end_date + # The end date of the range of time applied for this line item's price. + # + # @return [Time] + required :end_date, Time + + # @!attribute filter + # An additional filter that was used to calculate the usage for this line item. + # + # @return [String, nil] + required :filter, String, nil?: true + + # @!attribute grouping + # [DEPRECATED] For configured prices that are split by a grouping key, this will + # be populated with the key and a value. The `amount` and `subtotal` will be the + # values for this particular grouping. + # + # @return [String, nil] + required :grouping, String, nil?: true + + # @!attribute maximum + # @deprecated + # + # This field is deprecated in favor of `adjustments`. + # + # @return [Orb::Models::Maximum, nil] + required :maximum, -> { Orb::Maximum }, nil?: true + + # @!attribute maximum_amount + # @deprecated + # + # This field is deprecated in favor of `adjustments`. + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute minimum + # @deprecated + # + # This field is deprecated in favor of `adjustments`. + # + # @return [Orb::Models::Minimum, nil] + required :minimum, -> { Orb::Minimum }, nil?: true + + # @!attribute minimum_amount + # @deprecated + # + # This field is deprecated in favor of `adjustments`. + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute name + # The name of the price associated with this line item. + # + # @return [String] + required :name, String + + # @!attribute partially_invoiced_amount + # Any amount applied from a partial invoice + # + # @return [String] + required :partially_invoiced_amount, String + + # @!attribute price + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + # + # @return [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::Minimum, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput] + required :price, union: -> { Orb::Price } + + # @!attribute quantity + # Either the fixed fee quantity or the usage during the service period. + # + # @return [Float] + required :quantity, Float + + # @!attribute start_date + # The start date of the range of time applied for this line item's price. + # + # @return [Time] + required :start_date, Time + + # @!attribute sub_line_items + # For complex pricing structures, the line item can be broken down further in + # `sub_line_items`. + # + # @return [Array] + required :sub_line_items, + -> { Orb::Internal::Type::ArrayOf[union: Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem::SubLineItem] } + + # @!attribute subtotal + # The line amount before any adjustments. + # + # @return [String] + required :subtotal, String + + # @!attribute tax_amounts + # An array of tax rates and their incurred tax amounts. Empty if no tax + # integration is configured. + # + # @return [Array] + required :tax_amounts, -> { Orb::Internal::Type::ArrayOf[Orb::TaxAmount] } + + # @!attribute usage_customer_ids + # A list of customer ids that were used to calculate the usage for this line item. + # + # @return [Array, nil] + required :usage_customer_ids, Orb::Internal::Type::ArrayOf[String], nil?: true + + # @!method initialize(id:, adjusted_subtotal:, adjustments:, amount:, credits_applied:, discount:, end_date:, filter:, grouping:, maximum:, maximum_amount:, minimum:, minimum_amount:, name:, partially_invoiced_amount:, price:, quantity:, start_date:, sub_line_items:, subtotal:, tax_amounts:, usage_customer_ids:) + # Some parameter documentations has been truncated, see + # {Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem} for more + # details. + # + # @param id [String] A unique ID for this line item. + # + # @param adjusted_subtotal [String] The line amount after any adjustments and before overage conversion, credits and + # + # @param adjustments [Array] All adjustments applied to the line item in the order they were applied based on + # + # @param amount [String] The final amount for a line item after all adjustments and pre paid credits have + # + # @param credits_applied [String] The number of prepaid credits applied. + # + # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::UsageDiscount, Orb::Models::AmountDiscount, nil] This field is deprecated in favor of `adjustments` + # + # @param end_date [Time] The end date of the range of time applied for this line item's price. + # + # @param filter [String, nil] An additional filter that was used to calculate the usage for this line item. + # + # @param grouping [String, nil] [DEPRECATED] For configured prices that are split by a grouping key, this will b + # + # @param maximum [Orb::Models::Maximum, nil] This field is deprecated in favor of `adjustments`. + # + # @param maximum_amount [String, nil] This field is deprecated in favor of `adjustments`. + # + # @param minimum [Orb::Models::Minimum, nil] This field is deprecated in favor of `adjustments`. + # + # @param minimum_amount [String, nil] This field is deprecated in favor of `adjustments`. + # + # @param name [String] The name of the price associated with this line item. + # + # @param partially_invoiced_amount [String] Any amount applied from a partial invoice + # + # @param price [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::Minimum, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput] The Price resource represents a price that can be billed on a subscription, resu + # + # @param quantity [Float] Either the fixed fee quantity or the usage during the service period. + # + # @param start_date [Time] The start date of the range of time applied for this line item's price. + # + # @param sub_line_items [Array] For complex pricing structures, the line item can be broken down further in `sub + # + # @param subtotal [String] The line amount before any adjustments. + # + # @param tax_amounts [Array] An array of tax rates and their incurred tax amounts. Empty if no tax integratio + # + # @param usage_customer_ids [Array, nil] A list of customer ids that were used to calculate the usage for this line item. + + module Adjustment + extend Orb::Internal::Type::Union + + discriminator :adjustment_type + + variant :usage_discount, -> { Orb::MonetaryUsageDiscountAdjustment } + + variant :amount_discount, -> { Orb::MonetaryAmountDiscountAdjustment } + + variant :percentage_discount, -> { Orb::MonetaryPercentageDiscountAdjustment } + + variant :minimum, -> { Orb::MonetaryMinimumAdjustment } + + variant :maximum, -> { Orb::MonetaryMaximumAdjustment } + + # @!method self.variants + # @return [Array(Orb::Models::MonetaryUsageDiscountAdjustment, Orb::Models::MonetaryAmountDiscountAdjustment, Orb::Models::MonetaryPercentageDiscountAdjustment, Orb::Models::MonetaryMinimumAdjustment, Orb::Models::MonetaryMaximumAdjustment)] + end + + module SubLineItem + extend Orb::Internal::Type::Union + + discriminator :type + + variant :matrix, -> { Orb::MatrixSubLineItem } + + variant :tier, -> { Orb::TierSubLineItem } + + variant :"'null'", -> { Orb::OtherSubLineItem } + + # @!method self.variants + # @return [Array(Orb::Models::MatrixSubLineItem, Orb::Models::TierSubLineItem, Orb::Models::OtherSubLineItem)] + end + end + + class PaymentAttempt < Orb::Internal::Type::BaseModel + # @!attribute id + # The ID of the payment attempt. + # + # @return [String] + required :id, String + + # @!attribute amount + # The amount of the payment attempt. + # + # @return [String] + required :amount, String + + # @!attribute created_at + # The time at which the payment attempt was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute payment_provider + # The payment provider that attempted to collect the payment. + # + # @return [Symbol, Orb::Models::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt::PaymentProvider, nil] + required :payment_provider, + enum: -> { + Orb::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt::PaymentProvider + }, + nil?: true + + # @!attribute payment_provider_id + # The ID of the payment attempt in the payment provider. + # + # @return [String, nil] + required :payment_provider_id, String, nil?: true + + # @!attribute receipt_pdf + # URL to the downloadable PDF version of the receipt. This field will be `null` + # for payment attempts that did not succeed. + # + # @return [String, nil] + required :receipt_pdf, String, nil?: true + + # @!attribute succeeded + # Whether the payment attempt succeeded. + # + # @return [Boolean] + required :succeeded, Orb::Internal::Type::Boolean + + # @!method initialize(id:, amount:, created_at:, payment_provider:, payment_provider_id:, receipt_pdf:, succeeded:) + # Some parameter documentations has been truncated, see + # {Orb::Models::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt} for + # more details. + # + # @param id [String] The ID of the payment attempt. + # + # @param amount [String] The amount of the payment attempt. + # + # @param created_at [Time] The time at which the payment attempt was created. + # + # @param payment_provider [Symbol, Orb::Models::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt::PaymentProvider, nil] The payment provider that attempted to collect the payment. + # + # @param payment_provider_id [String, nil] The ID of the payment attempt in the payment provider. + # + # @param receipt_pdf [String, nil] URL to the downloadable PDF version of the receipt. This field will be `null` fo + # + # @param succeeded [Boolean] Whether the payment attempt succeeded. + + # The payment provider that attempted to collect the payment. + # + # @see Orb::Models::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt#payment_provider + module PaymentProvider + extend Orb::Internal::Type::Enum + + STRIPE = :stripe + + # @!method self.values + # @return [Array] + end + end + + # @see Orb::Models::ChangedSubscriptionResources::CreatedInvoice#status + module Status + extend Orb::Internal::Type::Enum + + ISSUED = :issued + PAID = :paid + SYNCED = :synced + VOID = :void + DRAFT = :draft + + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/orb/models/customer.rb b/lib/orb/models/customer.rb index 088a5136..9ccea06a 100644 --- a/lib/orb/models/customer.rb +++ b/lib/orb/models/customer.rb @@ -19,6 +19,14 @@ class Customer < Orb::Internal::Type::BaseModel # @return [Boolean] required :auto_collection, Orb::Internal::Type::Boolean + # @!attribute auto_issuance + # Whether invoices for this customer should be automatically issued. If true, + # invoices will be automatically issued. If false, invoices will require manual + # approval. If null, inherits the account-level setting. + # + # @return [Boolean, nil] + required :auto_issuance, Orb::Internal::Type::Boolean, nil?: true + # @!attribute balance # The customer's current balance in their currency. # @@ -279,7 +287,7 @@ class Customer < Orb::Internal::Type::BaseModel # @return [Orb::Models::Customer::ReportingConfiguration, nil] optional :reporting_configuration, -> { Orb::Customer::ReportingConfiguration }, nil?: true - # @!method initialize(id:, additional_emails:, auto_collection:, balance:, billing_address:, created_at:, currency:, email:, email_delivery:, exempt_from_automated_tax:, external_customer_id:, hierarchy:, metadata:, name:, payment_provider:, payment_provider_id:, portal_url:, shipping_address:, tax_id:, timezone:, accounting_sync_configuration: nil, reporting_configuration: nil) + # @!method initialize(id:, additional_emails:, auto_collection:, auto_issuance:, balance:, billing_address:, created_at:, currency:, email:, email_delivery:, exempt_from_automated_tax:, external_customer_id:, hierarchy:, metadata:, name:, payment_provider:, payment_provider_id:, portal_url:, shipping_address:, tax_id:, timezone:, accounting_sync_configuration: nil, reporting_configuration: nil) # Some parameter documentations has been truncated, see {Orb::Models::Customer} # for more details. # @@ -308,6 +316,8 @@ class Customer < Orb::Internal::Type::BaseModel # # @param auto_collection [Boolean] # + # @param auto_issuance [Boolean, nil] Whether invoices for this customer should be automatically issued. If true, invo + # # @param balance [String] The customer's current balance in their currency. # # @param billing_address [Orb::Models::Address, nil] diff --git a/lib/orb/models/customer_create_params.rb b/lib/orb/models/customer_create_params.rb index d66159b1..206f5280 100644 --- a/lib/orb/models/customer_create_params.rb +++ b/lib/orb/models/customer_create_params.rb @@ -28,7 +28,8 @@ class CustomerCreateParams < Orb::Internal::Type::BaseModel # @!attribute additional_emails # Additional email addresses for this customer. If populated, these email - # addresses will be CC'd for customer communications. + # addresses will be CC'd for customer communications. The total number of email + # addresses (including the primary email) cannot exceed 50. # # @return [Array, nil] optional :additional_emails, Orb::Internal::Type::ArrayOf[String], nil?: true @@ -41,6 +42,15 @@ class CustomerCreateParams < Orb::Internal::Type::BaseModel # @return [Boolean, nil] optional :auto_collection, Orb::Internal::Type::Boolean, nil?: true + # @!attribute auto_issuance + # Used to determine if invoices for this customer will be automatically issued. If + # true, invoices will be automatically issued. If false, invoices will require + # manual approval. If `null` is specified, the customer's auto issuance setting + # will be inherited from the account-level setting. + # + # @return [Boolean, nil] + optional :auto_issuance, Orb::Internal::Type::Boolean, nil?: true + # @!attribute billing_address # # @return [Orb::Models::AddressInput, nil] @@ -107,7 +117,7 @@ class CustomerCreateParams < Orb::Internal::Type::BaseModel # @!attribute tax_configuration # - # @return [Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, nil] + # @return [Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, Orb::Models::CustomerCreateParams::TaxConfiguration::Numeral, nil] optional :tax_configuration, union: -> { Orb::CustomerCreateParams::TaxConfiguration }, nil?: true # @!attribute tax_id @@ -267,7 +277,7 @@ class CustomerCreateParams < Orb::Internal::Type::BaseModel # @return [String, nil] optional :timezone, String, nil?: true - # @!method initialize(email:, name:, accounting_sync_configuration: nil, additional_emails: nil, auto_collection: nil, billing_address: nil, currency: nil, email_delivery: nil, external_customer_id: nil, hierarchy: nil, metadata: nil, payment_provider: nil, payment_provider_id: nil, reporting_configuration: nil, shipping_address: nil, tax_configuration: nil, tax_id: nil, timezone: nil, request_options: {}) + # @!method initialize(email:, name:, accounting_sync_configuration: nil, additional_emails: nil, auto_collection: nil, auto_issuance: nil, billing_address: nil, currency: nil, email_delivery: nil, external_customer_id: nil, hierarchy: nil, metadata: nil, payment_provider: nil, payment_provider_id: nil, reporting_configuration: nil, shipping_address: nil, tax_configuration: nil, tax_id: nil, timezone: nil, request_options: {}) # Some parameter documentations has been truncated, see # {Orb::Models::CustomerCreateParams} for more details. # @@ -281,6 +291,8 @@ class CustomerCreateParams < Orb::Internal::Type::BaseModel # # @param auto_collection [Boolean, nil] Used to determine if invoices for this customer will automatically attempt to ch # + # @param auto_issuance [Boolean, nil] Used to determine if invoices for this customer will be automatically issued. If + # # @param billing_address [Orb::Models::AddressInput, nil] # # @param currency [String, nil] An ISO 4217 currency string used for the customer's invoices and balance. If not @@ -301,7 +313,7 @@ class CustomerCreateParams < Orb::Internal::Type::BaseModel # # @param shipping_address [Orb::Models::AddressInput, nil] # - # @param tax_configuration [Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, nil] + # @param tax_configuration [Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, Orb::Models::CustomerCreateParams::TaxConfiguration::Numeral, nil] # # @param tax_id [Orb::Models::CustomerTaxID, nil] Tax IDs are commonly required to be displayed on customer invoices, which are ad # @@ -336,8 +348,26 @@ module TaxConfiguration variant :sphere, -> { Orb::NewSphereConfiguration } + variant :numeral, -> { Orb::CustomerCreateParams::TaxConfiguration::Numeral } + + class Numeral < Orb::Internal::Type::BaseModel + # @!attribute tax_exempt + # + # @return [Boolean] + required :tax_exempt, Orb::Internal::Type::Boolean + + # @!attribute tax_provider + # + # @return [Symbol, :numeral] + required :tax_provider, const: :numeral + + # @!method initialize(tax_exempt:, tax_provider: :numeral) + # @param tax_exempt [Boolean] + # @param tax_provider [Symbol, :numeral] + end + # @!method self.variants - # @return [Array(Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration)] + # @return [Array(Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, Orb::Models::CustomerCreateParams::TaxConfiguration::Numeral)] end end end diff --git a/lib/orb/models/customer_update_by_external_id_params.rb b/lib/orb/models/customer_update_by_external_id_params.rb index c9c4d9ea..bc47aa84 100644 --- a/lib/orb/models/customer_update_by_external_id_params.rb +++ b/lib/orb/models/customer_update_by_external_id_params.rb @@ -14,7 +14,8 @@ class CustomerUpdateByExternalIDParams < Orb::Internal::Type::BaseModel # @!attribute additional_emails # Additional email addresses for this customer. If populated, these email - # addresses will be CC'd for customer communications. + # addresses will be CC'd for customer communications. The total number of email + # addresses (including the primary email) cannot exceed 50. # # @return [Array, nil] optional :additional_emails, Orb::Internal::Type::ArrayOf[String], nil?: true @@ -27,6 +28,15 @@ class CustomerUpdateByExternalIDParams < Orb::Internal::Type::BaseModel # @return [Boolean, nil] optional :auto_collection, Orb::Internal::Type::Boolean, nil?: true + # @!attribute auto_issuance + # Used to determine if invoices for this customer will be automatically issued. If + # true, invoices will be automatically issued. If false, invoices will require + # manual approval.If `null` is specified, the customer's auto issuance setting + # will be inherited from the account-level setting. + # + # @return [Boolean, nil] + optional :auto_issuance, Orb::Internal::Type::Boolean, nil?: true + # @!attribute billing_address # # @return [Orb::Models::AddressInput, nil] @@ -113,7 +123,7 @@ class CustomerUpdateByExternalIDParams < Orb::Internal::Type::BaseModel # @!attribute tax_configuration # - # @return [Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, nil] + # @return [Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Numeral, nil] optional :tax_configuration, union: -> { Orb::CustomerUpdateByExternalIDParams::TaxConfiguration }, nil?: true @@ -267,7 +277,7 @@ class CustomerUpdateByExternalIDParams < Orb::Internal::Type::BaseModel # @return [Orb::Models::CustomerTaxID, nil] optional :tax_id, -> { Orb::CustomerTaxID }, nil?: true - # @!method initialize(accounting_sync_configuration: nil, additional_emails: nil, auto_collection: nil, billing_address: nil, currency: nil, email: nil, email_delivery: nil, external_customer_id: nil, hierarchy: nil, metadata: nil, name: nil, payment_provider: nil, payment_provider_id: nil, reporting_configuration: nil, shipping_address: nil, tax_configuration: nil, tax_id: nil, request_options: {}) + # @!method initialize(accounting_sync_configuration: nil, additional_emails: nil, auto_collection: nil, auto_issuance: nil, billing_address: nil, currency: nil, email: nil, email_delivery: nil, external_customer_id: nil, hierarchy: nil, metadata: nil, name: nil, payment_provider: nil, payment_provider_id: nil, reporting_configuration: nil, shipping_address: nil, tax_configuration: nil, tax_id: nil, request_options: {}) # Some parameter documentations has been truncated, see # {Orb::Models::CustomerUpdateByExternalIDParams} for more details. # @@ -277,6 +287,8 @@ class CustomerUpdateByExternalIDParams < Orb::Internal::Type::BaseModel # # @param auto_collection [Boolean, nil] Used to determine if invoices for this customer will automatically attempt to ch # + # @param auto_issuance [Boolean, nil] Used to determine if invoices for this customer will be automatically issued. If + # # @param billing_address [Orb::Models::AddressInput, nil] # # @param currency [String, nil] An ISO 4217 currency string used for the customer's invoices and balance. If not @@ -301,7 +313,7 @@ class CustomerUpdateByExternalIDParams < Orb::Internal::Type::BaseModel # # @param shipping_address [Orb::Models::AddressInput, nil] # - # @param tax_configuration [Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, nil] + # @param tax_configuration [Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Numeral, nil] # # @param tax_id [Orb::Models::CustomerTaxID, nil] Tax IDs are commonly required to be displayed on customer invoices, which are ad # @@ -338,8 +350,26 @@ module TaxConfiguration variant :sphere, -> { Orb::NewSphereConfiguration } + variant :numeral, -> { Orb::CustomerUpdateByExternalIDParams::TaxConfiguration::Numeral } + + class Numeral < Orb::Internal::Type::BaseModel + # @!attribute tax_exempt + # + # @return [Boolean] + required :tax_exempt, Orb::Internal::Type::Boolean + + # @!attribute tax_provider + # + # @return [Symbol, :numeral] + required :tax_provider, const: :numeral + + # @!method initialize(tax_exempt:, tax_provider: :numeral) + # @param tax_exempt [Boolean] + # @param tax_provider [Symbol, :numeral] + end + # @!method self.variants - # @return [Array(Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration)] + # @return [Array(Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Numeral)] end end end diff --git a/lib/orb/models/customer_update_params.rb b/lib/orb/models/customer_update_params.rb index da2fb028..9d499581 100644 --- a/lib/orb/models/customer_update_params.rb +++ b/lib/orb/models/customer_update_params.rb @@ -14,7 +14,8 @@ class CustomerUpdateParams < Orb::Internal::Type::BaseModel # @!attribute additional_emails # Additional email addresses for this customer. If populated, these email - # addresses will be CC'd for customer communications. + # addresses will be CC'd for customer communications. The total number of email + # addresses (including the primary email) cannot exceed 50. # # @return [Array, nil] optional :additional_emails, Orb::Internal::Type::ArrayOf[String], nil?: true @@ -27,6 +28,15 @@ class CustomerUpdateParams < Orb::Internal::Type::BaseModel # @return [Boolean, nil] optional :auto_collection, Orb::Internal::Type::Boolean, nil?: true + # @!attribute auto_issuance + # Used to determine if invoices for this customer will be automatically issued. If + # true, invoices will be automatically issued. If false, invoices will require + # manual approval.If `null` is specified, the customer's auto issuance setting + # will be inherited from the account-level setting. + # + # @return [Boolean, nil] + optional :auto_issuance, Orb::Internal::Type::Boolean, nil?: true + # @!attribute billing_address # # @return [Orb::Models::AddressInput, nil] @@ -111,7 +121,7 @@ class CustomerUpdateParams < Orb::Internal::Type::BaseModel # @!attribute tax_configuration # - # @return [Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, nil] + # @return [Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, Orb::Models::CustomerUpdateParams::TaxConfiguration::Numeral, nil] optional :tax_configuration, union: -> { Orb::CustomerUpdateParams::TaxConfiguration }, nil?: true # @!attribute tax_id @@ -263,7 +273,7 @@ class CustomerUpdateParams < Orb::Internal::Type::BaseModel # @return [Orb::Models::CustomerTaxID, nil] optional :tax_id, -> { Orb::CustomerTaxID }, nil?: true - # @!method initialize(accounting_sync_configuration: nil, additional_emails: nil, auto_collection: nil, billing_address: nil, currency: nil, email: nil, email_delivery: nil, external_customer_id: nil, hierarchy: nil, metadata: nil, name: nil, payment_provider: nil, payment_provider_id: nil, reporting_configuration: nil, shipping_address: nil, tax_configuration: nil, tax_id: nil, request_options: {}) + # @!method initialize(accounting_sync_configuration: nil, additional_emails: nil, auto_collection: nil, auto_issuance: nil, billing_address: nil, currency: nil, email: nil, email_delivery: nil, external_customer_id: nil, hierarchy: nil, metadata: nil, name: nil, payment_provider: nil, payment_provider_id: nil, reporting_configuration: nil, shipping_address: nil, tax_configuration: nil, tax_id: nil, request_options: {}) # Some parameter documentations has been truncated, see # {Orb::Models::CustomerUpdateParams} for more details. # @@ -273,6 +283,8 @@ class CustomerUpdateParams < Orb::Internal::Type::BaseModel # # @param auto_collection [Boolean, nil] Used to determine if invoices for this customer will automatically attempt to ch # + # @param auto_issuance [Boolean, nil] Used to determine if invoices for this customer will be automatically issued. If + # # @param billing_address [Orb::Models::AddressInput, nil] # # @param currency [String, nil] An ISO 4217 currency string used for the customer's invoices and balance. If not @@ -297,7 +309,7 @@ class CustomerUpdateParams < Orb::Internal::Type::BaseModel # # @param shipping_address [Orb::Models::AddressInput, nil] # - # @param tax_configuration [Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, nil] + # @param tax_configuration [Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, Orb::Models::CustomerUpdateParams::TaxConfiguration::Numeral, nil] # # @param tax_id [Orb::Models::CustomerTaxID, nil] Tax IDs are commonly required to be displayed on customer invoices, which are ad # @@ -334,8 +346,26 @@ module TaxConfiguration variant :sphere, -> { Orb::NewSphereConfiguration } + variant :numeral, -> { Orb::CustomerUpdateParams::TaxConfiguration::Numeral } + + class Numeral < Orb::Internal::Type::BaseModel + # @!attribute tax_exempt + # + # @return [Boolean] + required :tax_exempt, Orb::Internal::Type::Boolean + + # @!attribute tax_provider + # + # @return [Symbol, :numeral] + required :tax_provider, const: :numeral + + # @!method initialize(tax_exempt:, tax_provider: :numeral) + # @param tax_exempt [Boolean] + # @param tax_provider [Symbol, :numeral] + end + # @!method self.variants - # @return [Array(Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration)] + # @return [Array(Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, Orb::Models::CustomerUpdateParams::TaxConfiguration::Numeral)] end end end diff --git a/lib/orb/models/customers/balance_transaction_create_response.rb b/lib/orb/models/customers/balance_transaction_create_response.rb index da9bbf4c..35686a3c 100644 --- a/lib/orb/models/customers/balance_transaction_create_response.rb +++ b/lib/orb/models/customers/balance_transaction_create_response.rb @@ -100,6 +100,7 @@ module Action CREDIT_NOTE_VOIDED = :credit_note_voided OVERPAYMENT_REFUND = :overpayment_refund EXTERNAL_PAYMENT = :external_payment + SMALL_INVOICE_CARRYOVER = :small_invoice_carryover # @!method self.values # @return [Array] diff --git a/lib/orb/models/customers/balance_transaction_list_response.rb b/lib/orb/models/customers/balance_transaction_list_response.rb index c1d2573c..fc30a817 100644 --- a/lib/orb/models/customers/balance_transaction_list_response.rb +++ b/lib/orb/models/customers/balance_transaction_list_response.rb @@ -100,6 +100,7 @@ module Action CREDIT_NOTE_VOIDED = :credit_note_voided OVERPAYMENT_REFUND = :overpayment_refund EXTERNAL_PAYMENT = :external_payment + SMALL_INVOICE_CARRYOVER = :small_invoice_carryover # @!method self.values # @return [Array] diff --git a/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb b/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb index aadc7db9..2342cd47 100644 --- a/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb +++ b/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb @@ -146,13 +146,26 @@ class InvoiceSettings < Orb::Internal::Type::BaseModel required :auto_collection, Orb::Internal::Type::Boolean # @!attribute net_terms - # The net terms determines the difference between the invoice date and the issue - # date for the invoice. If you intend the invoice to be due on issue, set this - # to 0. + # The net terms determines the due date of the invoice. Due date is calculated + # based on the invoice or issuance date, depending on the account's configured due + # date calculation method. A value of '0' here represents that the invoice is due + # on issue, whereas a value of '30' represents that the customer has 30 days to + # pay the invoice. Do not set this field if you want to set a custom due date. # # @return [Integer, nil] required :net_terms, Integer, nil?: true + # @!attribute custom_due_date + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + # + # @return [Date, Time, nil] + optional :custom_due_date, + union: -> { + Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::CustomDueDate + }, + nil?: true + # @!attribute invoice_date # An ISO 8601 format date that denotes when this invoice should be dated in the # customer's timezone. If not provided, the invoice date will default to the @@ -178,7 +191,7 @@ class InvoiceSettings < Orb::Internal::Type::BaseModel # @return [Boolean, nil] optional :require_successful_payment, Orb::Internal::Type::Boolean - # @!method initialize(auto_collection:, net_terms:, invoice_date: nil, memo: nil, require_successful_payment: nil) + # @!method initialize(auto_collection:, net_terms:, custom_due_date: nil, invoice_date: nil, memo: nil, require_successful_payment: nil) # Some parameter documentations has been truncated, see # {Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings} # for more details. @@ -190,7 +203,9 @@ class InvoiceSettings < Orb::Internal::Type::BaseModel # # @param auto_collection [Boolean] Whether the credits purchase invoice should auto collect with the customer's sav # - # @param net_terms [Integer, nil] The net terms determines the difference between the invoice date and the issue d + # @param net_terms [Integer, nil] The net terms determines the due date of the invoice. Due date is calculated bas + # + # @param custom_due_date [Date, Time, nil] An optional custom due date for the invoice. If not set, the due date will be ca # # @param invoice_date [Date, Time, nil] An ISO 8601 format date that denotes when this invoice should be dated in the cu # @@ -198,6 +213,21 @@ class InvoiceSettings < Orb::Internal::Type::BaseModel # # @param require_successful_payment [Boolean] If true, the new credit block will require that the corresponding invoice is pai + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + # + # @see Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings#custom_due_date + module CustomDueDate + extend Orb::Internal::Type::Union + + variant Date + + variant Time + + # @!method self.variants + # @return [Array(Date, Time)] + end + # An ISO 8601 format date that denotes when this invoice should be dated in the # customer's timezone. If not provided, the invoice date will default to the # credit block's effective date. diff --git a/lib/orb/models/customers/credits/ledger_create_entry_params.rb b/lib/orb/models/customers/credits/ledger_create_entry_params.rb index 4b6cc06a..bb60d602 100644 --- a/lib/orb/models/customers/credits/ledger_create_entry_params.rb +++ b/lib/orb/models/customers/credits/ledger_create_entry_params.rb @@ -145,13 +145,26 @@ class InvoiceSettings < Orb::Internal::Type::BaseModel required :auto_collection, Orb::Internal::Type::Boolean # @!attribute net_terms - # The net terms determines the difference between the invoice date and the issue - # date for the invoice. If you intend the invoice to be due on issue, set this - # to 0. + # The net terms determines the due date of the invoice. Due date is calculated + # based on the invoice or issuance date, depending on the account's configured due + # date calculation method. A value of '0' here represents that the invoice is due + # on issue, whereas a value of '30' represents that the customer has 30 days to + # pay the invoice. Do not set this field if you want to set a custom due date. # # @return [Integer, nil] required :net_terms, Integer, nil?: true + # @!attribute custom_due_date + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + # + # @return [Date, Time, nil] + optional :custom_due_date, + union: -> { + Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::CustomDueDate + }, + nil?: true + # @!attribute invoice_date # An ISO 8601 format date that denotes when this invoice should be dated in the # customer's timezone. If not provided, the invoice date will default to the @@ -177,7 +190,7 @@ class InvoiceSettings < Orb::Internal::Type::BaseModel # @return [Boolean, nil] optional :require_successful_payment, Orb::Internal::Type::Boolean - # @!method initialize(auto_collection:, net_terms:, invoice_date: nil, memo: nil, require_successful_payment: nil) + # @!method initialize(auto_collection:, net_terms:, custom_due_date: nil, invoice_date: nil, memo: nil, require_successful_payment: nil) # Some parameter documentations has been truncated, see # {Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings} for # more details. @@ -189,7 +202,9 @@ class InvoiceSettings < Orb::Internal::Type::BaseModel # # @param auto_collection [Boolean] Whether the credits purchase invoice should auto collect with the customer's sav # - # @param net_terms [Integer, nil] The net terms determines the difference between the invoice date and the issue d + # @param net_terms [Integer, nil] The net terms determines the due date of the invoice. Due date is calculated bas + # + # @param custom_due_date [Date, Time, nil] An optional custom due date for the invoice. If not set, the due date will be ca # # @param invoice_date [Date, Time, nil] An ISO 8601 format date that denotes when this invoice should be dated in the cu # @@ -197,6 +212,21 @@ class InvoiceSettings < Orb::Internal::Type::BaseModel # # @param require_successful_payment [Boolean] If true, the new credit block will require that the corresponding invoice is pai + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + # + # @see Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings#custom_due_date + module CustomDueDate + extend Orb::Internal::Type::Union + + variant Date + + variant Time + + # @!method self.variants + # @return [Array(Date, Time)] + end + # An ISO 8601 format date that denotes when this invoice should be dated in the # customer's timezone. If not provided, the invoice date will default to the # credit block's effective date. diff --git a/lib/orb/models/invoice.rb b/lib/orb/models/invoice.rb index cf49a6d7..9690015b 100644 --- a/lib/orb/models/invoice.rb +++ b/lib/orb/models/invoice.rb @@ -696,6 +696,7 @@ module Action CREDIT_NOTE_VOIDED = :credit_note_voided OVERPAYMENT_REFUND = :overpayment_refund EXTERNAL_PAYMENT = :external_payment + SMALL_INVOICE_CARRYOVER = :small_invoice_carryover # @!method self.values # @return [Array] @@ -844,7 +845,7 @@ class LineItem < Orb::Internal::Type::BaseModel # For more on the types of prices, see # [the core concepts documentation](/core-concepts#plan-and-price) # - # @return [Orb::Models::Price::Unit, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::Tiered, Orb::Models::Price::TieredBPS, Orb::Models::Price::BPS, Orb::Models::Price::BulkBPS, Orb::Models::Price::Bulk, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::GroupedWithMinMaxThresholds] + # @return [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::Minimum, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput] required :price, union: -> { Orb::Price } # @!attribute quantity @@ -867,7 +868,7 @@ class LineItem < Orb::Internal::Type::BaseModel required :sub_line_items, -> { Orb::Internal::Type::ArrayOf[union: Orb::Invoice::LineItem::SubLineItem] } # @!attribute subtotal - # The line amount before before any adjustments. + # The line amount before any adjustments. # # @return [String] required :subtotal, String @@ -919,7 +920,7 @@ class LineItem < Orb::Internal::Type::BaseModel # # @param partially_invoiced_amount [String] Any amount applied from a partial invoice # - # @param price [Orb::Models::Price::Unit, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::Tiered, Orb::Models::Price::TieredBPS, Orb::Models::Price::BPS, Orb::Models::Price::BulkBPS, Orb::Models::Price::Bulk, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::GroupedWithMinMaxThresholds] The Price resource represents a price that can be billed on a subscription, resu + # @param price [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::Minimum, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput] The Price resource represents a price that can be billed on a subscription, resu # # @param quantity [Float] Either the fixed fee quantity or the usage during the service period. # @@ -927,7 +928,7 @@ class LineItem < Orb::Internal::Type::BaseModel # # @param sub_line_items [Array] For complex pricing structures, the line item can be broken down further in `sub # - # @param subtotal [String] The line amount before before any adjustments. + # @param subtotal [String] The line amount before any adjustments. # # @param tax_amounts [Array] An array of tax rates and their incurred tax amounts. Empty if no tax integratio # @@ -999,13 +1000,23 @@ class PaymentAttempt < Orb::Internal::Type::BaseModel # @return [String, nil] required :payment_provider_id, String, nil?: true + # @!attribute receipt_pdf + # URL to the downloadable PDF version of the receipt. This field will be `null` + # for payment attempts that did not succeed. + # + # @return [String, nil] + required :receipt_pdf, String, nil?: true + # @!attribute succeeded # Whether the payment attempt succeeded. # # @return [Boolean] required :succeeded, Orb::Internal::Type::Boolean - # @!method initialize(id:, amount:, created_at:, payment_provider:, payment_provider_id:, succeeded:) + # @!method initialize(id:, amount:, created_at:, payment_provider:, payment_provider_id:, receipt_pdf:, succeeded:) + # Some parameter documentations has been truncated, see + # {Orb::Models::Invoice::PaymentAttempt} for more details. + # # @param id [String] The ID of the payment attempt. # # @param amount [String] The amount of the payment attempt. @@ -1016,6 +1027,8 @@ class PaymentAttempt < Orb::Internal::Type::BaseModel # # @param payment_provider_id [String, nil] The ID of the payment attempt in the payment provider. # + # @param receipt_pdf [String, nil] URL to the downloadable PDF version of the receipt. This field will be `null` fo + # # @param succeeded [Boolean] Whether the payment attempt succeeded. # The payment provider that attempted to collect the payment. diff --git a/lib/orb/models/invoice_create_params.rb b/lib/orb/models/invoice_create_params.rb index cb86d7ff..09b33e50 100644 --- a/lib/orb/models/invoice_create_params.rb +++ b/lib/orb/models/invoice_create_params.rb @@ -39,6 +39,13 @@ class InvoiceCreateParams < Orb::Internal::Type::BaseModel # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::UsageDiscount, Orb::Models::AmountDiscount, nil] optional :discount, union: -> { Orb::Discount }, nil?: true + # @!attribute due_date + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + # + # @return [Date, Time, nil] + optional :due_date, union: -> { Orb::InvoiceCreateParams::DueDate }, nil?: true + # @!attribute external_customer_id # The `external_customer_id` of the `Customer` to create this invoice for. One of # `customer_id` and `external_customer_id` are required. @@ -47,7 +54,8 @@ class InvoiceCreateParams < Orb::Internal::Type::BaseModel optional :external_customer_id, String, nil?: true # @!attribute memo - # An optional memo to attach to the invoice. + # An optional memo to attach to the invoice. If no memo is provided, we will + # attach the default memo # # @return [String, nil] optional :memo, String, nil?: true @@ -61,10 +69,11 @@ class InvoiceCreateParams < Orb::Internal::Type::BaseModel optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true # @!attribute net_terms - # Determines the difference between the invoice issue date for subscription - # invoices as the date that they are due. A value of '0' here represents that the - # invoice is due on issue, whereas a value of 30 represents that the customer has - # 30 days to pay the invoice. + # The net terms determines the due date of the invoice. Due date is calculated + # based on the invoice or issuance date, depending on the account's configured due + # date calculation method. A value of '0' here represents that the invoice is due + # on issue, whereas a value of '30' represents that the customer has 30 days to + # pay the invoice. Do not set this field if you want to set a custom due date. # # @return [Integer, nil] optional :net_terms, Integer, nil?: true @@ -77,7 +86,7 @@ class InvoiceCreateParams < Orb::Internal::Type::BaseModel # @return [Boolean, nil] optional :will_auto_issue, Orb::Internal::Type::Boolean - # @!method initialize(currency:, invoice_date:, line_items:, customer_id: nil, discount: nil, external_customer_id: nil, memo: nil, metadata: nil, net_terms: nil, will_auto_issue: nil, request_options: {}) + # @!method initialize(currency:, invoice_date:, line_items:, customer_id: nil, discount: nil, due_date: nil, external_customer_id: nil, memo: nil, metadata: nil, net_terms: nil, will_auto_issue: nil, request_options: {}) # Some parameter documentations has been truncated, see # {Orb::Models::InvoiceCreateParams} for more details. # @@ -91,13 +100,15 @@ class InvoiceCreateParams < Orb::Internal::Type::BaseModel # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::UsageDiscount, Orb::Models::AmountDiscount, nil] An optional discount to attach to the invoice. # + # @param due_date [Date, Time, nil] An optional custom due date for the invoice. If not set, the due date will be ca + # # @param external_customer_id [String, nil] The `external_customer_id` of the `Customer` to create this invoice for. One of # - # @param memo [String, nil] An optional memo to attach to the invoice. + # @param memo [String, nil] An optional memo to attach to the invoice. If no memo is provided, we will attac # # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed # - # @param net_terms [Integer, nil] Determines the difference between the invoice issue date for subscription invoic + # @param net_terms [Integer, nil] The net terms determines the due date of the invoice. Due date is calculated bas # # @param will_auto_issue [Boolean] When true, this invoice will be submitted for issuance upon creation. When false # @@ -139,6 +150,7 @@ class LineItem < Orb::Internal::Type::BaseModel required :start_date, Date # @!attribute unit_config + # Configuration for unit pricing # # @return [Orb::Models::UnitConfig] required :unit_config, -> { Orb::UnitConfig } @@ -156,7 +168,7 @@ class LineItem < Orb::Internal::Type::BaseModel # # @param start_date [Date] A date string to specify the line item's start date in the customer's timezone. # - # @param unit_config [Orb::Models::UnitConfig] + # @param unit_config [Orb::Models::UnitConfig] Configuration for unit pricing # @see Orb::Models::InvoiceCreateParams::LineItem#model_type module ModelType @@ -168,6 +180,19 @@ module ModelType # @return [Array] end end + + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + module DueDate + extend Orb::Internal::Type::Union + + variant Date + + variant Time + + # @!method self.variants + # @return [Array(Date, Time)] + end end end end diff --git a/lib/orb/models/invoice_fetch_upcoming_response.rb b/lib/orb/models/invoice_fetch_upcoming_response.rb index 8c8fe8d1..9990fcc1 100644 --- a/lib/orb/models/invoice_fetch_upcoming_response.rb +++ b/lib/orb/models/invoice_fetch_upcoming_response.rb @@ -696,6 +696,7 @@ module Action CREDIT_NOTE_VOIDED = :credit_note_voided OVERPAYMENT_REFUND = :overpayment_refund EXTERNAL_PAYMENT = :external_payment + SMALL_INVOICE_CARRYOVER = :small_invoice_carryover # @!method self.values # @return [Array] @@ -845,7 +846,7 @@ class LineItem < Orb::Internal::Type::BaseModel # For more on the types of prices, see # [the core concepts documentation](/core-concepts#plan-and-price) # - # @return [Orb::Models::Price::Unit, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::Tiered, Orb::Models::Price::TieredBPS, Orb::Models::Price::BPS, Orb::Models::Price::BulkBPS, Orb::Models::Price::Bulk, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::GroupedWithMinMaxThresholds] + # @return [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::Minimum, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput] required :price, union: -> { Orb::Price } # @!attribute quantity @@ -869,7 +870,7 @@ class LineItem < Orb::Internal::Type::BaseModel -> { Orb::Internal::Type::ArrayOf[union: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem] } # @!attribute subtotal - # The line amount before before any adjustments. + # The line amount before any adjustments. # # @return [String] required :subtotal, String @@ -921,7 +922,7 @@ class LineItem < Orb::Internal::Type::BaseModel # # @param partially_invoiced_amount [String] Any amount applied from a partial invoice # - # @param price [Orb::Models::Price::Unit, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::Tiered, Orb::Models::Price::TieredBPS, Orb::Models::Price::BPS, Orb::Models::Price::BulkBPS, Orb::Models::Price::Bulk, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::GroupedWithMinMaxThresholds] The Price resource represents a price that can be billed on a subscription, resu + # @param price [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::Minimum, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput] The Price resource represents a price that can be billed on a subscription, resu # # @param quantity [Float] Either the fixed fee quantity or the usage during the service period. # @@ -929,7 +930,7 @@ class LineItem < Orb::Internal::Type::BaseModel # # @param sub_line_items [Array] For complex pricing structures, the line item can be broken down further in `sub # - # @param subtotal [String] The line amount before before any adjustments. + # @param subtotal [String] The line amount before any adjustments. # # @param tax_amounts [Array] An array of tax rates and their incurred tax amounts. Empty if no tax integratio # @@ -1003,13 +1004,23 @@ class PaymentAttempt < Orb::Internal::Type::BaseModel # @return [String, nil] required :payment_provider_id, String, nil?: true + # @!attribute receipt_pdf + # URL to the downloadable PDF version of the receipt. This field will be `null` + # for payment attempts that did not succeed. + # + # @return [String, nil] + required :receipt_pdf, String, nil?: true + # @!attribute succeeded # Whether the payment attempt succeeded. # # @return [Boolean] required :succeeded, Orb::Internal::Type::Boolean - # @!method initialize(id:, amount:, created_at:, payment_provider:, payment_provider_id:, succeeded:) + # @!method initialize(id:, amount:, created_at:, payment_provider:, payment_provider_id:, receipt_pdf:, succeeded:) + # Some parameter documentations has been truncated, see + # {Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt} for more details. + # # @param id [String] The ID of the payment attempt. # # @param amount [String] The amount of the payment attempt. @@ -1020,6 +1031,8 @@ class PaymentAttempt < Orb::Internal::Type::BaseModel # # @param payment_provider_id [String, nil] The ID of the payment attempt in the payment provider. # + # @param receipt_pdf [String, nil] URL to the downloadable PDF version of the receipt. This field will be `null` fo + # # @param succeeded [Boolean] Whether the payment attempt succeeded. # The payment provider that attempted to collect the payment. diff --git a/lib/orb/models/invoice_line_item_create_params.rb b/lib/orb/models/invoice_line_item_create_params.rb index d144626f..30a913b5 100644 --- a/lib/orb/models/invoice_line_item_create_params.rb +++ b/lib/orb/models/invoice_line_item_create_params.rb @@ -25,13 +25,6 @@ class InvoiceLineItemCreateParams < Orb::Internal::Type::BaseModel # @return [String] required :invoice_id, String - # @!attribute name - # The item name associated with this line item. If an item with the same name - # exists in Orb, that item will be associated with the line item. - # - # @return [String] - required :name, String - # @!attribute quantity # The number of units on the line item # @@ -44,7 +37,27 @@ class InvoiceLineItemCreateParams < Orb::Internal::Type::BaseModel # @return [Date] required :start_date, Date - # @!method initialize(amount:, end_date:, invoice_id:, name:, quantity:, start_date:, request_options: {}) + # @!attribute item_id + # The id of the item to associate with this line item. If provided without `name`, + # the item's name will be used for the price/line item. If provided with `name`, + # the item will be associated but `name` will be used for the line item. At least + # one of `name` or `item_id` must be provided. + # + # @return [String, nil] + optional :item_id, String, nil?: true + + # @!attribute name + # The name to use for the line item. If `item_id` is not provided, Orb will search + # for an item with this name. If found, that item will be associated with the line + # item. If not found, a new item will be created with this name. If `item_id` is + # provided, this name will be used for the line item, but the item association + # will be based on `item_id`. At least one of `name` or `item_id` must be + # provided. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!method initialize(amount:, end_date:, invoice_id:, quantity:, start_date:, item_id: nil, name: nil, request_options: {}) # Some parameter documentations has been truncated, see # {Orb::Models::InvoiceLineItemCreateParams} for more details. # @@ -54,12 +67,14 @@ class InvoiceLineItemCreateParams < Orb::Internal::Type::BaseModel # # @param invoice_id [String] The id of the Invoice to add this line item. # - # @param name [String] The item name associated with this line item. If an item with the same name exis - # # @param quantity [Float] The number of units on the line item # # @param start_date [Date] A date string to specify the line item's start date in the customer's timezone. # + # @param item_id [String, nil] The id of the item to associate with this line item. If provided without `name`, + # + # @param name [String, nil] The name to use for the line item. If `item_id` is not provided, Orb will search + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/orb/models/invoice_line_item_create_response.rb b/lib/orb/models/invoice_line_item_create_response.rb index c4533fc8..2378290c 100644 --- a/lib/orb/models/invoice_line_item_create_response.rb +++ b/lib/orb/models/invoice_line_item_create_response.rb @@ -123,7 +123,7 @@ class InvoiceLineItemCreateResponse < Orb::Internal::Type::BaseModel # For more on the types of prices, see # [the core concepts documentation](/core-concepts#plan-and-price) # - # @return [Orb::Models::Price::Unit, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::Tiered, Orb::Models::Price::TieredBPS, Orb::Models::Price::BPS, Orb::Models::Price::BulkBPS, Orb::Models::Price::Bulk, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::GroupedWithMinMaxThresholds] + # @return [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::Minimum, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput] required :price, union: -> { Orb::Price } # @!attribute quantity @@ -147,7 +147,7 @@ class InvoiceLineItemCreateResponse < Orb::Internal::Type::BaseModel -> { Orb::Internal::Type::ArrayOf[union: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem] } # @!attribute subtotal - # The line amount before before any adjustments. + # The line amount before any adjustments. # # @return [String] required :subtotal, String @@ -199,7 +199,7 @@ class InvoiceLineItemCreateResponse < Orb::Internal::Type::BaseModel # # @param partially_invoiced_amount [String] Any amount applied from a partial invoice # - # @param price [Orb::Models::Price::Unit, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::Tiered, Orb::Models::Price::TieredBPS, Orb::Models::Price::BPS, Orb::Models::Price::BulkBPS, Orb::Models::Price::Bulk, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::GroupedWithMinMaxThresholds] The Price resource represents a price that can be billed on a subscription, resu + # @param price [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::Minimum, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput] The Price resource represents a price that can be billed on a subscription, resu # # @param quantity [Float] Either the fixed fee quantity or the usage during the service period. # @@ -207,7 +207,7 @@ class InvoiceLineItemCreateResponse < Orb::Internal::Type::BaseModel # # @param sub_line_items [Array] For complex pricing structures, the line item can be broken down further in `sub # - # @param subtotal [String] The line amount before before any adjustments. + # @param subtotal [String] The line amount before any adjustments. # # @param tax_amounts [Array] An array of tax rates and their incurred tax amounts. Empty if no tax integratio # diff --git a/lib/orb/models/invoice_update_params.rb b/lib/orb/models/invoice_update_params.rb index 32300d62..9659ab9d 100644 --- a/lib/orb/models/invoice_update_params.rb +++ b/lib/orb/models/invoice_update_params.rb @@ -7,6 +7,13 @@ class InvoiceUpdateParams < Orb::Internal::Type::BaseModel extend Orb::Internal::Type::RequestParameters::Converter include Orb::Internal::Type::RequestParameters + # @!attribute due_date + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + # + # @return [Date, Time, nil] + optional :due_date, union: -> { Orb::InvoiceUpdateParams::DueDate }, nil?: true + # @!attribute metadata # User-specified key/value pairs for the resource. Individual keys can be removed # by setting the value to `null`, and the entire metadata mapping can be cleared @@ -15,13 +22,40 @@ class InvoiceUpdateParams < Orb::Internal::Type::BaseModel # @return [Hash{Symbol=>String, nil}, nil] optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true - # @!method initialize(metadata: nil, request_options: {}) + # @!attribute net_terms + # The net terms determines the due date of the invoice. Due date is calculated + # based on the invoice or issuance date, depending on the account's configured due + # date calculation method. A value of '0' here represents that the invoice is due + # on issue, whereas a value of '30' represents that the customer has 30 days to + # pay the invoice. Do not set this field if you want to set a custom due date. + # + # @return [Integer, nil] + optional :net_terms, Integer, nil?: true + + # @!method initialize(due_date: nil, metadata: nil, net_terms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {Orb::Models::InvoiceUpdateParams} for more details. # + # @param due_date [Date, Time, nil] An optional custom due date for the invoice. If not set, the due date will be ca + # # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed # + # @param net_terms [Integer, nil] The net terms determines the due date of the invoice. Due date is calculated bas + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + module DueDate + extend Orb::Internal::Type::Union + + variant Date + + variant Time + + # @!method self.variants + # @return [Array(Date, Time)] + end end end end diff --git a/lib/orb/models/item.rb b/lib/orb/models/item.rb index 2ed6a35a..91a12d56 100644 --- a/lib/orb/models/item.rb +++ b/lib/orb/models/item.rb @@ -5,16 +5,20 @@ module Models # @see Orb::Resources::Items#create class Item < Orb::Internal::Type::BaseModel # @!attribute id + # The Orb-assigned unique identifier for the item. # # @return [String] required :id, String # @!attribute created_at + # The time at which the item was created. # # @return [Time] required :created_at, Time # @!attribute external_connections + # A list of external connections for this item, used to sync with external + # invoicing and tax systems. # # @return [Array] required :external_connections, -> { Orb::Internal::Type::ArrayOf[Orb::Item::ExternalConnection] } @@ -29,11 +33,18 @@ class Item < Orb::Internal::Type::BaseModel required :metadata, Orb::Internal::Type::HashOf[String] # @!attribute name + # The name of the item. # # @return [String] required :name, String - # @!method initialize(id:, created_at:, external_connections:, metadata:, name:) + # @!attribute archived_at + # The time at which the item was archived. If null, the item is not archived. + # + # @return [Time, nil] + optional :archived_at, Time, nil?: true + + # @!method initialize(id:, created_at:, external_connections:, metadata:, name:, archived_at: nil) # Some parameter documentations has been truncated, see {Orb::Models::Item} for # more details. # @@ -41,31 +52,41 @@ class Item < Orb::Internal::Type::BaseModel # with all line items, billable metrics, and prices and are used for defining # external sync behavior for invoices and tax calculation purposes. # - # @param id [String] + # @param id [String] The Orb-assigned unique identifier for the item. # - # @param created_at [Time] + # @param created_at [Time] The time at which the item was created. # - # @param external_connections [Array] + # @param external_connections [Array] A list of external connections for this item, used to sync with external invoici # # @param metadata [Hash{Symbol=>String}] User specified key-value pairs for the resource. If not present, this defaults t # - # @param name [String] + # @param name [String] The name of the item. + # + # @param archived_at [Time, nil] The time at which the item was archived. If null, the item is not archived. class ExternalConnection < Orb::Internal::Type::BaseModel # @!attribute external_connection_name + # The name of the external system this item is connected to. # # @return [Symbol, Orb::Models::Item::ExternalConnection::ExternalConnectionName] required :external_connection_name, enum: -> { Orb::Item::ExternalConnection::ExternalConnectionName } # @!attribute external_entity_id + # The identifier of this item in the external system. # # @return [String] required :external_entity_id, String # @!method initialize(external_connection_name:, external_entity_id:) - # @param external_connection_name [Symbol, Orb::Models::Item::ExternalConnection::ExternalConnectionName] - # @param external_entity_id [String] + # Represents a connection between an Item and an external system for invoicing or + # tax calculation purposes. + # + # @param external_connection_name [Symbol, Orb::Models::Item::ExternalConnection::ExternalConnectionName] The name of the external system this item is connected to. + # + # @param external_entity_id [String] The identifier of this item in the external system. + # The name of the external system this item is connected to. + # # @see Orb::Models::Item::ExternalConnection#external_connection_name module ExternalConnectionName extend Orb::Internal::Type::Enum @@ -77,6 +98,7 @@ module ExternalConnectionName TAXJAR = :taxjar AVALARA = :avalara ANROK = :anrok + NUMERAL = :numeral # @!method self.values # @return [Array] diff --git a/lib/orb/models/item_slim.rb b/lib/orb/models/item_slim.rb index 4945f123..7575915c 100644 --- a/lib/orb/models/item_slim.rb +++ b/lib/orb/models/item_slim.rb @@ -4,18 +4,24 @@ module Orb module Models class ItemSlim < Orb::Internal::Type::BaseModel # @!attribute id + # The Orb-assigned unique identifier for the item. # # @return [String] required :id, String # @!attribute name + # The name of the item. # # @return [String] required :name, String # @!method initialize(id:, name:) - # @param id [String] - # @param name [String] + # A minimal representation of an Item containing only the essential identifying + # information. + # + # @param id [String] The Orb-assigned unique identifier for the item. + # + # @param name [String] The name of the item. end end end diff --git a/lib/orb/models/item_update_params.rb b/lib/orb/models/item_update_params.rb index 2f974597..2f7baa7f 100644 --- a/lib/orb/models/item_update_params.rb +++ b/lib/orb/models/item_update_params.rb @@ -41,20 +41,28 @@ class ItemUpdateParams < Orb::Internal::Type::BaseModel class ExternalConnection < Orb::Internal::Type::BaseModel # @!attribute external_connection_name + # The name of the external system this item is connected to. # # @return [Symbol, Orb::Models::ItemUpdateParams::ExternalConnection::ExternalConnectionName] required :external_connection_name, enum: -> { Orb::ItemUpdateParams::ExternalConnection::ExternalConnectionName } # @!attribute external_entity_id + # The identifier of this item in the external system. # # @return [String] required :external_entity_id, String # @!method initialize(external_connection_name:, external_entity_id:) - # @param external_connection_name [Symbol, Orb::Models::ItemUpdateParams::ExternalConnection::ExternalConnectionName] - # @param external_entity_id [String] + # Represents a connection between an Item and an external system for invoicing or + # tax calculation purposes. + # + # @param external_connection_name [Symbol, Orb::Models::ItemUpdateParams::ExternalConnection::ExternalConnectionName] The name of the external system this item is connected to. + # + # @param external_entity_id [String] The identifier of this item in the external system. + # The name of the external system this item is connected to. + # # @see Orb::Models::ItemUpdateParams::ExternalConnection#external_connection_name module ExternalConnectionName extend Orb::Internal::Type::Enum @@ -66,6 +74,7 @@ module ExternalConnectionName TAXJAR = :taxjar AVALARA = :avalara ANROK = :anrok + NUMERAL = :numeral # @!method self.values # @return [Array] diff --git a/lib/orb/models/matrix_config.rb b/lib/orb/models/matrix_config.rb index d1ed0ac2..375f6b9a 100644 --- a/lib/orb/models/matrix_config.rb +++ b/lib/orb/models/matrix_config.rb @@ -16,17 +16,19 @@ class MatrixConfig < Orb::Internal::Type::BaseModel required :dimensions, Orb::Internal::Type::ArrayOf[String, nil?: true] # @!attribute matrix_values - # Matrix values for specified matrix grouping keys + # Matrix values configuration # # @return [Array] required :matrix_values, -> { Orb::Internal::Type::ArrayOf[Orb::MatrixValue] } # @!method initialize(default_unit_amount:, dimensions:, matrix_values:) + # Configuration for matrix pricing + # # @param default_unit_amount [String] Default per unit rate for any usage not bucketed into a specified matrix_value # # @param dimensions [Array] One or two event property values to evaluate matrix groups by # - # @param matrix_values [Array] Matrix values for specified matrix grouping keys + # @param matrix_values [Array] Matrix values configuration end end end diff --git a/lib/orb/models/matrix_sub_line_item.rb b/lib/orb/models/matrix_sub_line_item.rb index 154c80d6..cb9e01c1 100644 --- a/lib/orb/models/matrix_sub_line_item.rb +++ b/lib/orb/models/matrix_sub_line_item.rb @@ -34,7 +34,13 @@ class MatrixSubLineItem < Orb::Internal::Type::BaseModel # @return [Symbol, Orb::Models::MatrixSubLineItem::Type] required :type, enum: -> { Orb::MatrixSubLineItem::Type } - # @!method initialize(amount:, grouping:, matrix_config:, name:, quantity:, type:) + # @!attribute scaled_quantity + # The scaled quantity for this line item for specific pricing structures + # + # @return [Float, nil] + optional :scaled_quantity, Float, nil?: true + + # @!method initialize(amount:, grouping:, matrix_config:, name:, quantity:, type:, scaled_quantity: nil) # @param amount [String] The total amount for this sub line item. # # @param grouping [Orb::Models::SubLineItemGrouping, nil] @@ -46,6 +52,8 @@ class MatrixSubLineItem < Orb::Internal::Type::BaseModel # @param quantity [Float] # # @param type [Symbol, Orb::Models::MatrixSubLineItem::Type] + # + # @param scaled_quantity [Float, nil] The scaled quantity for this line item for specific pricing structures # @see Orb::Models::MatrixSubLineItem#type module Type diff --git a/lib/orb/models/matrix_value.rb b/lib/orb/models/matrix_value.rb index 6b53fab3..e013a80e 100644 --- a/lib/orb/models/matrix_value.rb +++ b/lib/orb/models/matrix_value.rb @@ -4,9 +4,7 @@ module Orb module Models class MatrixValue < Orb::Internal::Type::BaseModel # @!attribute dimension_values - # One or two matrix keys to filter usage to this Matrix value by. For example, - # ["region", "tier"] could be used to filter cloud usage by a cloud region and an - # instance tier. + # One or two matrix keys to filter usage to this Matrix value by # # @return [Array] required :dimension_values, Orb::Internal::Type::ArrayOf[String, nil?: true] @@ -18,10 +16,9 @@ class MatrixValue < Orb::Internal::Type::BaseModel required :unit_amount, String # @!method initialize(dimension_values:, unit_amount:) - # Some parameter documentations has been truncated, see {Orb::Models::MatrixValue} - # for more details. + # Configuration for a single matrix value # - # @param dimension_values [Array] One or two matrix keys to filter usage to this Matrix value by. For example, ["r + # @param dimension_values [Array] One or two matrix keys to filter usage to this Matrix value by # # @param unit_amount [String] Unit price for the specified dimension_values end diff --git a/lib/orb/models/matrix_with_allocation_config.rb b/lib/orb/models/matrix_with_allocation_config.rb index 2163b81b..78e37797 100644 --- a/lib/orb/models/matrix_with_allocation_config.rb +++ b/lib/orb/models/matrix_with_allocation_config.rb @@ -4,10 +4,10 @@ module Orb module Models class MatrixWithAllocationConfig < Orb::Internal::Type::BaseModel # @!attribute allocation - # Allocation to be used to calculate the price + # Usage allocation # - # @return [Float] - required :allocation, Float + # @return [String] + required :allocation, String # @!attribute default_unit_amount # Default per unit rate for any usage not bucketed into a specified matrix_value @@ -22,19 +22,47 @@ class MatrixWithAllocationConfig < Orb::Internal::Type::BaseModel required :dimensions, Orb::Internal::Type::ArrayOf[String, nil?: true] # @!attribute matrix_values - # Matrix values for specified matrix grouping keys + # Matrix values configuration # - # @return [Array] - required :matrix_values, -> { Orb::Internal::Type::ArrayOf[Orb::MatrixValue] } + # @return [Array] + required :matrix_values, -> { Orb::Internal::Type::ArrayOf[Orb::MatrixWithAllocationConfig::MatrixValue] } # @!method initialize(allocation:, default_unit_amount:, dimensions:, matrix_values:) - # @param allocation [Float] Allocation to be used to calculate the price + # Configuration for matrix pricing with usage allocation + # + # @param allocation [String] Usage allocation # # @param default_unit_amount [String] Default per unit rate for any usage not bucketed into a specified matrix_value # # @param dimensions [Array] One or two event property values to evaluate matrix groups by # - # @param matrix_values [Array] Matrix values for specified matrix grouping keys + # @param matrix_values [Array] Matrix values configuration + + class MatrixValue < Orb::Internal::Type::BaseModel + # @!attribute dimension_values + # One or two matrix keys to filter usage to this Matrix value by. For example, + # ["region", "tier"] could be used to filter cloud usage by a cloud region and an + # instance tier. + # + # @return [Array] + required :dimension_values, Orb::Internal::Type::ArrayOf[String, nil?: true] + + # @!attribute unit_amount + # Unit price for the specified dimension_values + # + # @return [String] + required :unit_amount, String + + # @!method initialize(dimension_values:, unit_amount:) + # Some parameter documentations has been truncated, see + # {Orb::Models::MatrixWithAllocationConfig::MatrixValue} for more details. + # + # Configuration for a single matrix value + # + # @param dimension_values [Array] One or two matrix keys to filter usage to this Matrix value by. For example, ["r + # + # @param unit_amount [String] Unit price for the specified dimension_values + end end end end diff --git a/lib/orb/models/monetary_amount_discount_adjustment.rb b/lib/orb/models/monetary_amount_discount_adjustment.rb index f440f6c1..be488a11 100644 --- a/lib/orb/models/monetary_amount_discount_adjustment.rb +++ b/lib/orb/models/monetary_amount_discount_adjustment.rb @@ -41,8 +41,8 @@ class MonetaryAmountDiscountAdjustment < Orb::Internal::Type::BaseModel required :filters, -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] } # @!attribute is_invoice_level - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. # # @return [Boolean] required :is_invoice_level, Orb::Internal::Type::Boolean @@ -76,7 +76,7 @@ class MonetaryAmountDiscountAdjustment < Orb::Internal::Type::BaseModel # # @param filters [Array] The filters that determine which prices to apply this adjustment to. # - # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha + # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invoice, false for adjustments that # # @param reason [String, nil] The reason for the adjustment. # diff --git a/lib/orb/models/monetary_maximum_adjustment.rb b/lib/orb/models/monetary_maximum_adjustment.rb index ab07d10b..365c21d5 100644 --- a/lib/orb/models/monetary_maximum_adjustment.rb +++ b/lib/orb/models/monetary_maximum_adjustment.rb @@ -34,8 +34,8 @@ class MonetaryMaximumAdjustment < Orb::Internal::Type::BaseModel required :filters, -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] } # @!attribute is_invoice_level - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. # # @return [Boolean] required :is_invoice_level, Orb::Internal::Type::Boolean @@ -74,7 +74,7 @@ class MonetaryMaximumAdjustment < Orb::Internal::Type::BaseModel # # @param filters [Array] The filters that determine which prices to apply this adjustment to. # - # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha + # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invoice, false for adjustments that # # @param maximum_amount [String] The maximum amount to charge in a given billing period for the prices this adjus # diff --git a/lib/orb/models/monetary_minimum_adjustment.rb b/lib/orb/models/monetary_minimum_adjustment.rb index 6419d5ae..2f78cc4a 100644 --- a/lib/orb/models/monetary_minimum_adjustment.rb +++ b/lib/orb/models/monetary_minimum_adjustment.rb @@ -34,8 +34,8 @@ class MonetaryMinimumAdjustment < Orb::Internal::Type::BaseModel required :filters, -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] } # @!attribute is_invoice_level - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. # # @return [Boolean] required :is_invoice_level, Orb::Internal::Type::Boolean @@ -80,7 +80,7 @@ class MonetaryMinimumAdjustment < Orb::Internal::Type::BaseModel # # @param filters [Array] The filters that determine which prices to apply this adjustment to. # - # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha + # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invoice, false for adjustments that # # @param item_id [String] The item ID that revenue from this minimum will be attributed to. # diff --git a/lib/orb/models/monetary_percentage_discount_adjustment.rb b/lib/orb/models/monetary_percentage_discount_adjustment.rb index a0eb138e..8850364a 100644 --- a/lib/orb/models/monetary_percentage_discount_adjustment.rb +++ b/lib/orb/models/monetary_percentage_discount_adjustment.rb @@ -34,8 +34,8 @@ class MonetaryPercentageDiscountAdjustment < Orb::Internal::Type::BaseModel required :filters, -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] } # @!attribute is_invoice_level - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. # # @return [Boolean] required :is_invoice_level, Orb::Internal::Type::Boolean @@ -74,7 +74,7 @@ class MonetaryPercentageDiscountAdjustment < Orb::Internal::Type::BaseModel # # @param filters [Array] The filters that determine which prices to apply this adjustment to. # - # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha + # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invoice, false for adjustments that # # @param percentage_discount [Float] The percentage (as a value between 0 and 1) by which to discount the price inter # diff --git a/lib/orb/models/monetary_usage_discount_adjustment.rb b/lib/orb/models/monetary_usage_discount_adjustment.rb index a1c2c549..9f8a78ca 100644 --- a/lib/orb/models/monetary_usage_discount_adjustment.rb +++ b/lib/orb/models/monetary_usage_discount_adjustment.rb @@ -34,8 +34,8 @@ class MonetaryUsageDiscountAdjustment < Orb::Internal::Type::BaseModel required :filters, -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] } # @!attribute is_invoice_level - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. # # @return [Boolean] required :is_invoice_level, Orb::Internal::Type::Boolean @@ -74,7 +74,7 @@ class MonetaryUsageDiscountAdjustment < Orb::Internal::Type::BaseModel # # @param filters [Array] The filters that determine which prices to apply this adjustment to. # - # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha + # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invoice, false for adjustments that # # @param reason [String, nil] The reason for the adjustment. # diff --git a/lib/orb/models/new_floating_bulk_bps_price.rb b/lib/orb/models/new_floating_bulk_bps_price.rb deleted file mode 100644 index 32c9b545..00000000 --- a/lib/orb/models/new_floating_bulk_bps_price.rb +++ /dev/null @@ -1,197 +0,0 @@ -# frozen_string_literal: true - -module Orb - module Models - class NewFloatingBulkBPSPrice < Orb::Internal::Type::BaseModel - # @!attribute bulk_bps_config - # - # @return [Orb::Models::BulkBPSConfig] - required :bulk_bps_config, -> { Orb::BulkBPSConfig } - - # @!attribute cadence - # The cadence to bill for this price on. - # - # @return [Symbol, Orb::Models::NewFloatingBulkBPSPrice::Cadence] - required :cadence, enum: -> { Orb::NewFloatingBulkBPSPrice::Cadence } - - # @!attribute currency - # An ISO 4217 currency string for which this price is billed in. - # - # @return [String] - required :currency, String - - # @!attribute item_id - # The id of the item the price will be associated with. - # - # @return [String] - required :item_id, String - - # @!attribute model_type - # - # @return [Symbol, Orb::Models::NewFloatingBulkBPSPrice::ModelType] - required :model_type, enum: -> { Orb::NewFloatingBulkBPSPrice::ModelType } - - # @!attribute name - # The name of the price. - # - # @return [String] - required :name, String - - # @!attribute billable_metric_id - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - # - # @return [String, nil] - optional :billable_metric_id, String, nil?: true - - # @!attribute billed_in_advance - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - # - # @return [Boolean, nil] - optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true - - # @!attribute billing_cycle_configuration - # For custom cadence: specifies the duration of the billing period in days or - # months. - # - # @return [Orb::Models::NewBillingCycleConfiguration, nil] - optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true - - # @!attribute conversion_rate - # The per unit conversion rate of the price currency to the invoicing currency. - # - # @return [Float, nil] - optional :conversion_rate, Float, nil?: true - - # @!attribute conversion_rate_config - # The configuration for the rate of the price currency to the invoicing currency. - # - # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - optional :conversion_rate_config, - union: -> { Orb::NewFloatingBulkBPSPrice::ConversionRateConfig }, - nil?: true - - # @!attribute dimensional_price_configuration - # For dimensional price: specifies a price group and dimension values - # - # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] - optional :dimensional_price_configuration, -> { Orb::NewDimensionalPriceConfiguration }, nil?: true - - # @!attribute external_price_id - # An alias for the price. - # - # @return [String, nil] - optional :external_price_id, String, nil?: true - - # @!attribute fixed_price_quantity - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - # - # @return [Float, nil] - optional :fixed_price_quantity, Float, nil?: true - - # @!attribute invoice_grouping_key - # The property used to group this price on an invoice - # - # @return [String, nil] - optional :invoice_grouping_key, String, nil?: true - - # @!attribute invoicing_cycle_configuration - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - # - # @return [Orb::Models::NewBillingCycleConfiguration, nil] - optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true - - # @!attribute metadata - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - # - # @return [Hash{Symbol=>String, nil}, nil] - optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true - - # @!method initialize(bulk_bps_config:, cadence:, currency:, item_id:, model_type:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil) - # Some parameter documentations has been truncated, see - # {Orb::Models::NewFloatingBulkBPSPrice} for more details. - # - # @param bulk_bps_config [Orb::Models::BulkBPSConfig] - # - # @param cadence [Symbol, Orb::Models::NewFloatingBulkBPSPrice::Cadence] The cadence to bill for this price on. - # - # @param currency [String] An ISO 4217 currency string for which this price is billed in. - # - # @param item_id [String] The id of the item the price will be associated with. - # - # @param model_type [Symbol, Orb::Models::NewFloatingBulkBPSPrice::ModelType] - # - # @param name [String] The name of the price. - # - # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b - # - # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi - # - # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont - # - # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. - # - # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. - # - # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values - # - # @param external_price_id [String, nil] An alias for the price. - # - # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl - # - # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice - # - # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. - # - # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed - - # The cadence to bill for this price on. - # - # @see Orb::Models::NewFloatingBulkBPSPrice#cadence - module Cadence - extend Orb::Internal::Type::Enum - - ANNUAL = :annual - SEMI_ANNUAL = :semi_annual - MONTHLY = :monthly - QUARTERLY = :quarterly - ONE_TIME = :one_time - CUSTOM = :custom - - # @!method self.values - # @return [Array] - end - - # @see Orb::Models::NewFloatingBulkBPSPrice#model_type - module ModelType - extend Orb::Internal::Type::Enum - - BULK_BPS = :bulk_bps - - # @!method self.values - # @return [Array] - end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingBulkBPSPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - end - end -end diff --git a/lib/orb/models/new_floating_bulk_price.rb b/lib/orb/models/new_floating_bulk_price.rb index e0ee7cc3..c9542e7a 100644 --- a/lib/orb/models/new_floating_bulk_price.rb +++ b/lib/orb/models/new_floating_bulk_price.rb @@ -4,6 +4,7 @@ module Orb module Models class NewFloatingBulkPrice < Orb::Internal::Type::BaseModel # @!attribute bulk_config + # Configuration for bulk pricing # # @return [Orb::Models::BulkConfig] required :bulk_config, -> { Orb::BulkConfig } @@ -27,6 +28,7 @@ class NewFloatingBulkPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingBulkPrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingBulkPrice::ModelType } @@ -116,7 +118,7 @@ class NewFloatingBulkPrice < Orb::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {Orb::Models::NewFloatingBulkPrice} for more details. # - # @param bulk_config [Orb::Models::BulkConfig] + # @param bulk_config [Orb::Models::BulkConfig] Configuration for bulk pricing # # @param cadence [Symbol, Orb::Models::NewFloatingBulkPrice::Cadence] The cadence to bill for this price on. # @@ -124,7 +126,7 @@ class NewFloatingBulkPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingBulkPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingBulkPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -167,6 +169,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewFloatingBulkPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -176,22 +180,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingBulkPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_floating_bulk_with_proration_price.rb b/lib/orb/models/new_floating_bulk_with_proration_price.rb index 0fc69839..c232f558 100644 --- a/lib/orb/models/new_floating_bulk_with_proration_price.rb +++ b/lib/orb/models/new_floating_bulk_with_proration_price.rb @@ -4,9 +4,11 @@ module Orb module Models class NewFloatingBulkWithProrationPrice < Orb::Internal::Type::BaseModel # @!attribute bulk_with_proration_config + # Configuration for bulk_with_proration pricing # - # @return [Hash{Symbol=>Object}] - required :bulk_with_proration_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig] + required :bulk_with_proration_config, + -> { Orb::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig } # @!attribute cadence # The cadence to bill for this price on. @@ -27,6 +29,7 @@ class NewFloatingBulkWithProrationPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingBulkWithProrationPrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingBulkWithProrationPrice::ModelType } @@ -116,7 +119,7 @@ class NewFloatingBulkWithProrationPrice < Orb::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {Orb::Models::NewFloatingBulkWithProrationPrice} for more details. # - # @param bulk_with_proration_config [Hash{Symbol=>Object}] + # @param bulk_with_proration_config [Orb::Models::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig] Configuration for bulk_with_proration pricing # # @param cadence [Symbol, Orb::Models::NewFloatingBulkWithProrationPrice::Cadence] The cadence to bill for this price on. # @@ -124,7 +127,7 @@ class NewFloatingBulkWithProrationPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingBulkWithProrationPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingBulkWithProrationPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -150,6 +153,42 @@ class NewFloatingBulkWithProrationPrice < Orb::Internal::Type::BaseModel # # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # @see Orb::Models::NewFloatingBulkWithProrationPrice#bulk_with_proration_config + class BulkWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Bulk tiers for rating based on total usage volume + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig::Tier] } + + # @!method initialize(tiers:) + # Configuration for bulk_with_proration pricing + # + # @param tiers [Array] Bulk tiers for rating based on total usage volume + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute unit_amount + # Cost per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute tier_lower_bound + # The lower bound for this tier + # + # @return [String, nil] + optional :tier_lower_bound, String, nil?: true + + # @!method initialize(unit_amount:, tier_lower_bound: nil) + # Configuration for a single bulk pricing tier with proration + # + # @param unit_amount [String] Cost per unit + # + # @param tier_lower_bound [String, nil] The lower bound for this tier + end + end + # The cadence to bill for this price on. # # @see Orb::Models::NewFloatingBulkWithProrationPrice#cadence @@ -167,6 +206,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewFloatingBulkWithProrationPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -176,22 +217,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingBulkWithProrationPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_floating_cumulative_grouped_bulk_price.rb b/lib/orb/models/new_floating_cumulative_grouped_bulk_price.rb index 39ab3d96..3c913936 100644 --- a/lib/orb/models/new_floating_cumulative_grouped_bulk_price.rb +++ b/lib/orb/models/new_floating_cumulative_grouped_bulk_price.rb @@ -10,9 +10,11 @@ class NewFloatingCumulativeGroupedBulkPrice < Orb::Internal::Type::BaseModel required :cadence, enum: -> { Orb::NewFloatingCumulativeGroupedBulkPrice::Cadence } # @!attribute cumulative_grouped_bulk_config + # Configuration for cumulative_grouped_bulk pricing # - # @return [Hash{Symbol=>Object}] - required :cumulative_grouped_bulk_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig] + required :cumulative_grouped_bulk_config, + -> { Orb::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig } # @!attribute currency # An ISO 4217 currency string for which this price is billed in. @@ -27,6 +29,7 @@ class NewFloatingCumulativeGroupedBulkPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingCumulativeGroupedBulkPrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingCumulativeGroupedBulkPrice::ModelType } @@ -118,13 +121,13 @@ class NewFloatingCumulativeGroupedBulkPrice < Orb::Internal::Type::BaseModel # # @param cadence [Symbol, Orb::Models::NewFloatingCumulativeGroupedBulkPrice::Cadence] The cadence to bill for this price on. # - # @param cumulative_grouped_bulk_config [Hash{Symbol=>Object}] + # @param cumulative_grouped_bulk_config [Orb::Models::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig] Configuration for cumulative_grouped_bulk pricing # # @param currency [String] An ISO 4217 currency string for which this price is billed in. # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingCumulativeGroupedBulkPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingCumulativeGroupedBulkPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -167,6 +170,60 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewFloatingCumulativeGroupedBulkPrice#cumulative_grouped_bulk_config + class CumulativeGroupedBulkConfig < Orb::Internal::Type::BaseModel + # @!attribute dimension_values + # Each tier lower bound must have the same group of values. + # + # @return [Array] + required :dimension_values, + -> { Orb::Internal::Type::ArrayOf[Orb::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue] } + + # @!attribute group + # Grouping key name + # + # @return [String] + required :group, String + + # @!method initialize(dimension_values:, group:) + # Configuration for cumulative_grouped_bulk pricing + # + # @param dimension_values [Array] Each tier lower bound must have the same group of values. + # + # @param group [String] Grouping key name + + class DimensionValue < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # Grouping key value + # + # @return [String] + required :grouping_key, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Unit amount for this combination + # + # @return [String] + required :unit_amount, String + + # @!method initialize(grouping_key:, tier_lower_bound:, unit_amount:) + # Configuration for a dimension value entry + # + # @param grouping_key [String] Grouping key value + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Unit amount for this combination + end + end + + # The pricing model type + # # @see Orb::Models::NewFloatingCumulativeGroupedBulkPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -176,22 +233,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingCumulativeGroupedBulkPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_floating_grouped_allocation_price.rb b/lib/orb/models/new_floating_grouped_allocation_price.rb index a528b811..e4a085e8 100644 --- a/lib/orb/models/new_floating_grouped_allocation_price.rb +++ b/lib/orb/models/new_floating_grouped_allocation_price.rb @@ -16,9 +16,11 @@ class NewFloatingGroupedAllocationPrice < Orb::Internal::Type::BaseModel required :currency, String # @!attribute grouped_allocation_config + # Configuration for grouped_allocation pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_allocation_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewFloatingGroupedAllocationPrice::GroupedAllocationConfig] + required :grouped_allocation_config, + -> { Orb::NewFloatingGroupedAllocationPrice::GroupedAllocationConfig } # @!attribute item_id # The id of the item the price will be associated with. @@ -27,6 +29,7 @@ class NewFloatingGroupedAllocationPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingGroupedAllocationPrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingGroupedAllocationPrice::ModelType } @@ -120,11 +123,11 @@ class NewFloatingGroupedAllocationPrice < Orb::Internal::Type::BaseModel # # @param currency [String] An ISO 4217 currency string for which this price is billed in. # - # @param grouped_allocation_config [Hash{Symbol=>Object}] + # @param grouped_allocation_config [Orb::Models::NewFloatingGroupedAllocationPrice::GroupedAllocationConfig] Configuration for grouped_allocation pricing # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingGroupedAllocationPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingGroupedAllocationPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -167,6 +170,38 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewFloatingGroupedAllocationPrice#grouped_allocation_config + class GroupedAllocationConfig < Orb::Internal::Type::BaseModel + # @!attribute allocation + # Usage allocation per group + # + # @return [String] + required :allocation, String + + # @!attribute grouping_key + # How to determine the groups that should each be allocated some quantity + # + # @return [String] + required :grouping_key, String + + # @!attribute overage_unit_rate + # Unit rate for post-allocation + # + # @return [String] + required :overage_unit_rate, String + + # @!method initialize(allocation:, grouping_key:, overage_unit_rate:) + # Configuration for grouped_allocation pricing + # + # @param allocation [String] Usage allocation per group + # + # @param grouping_key [String] How to determine the groups that should each be allocated some quantity + # + # @param overage_unit_rate [String] Unit rate for post-allocation + end + + # The pricing model type + # # @see Orb::Models::NewFloatingGroupedAllocationPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -176,22 +211,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingGroupedAllocationPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_floating_grouped_tiered_package_price.rb b/lib/orb/models/new_floating_grouped_tiered_package_price.rb index 68e1bbd5..631e5097 100644 --- a/lib/orb/models/new_floating_grouped_tiered_package_price.rb +++ b/lib/orb/models/new_floating_grouped_tiered_package_price.rb @@ -16,9 +16,11 @@ class NewFloatingGroupedTieredPackagePrice < Orb::Internal::Type::BaseModel required :currency, String # @!attribute grouped_tiered_package_config + # Configuration for grouped_tiered_package pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_tiered_package_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig] + required :grouped_tiered_package_config, + -> { Orb::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig } # @!attribute item_id # The id of the item the price will be associated with. @@ -27,6 +29,7 @@ class NewFloatingGroupedTieredPackagePrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingGroupedTieredPackagePrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingGroupedTieredPackagePrice::ModelType } @@ -120,11 +123,11 @@ class NewFloatingGroupedTieredPackagePrice < Orb::Internal::Type::BaseModel # # @param currency [String] An ISO 4217 currency string for which this price is billed in. # - # @param grouped_tiered_package_config [Hash{Symbol=>Object}] + # @param grouped_tiered_package_config [Orb::Models::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig] Configuration for grouped_tiered_package pricing # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingGroupedTieredPackagePrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingGroupedTieredPackagePrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -167,6 +170,65 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewFloatingGroupedTieredPackagePrice#grouped_tiered_package_config + class GroupedTieredPackageConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before tiering + # + # @return [String] + required :grouping_key, String + + # @!attribute package_size + # Package size + # + # @return [String] + required :package_size, String + + # @!attribute tiers + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier] } + + # @!method initialize(grouping_key:, package_size:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig} + # for more details. + # + # Configuration for grouped_tiered_package pricing + # + # @param grouping_key [String] The event property used to group before tiering + # + # @param package_size [String] Package size + # + # @param tiers [Array] Apply tiered pricing after rounding up the quantity to the package size. Tiers a + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute per_unit + # Price per package + # + # @return [String] + required :per_unit, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!method initialize(per_unit:, tier_lower_bound:) + # Configuration for a single tier + # + # @param per_unit [String] Price per package + # + # @param tier_lower_bound [String] Tier lower bound + end + end + + # The pricing model type + # # @see Orb::Models::NewFloatingGroupedTieredPackagePrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -176,22 +238,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingGroupedTieredPackagePrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_floating_grouped_tiered_price.rb b/lib/orb/models/new_floating_grouped_tiered_price.rb index 5b06bfac..c908ee42 100644 --- a/lib/orb/models/new_floating_grouped_tiered_price.rb +++ b/lib/orb/models/new_floating_grouped_tiered_price.rb @@ -16,9 +16,10 @@ class NewFloatingGroupedTieredPrice < Orb::Internal::Type::BaseModel required :currency, String # @!attribute grouped_tiered_config + # Configuration for grouped_tiered pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_tiered_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewFloatingGroupedTieredPrice::GroupedTieredConfig] + required :grouped_tiered_config, -> { Orb::NewFloatingGroupedTieredPrice::GroupedTieredConfig } # @!attribute item_id # The id of the item the price will be associated with. @@ -27,6 +28,7 @@ class NewFloatingGroupedTieredPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingGroupedTieredPrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingGroupedTieredPrice::ModelType } @@ -120,11 +122,11 @@ class NewFloatingGroupedTieredPrice < Orb::Internal::Type::BaseModel # # @param currency [String] An ISO 4217 currency string for which this price is billed in. # - # @param grouped_tiered_config [Hash{Symbol=>Object}] + # @param grouped_tiered_config [Orb::Models::NewFloatingGroupedTieredPrice::GroupedTieredConfig] Configuration for grouped_tiered pricing # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingGroupedTieredPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingGroupedTieredPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -167,6 +169,57 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewFloatingGroupedTieredPrice#grouped_tiered_config + class GroupedTieredConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The billable metric property used to group before tiering + # + # @return [String] + required :grouping_key, String + + # @!attribute tiers + # Apply tiered pricing to each segment generated after grouping with the provided + # key + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewFloatingGroupedTieredPrice::GroupedTieredConfig::Tier] } + + # @!method initialize(grouping_key:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewFloatingGroupedTieredPrice::GroupedTieredConfig} for more + # details. + # + # Configuration for grouped_tiered pricing + # + # @param grouping_key [String] The billable metric property used to group before tiering + # + # @param tiers [Array] Apply tiered pricing to each segment generated after grouping with the provided + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tier + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Per unit amount + end + end + + # The pricing model type + # # @see Orb::Models::NewFloatingGroupedTieredPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -176,22 +229,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingGroupedTieredPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_floating_grouped_with_metered_minimum_price.rb b/lib/orb/models/new_floating_grouped_with_metered_minimum_price.rb index 7d3fcce7..00cb58f0 100644 --- a/lib/orb/models/new_floating_grouped_with_metered_minimum_price.rb +++ b/lib/orb/models/new_floating_grouped_with_metered_minimum_price.rb @@ -16,9 +16,11 @@ class NewFloatingGroupedWithMeteredMinimumPrice < Orb::Internal::Type::BaseModel required :currency, String # @!attribute grouped_with_metered_minimum_config + # Configuration for grouped_with_metered_minimum pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_with_metered_minimum_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig] + required :grouped_with_metered_minimum_config, + -> { Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig } # @!attribute item_id # The id of the item the price will be associated with. @@ -27,6 +29,7 @@ class NewFloatingGroupedWithMeteredMinimumPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingGroupedWithMeteredMinimumPrice::ModelType } @@ -120,11 +123,11 @@ class NewFloatingGroupedWithMeteredMinimumPrice < Orb::Internal::Type::BaseModel # # @param currency [String] An ISO 4217 currency string for which this price is billed in. # - # @param grouped_with_metered_minimum_config [Hash{Symbol=>Object}] + # @param grouped_with_metered_minimum_config [Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig] Configuration for grouped_with_metered_minimum pricing # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -167,6 +170,112 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice#grouped_with_metered_minimum_config + class GroupedWithMeteredMinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # Used to partition the usage into groups. The minimum amount is applied to each + # group. + # + # @return [String] + required :grouping_key, String + + # @!attribute minimum_unit_amount + # The minimum amount to charge per group per unit + # + # @return [String] + required :minimum_unit_amount, String + + # @!attribute pricing_key + # Used to determine the unit rate + # + # @return [String] + required :pricing_key, String + + # @!attribute scaling_factors + # Scale the unit rates by the scaling factor. + # + # @return [Array] + required :scaling_factors, + -> { Orb::Internal::Type::ArrayOf[Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor] } + + # @!attribute scaling_key + # Used to determine the unit rate scaling factor + # + # @return [String] + required :scaling_key, String + + # @!attribute unit_amounts + # Apply per unit pricing to each pricing value. The minimum amount is applied any + # unmatched usage. + # + # @return [Array] + required :unit_amounts, + -> { Orb::Internal::Type::ArrayOf[Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount] } + + # @!method initialize(grouping_key:, minimum_unit_amount:, pricing_key:, scaling_factors:, scaling_key:, unit_amounts:) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig} + # for more details. + # + # Configuration for grouped_with_metered_minimum pricing + # + # @param grouping_key [String] Used to partition the usage into groups. The minimum amount is applied to each g + # + # @param minimum_unit_amount [String] The minimum amount to charge per group per unit + # + # @param pricing_key [String] Used to determine the unit rate + # + # @param scaling_factors [Array] Scale the unit rates by the scaling factor. + # + # @param scaling_key [String] Used to determine the unit rate scaling factor + # + # @param unit_amounts [Array] Apply per unit pricing to each pricing value. The minimum amount is applied any + + class ScalingFactor < Orb::Internal::Type::BaseModel + # @!attribute scaling_factor + # Scaling factor + # + # @return [String] + required :scaling_factor, String + + # @!attribute scaling_value + # Scaling value + # + # @return [String] + required :scaling_value, String + + # @!method initialize(scaling_factor:, scaling_value:) + # Configuration for a scaling factor + # + # @param scaling_factor [String] Scaling factor + # + # @param scaling_value [String] Scaling value + end + + class UnitAmount < Orb::Internal::Type::BaseModel + # @!attribute pricing_value + # Pricing value + # + # @return [String] + required :pricing_value, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(pricing_value:, unit_amount:) + # Configuration for a unit amount + # + # @param pricing_value [String] Pricing value + # + # @param unit_amount [String] Per unit amount + end + end + + # The pricing model type + # # @see Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -176,22 +285,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_floating_grouped_with_prorated_minimum_price.rb b/lib/orb/models/new_floating_grouped_with_prorated_minimum_price.rb index 3861c7ba..a4c78956 100644 --- a/lib/orb/models/new_floating_grouped_with_prorated_minimum_price.rb +++ b/lib/orb/models/new_floating_grouped_with_prorated_minimum_price.rb @@ -16,9 +16,11 @@ class NewFloatingGroupedWithProratedMinimumPrice < Orb::Internal::Type::BaseMode required :currency, String # @!attribute grouped_with_prorated_minimum_config + # Configuration for grouped_with_prorated_minimum pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_with_prorated_minimum_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewFloatingGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig] + required :grouped_with_prorated_minimum_config, + -> { Orb::NewFloatingGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig } # @!attribute item_id # The id of the item the price will be associated with. @@ -27,6 +29,7 @@ class NewFloatingGroupedWithProratedMinimumPrice < Orb::Internal::Type::BaseMode required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingGroupedWithProratedMinimumPrice::ModelType } @@ -120,11 +123,11 @@ class NewFloatingGroupedWithProratedMinimumPrice < Orb::Internal::Type::BaseMode # # @param currency [String] An ISO 4217 currency string for which this price is billed in. # - # @param grouped_with_prorated_minimum_config [Hash{Symbol=>Object}] + # @param grouped_with_prorated_minimum_config [Orb::Models::NewFloatingGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig] Configuration for grouped_with_prorated_minimum pricing # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -167,6 +170,38 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewFloatingGroupedWithProratedMinimumPrice#grouped_with_prorated_minimum_config + class GroupedWithProratedMinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # How to determine the groups that should each have a minimum + # + # @return [String] + required :grouping_key, String + + # @!attribute minimum + # The minimum amount to charge per group + # + # @return [String] + required :minimum, String + + # @!attribute unit_rate + # The amount to charge per unit + # + # @return [String] + required :unit_rate, String + + # @!method initialize(grouping_key:, minimum:, unit_rate:) + # Configuration for grouped_with_prorated_minimum pricing + # + # @param grouping_key [String] How to determine the groups that should each have a minimum + # + # @param minimum [String] The minimum amount to charge per group + # + # @param unit_rate [String] The amount to charge per unit + end + + # The pricing model type + # # @see Orb::Models::NewFloatingGroupedWithProratedMinimumPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -176,22 +211,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingGroupedWithProratedMinimumPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_floating_matrix_price.rb b/lib/orb/models/new_floating_matrix_price.rb index 779579e1..ca0c5001 100644 --- a/lib/orb/models/new_floating_matrix_price.rb +++ b/lib/orb/models/new_floating_matrix_price.rb @@ -22,11 +22,13 @@ class NewFloatingMatrixPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute matrix_config + # Configuration for matrix pricing # # @return [Orb::Models::MatrixConfig] required :matrix_config, -> { Orb::MatrixConfig } # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingMatrixPrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingMatrixPrice::ModelType } @@ -122,9 +124,9 @@ class NewFloatingMatrixPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param matrix_config [Orb::Models::MatrixConfig] + # @param matrix_config [Orb::Models::MatrixConfig] Configuration for matrix pricing # - # @param model_type [Symbol, Orb::Models::NewFloatingMatrixPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingMatrixPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -167,6 +169,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewFloatingMatrixPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -176,22 +180,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingMatrixPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_floating_matrix_with_allocation_price.rb b/lib/orb/models/new_floating_matrix_with_allocation_price.rb index a90b47ba..855d91ac 100644 --- a/lib/orb/models/new_floating_matrix_with_allocation_price.rb +++ b/lib/orb/models/new_floating_matrix_with_allocation_price.rb @@ -22,11 +22,13 @@ class NewFloatingMatrixWithAllocationPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute matrix_with_allocation_config + # Configuration for matrix_with_allocation pricing # # @return [Orb::Models::MatrixWithAllocationConfig] required :matrix_with_allocation_config, -> { Orb::MatrixWithAllocationConfig } # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingMatrixWithAllocationPrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingMatrixWithAllocationPrice::ModelType } @@ -122,9 +124,9 @@ class NewFloatingMatrixWithAllocationPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param matrix_with_allocation_config [Orb::Models::MatrixWithAllocationConfig] + # @param matrix_with_allocation_config [Orb::Models::MatrixWithAllocationConfig] Configuration for matrix_with_allocation pricing # - # @param model_type [Symbol, Orb::Models::NewFloatingMatrixWithAllocationPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingMatrixWithAllocationPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -167,6 +169,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewFloatingMatrixWithAllocationPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -176,22 +180,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingMatrixWithAllocationPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_floating_matrix_with_display_name_price.rb b/lib/orb/models/new_floating_matrix_with_display_name_price.rb index 6ec8f850..731520aa 100644 --- a/lib/orb/models/new_floating_matrix_with_display_name_price.rb +++ b/lib/orb/models/new_floating_matrix_with_display_name_price.rb @@ -22,11 +22,14 @@ class NewFloatingMatrixWithDisplayNamePrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute matrix_with_display_name_config + # Configuration for matrix_with_display_name pricing # - # @return [Hash{Symbol=>Object}] - required :matrix_with_display_name_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig] + required :matrix_with_display_name_config, + -> { Orb::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig } # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingMatrixWithDisplayNamePrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingMatrixWithDisplayNamePrice::ModelType } @@ -122,9 +125,9 @@ class NewFloatingMatrixWithDisplayNamePrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param matrix_with_display_name_config [Hash{Symbol=>Object}] + # @param matrix_with_display_name_config [Orb::Models::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig] Configuration for matrix_with_display_name pricing # - # @param model_type [Symbol, Orb::Models::NewFloatingMatrixWithDisplayNamePrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingMatrixWithDisplayNamePrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -167,6 +170,60 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewFloatingMatrixWithDisplayNamePrice#matrix_with_display_name_config + class MatrixWithDisplayNameConfig < Orb::Internal::Type::BaseModel + # @!attribute dimension + # Used to determine the unit rate + # + # @return [String] + required :dimension, String + + # @!attribute unit_amounts + # Apply per unit pricing to each dimension value + # + # @return [Array] + required :unit_amounts, + -> { Orb::Internal::Type::ArrayOf[Orb::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount] } + + # @!method initialize(dimension:, unit_amounts:) + # Configuration for matrix_with_display_name pricing + # + # @param dimension [String] Used to determine the unit rate + # + # @param unit_amounts [Array] Apply per unit pricing to each dimension value + + class UnitAmount < Orb::Internal::Type::BaseModel + # @!attribute dimension_value + # The dimension value + # + # @return [String] + required :dimension_value, String + + # @!attribute display_name + # Display name for this dimension value + # + # @return [String] + required :display_name, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(dimension_value:, display_name:, unit_amount:) + # Configuration for a unit amount item + # + # @param dimension_value [String] The dimension value + # + # @param display_name [String] Display name for this dimension value + # + # @param unit_amount [String] Per unit amount + end + end + + # The pricing model type + # # @see Orb::Models::NewFloatingMatrixWithDisplayNamePrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -176,22 +233,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingMatrixWithDisplayNamePrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_floating_max_group_tiered_package_price.rb b/lib/orb/models/new_floating_max_group_tiered_package_price.rb index 197880fe..bd2424c5 100644 --- a/lib/orb/models/new_floating_max_group_tiered_package_price.rb +++ b/lib/orb/models/new_floating_max_group_tiered_package_price.rb @@ -22,11 +22,14 @@ class NewFloatingMaxGroupTieredPackagePrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute max_group_tiered_package_config + # Configuration for max_group_tiered_package pricing # - # @return [Hash{Symbol=>Object}] - required :max_group_tiered_package_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig] + required :max_group_tiered_package_config, + -> { Orb::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig } # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingMaxGroupTieredPackagePrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingMaxGroupTieredPackagePrice::ModelType } @@ -122,9 +125,9 @@ class NewFloatingMaxGroupTieredPackagePrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param max_group_tiered_package_config [Hash{Symbol=>Object}] + # @param max_group_tiered_package_config [Orb::Models::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig] Configuration for max_group_tiered_package pricing # - # @param model_type [Symbol, Orb::Models::NewFloatingMaxGroupTieredPackagePrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingMaxGroupTieredPackagePrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -167,6 +170,64 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewFloatingMaxGroupTieredPackagePrice#max_group_tiered_package_config + class MaxGroupTieredPackageConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before tiering the group with the highest value + # + # @return [String] + required :grouping_key, String + + # @!attribute package_size + # Package size + # + # @return [String] + required :package_size, String + + # @!attribute tiers + # Apply tiered pricing to the largest group after grouping with the provided key. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier] } + + # @!method initialize(grouping_key:, package_size:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig} + # for more details. + # + # Configuration for max_group_tiered_package pricing + # + # @param grouping_key [String] The event property used to group before tiering the group with the highest value + # + # @param package_size [String] Package size + # + # @param tiers [Array] Apply tiered pricing to the largest group after grouping with the provided key. + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tier + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Per unit amount + end + end + + # The pricing model type + # # @see Orb::Models::NewFloatingMaxGroupTieredPackagePrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -176,22 +237,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingMaxGroupTieredPackagePrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_floating_bps_price.rb b/lib/orb/models/new_floating_minimum_composite_price.rb similarity index 70% rename from lib/orb/models/new_floating_bps_price.rb rename to lib/orb/models/new_floating_minimum_composite_price.rb index d6d2f218..6ddca0b5 100644 --- a/lib/orb/models/new_floating_bps_price.rb +++ b/lib/orb/models/new_floating_minimum_composite_price.rb @@ -2,17 +2,12 @@ module Orb module Models - class NewFloatingBPSPrice < Orb::Internal::Type::BaseModel - # @!attribute bps_config - # - # @return [Orb::Models::BPSConfig] - required :bps_config, -> { Orb::BPSConfig } - + class NewFloatingMinimumCompositePrice < Orb::Internal::Type::BaseModel # @!attribute cadence # The cadence to bill for this price on. # - # @return [Symbol, Orb::Models::NewFloatingBPSPrice::Cadence] - required :cadence, enum: -> { Orb::NewFloatingBPSPrice::Cadence } + # @return [Symbol, Orb::Models::NewFloatingMinimumCompositePrice::Cadence] + required :cadence, enum: -> { Orb::NewFloatingMinimumCompositePrice::Cadence } # @!attribute currency # An ISO 4217 currency string for which this price is billed in. @@ -26,10 +21,17 @@ class NewFloatingBPSPrice < Orb::Internal::Type::BaseModel # @return [String] required :item_id, String + # @!attribute minimum_config + # Configuration for minimum pricing + # + # @return [Orb::Models::NewFloatingMinimumCompositePrice::MinimumConfig] + required :minimum_config, -> { Orb::NewFloatingMinimumCompositePrice::MinimumConfig } + # @!attribute model_type + # The pricing model type # - # @return [Symbol, Orb::Models::NewFloatingBPSPrice::ModelType] - required :model_type, enum: -> { Orb::NewFloatingBPSPrice::ModelType } + # @return [Symbol, Orb::Models::NewFloatingMinimumCompositePrice::ModelType] + required :model_type, enum: -> { Orb::NewFloatingMinimumCompositePrice::ModelType } # @!attribute name # The name of the price. @@ -69,9 +71,7 @@ class NewFloatingBPSPrice < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] optional :conversion_rate_config, - union: -> { - Orb::NewFloatingBPSPrice::ConversionRateConfig - }, + union: -> { Orb::NewFloatingMinimumCompositePrice::ConversionRateConfig }, nil?: true # @!attribute dimensional_price_configuration @@ -114,19 +114,19 @@ class NewFloatingBPSPrice < Orb::Internal::Type::BaseModel # @return [Hash{Symbol=>String, nil}, nil] optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true - # @!method initialize(bps_config:, cadence:, currency:, item_id:, model_type:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil) + # @!method initialize(cadence:, currency:, item_id:, minimum_config:, model_type:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil) # Some parameter documentations has been truncated, see - # {Orb::Models::NewFloatingBPSPrice} for more details. + # {Orb::Models::NewFloatingMinimumCompositePrice} for more details. # - # @param bps_config [Orb::Models::BPSConfig] - # - # @param cadence [Symbol, Orb::Models::NewFloatingBPSPrice::Cadence] The cadence to bill for this price on. + # @param cadence [Symbol, Orb::Models::NewFloatingMinimumCompositePrice::Cadence] The cadence to bill for this price on. # # @param currency [String] An ISO 4217 currency string for which this price is billed in. # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingBPSPrice::ModelType] + # @param minimum_config [Orb::Models::NewFloatingMinimumCompositePrice::MinimumConfig] Configuration for minimum pricing + # + # @param model_type [Symbol, Orb::Models::NewFloatingMinimumCompositePrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -154,7 +154,7 @@ class NewFloatingBPSPrice < Orb::Internal::Type::BaseModel # The cadence to bill for this price on. # - # @see Orb::Models::NewFloatingBPSPrice#cadence + # @see Orb::Models::NewFloatingMinimumCompositePrice#cadence module Cadence extend Orb::Internal::Type::Enum @@ -169,31 +169,39 @@ module Cadence # @return [Array] end - # @see Orb::Models::NewFloatingBPSPrice#model_type + # @see Orb::Models::NewFloatingMinimumCompositePrice#minimum_config + class MinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute minimum_amount + # The minimum amount to apply + # + # @return [String] + required :minimum_amount, String + + # @!attribute prorated + # If true, subtotals from this price are prorated based on the service period + # + # @return [Boolean, nil] + optional :prorated, Orb::Internal::Type::Boolean + + # @!method initialize(minimum_amount:, prorated: nil) + # Configuration for minimum pricing + # + # @param minimum_amount [String] The minimum amount to apply + # + # @param prorated [Boolean] If true, subtotals from this price are prorated based on the service period + end + + # The pricing model type + # + # @see Orb::Models::NewFloatingMinimumCompositePrice#model_type module ModelType extend Orb::Internal::Type::Enum - BPS = :bps + MINIMUM = :minimum # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingBPSPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_floating_package_price.rb b/lib/orb/models/new_floating_package_price.rb index c4271710..453a13f2 100644 --- a/lib/orb/models/new_floating_package_price.rb +++ b/lib/orb/models/new_floating_package_price.rb @@ -22,6 +22,7 @@ class NewFloatingPackagePrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingPackagePrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingPackagePrice::ModelType } @@ -33,6 +34,7 @@ class NewFloatingPackagePrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute package_config + # Configuration for package pricing # # @return [Orb::Models::PackageConfig] required :package_config, -> { Orb::PackageConfig } @@ -122,11 +124,11 @@ class NewFloatingPackagePrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingPackagePrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingPackagePrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param package_config [Orb::Models::PackageConfig] + # @param package_config [Orb::Models::PackageConfig] Configuration for package pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -167,6 +169,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewFloatingPackagePrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -176,22 +180,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingPackagePrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_floating_package_with_allocation_price.rb b/lib/orb/models/new_floating_package_with_allocation_price.rb index 10a5c127..c4bf5d83 100644 --- a/lib/orb/models/new_floating_package_with_allocation_price.rb +++ b/lib/orb/models/new_floating_package_with_allocation_price.rb @@ -22,6 +22,7 @@ class NewFloatingPackageWithAllocationPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingPackageWithAllocationPrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingPackageWithAllocationPrice::ModelType } @@ -33,9 +34,11 @@ class NewFloatingPackageWithAllocationPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute package_with_allocation_config + # Configuration for package_with_allocation pricing # - # @return [Hash{Symbol=>Object}] - required :package_with_allocation_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewFloatingPackageWithAllocationPrice::PackageWithAllocationConfig] + required :package_with_allocation_config, + -> { Orb::NewFloatingPackageWithAllocationPrice::PackageWithAllocationConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -122,11 +125,11 @@ class NewFloatingPackageWithAllocationPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingPackageWithAllocationPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingPackageWithAllocationPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param package_with_allocation_config [Hash{Symbol=>Object}] + # @param package_with_allocation_config [Orb::Models::NewFloatingPackageWithAllocationPrice::PackageWithAllocationConfig] Configuration for package_with_allocation pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -167,6 +170,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewFloatingPackageWithAllocationPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -177,20 +182,34 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingPackageWithAllocationPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::NewFloatingPackageWithAllocationPrice#package_with_allocation_config + class PackageWithAllocationConfig < Orb::Internal::Type::BaseModel + # @!attribute allocation + # Usage allocation + # + # @return [String] + required :allocation, String + + # @!attribute package_amount + # Price per package + # + # @return [String] + required :package_amount, String + + # @!attribute package_size + # Package size + # + # @return [String] + required :package_size, String + + # @!method initialize(allocation:, package_amount:, package_size:) + # Configuration for package_with_allocation pricing + # + # @param allocation [String] Usage allocation + # + # @param package_amount [String] Price per package + # + # @param package_size [String] Package size end end end diff --git a/lib/orb/models/new_floating_scalable_matrix_with_tiered_pricing_price.rb b/lib/orb/models/new_floating_scalable_matrix_with_tiered_pricing_price.rb index 8f741d3d..e8df8b32 100644 --- a/lib/orb/models/new_floating_scalable_matrix_with_tiered_pricing_price.rb +++ b/lib/orb/models/new_floating_scalable_matrix_with_tiered_pricing_price.rb @@ -22,6 +22,7 @@ class NewFloatingScalableMatrixWithTieredPricingPrice < Orb::Internal::Type::Bas required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ModelType } @@ -33,10 +34,11 @@ class NewFloatingScalableMatrixWithTieredPricingPrice < Orb::Internal::Type::Bas required :name, String # @!attribute scalable_matrix_with_tiered_pricing_config + # Configuration for scalable_matrix_with_tiered_pricing pricing # - # @return [Hash{Symbol=>Object}] + # @return [Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig] required :scalable_matrix_with_tiered_pricing_config, - Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + -> { Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -123,11 +125,11 @@ class NewFloatingScalableMatrixWithTieredPricingPrice < Orb::Internal::Type::Bas # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param scalable_matrix_with_tiered_pricing_config [Hash{Symbol=>Object}] + # @param scalable_matrix_with_tiered_pricing_config [Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig] Configuration for scalable_matrix_with_tiered_pricing pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -168,6 +170,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -178,20 +182,98 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union + # @see Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice#scalable_matrix_with_tiered_pricing_config + class ScalableMatrixWithTieredPricingConfig < Orb::Internal::Type::BaseModel + # @!attribute first_dimension + # Used for the scalable matrix first dimension + # + # @return [String] + required :first_dimension, String + + # @!attribute matrix_scaling_factors + # Apply a scaling factor to each dimension + # + # @return [Array] + required :matrix_scaling_factors, + -> do + Orb::Internal::Type::ArrayOf[ + Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor + ] + end + + # @!attribute tiers + # Tier pricing structure + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier] } + + # @!attribute second_dimension + # Used for the scalable matrix second dimension (optional) + # + # @return [String, nil] + optional :second_dimension, String, nil?: true + + # @!method initialize(first_dimension:, matrix_scaling_factors:, tiers:, second_dimension: nil) + # Configuration for scalable_matrix_with_tiered_pricing pricing + # + # @param first_dimension [String] Used for the scalable matrix first dimension + # + # @param matrix_scaling_factors [Array] Apply a scaling factor to each dimension + # + # @param tiers [Array] Tier pricing structure + # + # @param second_dimension [String, nil] Used for the scalable matrix second dimension (optional) + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + # @!attribute first_dimension_value + # First dimension value + # + # @return [String] + required :first_dimension_value, String + + # @!attribute scaling_factor + # Scaling factor + # + # @return [String] + required :scaling_factor, String + + # @!attribute second_dimension_value + # Second dimension value (optional) + # + # @return [String, nil] + optional :second_dimension_value, String, nil?: true - discriminator :conversion_rate_type + # @!method initialize(first_dimension_value:, scaling_factor:, second_dimension_value: nil) + # Configuration for a single matrix scaling factor + # + # @param first_dimension_value [String] First dimension value + # + # @param scaling_factor [String] Scaling factor + # + # @param second_dimension_value [String, nil] Second dimension value (optional) + end - variant :unit, -> { Orb::UnitConversionRateConfig } + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String - variant :tiered, -> { Orb::TieredConversionRateConfig } + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tier entry with business logic + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Per unit amount + end end end end diff --git a/lib/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rb b/lib/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rb index b6c58901..40982d9c 100644 --- a/lib/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rb +++ b/lib/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rb @@ -22,6 +22,7 @@ class NewFloatingScalableMatrixWithUnitPricingPrice < Orb::Internal::Type::BaseM required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ModelType } @@ -33,10 +34,11 @@ class NewFloatingScalableMatrixWithUnitPricingPrice < Orb::Internal::Type::BaseM required :name, String # @!attribute scalable_matrix_with_unit_pricing_config + # Configuration for scalable_matrix_with_unit_pricing pricing # - # @return [Hash{Symbol=>Object}] + # @return [Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig] required :scalable_matrix_with_unit_pricing_config, - Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + -> { Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -123,11 +125,11 @@ class NewFloatingScalableMatrixWithUnitPricingPrice < Orb::Internal::Type::BaseM # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param scalable_matrix_with_unit_pricing_config [Hash{Symbol=>Object}] + # @param scalable_matrix_with_unit_pricing_config [Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig] Configuration for scalable_matrix_with_unit_pricing pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -168,6 +170,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -178,20 +182,84 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union + # @see Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice#scalable_matrix_with_unit_pricing_config + class ScalableMatrixWithUnitPricingConfig < Orb::Internal::Type::BaseModel + # @!attribute first_dimension + # Used to determine the unit rate + # + # @return [String] + required :first_dimension, String + + # @!attribute matrix_scaling_factors + # Apply a scaling factor to each dimension + # + # @return [Array] + required :matrix_scaling_factors, + -> do + Orb::Internal::Type::ArrayOf[ + Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor + ] + end + + # @!attribute unit_price + # The final unit price to rate against the output of the matrix + # + # @return [String] + required :unit_price, String + + # @!attribute prorate + # If true, the unit price will be prorated to the billing period + # + # @return [Boolean, nil] + optional :prorate, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute second_dimension + # Used to determine the unit rate (optional) + # + # @return [String, nil] + optional :second_dimension, String, nil?: true + + # @!method initialize(first_dimension:, matrix_scaling_factors:, unit_price:, prorate: nil, second_dimension: nil) + # Configuration for scalable_matrix_with_unit_pricing pricing + # + # @param first_dimension [String] Used to determine the unit rate + # + # @param matrix_scaling_factors [Array] Apply a scaling factor to each dimension + # + # @param unit_price [String] The final unit price to rate against the output of the matrix + # + # @param prorate [Boolean, nil] If true, the unit price will be prorated to the billing period + # + # @param second_dimension [String, nil] Used to determine the unit rate (optional) - discriminator :conversion_rate_type + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + # @!attribute first_dimension_value + # First dimension value + # + # @return [String] + required :first_dimension_value, String - variant :unit, -> { Orb::UnitConversionRateConfig } + # @!attribute scaling_factor + # Scaling factor + # + # @return [String] + required :scaling_factor, String - variant :tiered, -> { Orb::TieredConversionRateConfig } + # @!attribute second_dimension_value + # Second dimension value (optional) + # + # @return [String, nil] + optional :second_dimension_value, String, nil?: true - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @!method initialize(first_dimension_value:, scaling_factor:, second_dimension_value: nil) + # Configuration for a single matrix scaling factor + # + # @param first_dimension_value [String] First dimension value + # + # @param scaling_factor [String] Scaling factor + # + # @param second_dimension_value [String, nil] Second dimension value (optional) + end end end end diff --git a/lib/orb/models/new_floating_threshold_total_amount_price.rb b/lib/orb/models/new_floating_threshold_total_amount_price.rb index 8d795da3..e07bfa3e 100644 --- a/lib/orb/models/new_floating_threshold_total_amount_price.rb +++ b/lib/orb/models/new_floating_threshold_total_amount_price.rb @@ -22,6 +22,7 @@ class NewFloatingThresholdTotalAmountPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingThresholdTotalAmountPrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingThresholdTotalAmountPrice::ModelType } @@ -33,9 +34,11 @@ class NewFloatingThresholdTotalAmountPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute threshold_total_amount_config + # Configuration for threshold_total_amount pricing # - # @return [Hash{Symbol=>Object}] - required :threshold_total_amount_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig] + required :threshold_total_amount_config, + -> { Orb::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -122,11 +125,11 @@ class NewFloatingThresholdTotalAmountPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingThresholdTotalAmountPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingThresholdTotalAmountPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param threshold_total_amount_config [Hash{Symbol=>Object}] + # @param threshold_total_amount_config [Orb::Models::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig] Configuration for threshold_total_amount pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -167,6 +170,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewFloatingThresholdTotalAmountPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -177,20 +182,53 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingThresholdTotalAmountPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::NewFloatingThresholdTotalAmountPrice#threshold_total_amount_config + class ThresholdTotalAmountConfig < Orb::Internal::Type::BaseModel + # @!attribute consumption_table + # When the quantity consumed passes a provided threshold, the configured total + # will be charged + # + # @return [Array] + required :consumption_table, + -> { Orb::Internal::Type::ArrayOf[Orb::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable] } + + # @!attribute prorate + # If true, the unit price will be prorated to the billing period + # + # @return [Boolean, nil] + optional :prorate, Orb::Internal::Type::Boolean, nil?: true + + # @!method initialize(consumption_table:, prorate: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig} + # for more details. + # + # Configuration for threshold_total_amount pricing + # + # @param consumption_table [Array] When the quantity consumed passes a provided threshold, the configured total wil + # + # @param prorate [Boolean, nil] If true, the unit price will be prorated to the billing period + + class ConsumptionTable < Orb::Internal::Type::BaseModel + # @!attribute threshold + # Quantity threshold + # + # @return [String] + required :threshold, String + + # @!attribute total_amount + # Total amount for this threshold + # + # @return [String] + required :total_amount, String + + # @!method initialize(threshold:, total_amount:) + # Configuration for a single threshold + # + # @param threshold [String] Quantity threshold + # + # @param total_amount [String] Total amount for this threshold + end end end end diff --git a/lib/orb/models/new_floating_tiered_bps_price.rb b/lib/orb/models/new_floating_tiered_bps_price.rb deleted file mode 100644 index 7957bb91..00000000 --- a/lib/orb/models/new_floating_tiered_bps_price.rb +++ /dev/null @@ -1,197 +0,0 @@ -# frozen_string_literal: true - -module Orb - module Models - class NewFloatingTieredBPSPrice < Orb::Internal::Type::BaseModel - # @!attribute cadence - # The cadence to bill for this price on. - # - # @return [Symbol, Orb::Models::NewFloatingTieredBPSPrice::Cadence] - required :cadence, enum: -> { Orb::NewFloatingTieredBPSPrice::Cadence } - - # @!attribute currency - # An ISO 4217 currency string for which this price is billed in. - # - # @return [String] - required :currency, String - - # @!attribute item_id - # The id of the item the price will be associated with. - # - # @return [String] - required :item_id, String - - # @!attribute model_type - # - # @return [Symbol, Orb::Models::NewFloatingTieredBPSPrice::ModelType] - required :model_type, enum: -> { Orb::NewFloatingTieredBPSPrice::ModelType } - - # @!attribute name - # The name of the price. - # - # @return [String] - required :name, String - - # @!attribute tiered_bps_config - # - # @return [Orb::Models::TieredBPSConfig] - required :tiered_bps_config, -> { Orb::TieredBPSConfig } - - # @!attribute billable_metric_id - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - # - # @return [String, nil] - optional :billable_metric_id, String, nil?: true - - # @!attribute billed_in_advance - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - # - # @return [Boolean, nil] - optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true - - # @!attribute billing_cycle_configuration - # For custom cadence: specifies the duration of the billing period in days or - # months. - # - # @return [Orb::Models::NewBillingCycleConfiguration, nil] - optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true - - # @!attribute conversion_rate - # The per unit conversion rate of the price currency to the invoicing currency. - # - # @return [Float, nil] - optional :conversion_rate, Float, nil?: true - - # @!attribute conversion_rate_config - # The configuration for the rate of the price currency to the invoicing currency. - # - # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - optional :conversion_rate_config, - union: -> { Orb::NewFloatingTieredBPSPrice::ConversionRateConfig }, - nil?: true - - # @!attribute dimensional_price_configuration - # For dimensional price: specifies a price group and dimension values - # - # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] - optional :dimensional_price_configuration, -> { Orb::NewDimensionalPriceConfiguration }, nil?: true - - # @!attribute external_price_id - # An alias for the price. - # - # @return [String, nil] - optional :external_price_id, String, nil?: true - - # @!attribute fixed_price_quantity - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - # - # @return [Float, nil] - optional :fixed_price_quantity, Float, nil?: true - - # @!attribute invoice_grouping_key - # The property used to group this price on an invoice - # - # @return [String, nil] - optional :invoice_grouping_key, String, nil?: true - - # @!attribute invoicing_cycle_configuration - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - # - # @return [Orb::Models::NewBillingCycleConfiguration, nil] - optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true - - # @!attribute metadata - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - # - # @return [Hash{Symbol=>String, nil}, nil] - optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true - - # @!method initialize(cadence:, currency:, item_id:, model_type:, name:, tiered_bps_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil) - # Some parameter documentations has been truncated, see - # {Orb::Models::NewFloatingTieredBPSPrice} for more details. - # - # @param cadence [Symbol, Orb::Models::NewFloatingTieredBPSPrice::Cadence] The cadence to bill for this price on. - # - # @param currency [String] An ISO 4217 currency string for which this price is billed in. - # - # @param item_id [String] The id of the item the price will be associated with. - # - # @param model_type [Symbol, Orb::Models::NewFloatingTieredBPSPrice::ModelType] - # - # @param name [String] The name of the price. - # - # @param tiered_bps_config [Orb::Models::TieredBPSConfig] - # - # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b - # - # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi - # - # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont - # - # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. - # - # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. - # - # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values - # - # @param external_price_id [String, nil] An alias for the price. - # - # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl - # - # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice - # - # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. - # - # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed - - # The cadence to bill for this price on. - # - # @see Orb::Models::NewFloatingTieredBPSPrice#cadence - module Cadence - extend Orb::Internal::Type::Enum - - ANNUAL = :annual - SEMI_ANNUAL = :semi_annual - MONTHLY = :monthly - QUARTERLY = :quarterly - ONE_TIME = :one_time - CUSTOM = :custom - - # @!method self.values - # @return [Array] - end - - # @see Orb::Models::NewFloatingTieredBPSPrice#model_type - module ModelType - extend Orb::Internal::Type::Enum - - TIERED_BPS = :tiered_bps - - # @!method self.values - # @return [Array] - end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingTieredBPSPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - end - end -end diff --git a/lib/orb/models/new_floating_tiered_package_price.rb b/lib/orb/models/new_floating_tiered_package_price.rb index 4cbd1bae..06d4f516 100644 --- a/lib/orb/models/new_floating_tiered_package_price.rb +++ b/lib/orb/models/new_floating_tiered_package_price.rb @@ -22,6 +22,7 @@ class NewFloatingTieredPackagePrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingTieredPackagePrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingTieredPackagePrice::ModelType } @@ -33,9 +34,10 @@ class NewFloatingTieredPackagePrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute tiered_package_config + # Configuration for tiered_package pricing # - # @return [Hash{Symbol=>Object}] - required :tiered_package_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewFloatingTieredPackagePrice::TieredPackageConfig] + required :tiered_package_config, -> { Orb::NewFloatingTieredPackagePrice::TieredPackageConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -122,11 +124,11 @@ class NewFloatingTieredPackagePrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingTieredPackagePrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingTieredPackagePrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param tiered_package_config [Hash{Symbol=>Object}] + # @param tiered_package_config [Orb::Models::NewFloatingTieredPackagePrice::TieredPackageConfig] Configuration for tiered_package pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -167,6 +169,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewFloatingTieredPackagePrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -177,20 +181,55 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingTieredPackagePrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::NewFloatingTieredPackagePrice#tiered_package_config + class TieredPackageConfig < Orb::Internal::Type::BaseModel + # @!attribute package_size + # Package size + # + # @return [String] + required :package_size, String + + # @!attribute tiers + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. The tier bounds are defined based on + # the total quantity rather than the number of packages, so they must be multiples + # of the package size. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewFloatingTieredPackagePrice::TieredPackageConfig::Tier] } + + # @!method initialize(package_size:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewFloatingTieredPackagePrice::TieredPackageConfig} for more + # details. + # + # Configuration for tiered_package pricing + # + # @param package_size [String] Package size + # + # @param tiers [Array] Apply tiered pricing after rounding up the quantity to the package size. Tiers a + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute per_unit + # Price per package + # + # @return [String] + required :per_unit, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!method initialize(per_unit:, tier_lower_bound:) + # Configuration for a single tier with business logic + # + # @param per_unit [String] Price per package + # + # @param tier_lower_bound [String] Tier lower bound + end end end end diff --git a/lib/orb/models/new_floating_tiered_package_with_minimum_price.rb b/lib/orb/models/new_floating_tiered_package_with_minimum_price.rb index 46672ff0..18addae6 100644 --- a/lib/orb/models/new_floating_tiered_package_with_minimum_price.rb +++ b/lib/orb/models/new_floating_tiered_package_with_minimum_price.rb @@ -22,6 +22,7 @@ class NewFloatingTieredPackageWithMinimumPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingTieredPackageWithMinimumPrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingTieredPackageWithMinimumPrice::ModelType } @@ -33,9 +34,11 @@ class NewFloatingTieredPackageWithMinimumPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute tiered_package_with_minimum_config + # Configuration for tiered_package_with_minimum pricing # - # @return [Hash{Symbol=>Object}] - required :tiered_package_with_minimum_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig] + required :tiered_package_with_minimum_config, + -> { Orb::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -122,11 +125,11 @@ class NewFloatingTieredPackageWithMinimumPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingTieredPackageWithMinimumPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingTieredPackageWithMinimumPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param tiered_package_with_minimum_config [Hash{Symbol=>Object}] + # @param tiered_package_with_minimum_config [Orb::Models::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig] Configuration for tiered_package_with_minimum pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -167,6 +170,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewFloatingTieredPackageWithMinimumPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -177,20 +182,61 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingTieredPackageWithMinimumPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::NewFloatingTieredPackageWithMinimumPrice#tiered_package_with_minimum_config + class TieredPackageWithMinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute package_size + # Package size + # + # @return [Float] + required :package_size, Float + + # @!attribute tiers + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier] } + + # @!method initialize(package_size:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig} + # for more details. + # + # Configuration for tiered_package_with_minimum pricing + # + # @param package_size [Float] Package size + # + # @param tiers [Array] Apply tiered pricing after rounding up the quantity to the package size. Tiers a + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute minimum_amount + # Minimum amount + # + # @return [String] + required :minimum_amount, String + + # @!attribute per_unit + # Price per package + # + # @return [String] + required :per_unit, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!method initialize(minimum_amount:, per_unit:, tier_lower_bound:) + # Configuration for a single tier + # + # @param minimum_amount [String] Minimum amount + # + # @param per_unit [String] Price per package + # + # @param tier_lower_bound [String] Tier lower bound + end end end end diff --git a/lib/orb/models/new_floating_tiered_price.rb b/lib/orb/models/new_floating_tiered_price.rb index 98b1fb44..c597e213 100644 --- a/lib/orb/models/new_floating_tiered_price.rb +++ b/lib/orb/models/new_floating_tiered_price.rb @@ -22,6 +22,7 @@ class NewFloatingTieredPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingTieredPrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingTieredPrice::ModelType } @@ -33,6 +34,7 @@ class NewFloatingTieredPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute tiered_config + # Configuration for tiered pricing # # @return [Orb::Models::TieredConfig] required :tiered_config, -> { Orb::TieredConfig } @@ -122,11 +124,11 @@ class NewFloatingTieredPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingTieredPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingTieredPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param tiered_config [Orb::Models::TieredConfig] + # @param tiered_config [Orb::Models::TieredConfig] Configuration for tiered pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -167,6 +169,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewFloatingTieredPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -176,22 +180,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingTieredPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_floating_tiered_with_minimum_price.rb b/lib/orb/models/new_floating_tiered_with_minimum_price.rb index f526b229..ae77d8ff 100644 --- a/lib/orb/models/new_floating_tiered_with_minimum_price.rb +++ b/lib/orb/models/new_floating_tiered_with_minimum_price.rb @@ -22,6 +22,7 @@ class NewFloatingTieredWithMinimumPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingTieredWithMinimumPrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingTieredWithMinimumPrice::ModelType } @@ -33,9 +34,11 @@ class NewFloatingTieredWithMinimumPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute tiered_with_minimum_config + # Configuration for tiered_with_minimum pricing # - # @return [Hash{Symbol=>Object}] - required :tiered_with_minimum_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig] + required :tiered_with_minimum_config, + -> { Orb::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -122,11 +125,11 @@ class NewFloatingTieredWithMinimumPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingTieredWithMinimumPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingTieredWithMinimumPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param tiered_with_minimum_config [Hash{Symbol=>Object}] + # @param tiered_with_minimum_config [Orb::Models::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig] Configuration for tiered_with_minimum pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -167,6 +170,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewFloatingTieredWithMinimumPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -177,20 +182,69 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingTieredWithMinimumPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::NewFloatingTieredWithMinimumPrice#tiered_with_minimum_config + class TieredWithMinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Tiered pricing with a minimum amount dependent on the volume tier. Tiers are + # defined using exclusive lower bounds. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig::Tier] } + + # @!attribute hide_zero_amount_tiers + # If true, tiers with an accrued amount of 0 will not be included in the rating. + # + # @return [Boolean, nil] + optional :hide_zero_amount_tiers, Orb::Internal::Type::Boolean + + # @!attribute prorate + # If true, the unit price will be prorated to the billing period + # + # @return [Boolean, nil] + optional :prorate, Orb::Internal::Type::Boolean + + # @!method initialize(tiers:, hide_zero_amount_tiers: nil, prorate: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig} for + # more details. + # + # Configuration for tiered_with_minimum pricing + # + # @param tiers [Array] Tiered pricing with a minimum amount dependent on the volume tier. Tiers are def + # + # @param hide_zero_amount_tiers [Boolean] If true, tiers with an accrued amount of 0 will not be included in the rating. + # + # @param prorate [Boolean] If true, the unit price will be prorated to the billing period + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute minimum_amount + # Minimum amount + # + # @return [String] + required :minimum_amount, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(minimum_amount:, tier_lower_bound:, unit_amount:) + # Configuration for a single tier + # + # @param minimum_amount [String] Minimum amount + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Per unit amount + end end end end diff --git a/lib/orb/models/new_floating_tiered_with_proration_price.rb b/lib/orb/models/new_floating_tiered_with_proration_price.rb index 84247fcf..9085b5c5 100644 --- a/lib/orb/models/new_floating_tiered_with_proration_price.rb +++ b/lib/orb/models/new_floating_tiered_with_proration_price.rb @@ -22,6 +22,7 @@ class NewFloatingTieredWithProrationPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingTieredWithProrationPrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingTieredWithProrationPrice::ModelType } @@ -33,9 +34,11 @@ class NewFloatingTieredWithProrationPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute tiered_with_proration_config + # Configuration for tiered_with_proration pricing # - # @return [Hash{Symbol=>Object}] - required :tiered_with_proration_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig] + required :tiered_with_proration_config, + -> { Orb::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -122,11 +125,11 @@ class NewFloatingTieredWithProrationPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingTieredWithProrationPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingTieredWithProrationPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param tiered_with_proration_config [Hash{Symbol=>Object}] + # @param tiered_with_proration_config [Orb::Models::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig] Configuration for tiered_with_proration pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -167,6 +170,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewFloatingTieredWithProrationPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -177,20 +182,45 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingTieredWithProrationPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::NewFloatingTieredWithProrationPrice#tiered_with_proration_config + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Tiers for rating based on total usage quantities into the specified tier with + # proration + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig::Tier] } + + # @!method initialize(tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig} + # for more details. + # + # Configuration for tiered_with_proration pricing + # + # @param tiers [Array] Tiers for rating based on total usage quantities into the specified tier with pr + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Inclusive tier starting value + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tiered with proration tier + # + # @param tier_lower_bound [String] Inclusive tier starting value + # + # @param unit_amount [String] Amount per unit + end end end end diff --git a/lib/orb/models/new_floating_unit_price.rb b/lib/orb/models/new_floating_unit_price.rb index 72c264f7..7fdbad42 100644 --- a/lib/orb/models/new_floating_unit_price.rb +++ b/lib/orb/models/new_floating_unit_price.rb @@ -22,6 +22,7 @@ class NewFloatingUnitPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingUnitPrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingUnitPrice::ModelType } @@ -33,6 +34,7 @@ class NewFloatingUnitPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute unit_config + # Configuration for unit pricing # # @return [Orb::Models::UnitConfig] required :unit_config, -> { Orb::UnitConfig } @@ -122,11 +124,11 @@ class NewFloatingUnitPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingUnitPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingUnitPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param unit_config [Orb::Models::UnitConfig] + # @param unit_config [Orb::Models::UnitConfig] Configuration for unit pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -167,6 +169,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewFloatingUnitPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -176,22 +180,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingUnitPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_floating_unit_with_percent_price.rb b/lib/orb/models/new_floating_unit_with_percent_price.rb index 3cd6e92a..01301957 100644 --- a/lib/orb/models/new_floating_unit_with_percent_price.rb +++ b/lib/orb/models/new_floating_unit_with_percent_price.rb @@ -22,6 +22,7 @@ class NewFloatingUnitWithPercentPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingUnitWithPercentPrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingUnitWithPercentPrice::ModelType } @@ -33,9 +34,10 @@ class NewFloatingUnitWithPercentPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute unit_with_percent_config + # Configuration for unit_with_percent pricing # - # @return [Hash{Symbol=>Object}] - required :unit_with_percent_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewFloatingUnitWithPercentPrice::UnitWithPercentConfig] + required :unit_with_percent_config, -> { Orb::NewFloatingUnitWithPercentPrice::UnitWithPercentConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -122,11 +124,11 @@ class NewFloatingUnitWithPercentPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingUnitWithPercentPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingUnitWithPercentPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param unit_with_percent_config [Hash{Symbol=>Object}] + # @param unit_with_percent_config [Orb::Models::NewFloatingUnitWithPercentPrice::UnitWithPercentConfig] Configuration for unit_with_percent pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -167,6 +169,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewFloatingUnitWithPercentPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -177,20 +181,26 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingUnitWithPercentPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::NewFloatingUnitWithPercentPrice#unit_with_percent_config + class UnitWithPercentConfig < Orb::Internal::Type::BaseModel + # @!attribute percent + # What percent, out of 100, of the calculated total to charge + # + # @return [String] + required :percent, String + + # @!attribute unit_amount + # Rate per unit of usage + # + # @return [String] + required :unit_amount, String + + # @!method initialize(percent:, unit_amount:) + # Configuration for unit_with_percent pricing + # + # @param percent [String] What percent, out of 100, of the calculated total to charge + # + # @param unit_amount [String] Rate per unit of usage end end end diff --git a/lib/orb/models/new_floating_unit_with_proration_price.rb b/lib/orb/models/new_floating_unit_with_proration_price.rb index 3e65a990..3de66e4c 100644 --- a/lib/orb/models/new_floating_unit_with_proration_price.rb +++ b/lib/orb/models/new_floating_unit_with_proration_price.rb @@ -22,6 +22,7 @@ class NewFloatingUnitWithProrationPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewFloatingUnitWithProrationPrice::ModelType] required :model_type, enum: -> { Orb::NewFloatingUnitWithProrationPrice::ModelType } @@ -33,9 +34,11 @@ class NewFloatingUnitWithProrationPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute unit_with_proration_config + # Configuration for unit_with_proration pricing # - # @return [Hash{Symbol=>Object}] - required :unit_with_proration_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewFloatingUnitWithProrationPrice::UnitWithProrationConfig] + required :unit_with_proration_config, + -> { Orb::NewFloatingUnitWithProrationPrice::UnitWithProrationConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -122,11 +125,11 @@ class NewFloatingUnitWithProrationPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewFloatingUnitWithProrationPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewFloatingUnitWithProrationPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param unit_with_proration_config [Hash{Symbol=>Object}] + # @param unit_with_proration_config [Orb::Models::NewFloatingUnitWithProrationPrice::UnitWithProrationConfig] Configuration for unit_with_proration pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -167,6 +170,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewFloatingUnitWithProrationPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -177,20 +182,18 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewFloatingUnitWithProrationPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::NewFloatingUnitWithProrationPrice#unit_with_proration_config + class UnitWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute unit_amount + # Rate per unit of usage + # + # @return [String] + required :unit_amount, String + + # @!method initialize(unit_amount:) + # Configuration for unit_with_proration pricing + # + # @param unit_amount [String] Rate per unit of usage end end end diff --git a/lib/orb/models/new_plan_bps_price.rb b/lib/orb/models/new_plan_bps_price.rb deleted file mode 100644 index b1935a89..00000000 --- a/lib/orb/models/new_plan_bps_price.rb +++ /dev/null @@ -1,205 +0,0 @@ -# frozen_string_literal: true - -module Orb - module Models - class NewPlanBPSPrice < Orb::Internal::Type::BaseModel - # @!attribute bps_config - # - # @return [Orb::Models::BPSConfig] - required :bps_config, -> { Orb::BPSConfig } - - # @!attribute cadence - # The cadence to bill for this price on. - # - # @return [Symbol, Orb::Models::NewPlanBPSPrice::Cadence] - required :cadence, enum: -> { Orb::NewPlanBPSPrice::Cadence } - - # @!attribute item_id - # The id of the item the price will be associated with. - # - # @return [String] - required :item_id, String - - # @!attribute model_type - # - # @return [Symbol, Orb::Models::NewPlanBPSPrice::ModelType] - required :model_type, enum: -> { Orb::NewPlanBPSPrice::ModelType } - - # @!attribute name - # The name of the price. - # - # @return [String] - required :name, String - - # @!attribute billable_metric_id - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - # - # @return [String, nil] - optional :billable_metric_id, String, nil?: true - - # @!attribute billed_in_advance - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - # - # @return [Boolean, nil] - optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true - - # @!attribute billing_cycle_configuration - # For custom cadence: specifies the duration of the billing period in days or - # months. - # - # @return [Orb::Models::NewBillingCycleConfiguration, nil] - optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true - - # @!attribute conversion_rate - # The per unit conversion rate of the price currency to the invoicing currency. - # - # @return [Float, nil] - optional :conversion_rate, Float, nil?: true - - # @!attribute conversion_rate_config - # The configuration for the rate of the price currency to the invoicing currency. - # - # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - optional :conversion_rate_config, union: -> { Orb::NewPlanBPSPrice::ConversionRateConfig }, nil?: true - - # @!attribute currency - # An ISO 4217 currency string, or custom pricing unit identifier, in which this - # price is billed. - # - # @return [String, nil] - optional :currency, String, nil?: true - - # @!attribute dimensional_price_configuration - # For dimensional price: specifies a price group and dimension values - # - # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] - optional :dimensional_price_configuration, -> { Orb::NewDimensionalPriceConfiguration }, nil?: true - - # @!attribute external_price_id - # An alias for the price. - # - # @return [String, nil] - optional :external_price_id, String, nil?: true - - # @!attribute fixed_price_quantity - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - # - # @return [Float, nil] - optional :fixed_price_quantity, Float, nil?: true - - # @!attribute invoice_grouping_key - # The property used to group this price on an invoice - # - # @return [String, nil] - optional :invoice_grouping_key, String, nil?: true - - # @!attribute invoicing_cycle_configuration - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - # - # @return [Orb::Models::NewBillingCycleConfiguration, nil] - optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true - - # @!attribute metadata - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - # - # @return [Hash{Symbol=>String, nil}, nil] - optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true - - # @!attribute reference_id - # A transient ID that can be used to reference this price when adding adjustments - # in the same API call. - # - # @return [String, nil] - optional :reference_id, String, nil?: true - - # @!method initialize(bps_config:, cadence:, item_id:, model_type:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil) - # Some parameter documentations has been truncated, see - # {Orb::Models::NewPlanBPSPrice} for more details. - # - # @param bps_config [Orb::Models::BPSConfig] - # - # @param cadence [Symbol, Orb::Models::NewPlanBPSPrice::Cadence] The cadence to bill for this price on. - # - # @param item_id [String] The id of the item the price will be associated with. - # - # @param model_type [Symbol, Orb::Models::NewPlanBPSPrice::ModelType] - # - # @param name [String] The name of the price. - # - # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b - # - # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi - # - # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont - # - # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. - # - # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. - # - # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr - # - # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values - # - # @param external_price_id [String, nil] An alias for the price. - # - # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl - # - # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice - # - # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. - # - # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed - # - # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments - - # The cadence to bill for this price on. - # - # @see Orb::Models::NewPlanBPSPrice#cadence - module Cadence - extend Orb::Internal::Type::Enum - - ANNUAL = :annual - SEMI_ANNUAL = :semi_annual - MONTHLY = :monthly - QUARTERLY = :quarterly - ONE_TIME = :one_time - CUSTOM = :custom - - # @!method self.values - # @return [Array] - end - - # @see Orb::Models::NewPlanBPSPrice#model_type - module ModelType - extend Orb::Internal::Type::Enum - - BPS = :bps - - # @!method self.values - # @return [Array] - end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanBPSPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - end - end -end diff --git a/lib/orb/models/new_plan_bulk_price.rb b/lib/orb/models/new_plan_bulk_price.rb index 925107b3..068fe8c5 100644 --- a/lib/orb/models/new_plan_bulk_price.rb +++ b/lib/orb/models/new_plan_bulk_price.rb @@ -4,6 +4,7 @@ module Orb module Models class NewPlanBulkPrice < Orb::Internal::Type::BaseModel # @!attribute bulk_config + # Configuration for bulk pricing # # @return [Orb::Models::BulkConfig] required :bulk_config, -> { Orb::BulkConfig } @@ -21,6 +22,7 @@ class NewPlanBulkPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanBulkPrice::ModelType] required :model_type, enum: -> { Orb::NewPlanBulkPrice::ModelType } @@ -122,13 +124,13 @@ class NewPlanBulkPrice < Orb::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {Orb::Models::NewPlanBulkPrice} for more details. # - # @param bulk_config [Orb::Models::BulkConfig] + # @param bulk_config [Orb::Models::BulkConfig] Configuration for bulk pricing # # @param cadence [Symbol, Orb::Models::NewPlanBulkPrice::Cadence] The cadence to bill for this price on. # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanBulkPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanBulkPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -175,6 +177,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewPlanBulkPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -184,22 +188,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanBulkPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_plan_bulk_with_proration_price.rb b/lib/orb/models/new_plan_bulk_with_proration_price.rb index ab1f203b..778c635b 100644 --- a/lib/orb/models/new_plan_bulk_with_proration_price.rb +++ b/lib/orb/models/new_plan_bulk_with_proration_price.rb @@ -4,9 +4,10 @@ module Orb module Models class NewPlanBulkWithProrationPrice < Orb::Internal::Type::BaseModel # @!attribute bulk_with_proration_config + # Configuration for bulk_with_proration pricing # - # @return [Hash{Symbol=>Object}] - required :bulk_with_proration_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewPlanBulkWithProrationPrice::BulkWithProrationConfig] + required :bulk_with_proration_config, -> { Orb::NewPlanBulkWithProrationPrice::BulkWithProrationConfig } # @!attribute cadence # The cadence to bill for this price on. @@ -21,6 +22,7 @@ class NewPlanBulkWithProrationPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanBulkWithProrationPrice::ModelType] required :model_type, enum: -> { Orb::NewPlanBulkWithProrationPrice::ModelType } @@ -124,13 +126,13 @@ class NewPlanBulkWithProrationPrice < Orb::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {Orb::Models::NewPlanBulkWithProrationPrice} for more details. # - # @param bulk_with_proration_config [Hash{Symbol=>Object}] + # @param bulk_with_proration_config [Orb::Models::NewPlanBulkWithProrationPrice::BulkWithProrationConfig] Configuration for bulk_with_proration pricing # # @param cadence [Symbol, Orb::Models::NewPlanBulkWithProrationPrice::Cadence] The cadence to bill for this price on. # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanBulkWithProrationPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanBulkWithProrationPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -160,6 +162,42 @@ class NewPlanBulkWithProrationPrice < Orb::Internal::Type::BaseModel # # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # @see Orb::Models::NewPlanBulkWithProrationPrice#bulk_with_proration_config + class BulkWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Bulk tiers for rating based on total usage volume + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewPlanBulkWithProrationPrice::BulkWithProrationConfig::Tier] } + + # @!method initialize(tiers:) + # Configuration for bulk_with_proration pricing + # + # @param tiers [Array] Bulk tiers for rating based on total usage volume + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute unit_amount + # Cost per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute tier_lower_bound + # The lower bound for this tier + # + # @return [String, nil] + optional :tier_lower_bound, String, nil?: true + + # @!method initialize(unit_amount:, tier_lower_bound: nil) + # Configuration for a single bulk pricing tier with proration + # + # @param unit_amount [String] Cost per unit + # + # @param tier_lower_bound [String, nil] The lower bound for this tier + end + end + # The cadence to bill for this price on. # # @see Orb::Models::NewPlanBulkWithProrationPrice#cadence @@ -177,6 +215,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewPlanBulkWithProrationPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +226,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanBulkWithProrationPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_plan_cumulative_grouped_bulk_price.rb b/lib/orb/models/new_plan_cumulative_grouped_bulk_price.rb index 96d9b8ec..aade0632 100644 --- a/lib/orb/models/new_plan_cumulative_grouped_bulk_price.rb +++ b/lib/orb/models/new_plan_cumulative_grouped_bulk_price.rb @@ -10,9 +10,11 @@ class NewPlanCumulativeGroupedBulkPrice < Orb::Internal::Type::BaseModel required :cadence, enum: -> { Orb::NewPlanCumulativeGroupedBulkPrice::Cadence } # @!attribute cumulative_grouped_bulk_config + # Configuration for cumulative_grouped_bulk pricing # - # @return [Hash{Symbol=>Object}] - required :cumulative_grouped_bulk_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig] + required :cumulative_grouped_bulk_config, + -> { Orb::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig } # @!attribute item_id # The id of the item the price will be associated with. @@ -21,6 +23,7 @@ class NewPlanCumulativeGroupedBulkPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanCumulativeGroupedBulkPrice::ModelType] required :model_type, enum: -> { Orb::NewPlanCumulativeGroupedBulkPrice::ModelType } @@ -126,11 +129,11 @@ class NewPlanCumulativeGroupedBulkPrice < Orb::Internal::Type::BaseModel # # @param cadence [Symbol, Orb::Models::NewPlanCumulativeGroupedBulkPrice::Cadence] The cadence to bill for this price on. # - # @param cumulative_grouped_bulk_config [Hash{Symbol=>Object}] + # @param cumulative_grouped_bulk_config [Orb::Models::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig] Configuration for cumulative_grouped_bulk pricing # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanCumulativeGroupedBulkPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanCumulativeGroupedBulkPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -177,6 +180,60 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewPlanCumulativeGroupedBulkPrice#cumulative_grouped_bulk_config + class CumulativeGroupedBulkConfig < Orb::Internal::Type::BaseModel + # @!attribute dimension_values + # Each tier lower bound must have the same group of values. + # + # @return [Array] + required :dimension_values, + -> { Orb::Internal::Type::ArrayOf[Orb::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue] } + + # @!attribute group + # Grouping key name + # + # @return [String] + required :group, String + + # @!method initialize(dimension_values:, group:) + # Configuration for cumulative_grouped_bulk pricing + # + # @param dimension_values [Array] Each tier lower bound must have the same group of values. + # + # @param group [String] Grouping key name + + class DimensionValue < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # Grouping key value + # + # @return [String] + required :grouping_key, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Unit amount for this combination + # + # @return [String] + required :unit_amount, String + + # @!method initialize(grouping_key:, tier_lower_bound:, unit_amount:) + # Configuration for a dimension value entry + # + # @param grouping_key [String] Grouping key value + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Unit amount for this combination + end + end + + # The pricing model type + # # @see Orb::Models::NewPlanCumulativeGroupedBulkPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +243,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanCumulativeGroupedBulkPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_plan_grouped_allocation_price.rb b/lib/orb/models/new_plan_grouped_allocation_price.rb index 1053c5bc..f4e34740 100644 --- a/lib/orb/models/new_plan_grouped_allocation_price.rb +++ b/lib/orb/models/new_plan_grouped_allocation_price.rb @@ -10,9 +10,10 @@ class NewPlanGroupedAllocationPrice < Orb::Internal::Type::BaseModel required :cadence, enum: -> { Orb::NewPlanGroupedAllocationPrice::Cadence } # @!attribute grouped_allocation_config + # Configuration for grouped_allocation pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_allocation_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewPlanGroupedAllocationPrice::GroupedAllocationConfig] + required :grouped_allocation_config, -> { Orb::NewPlanGroupedAllocationPrice::GroupedAllocationConfig } # @!attribute item_id # The id of the item the price will be associated with. @@ -21,6 +22,7 @@ class NewPlanGroupedAllocationPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanGroupedAllocationPrice::ModelType] required :model_type, enum: -> { Orb::NewPlanGroupedAllocationPrice::ModelType } @@ -126,11 +128,11 @@ class NewPlanGroupedAllocationPrice < Orb::Internal::Type::BaseModel # # @param cadence [Symbol, Orb::Models::NewPlanGroupedAllocationPrice::Cadence] The cadence to bill for this price on. # - # @param grouped_allocation_config [Hash{Symbol=>Object}] + # @param grouped_allocation_config [Orb::Models::NewPlanGroupedAllocationPrice::GroupedAllocationConfig] Configuration for grouped_allocation pricing # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanGroupedAllocationPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanGroupedAllocationPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -177,6 +179,38 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewPlanGroupedAllocationPrice#grouped_allocation_config + class GroupedAllocationConfig < Orb::Internal::Type::BaseModel + # @!attribute allocation + # Usage allocation per group + # + # @return [String] + required :allocation, String + + # @!attribute grouping_key + # How to determine the groups that should each be allocated some quantity + # + # @return [String] + required :grouping_key, String + + # @!attribute overage_unit_rate + # Unit rate for post-allocation + # + # @return [String] + required :overage_unit_rate, String + + # @!method initialize(allocation:, grouping_key:, overage_unit_rate:) + # Configuration for grouped_allocation pricing + # + # @param allocation [String] Usage allocation per group + # + # @param grouping_key [String] How to determine the groups that should each be allocated some quantity + # + # @param overage_unit_rate [String] Unit rate for post-allocation + end + + # The pricing model type + # # @see Orb::Models::NewPlanGroupedAllocationPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +220,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanGroupedAllocationPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_plan_grouped_tiered_package_price.rb b/lib/orb/models/new_plan_grouped_tiered_package_price.rb index a781f244..bf7e7ca3 100644 --- a/lib/orb/models/new_plan_grouped_tiered_package_price.rb +++ b/lib/orb/models/new_plan_grouped_tiered_package_price.rb @@ -10,9 +10,11 @@ class NewPlanGroupedTieredPackagePrice < Orb::Internal::Type::BaseModel required :cadence, enum: -> { Orb::NewPlanGroupedTieredPackagePrice::Cadence } # @!attribute grouped_tiered_package_config + # Configuration for grouped_tiered_package pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_tiered_package_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig] + required :grouped_tiered_package_config, + -> { Orb::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig } # @!attribute item_id # The id of the item the price will be associated with. @@ -21,6 +23,7 @@ class NewPlanGroupedTieredPackagePrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanGroupedTieredPackagePrice::ModelType] required :model_type, enum: -> { Orb::NewPlanGroupedTieredPackagePrice::ModelType } @@ -126,11 +129,11 @@ class NewPlanGroupedTieredPackagePrice < Orb::Internal::Type::BaseModel # # @param cadence [Symbol, Orb::Models::NewPlanGroupedTieredPackagePrice::Cadence] The cadence to bill for this price on. # - # @param grouped_tiered_package_config [Hash{Symbol=>Object}] + # @param grouped_tiered_package_config [Orb::Models::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig] Configuration for grouped_tiered_package pricing # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanGroupedTieredPackagePrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanGroupedTieredPackagePrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -177,6 +180,65 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewPlanGroupedTieredPackagePrice#grouped_tiered_package_config + class GroupedTieredPackageConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before tiering + # + # @return [String] + required :grouping_key, String + + # @!attribute package_size + # Package size + # + # @return [String] + required :package_size, String + + # @!attribute tiers + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier] } + + # @!method initialize(grouping_key:, package_size:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig} for + # more details. + # + # Configuration for grouped_tiered_package pricing + # + # @param grouping_key [String] The event property used to group before tiering + # + # @param package_size [String] Package size + # + # @param tiers [Array] Apply tiered pricing after rounding up the quantity to the package size. Tiers a + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute per_unit + # Price per package + # + # @return [String] + required :per_unit, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!method initialize(per_unit:, tier_lower_bound:) + # Configuration for a single tier + # + # @param per_unit [String] Price per package + # + # @param tier_lower_bound [String] Tier lower bound + end + end + + # The pricing model type + # # @see Orb::Models::NewPlanGroupedTieredPackagePrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +248,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanGroupedTieredPackagePrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_plan_grouped_tiered_price.rb b/lib/orb/models/new_plan_grouped_tiered_price.rb index 1675babc..809640ad 100644 --- a/lib/orb/models/new_plan_grouped_tiered_price.rb +++ b/lib/orb/models/new_plan_grouped_tiered_price.rb @@ -10,9 +10,10 @@ class NewPlanGroupedTieredPrice < Orb::Internal::Type::BaseModel required :cadence, enum: -> { Orb::NewPlanGroupedTieredPrice::Cadence } # @!attribute grouped_tiered_config + # Configuration for grouped_tiered pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_tiered_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewPlanGroupedTieredPrice::GroupedTieredConfig] + required :grouped_tiered_config, -> { Orb::NewPlanGroupedTieredPrice::GroupedTieredConfig } # @!attribute item_id # The id of the item the price will be associated with. @@ -21,6 +22,7 @@ class NewPlanGroupedTieredPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanGroupedTieredPrice::ModelType] required :model_type, enum: -> { Orb::NewPlanGroupedTieredPrice::ModelType } @@ -126,11 +128,11 @@ class NewPlanGroupedTieredPrice < Orb::Internal::Type::BaseModel # # @param cadence [Symbol, Orb::Models::NewPlanGroupedTieredPrice::Cadence] The cadence to bill for this price on. # - # @param grouped_tiered_config [Hash{Symbol=>Object}] + # @param grouped_tiered_config [Orb::Models::NewPlanGroupedTieredPrice::GroupedTieredConfig] Configuration for grouped_tiered pricing # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanGroupedTieredPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanGroupedTieredPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -177,6 +179,56 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewPlanGroupedTieredPrice#grouped_tiered_config + class GroupedTieredConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The billable metric property used to group before tiering + # + # @return [String] + required :grouping_key, String + + # @!attribute tiers + # Apply tiered pricing to each segment generated after grouping with the provided + # key + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewPlanGroupedTieredPrice::GroupedTieredConfig::Tier] } + + # @!method initialize(grouping_key:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewPlanGroupedTieredPrice::GroupedTieredConfig} for more details. + # + # Configuration for grouped_tiered pricing + # + # @param grouping_key [String] The billable metric property used to group before tiering + # + # @param tiers [Array] Apply tiered pricing to each segment generated after grouping with the provided + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tier + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Per unit amount + end + end + + # The pricing model type + # # @see Orb::Models::NewPlanGroupedTieredPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +238,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanGroupedTieredPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_plan_grouped_with_metered_minimum_price.rb b/lib/orb/models/new_plan_grouped_with_metered_minimum_price.rb index 6849e04b..b6a581e5 100644 --- a/lib/orb/models/new_plan_grouped_with_metered_minimum_price.rb +++ b/lib/orb/models/new_plan_grouped_with_metered_minimum_price.rb @@ -10,9 +10,11 @@ class NewPlanGroupedWithMeteredMinimumPrice < Orb::Internal::Type::BaseModel required :cadence, enum: -> { Orb::NewPlanGroupedWithMeteredMinimumPrice::Cadence } # @!attribute grouped_with_metered_minimum_config + # Configuration for grouped_with_metered_minimum pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_with_metered_minimum_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig] + required :grouped_with_metered_minimum_config, + -> { Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig } # @!attribute item_id # The id of the item the price will be associated with. @@ -21,6 +23,7 @@ class NewPlanGroupedWithMeteredMinimumPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice::ModelType] required :model_type, enum: -> { Orb::NewPlanGroupedWithMeteredMinimumPrice::ModelType } @@ -126,11 +129,11 @@ class NewPlanGroupedWithMeteredMinimumPrice < Orb::Internal::Type::BaseModel # # @param cadence [Symbol, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice::Cadence] The cadence to bill for this price on. # - # @param grouped_with_metered_minimum_config [Hash{Symbol=>Object}] + # @param grouped_with_metered_minimum_config [Orb::Models::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig] Configuration for grouped_with_metered_minimum pricing # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -177,6 +180,112 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewPlanGroupedWithMeteredMinimumPrice#grouped_with_metered_minimum_config + class GroupedWithMeteredMinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # Used to partition the usage into groups. The minimum amount is applied to each + # group. + # + # @return [String] + required :grouping_key, String + + # @!attribute minimum_unit_amount + # The minimum amount to charge per group per unit + # + # @return [String] + required :minimum_unit_amount, String + + # @!attribute pricing_key + # Used to determine the unit rate + # + # @return [String] + required :pricing_key, String + + # @!attribute scaling_factors + # Scale the unit rates by the scaling factor. + # + # @return [Array] + required :scaling_factors, + -> { Orb::Internal::Type::ArrayOf[Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor] } + + # @!attribute scaling_key + # Used to determine the unit rate scaling factor + # + # @return [String] + required :scaling_key, String + + # @!attribute unit_amounts + # Apply per unit pricing to each pricing value. The minimum amount is applied any + # unmatched usage. + # + # @return [Array] + required :unit_amounts, + -> { Orb::Internal::Type::ArrayOf[Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount] } + + # @!method initialize(grouping_key:, minimum_unit_amount:, pricing_key:, scaling_factors:, scaling_key:, unit_amounts:) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig} + # for more details. + # + # Configuration for grouped_with_metered_minimum pricing + # + # @param grouping_key [String] Used to partition the usage into groups. The minimum amount is applied to each g + # + # @param minimum_unit_amount [String] The minimum amount to charge per group per unit + # + # @param pricing_key [String] Used to determine the unit rate + # + # @param scaling_factors [Array] Scale the unit rates by the scaling factor. + # + # @param scaling_key [String] Used to determine the unit rate scaling factor + # + # @param unit_amounts [Array] Apply per unit pricing to each pricing value. The minimum amount is applied any + + class ScalingFactor < Orb::Internal::Type::BaseModel + # @!attribute scaling_factor + # Scaling factor + # + # @return [String] + required :scaling_factor, String + + # @!attribute scaling_value + # Scaling value + # + # @return [String] + required :scaling_value, String + + # @!method initialize(scaling_factor:, scaling_value:) + # Configuration for a scaling factor + # + # @param scaling_factor [String] Scaling factor + # + # @param scaling_value [String] Scaling value + end + + class UnitAmount < Orb::Internal::Type::BaseModel + # @!attribute pricing_value + # Pricing value + # + # @return [String] + required :pricing_value, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(pricing_value:, unit_amount:) + # Configuration for a unit amount + # + # @param pricing_value [String] Pricing value + # + # @param unit_amount [String] Per unit amount + end + end + + # The pricing model type + # # @see Orb::Models::NewPlanGroupedWithMeteredMinimumPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +295,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanGroupedWithMeteredMinimumPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_plan_grouped_with_prorated_minimum_price.rb b/lib/orb/models/new_plan_grouped_with_prorated_minimum_price.rb index e78643a4..0506e984 100644 --- a/lib/orb/models/new_plan_grouped_with_prorated_minimum_price.rb +++ b/lib/orb/models/new_plan_grouped_with_prorated_minimum_price.rb @@ -10,9 +10,11 @@ class NewPlanGroupedWithProratedMinimumPrice < Orb::Internal::Type::BaseModel required :cadence, enum: -> { Orb::NewPlanGroupedWithProratedMinimumPrice::Cadence } # @!attribute grouped_with_prorated_minimum_config + # Configuration for grouped_with_prorated_minimum pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_with_prorated_minimum_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewPlanGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig] + required :grouped_with_prorated_minimum_config, + -> { Orb::NewPlanGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig } # @!attribute item_id # The id of the item the price will be associated with. @@ -21,6 +23,7 @@ class NewPlanGroupedWithProratedMinimumPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanGroupedWithProratedMinimumPrice::ModelType] required :model_type, enum: -> { Orb::NewPlanGroupedWithProratedMinimumPrice::ModelType } @@ -126,11 +129,11 @@ class NewPlanGroupedWithProratedMinimumPrice < Orb::Internal::Type::BaseModel # # @param cadence [Symbol, Orb::Models::NewPlanGroupedWithProratedMinimumPrice::Cadence] The cadence to bill for this price on. # - # @param grouped_with_prorated_minimum_config [Hash{Symbol=>Object}] + # @param grouped_with_prorated_minimum_config [Orb::Models::NewPlanGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig] Configuration for grouped_with_prorated_minimum pricing # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanGroupedWithProratedMinimumPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanGroupedWithProratedMinimumPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -177,6 +180,38 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewPlanGroupedWithProratedMinimumPrice#grouped_with_prorated_minimum_config + class GroupedWithProratedMinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # How to determine the groups that should each have a minimum + # + # @return [String] + required :grouping_key, String + + # @!attribute minimum + # The minimum amount to charge per group + # + # @return [String] + required :minimum, String + + # @!attribute unit_rate + # The amount to charge per unit + # + # @return [String] + required :unit_rate, String + + # @!method initialize(grouping_key:, minimum:, unit_rate:) + # Configuration for grouped_with_prorated_minimum pricing + # + # @param grouping_key [String] How to determine the groups that should each have a minimum + # + # @param minimum [String] The minimum amount to charge per group + # + # @param unit_rate [String] The amount to charge per unit + end + + # The pricing model type + # # @see Orb::Models::NewPlanGroupedWithProratedMinimumPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +221,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanGroupedWithProratedMinimumPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_plan_matrix_price.rb b/lib/orb/models/new_plan_matrix_price.rb index 5ff55704..ace57dda 100644 --- a/lib/orb/models/new_plan_matrix_price.rb +++ b/lib/orb/models/new_plan_matrix_price.rb @@ -16,11 +16,13 @@ class NewPlanMatrixPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute matrix_config + # Configuration for matrix pricing # # @return [Orb::Models::MatrixConfig] required :matrix_config, -> { Orb::MatrixConfig } # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanMatrixPrice::ModelType] required :model_type, enum: -> { Orb::NewPlanMatrixPrice::ModelType } @@ -130,9 +132,9 @@ class NewPlanMatrixPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param matrix_config [Orb::Models::MatrixConfig] + # @param matrix_config [Orb::Models::MatrixConfig] Configuration for matrix pricing # - # @param model_type [Symbol, Orb::Models::NewPlanMatrixPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanMatrixPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -179,6 +181,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewPlanMatrixPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -188,22 +192,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanMatrixPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_plan_matrix_with_allocation_price.rb b/lib/orb/models/new_plan_matrix_with_allocation_price.rb index 88b6c652..e48c37ca 100644 --- a/lib/orb/models/new_plan_matrix_with_allocation_price.rb +++ b/lib/orb/models/new_plan_matrix_with_allocation_price.rb @@ -16,11 +16,13 @@ class NewPlanMatrixWithAllocationPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute matrix_with_allocation_config + # Configuration for matrix_with_allocation pricing # # @return [Orb::Models::MatrixWithAllocationConfig] required :matrix_with_allocation_config, -> { Orb::MatrixWithAllocationConfig } # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanMatrixWithAllocationPrice::ModelType] required :model_type, enum: -> { Orb::NewPlanMatrixWithAllocationPrice::ModelType } @@ -128,9 +130,9 @@ class NewPlanMatrixWithAllocationPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param matrix_with_allocation_config [Orb::Models::MatrixWithAllocationConfig] + # @param matrix_with_allocation_config [Orb::Models::MatrixWithAllocationConfig] Configuration for matrix_with_allocation pricing # - # @param model_type [Symbol, Orb::Models::NewPlanMatrixWithAllocationPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanMatrixWithAllocationPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -177,6 +179,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewPlanMatrixWithAllocationPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +190,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanMatrixWithAllocationPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_plan_matrix_with_display_name_price.rb b/lib/orb/models/new_plan_matrix_with_display_name_price.rb index d6a383fe..3aaa6fa4 100644 --- a/lib/orb/models/new_plan_matrix_with_display_name_price.rb +++ b/lib/orb/models/new_plan_matrix_with_display_name_price.rb @@ -16,11 +16,14 @@ class NewPlanMatrixWithDisplayNamePrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute matrix_with_display_name_config + # Configuration for matrix_with_display_name pricing # - # @return [Hash{Symbol=>Object}] - required :matrix_with_display_name_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig] + required :matrix_with_display_name_config, + -> { Orb::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig } # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanMatrixWithDisplayNamePrice::ModelType] required :model_type, enum: -> { Orb::NewPlanMatrixWithDisplayNamePrice::ModelType } @@ -128,9 +131,9 @@ class NewPlanMatrixWithDisplayNamePrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param matrix_with_display_name_config [Hash{Symbol=>Object}] + # @param matrix_with_display_name_config [Orb::Models::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig] Configuration for matrix_with_display_name pricing # - # @param model_type [Symbol, Orb::Models::NewPlanMatrixWithDisplayNamePrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanMatrixWithDisplayNamePrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -177,6 +180,60 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewPlanMatrixWithDisplayNamePrice#matrix_with_display_name_config + class MatrixWithDisplayNameConfig < Orb::Internal::Type::BaseModel + # @!attribute dimension + # Used to determine the unit rate + # + # @return [String] + required :dimension, String + + # @!attribute unit_amounts + # Apply per unit pricing to each dimension value + # + # @return [Array] + required :unit_amounts, + -> { Orb::Internal::Type::ArrayOf[Orb::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount] } + + # @!method initialize(dimension:, unit_amounts:) + # Configuration for matrix_with_display_name pricing + # + # @param dimension [String] Used to determine the unit rate + # + # @param unit_amounts [Array] Apply per unit pricing to each dimension value + + class UnitAmount < Orb::Internal::Type::BaseModel + # @!attribute dimension_value + # The dimension value + # + # @return [String] + required :dimension_value, String + + # @!attribute display_name + # Display name for this dimension value + # + # @return [String] + required :display_name, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(dimension_value:, display_name:, unit_amount:) + # Configuration for a unit amount item + # + # @param dimension_value [String] The dimension value + # + # @param display_name [String] Display name for this dimension value + # + # @param unit_amount [String] Per unit amount + end + end + + # The pricing model type + # # @see Orb::Models::NewPlanMatrixWithDisplayNamePrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +243,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanMatrixWithDisplayNamePrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_plan_max_group_tiered_package_price.rb b/lib/orb/models/new_plan_max_group_tiered_package_price.rb index 946f9a6b..88b527ad 100644 --- a/lib/orb/models/new_plan_max_group_tiered_package_price.rb +++ b/lib/orb/models/new_plan_max_group_tiered_package_price.rb @@ -16,11 +16,14 @@ class NewPlanMaxGroupTieredPackagePrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute max_group_tiered_package_config + # Configuration for max_group_tiered_package pricing # - # @return [Hash{Symbol=>Object}] - required :max_group_tiered_package_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig] + required :max_group_tiered_package_config, + -> { Orb::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig } # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanMaxGroupTieredPackagePrice::ModelType] required :model_type, enum: -> { Orb::NewPlanMaxGroupTieredPackagePrice::ModelType } @@ -128,9 +131,9 @@ class NewPlanMaxGroupTieredPackagePrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param max_group_tiered_package_config [Hash{Symbol=>Object}] + # @param max_group_tiered_package_config [Orb::Models::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig] Configuration for max_group_tiered_package pricing # - # @param model_type [Symbol, Orb::Models::NewPlanMaxGroupTieredPackagePrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanMaxGroupTieredPackagePrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -177,6 +180,64 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewPlanMaxGroupTieredPackagePrice#max_group_tiered_package_config + class MaxGroupTieredPackageConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before tiering the group with the highest value + # + # @return [String] + required :grouping_key, String + + # @!attribute package_size + # Package size + # + # @return [String] + required :package_size, String + + # @!attribute tiers + # Apply tiered pricing to the largest group after grouping with the provided key. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier] } + + # @!method initialize(grouping_key:, package_size:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig} + # for more details. + # + # Configuration for max_group_tiered_package pricing + # + # @param grouping_key [String] The event property used to group before tiering the group with the highest value + # + # @param package_size [String] Package size + # + # @param tiers [Array] Apply tiered pricing to the largest group after grouping with the provided key. + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tier + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Per unit amount + end + end + + # The pricing model type + # # @see Orb::Models::NewPlanMaxGroupTieredPackagePrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +247,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanMaxGroupTieredPackagePrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_plan_bulk_bps_price.rb b/lib/orb/models/new_plan_minimum_composite_price.rb similarity index 72% rename from lib/orb/models/new_plan_bulk_bps_price.rb rename to lib/orb/models/new_plan_minimum_composite_price.rb index 9fbc9094..7f3248fd 100644 --- a/lib/orb/models/new_plan_bulk_bps_price.rb +++ b/lib/orb/models/new_plan_minimum_composite_price.rb @@ -2,17 +2,12 @@ module Orb module Models - class NewPlanBulkBPSPrice < Orb::Internal::Type::BaseModel - # @!attribute bulk_bps_config - # - # @return [Orb::Models::BulkBPSConfig] - required :bulk_bps_config, -> { Orb::BulkBPSConfig } - + class NewPlanMinimumCompositePrice < Orb::Internal::Type::BaseModel # @!attribute cadence # The cadence to bill for this price on. # - # @return [Symbol, Orb::Models::NewPlanBulkBPSPrice::Cadence] - required :cadence, enum: -> { Orb::NewPlanBulkBPSPrice::Cadence } + # @return [Symbol, Orb::Models::NewPlanMinimumCompositePrice::Cadence] + required :cadence, enum: -> { Orb::NewPlanMinimumCompositePrice::Cadence } # @!attribute item_id # The id of the item the price will be associated with. @@ -20,10 +15,17 @@ class NewPlanBulkBPSPrice < Orb::Internal::Type::BaseModel # @return [String] required :item_id, String + # @!attribute minimum_config + # Configuration for minimum pricing + # + # @return [Orb::Models::NewPlanMinimumCompositePrice::MinimumConfig] + required :minimum_config, -> { Orb::NewPlanMinimumCompositePrice::MinimumConfig } + # @!attribute model_type + # The pricing model type # - # @return [Symbol, Orb::Models::NewPlanBulkBPSPrice::ModelType] - required :model_type, enum: -> { Orb::NewPlanBulkBPSPrice::ModelType } + # @return [Symbol, Orb::Models::NewPlanMinimumCompositePrice::ModelType] + required :model_type, enum: -> { Orb::NewPlanMinimumCompositePrice::ModelType } # @!attribute name # The name of the price. @@ -63,9 +65,7 @@ class NewPlanBulkBPSPrice < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] optional :conversion_rate_config, - union: -> { - Orb::NewPlanBulkBPSPrice::ConversionRateConfig - }, + union: -> { Orb::NewPlanMinimumCompositePrice::ConversionRateConfig }, nil?: true # @!attribute currency @@ -122,17 +122,17 @@ class NewPlanBulkBPSPrice < Orb::Internal::Type::BaseModel # @return [String, nil] optional :reference_id, String, nil?: true - # @!method initialize(bulk_bps_config:, cadence:, item_id:, model_type:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil) + # @!method initialize(cadence:, item_id:, minimum_config:, model_type:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil) # Some parameter documentations has been truncated, see - # {Orb::Models::NewPlanBulkBPSPrice} for more details. + # {Orb::Models::NewPlanMinimumCompositePrice} for more details. # - # @param bulk_bps_config [Orb::Models::BulkBPSConfig] - # - # @param cadence [Symbol, Orb::Models::NewPlanBulkBPSPrice::Cadence] The cadence to bill for this price on. + # @param cadence [Symbol, Orb::Models::NewPlanMinimumCompositePrice::Cadence] The cadence to bill for this price on. # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanBulkBPSPrice::ModelType] + # @param minimum_config [Orb::Models::NewPlanMinimumCompositePrice::MinimumConfig] Configuration for minimum pricing + # + # @param model_type [Symbol, Orb::Models::NewPlanMinimumCompositePrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -164,7 +164,7 @@ class NewPlanBulkBPSPrice < Orb::Internal::Type::BaseModel # The cadence to bill for this price on. # - # @see Orb::Models::NewPlanBulkBPSPrice#cadence + # @see Orb::Models::NewPlanMinimumCompositePrice#cadence module Cadence extend Orb::Internal::Type::Enum @@ -179,31 +179,39 @@ module Cadence # @return [Array] end - # @see Orb::Models::NewPlanBulkBPSPrice#model_type + # @see Orb::Models::NewPlanMinimumCompositePrice#minimum_config + class MinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute minimum_amount + # The minimum amount to apply + # + # @return [String] + required :minimum_amount, String + + # @!attribute prorated + # If true, subtotals from this price are prorated based on the service period + # + # @return [Boolean, nil] + optional :prorated, Orb::Internal::Type::Boolean + + # @!method initialize(minimum_amount:, prorated: nil) + # Configuration for minimum pricing + # + # @param minimum_amount [String] The minimum amount to apply + # + # @param prorated [Boolean] If true, subtotals from this price are prorated based on the service period + end + + # The pricing model type + # + # @see Orb::Models::NewPlanMinimumCompositePrice#model_type module ModelType extend Orb::Internal::Type::Enum - BULK_BPS = :bulk_bps + MINIMUM = :minimum # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanBulkBPSPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_plan_package_price.rb b/lib/orb/models/new_plan_package_price.rb index 24904fae..a9d40a6e 100644 --- a/lib/orb/models/new_plan_package_price.rb +++ b/lib/orb/models/new_plan_package_price.rb @@ -16,6 +16,7 @@ class NewPlanPackagePrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanPackagePrice::ModelType] required :model_type, enum: -> { Orb::NewPlanPackagePrice::ModelType } @@ -27,6 +28,7 @@ class NewPlanPackagePrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute package_config + # Configuration for package pricing # # @return [Orb::Models::PackageConfig] required :package_config, -> { Orb::PackageConfig } @@ -130,11 +132,11 @@ class NewPlanPackagePrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanPackagePrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanPackagePrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param package_config [Orb::Models::PackageConfig] + # @param package_config [Orb::Models::PackageConfig] Configuration for package pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -179,6 +181,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewPlanPackagePrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -188,22 +192,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanPackagePrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_plan_package_with_allocation_price.rb b/lib/orb/models/new_plan_package_with_allocation_price.rb index 316d986d..049f4ef6 100644 --- a/lib/orb/models/new_plan_package_with_allocation_price.rb +++ b/lib/orb/models/new_plan_package_with_allocation_price.rb @@ -16,6 +16,7 @@ class NewPlanPackageWithAllocationPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanPackageWithAllocationPrice::ModelType] required :model_type, enum: -> { Orb::NewPlanPackageWithAllocationPrice::ModelType } @@ -27,9 +28,11 @@ class NewPlanPackageWithAllocationPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute package_with_allocation_config + # Configuration for package_with_allocation pricing # - # @return [Hash{Symbol=>Object}] - required :package_with_allocation_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewPlanPackageWithAllocationPrice::PackageWithAllocationConfig] + required :package_with_allocation_config, + -> { Orb::NewPlanPackageWithAllocationPrice::PackageWithAllocationConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -128,11 +131,11 @@ class NewPlanPackageWithAllocationPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanPackageWithAllocationPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanPackageWithAllocationPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param package_with_allocation_config [Hash{Symbol=>Object}] + # @param package_with_allocation_config [Orb::Models::NewPlanPackageWithAllocationPrice::PackageWithAllocationConfig] Configuration for package_with_allocation pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -177,6 +180,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewPlanPackageWithAllocationPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -187,20 +192,34 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanPackageWithAllocationPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::NewPlanPackageWithAllocationPrice#package_with_allocation_config + class PackageWithAllocationConfig < Orb::Internal::Type::BaseModel + # @!attribute allocation + # Usage allocation + # + # @return [String] + required :allocation, String + + # @!attribute package_amount + # Price per package + # + # @return [String] + required :package_amount, String + + # @!attribute package_size + # Package size + # + # @return [String] + required :package_size, String + + # @!method initialize(allocation:, package_amount:, package_size:) + # Configuration for package_with_allocation pricing + # + # @param allocation [String] Usage allocation + # + # @param package_amount [String] Price per package + # + # @param package_size [String] Package size end end end diff --git a/lib/orb/models/new_plan_scalable_matrix_with_tiered_pricing_price.rb b/lib/orb/models/new_plan_scalable_matrix_with_tiered_pricing_price.rb index 164170a4..e1494b2a 100644 --- a/lib/orb/models/new_plan_scalable_matrix_with_tiered_pricing_price.rb +++ b/lib/orb/models/new_plan_scalable_matrix_with_tiered_pricing_price.rb @@ -16,6 +16,7 @@ class NewPlanScalableMatrixWithTieredPricingPrice < Orb::Internal::Type::BaseMod required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice::ModelType] required :model_type, enum: -> { Orb::NewPlanScalableMatrixWithTieredPricingPrice::ModelType } @@ -27,10 +28,11 @@ class NewPlanScalableMatrixWithTieredPricingPrice < Orb::Internal::Type::BaseMod required :name, String # @!attribute scalable_matrix_with_tiered_pricing_config + # Configuration for scalable_matrix_with_tiered_pricing pricing # - # @return [Hash{Symbol=>Object}] + # @return [Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig] required :scalable_matrix_with_tiered_pricing_config, - Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + -> { Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -129,11 +131,11 @@ class NewPlanScalableMatrixWithTieredPricingPrice < Orb::Internal::Type::BaseMod # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param scalable_matrix_with_tiered_pricing_config [Hash{Symbol=>Object}] + # @param scalable_matrix_with_tiered_pricing_config [Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig] Configuration for scalable_matrix_with_tiered_pricing pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -178,6 +180,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -188,20 +192,98 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union + # @see Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice#scalable_matrix_with_tiered_pricing_config + class ScalableMatrixWithTieredPricingConfig < Orb::Internal::Type::BaseModel + # @!attribute first_dimension + # Used for the scalable matrix first dimension + # + # @return [String] + required :first_dimension, String + + # @!attribute matrix_scaling_factors + # Apply a scaling factor to each dimension + # + # @return [Array] + required :matrix_scaling_factors, + -> do + Orb::Internal::Type::ArrayOf[ + Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor + ] + end + + # @!attribute tiers + # Tier pricing structure + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier] } + + # @!attribute second_dimension + # Used for the scalable matrix second dimension (optional) + # + # @return [String, nil] + optional :second_dimension, String, nil?: true + + # @!method initialize(first_dimension:, matrix_scaling_factors:, tiers:, second_dimension: nil) + # Configuration for scalable_matrix_with_tiered_pricing pricing + # + # @param first_dimension [String] Used for the scalable matrix first dimension + # + # @param matrix_scaling_factors [Array] Apply a scaling factor to each dimension + # + # @param tiers [Array] Tier pricing structure + # + # @param second_dimension [String, nil] Used for the scalable matrix second dimension (optional) + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + # @!attribute first_dimension_value + # First dimension value + # + # @return [String] + required :first_dimension_value, String + + # @!attribute scaling_factor + # Scaling factor + # + # @return [String] + required :scaling_factor, String + + # @!attribute second_dimension_value + # Second dimension value (optional) + # + # @return [String, nil] + optional :second_dimension_value, String, nil?: true - discriminator :conversion_rate_type + # @!method initialize(first_dimension_value:, scaling_factor:, second_dimension_value: nil) + # Configuration for a single matrix scaling factor + # + # @param first_dimension_value [String] First dimension value + # + # @param scaling_factor [String] Scaling factor + # + # @param second_dimension_value [String, nil] Second dimension value (optional) + end - variant :unit, -> { Orb::UnitConversionRateConfig } + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String - variant :tiered, -> { Orb::TieredConversionRateConfig } + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tier entry with business logic + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Per unit amount + end end end end diff --git a/lib/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rb b/lib/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rb index fe968a6e..b1fb6e39 100644 --- a/lib/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rb +++ b/lib/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rb @@ -16,6 +16,7 @@ class NewPlanScalableMatrixWithUnitPricingPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice::ModelType] required :model_type, enum: -> { Orb::NewPlanScalableMatrixWithUnitPricingPrice::ModelType } @@ -27,10 +28,11 @@ class NewPlanScalableMatrixWithUnitPricingPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute scalable_matrix_with_unit_pricing_config + # Configuration for scalable_matrix_with_unit_pricing pricing # - # @return [Hash{Symbol=>Object}] + # @return [Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig] required :scalable_matrix_with_unit_pricing_config, - Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + -> { Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -129,11 +131,11 @@ class NewPlanScalableMatrixWithUnitPricingPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param scalable_matrix_with_unit_pricing_config [Hash{Symbol=>Object}] + # @param scalable_matrix_with_unit_pricing_config [Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig] Configuration for scalable_matrix_with_unit_pricing pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -178,6 +180,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -188,20 +192,80 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union + # @see Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice#scalable_matrix_with_unit_pricing_config + class ScalableMatrixWithUnitPricingConfig < Orb::Internal::Type::BaseModel + # @!attribute first_dimension + # Used to determine the unit rate + # + # @return [String] + required :first_dimension, String + + # @!attribute matrix_scaling_factors + # Apply a scaling factor to each dimension + # + # @return [Array] + required :matrix_scaling_factors, + -> { Orb::Internal::Type::ArrayOf[Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor] } + + # @!attribute unit_price + # The final unit price to rate against the output of the matrix + # + # @return [String] + required :unit_price, String + + # @!attribute prorate + # If true, the unit price will be prorated to the billing period + # + # @return [Boolean, nil] + optional :prorate, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute second_dimension + # Used to determine the unit rate (optional) + # + # @return [String, nil] + optional :second_dimension, String, nil?: true + + # @!method initialize(first_dimension:, matrix_scaling_factors:, unit_price:, prorate: nil, second_dimension: nil) + # Configuration for scalable_matrix_with_unit_pricing pricing + # + # @param first_dimension [String] Used to determine the unit rate + # + # @param matrix_scaling_factors [Array] Apply a scaling factor to each dimension + # + # @param unit_price [String] The final unit price to rate against the output of the matrix + # + # @param prorate [Boolean, nil] If true, the unit price will be prorated to the billing period + # + # @param second_dimension [String, nil] Used to determine the unit rate (optional) - discriminator :conversion_rate_type + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + # @!attribute first_dimension_value + # First dimension value + # + # @return [String] + required :first_dimension_value, String - variant :unit, -> { Orb::UnitConversionRateConfig } + # @!attribute scaling_factor + # Scaling factor + # + # @return [String] + required :scaling_factor, String - variant :tiered, -> { Orb::TieredConversionRateConfig } + # @!attribute second_dimension_value + # Second dimension value (optional) + # + # @return [String, nil] + optional :second_dimension_value, String, nil?: true - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @!method initialize(first_dimension_value:, scaling_factor:, second_dimension_value: nil) + # Configuration for a single matrix scaling factor + # + # @param first_dimension_value [String] First dimension value + # + # @param scaling_factor [String] Scaling factor + # + # @param second_dimension_value [String, nil] Second dimension value (optional) + end end end end diff --git a/lib/orb/models/new_plan_threshold_total_amount_price.rb b/lib/orb/models/new_plan_threshold_total_amount_price.rb index eb936e62..4916e9a7 100644 --- a/lib/orb/models/new_plan_threshold_total_amount_price.rb +++ b/lib/orb/models/new_plan_threshold_total_amount_price.rb @@ -16,6 +16,7 @@ class NewPlanThresholdTotalAmountPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanThresholdTotalAmountPrice::ModelType] required :model_type, enum: -> { Orb::NewPlanThresholdTotalAmountPrice::ModelType } @@ -27,9 +28,11 @@ class NewPlanThresholdTotalAmountPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute threshold_total_amount_config + # Configuration for threshold_total_amount pricing # - # @return [Hash{Symbol=>Object}] - required :threshold_total_amount_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig] + required :threshold_total_amount_config, + -> { Orb::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -128,11 +131,11 @@ class NewPlanThresholdTotalAmountPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanThresholdTotalAmountPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanThresholdTotalAmountPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param threshold_total_amount_config [Hash{Symbol=>Object}] + # @param threshold_total_amount_config [Orb::Models::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig] Configuration for threshold_total_amount pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -177,6 +180,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewPlanThresholdTotalAmountPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -187,20 +192,53 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanThresholdTotalAmountPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::NewPlanThresholdTotalAmountPrice#threshold_total_amount_config + class ThresholdTotalAmountConfig < Orb::Internal::Type::BaseModel + # @!attribute consumption_table + # When the quantity consumed passes a provided threshold, the configured total + # will be charged + # + # @return [Array] + required :consumption_table, + -> { Orb::Internal::Type::ArrayOf[Orb::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable] } + + # @!attribute prorate + # If true, the unit price will be prorated to the billing period + # + # @return [Boolean, nil] + optional :prorate, Orb::Internal::Type::Boolean, nil?: true + + # @!method initialize(consumption_table:, prorate: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig} for + # more details. + # + # Configuration for threshold_total_amount pricing + # + # @param consumption_table [Array] When the quantity consumed passes a provided threshold, the configured total wil + # + # @param prorate [Boolean, nil] If true, the unit price will be prorated to the billing period + + class ConsumptionTable < Orb::Internal::Type::BaseModel + # @!attribute threshold + # Quantity threshold + # + # @return [String] + required :threshold, String + + # @!attribute total_amount + # Total amount for this threshold + # + # @return [String] + required :total_amount, String + + # @!method initialize(threshold:, total_amount:) + # Configuration for a single threshold + # + # @param threshold [String] Quantity threshold + # + # @param total_amount [String] Total amount for this threshold + end end end end diff --git a/lib/orb/models/new_plan_tier_with_proration_price.rb b/lib/orb/models/new_plan_tier_with_proration_price.rb deleted file mode 100644 index fd4866f1..00000000 --- a/lib/orb/models/new_plan_tier_with_proration_price.rb +++ /dev/null @@ -1,207 +0,0 @@ -# frozen_string_literal: true - -module Orb - module Models - class NewPlanTierWithProrationPrice < Orb::Internal::Type::BaseModel - # @!attribute cadence - # The cadence to bill for this price on. - # - # @return [Symbol, Orb::Models::NewPlanTierWithProrationPrice::Cadence] - required :cadence, enum: -> { Orb::NewPlanTierWithProrationPrice::Cadence } - - # @!attribute item_id - # The id of the item the price will be associated with. - # - # @return [String] - required :item_id, String - - # @!attribute model_type - # - # @return [Symbol, Orb::Models::NewPlanTierWithProrationPrice::ModelType] - required :model_type, enum: -> { Orb::NewPlanTierWithProrationPrice::ModelType } - - # @!attribute name - # The name of the price. - # - # @return [String] - required :name, String - - # @!attribute tiered_with_proration_config - # - # @return [Hash{Symbol=>Object}] - required :tiered_with_proration_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] - - # @!attribute billable_metric_id - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - # - # @return [String, nil] - optional :billable_metric_id, String, nil?: true - - # @!attribute billed_in_advance - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - # - # @return [Boolean, nil] - optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true - - # @!attribute billing_cycle_configuration - # For custom cadence: specifies the duration of the billing period in days or - # months. - # - # @return [Orb::Models::NewBillingCycleConfiguration, nil] - optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true - - # @!attribute conversion_rate - # The per unit conversion rate of the price currency to the invoicing currency. - # - # @return [Float, nil] - optional :conversion_rate, Float, nil?: true - - # @!attribute conversion_rate_config - # The configuration for the rate of the price currency to the invoicing currency. - # - # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - optional :conversion_rate_config, - union: -> { Orb::NewPlanTierWithProrationPrice::ConversionRateConfig }, - nil?: true - - # @!attribute currency - # An ISO 4217 currency string, or custom pricing unit identifier, in which this - # price is billed. - # - # @return [String, nil] - optional :currency, String, nil?: true - - # @!attribute dimensional_price_configuration - # For dimensional price: specifies a price group and dimension values - # - # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] - optional :dimensional_price_configuration, -> { Orb::NewDimensionalPriceConfiguration }, nil?: true - - # @!attribute external_price_id - # An alias for the price. - # - # @return [String, nil] - optional :external_price_id, String, nil?: true - - # @!attribute fixed_price_quantity - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - # - # @return [Float, nil] - optional :fixed_price_quantity, Float, nil?: true - - # @!attribute invoice_grouping_key - # The property used to group this price on an invoice - # - # @return [String, nil] - optional :invoice_grouping_key, String, nil?: true - - # @!attribute invoicing_cycle_configuration - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - # - # @return [Orb::Models::NewBillingCycleConfiguration, nil] - optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true - - # @!attribute metadata - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - # - # @return [Hash{Symbol=>String, nil}, nil] - optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true - - # @!attribute reference_id - # A transient ID that can be used to reference this price when adding adjustments - # in the same API call. - # - # @return [String, nil] - optional :reference_id, String, nil?: true - - # @!method initialize(cadence:, item_id:, model_type:, name:, tiered_with_proration_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil) - # Some parameter documentations has been truncated, see - # {Orb::Models::NewPlanTierWithProrationPrice} for more details. - # - # @param cadence [Symbol, Orb::Models::NewPlanTierWithProrationPrice::Cadence] The cadence to bill for this price on. - # - # @param item_id [String] The id of the item the price will be associated with. - # - # @param model_type [Symbol, Orb::Models::NewPlanTierWithProrationPrice::ModelType] - # - # @param name [String] The name of the price. - # - # @param tiered_with_proration_config [Hash{Symbol=>Object}] - # - # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b - # - # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi - # - # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont - # - # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. - # - # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. - # - # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr - # - # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values - # - # @param external_price_id [String, nil] An alias for the price. - # - # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl - # - # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice - # - # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. - # - # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed - # - # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments - - # The cadence to bill for this price on. - # - # @see Orb::Models::NewPlanTierWithProrationPrice#cadence - module Cadence - extend Orb::Internal::Type::Enum - - ANNUAL = :annual - SEMI_ANNUAL = :semi_annual - MONTHLY = :monthly - QUARTERLY = :quarterly - ONE_TIME = :one_time - CUSTOM = :custom - - # @!method self.values - # @return [Array] - end - - # @see Orb::Models::NewPlanTierWithProrationPrice#model_type - module ModelType - extend Orb::Internal::Type::Enum - - TIERED_WITH_PRORATION = :tiered_with_proration - - # @!method self.values - # @return [Array] - end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanTierWithProrationPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - end - end -end diff --git a/lib/orb/models/new_plan_tiered_bps_price.rb b/lib/orb/models/new_plan_tiered_bps_price.rb deleted file mode 100644 index cd0db7fb..00000000 --- a/lib/orb/models/new_plan_tiered_bps_price.rb +++ /dev/null @@ -1,207 +0,0 @@ -# frozen_string_literal: true - -module Orb - module Models - class NewPlanTieredBPSPrice < Orb::Internal::Type::BaseModel - # @!attribute cadence - # The cadence to bill for this price on. - # - # @return [Symbol, Orb::Models::NewPlanTieredBPSPrice::Cadence] - required :cadence, enum: -> { Orb::NewPlanTieredBPSPrice::Cadence } - - # @!attribute item_id - # The id of the item the price will be associated with. - # - # @return [String] - required :item_id, String - - # @!attribute model_type - # - # @return [Symbol, Orb::Models::NewPlanTieredBPSPrice::ModelType] - required :model_type, enum: -> { Orb::NewPlanTieredBPSPrice::ModelType } - - # @!attribute name - # The name of the price. - # - # @return [String] - required :name, String - - # @!attribute tiered_bps_config - # - # @return [Orb::Models::TieredBPSConfig] - required :tiered_bps_config, -> { Orb::TieredBPSConfig } - - # @!attribute billable_metric_id - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - # - # @return [String, nil] - optional :billable_metric_id, String, nil?: true - - # @!attribute billed_in_advance - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - # - # @return [Boolean, nil] - optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true - - # @!attribute billing_cycle_configuration - # For custom cadence: specifies the duration of the billing period in days or - # months. - # - # @return [Orb::Models::NewBillingCycleConfiguration, nil] - optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true - - # @!attribute conversion_rate - # The per unit conversion rate of the price currency to the invoicing currency. - # - # @return [Float, nil] - optional :conversion_rate, Float, nil?: true - - # @!attribute conversion_rate_config - # The configuration for the rate of the price currency to the invoicing currency. - # - # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - optional :conversion_rate_config, - union: -> { Orb::NewPlanTieredBPSPrice::ConversionRateConfig }, - nil?: true - - # @!attribute currency - # An ISO 4217 currency string, or custom pricing unit identifier, in which this - # price is billed. - # - # @return [String, nil] - optional :currency, String, nil?: true - - # @!attribute dimensional_price_configuration - # For dimensional price: specifies a price group and dimension values - # - # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] - optional :dimensional_price_configuration, -> { Orb::NewDimensionalPriceConfiguration }, nil?: true - - # @!attribute external_price_id - # An alias for the price. - # - # @return [String, nil] - optional :external_price_id, String, nil?: true - - # @!attribute fixed_price_quantity - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - # - # @return [Float, nil] - optional :fixed_price_quantity, Float, nil?: true - - # @!attribute invoice_grouping_key - # The property used to group this price on an invoice - # - # @return [String, nil] - optional :invoice_grouping_key, String, nil?: true - - # @!attribute invoicing_cycle_configuration - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - # - # @return [Orb::Models::NewBillingCycleConfiguration, nil] - optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true - - # @!attribute metadata - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - # - # @return [Hash{Symbol=>String, nil}, nil] - optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true - - # @!attribute reference_id - # A transient ID that can be used to reference this price when adding adjustments - # in the same API call. - # - # @return [String, nil] - optional :reference_id, String, nil?: true - - # @!method initialize(cadence:, item_id:, model_type:, name:, tiered_bps_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil) - # Some parameter documentations has been truncated, see - # {Orb::Models::NewPlanTieredBPSPrice} for more details. - # - # @param cadence [Symbol, Orb::Models::NewPlanTieredBPSPrice::Cadence] The cadence to bill for this price on. - # - # @param item_id [String] The id of the item the price will be associated with. - # - # @param model_type [Symbol, Orb::Models::NewPlanTieredBPSPrice::ModelType] - # - # @param name [String] The name of the price. - # - # @param tiered_bps_config [Orb::Models::TieredBPSConfig] - # - # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b - # - # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi - # - # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont - # - # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. - # - # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. - # - # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr - # - # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values - # - # @param external_price_id [String, nil] An alias for the price. - # - # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl - # - # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice - # - # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. - # - # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed - # - # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments - - # The cadence to bill for this price on. - # - # @see Orb::Models::NewPlanTieredBPSPrice#cadence - module Cadence - extend Orb::Internal::Type::Enum - - ANNUAL = :annual - SEMI_ANNUAL = :semi_annual - MONTHLY = :monthly - QUARTERLY = :quarterly - ONE_TIME = :one_time - CUSTOM = :custom - - # @!method self.values - # @return [Array] - end - - # @see Orb::Models::NewPlanTieredBPSPrice#model_type - module ModelType - extend Orb::Internal::Type::Enum - - TIERED_BPS = :tiered_bps - - # @!method self.values - # @return [Array] - end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanTieredBPSPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - end - end -end diff --git a/lib/orb/models/new_plan_tiered_package_price.rb b/lib/orb/models/new_plan_tiered_package_price.rb index 1cdc901d..4ddaf2c0 100644 --- a/lib/orb/models/new_plan_tiered_package_price.rb +++ b/lib/orb/models/new_plan_tiered_package_price.rb @@ -16,6 +16,7 @@ class NewPlanTieredPackagePrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanTieredPackagePrice::ModelType] required :model_type, enum: -> { Orb::NewPlanTieredPackagePrice::ModelType } @@ -27,9 +28,10 @@ class NewPlanTieredPackagePrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute tiered_package_config + # Configuration for tiered_package pricing # - # @return [Hash{Symbol=>Object}] - required :tiered_package_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewPlanTieredPackagePrice::TieredPackageConfig] + required :tiered_package_config, -> { Orb::NewPlanTieredPackagePrice::TieredPackageConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -128,11 +130,11 @@ class NewPlanTieredPackagePrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanTieredPackagePrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanTieredPackagePrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param tiered_package_config [Hash{Symbol=>Object}] + # @param tiered_package_config [Orb::Models::NewPlanTieredPackagePrice::TieredPackageConfig] Configuration for tiered_package pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -177,6 +179,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewPlanTieredPackagePrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -187,20 +191,54 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanTieredPackagePrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::NewPlanTieredPackagePrice#tiered_package_config + class TieredPackageConfig < Orb::Internal::Type::BaseModel + # @!attribute package_size + # Package size + # + # @return [String] + required :package_size, String + + # @!attribute tiers + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. The tier bounds are defined based on + # the total quantity rather than the number of packages, so they must be multiples + # of the package size. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewPlanTieredPackagePrice::TieredPackageConfig::Tier] } + + # @!method initialize(package_size:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewPlanTieredPackagePrice::TieredPackageConfig} for more details. + # + # Configuration for tiered_package pricing + # + # @param package_size [String] Package size + # + # @param tiers [Array] Apply tiered pricing after rounding up the quantity to the package size. Tiers a + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute per_unit + # Price per package + # + # @return [String] + required :per_unit, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!method initialize(per_unit:, tier_lower_bound:) + # Configuration for a single tier with business logic + # + # @param per_unit [String] Price per package + # + # @param tier_lower_bound [String] Tier lower bound + end end end end diff --git a/lib/orb/models/new_plan_tiered_package_with_minimum_price.rb b/lib/orb/models/new_plan_tiered_package_with_minimum_price.rb index 0be54963..11ef5ab5 100644 --- a/lib/orb/models/new_plan_tiered_package_with_minimum_price.rb +++ b/lib/orb/models/new_plan_tiered_package_with_minimum_price.rb @@ -16,6 +16,7 @@ class NewPlanTieredPackageWithMinimumPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanTieredPackageWithMinimumPrice::ModelType] required :model_type, enum: -> { Orb::NewPlanTieredPackageWithMinimumPrice::ModelType } @@ -27,9 +28,11 @@ class NewPlanTieredPackageWithMinimumPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute tiered_package_with_minimum_config + # Configuration for tiered_package_with_minimum pricing # - # @return [Hash{Symbol=>Object}] - required :tiered_package_with_minimum_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig] + required :tiered_package_with_minimum_config, + -> { Orb::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -128,11 +131,11 @@ class NewPlanTieredPackageWithMinimumPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanTieredPackageWithMinimumPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanTieredPackageWithMinimumPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param tiered_package_with_minimum_config [Hash{Symbol=>Object}] + # @param tiered_package_with_minimum_config [Orb::Models::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig] Configuration for tiered_package_with_minimum pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -177,6 +180,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewPlanTieredPackageWithMinimumPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -187,20 +192,61 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanTieredPackageWithMinimumPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::NewPlanTieredPackageWithMinimumPrice#tiered_package_with_minimum_config + class TieredPackageWithMinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute package_size + # Package size + # + # @return [Float] + required :package_size, Float + + # @!attribute tiers + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier] } + + # @!method initialize(package_size:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig} + # for more details. + # + # Configuration for tiered_package_with_minimum pricing + # + # @param package_size [Float] Package size + # + # @param tiers [Array] Apply tiered pricing after rounding up the quantity to the package size. Tiers a + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute minimum_amount + # Minimum amount + # + # @return [String] + required :minimum_amount, String + + # @!attribute per_unit + # Price per package + # + # @return [String] + required :per_unit, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!method initialize(minimum_amount:, per_unit:, tier_lower_bound:) + # Configuration for a single tier + # + # @param minimum_amount [String] Minimum amount + # + # @param per_unit [String] Price per package + # + # @param tier_lower_bound [String] Tier lower bound + end end end end diff --git a/lib/orb/models/new_plan_tiered_price.rb b/lib/orb/models/new_plan_tiered_price.rb index 713d3111..801f3c4f 100644 --- a/lib/orb/models/new_plan_tiered_price.rb +++ b/lib/orb/models/new_plan_tiered_price.rb @@ -16,6 +16,7 @@ class NewPlanTieredPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanTieredPrice::ModelType] required :model_type, enum: -> { Orb::NewPlanTieredPrice::ModelType } @@ -27,6 +28,7 @@ class NewPlanTieredPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute tiered_config + # Configuration for tiered pricing # # @return [Orb::Models::TieredConfig] required :tiered_config, -> { Orb::TieredConfig } @@ -130,11 +132,11 @@ class NewPlanTieredPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanTieredPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanTieredPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param tiered_config [Orb::Models::TieredConfig] + # @param tiered_config [Orb::Models::TieredConfig] Configuration for tiered pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -179,6 +181,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewPlanTieredPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -188,22 +192,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanTieredPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_plan_tiered_with_minimum_price.rb b/lib/orb/models/new_plan_tiered_with_minimum_price.rb index c6f9fab4..365f1c3e 100644 --- a/lib/orb/models/new_plan_tiered_with_minimum_price.rb +++ b/lib/orb/models/new_plan_tiered_with_minimum_price.rb @@ -16,6 +16,7 @@ class NewPlanTieredWithMinimumPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanTieredWithMinimumPrice::ModelType] required :model_type, enum: -> { Orb::NewPlanTieredWithMinimumPrice::ModelType } @@ -27,9 +28,10 @@ class NewPlanTieredWithMinimumPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute tiered_with_minimum_config + # Configuration for tiered_with_minimum pricing # - # @return [Hash{Symbol=>Object}] - required :tiered_with_minimum_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig] + required :tiered_with_minimum_config, -> { Orb::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -128,11 +130,11 @@ class NewPlanTieredWithMinimumPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanTieredWithMinimumPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanTieredWithMinimumPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param tiered_with_minimum_config [Hash{Symbol=>Object}] + # @param tiered_with_minimum_config [Orb::Models::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig] Configuration for tiered_with_minimum pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -177,6 +179,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewPlanTieredWithMinimumPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -187,20 +191,69 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanTieredWithMinimumPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union + # @see Orb::Models::NewPlanTieredWithMinimumPrice#tiered_with_minimum_config + class TieredWithMinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Tiered pricing with a minimum amount dependent on the volume tier. Tiers are + # defined using exclusive lower bounds. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig::Tier] } + + # @!attribute hide_zero_amount_tiers + # If true, tiers with an accrued amount of 0 will not be included in the rating. + # + # @return [Boolean, nil] + optional :hide_zero_amount_tiers, Orb::Internal::Type::Boolean + + # @!attribute prorate + # If true, the unit price will be prorated to the billing period + # + # @return [Boolean, nil] + optional :prorate, Orb::Internal::Type::Boolean + + # @!method initialize(tiers:, hide_zero_amount_tiers: nil, prorate: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig} for more + # details. + # + # Configuration for tiered_with_minimum pricing + # + # @param tiers [Array] Tiered pricing with a minimum amount dependent on the volume tier. Tiers are def + # + # @param hide_zero_amount_tiers [Boolean] If true, tiers with an accrued amount of 0 will not be included in the rating. + # + # @param prorate [Boolean] If true, the unit price will be prorated to the billing period - discriminator :conversion_rate_type + class Tier < Orb::Internal::Type::BaseModel + # @!attribute minimum_amount + # Minimum amount + # + # @return [String] + required :minimum_amount, String - variant :unit, -> { Orb::UnitConversionRateConfig } + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String - variant :tiered, -> { Orb::TieredConversionRateConfig } + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @!method initialize(minimum_amount:, tier_lower_bound:, unit_amount:) + # Configuration for a single tier + # + # @param minimum_amount [String] Minimum amount + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Per unit amount + end end end end diff --git a/lib/orb/models/new_plan_unit_price.rb b/lib/orb/models/new_plan_unit_price.rb index 0ed0df4a..700c82e6 100644 --- a/lib/orb/models/new_plan_unit_price.rb +++ b/lib/orb/models/new_plan_unit_price.rb @@ -16,6 +16,7 @@ class NewPlanUnitPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanUnitPrice::ModelType] required :model_type, enum: -> { Orb::NewPlanUnitPrice::ModelType } @@ -27,6 +28,7 @@ class NewPlanUnitPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute unit_config + # Configuration for unit pricing # # @return [Orb::Models::UnitConfig] required :unit_config, -> { Orb::UnitConfig } @@ -126,11 +128,11 @@ class NewPlanUnitPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanUnitPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanUnitPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param unit_config [Orb::Models::UnitConfig] + # @param unit_config [Orb::Models::UnitConfig] Configuration for unit pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -175,6 +177,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewPlanUnitPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -184,22 +188,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanUnitPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_plan_unit_with_percent_price.rb b/lib/orb/models/new_plan_unit_with_percent_price.rb index bf4b314d..3bfa2718 100644 --- a/lib/orb/models/new_plan_unit_with_percent_price.rb +++ b/lib/orb/models/new_plan_unit_with_percent_price.rb @@ -16,6 +16,7 @@ class NewPlanUnitWithPercentPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanUnitWithPercentPrice::ModelType] required :model_type, enum: -> { Orb::NewPlanUnitWithPercentPrice::ModelType } @@ -27,9 +28,10 @@ class NewPlanUnitWithPercentPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute unit_with_percent_config + # Configuration for unit_with_percent pricing # - # @return [Hash{Symbol=>Object}] - required :unit_with_percent_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewPlanUnitWithPercentPrice::UnitWithPercentConfig] + required :unit_with_percent_config, -> { Orb::NewPlanUnitWithPercentPrice::UnitWithPercentConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -128,11 +130,11 @@ class NewPlanUnitWithPercentPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanUnitWithPercentPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanUnitWithPercentPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param unit_with_percent_config [Hash{Symbol=>Object}] + # @param unit_with_percent_config [Orb::Models::NewPlanUnitWithPercentPrice::UnitWithPercentConfig] Configuration for unit_with_percent pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -177,6 +179,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewPlanUnitWithPercentPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -187,20 +191,26 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanUnitWithPercentPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::NewPlanUnitWithPercentPrice#unit_with_percent_config + class UnitWithPercentConfig < Orb::Internal::Type::BaseModel + # @!attribute percent + # What percent, out of 100, of the calculated total to charge + # + # @return [String] + required :percent, String + + # @!attribute unit_amount + # Rate per unit of usage + # + # @return [String] + required :unit_amount, String + + # @!method initialize(percent:, unit_amount:) + # Configuration for unit_with_percent pricing + # + # @param percent [String] What percent, out of 100, of the calculated total to charge + # + # @param unit_amount [String] Rate per unit of usage end end end diff --git a/lib/orb/models/new_plan_unit_with_proration_price.rb b/lib/orb/models/new_plan_unit_with_proration_price.rb index cbb3a25d..e2972712 100644 --- a/lib/orb/models/new_plan_unit_with_proration_price.rb +++ b/lib/orb/models/new_plan_unit_with_proration_price.rb @@ -16,6 +16,7 @@ class NewPlanUnitWithProrationPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewPlanUnitWithProrationPrice::ModelType] required :model_type, enum: -> { Orb::NewPlanUnitWithProrationPrice::ModelType } @@ -27,9 +28,10 @@ class NewPlanUnitWithProrationPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute unit_with_proration_config + # Configuration for unit_with_proration pricing # - # @return [Hash{Symbol=>Object}] - required :unit_with_proration_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewPlanUnitWithProrationPrice::UnitWithProrationConfig] + required :unit_with_proration_config, -> { Orb::NewPlanUnitWithProrationPrice::UnitWithProrationConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -128,11 +130,11 @@ class NewPlanUnitWithProrationPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewPlanUnitWithProrationPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewPlanUnitWithProrationPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param unit_with_proration_config [Hash{Symbol=>Object}] + # @param unit_with_proration_config [Orb::Models::NewPlanUnitWithProrationPrice::UnitWithProrationConfig] Configuration for unit_with_proration pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -177,6 +179,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewPlanUnitWithProrationPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -187,20 +191,18 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewPlanUnitWithProrationPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::NewPlanUnitWithProrationPrice#unit_with_proration_config + class UnitWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute unit_amount + # Rate per unit of usage + # + # @return [String] + required :unit_amount, String + + # @!method initialize(unit_amount:) + # Configuration for unit_with_proration pricing + # + # @param unit_amount [String] Rate per unit of usage end end end diff --git a/lib/orb/models/new_subscription_bps_price.rb b/lib/orb/models/new_subscription_bps_price.rb deleted file mode 100644 index 5cbf734d..00000000 --- a/lib/orb/models/new_subscription_bps_price.rb +++ /dev/null @@ -1,207 +0,0 @@ -# frozen_string_literal: true - -module Orb - module Models - class NewSubscriptionBPSPrice < Orb::Internal::Type::BaseModel - # @!attribute bps_config - # - # @return [Orb::Models::BPSConfig] - required :bps_config, -> { Orb::BPSConfig } - - # @!attribute cadence - # The cadence to bill for this price on. - # - # @return [Symbol, Orb::Models::NewSubscriptionBPSPrice::Cadence] - required :cadence, enum: -> { Orb::NewSubscriptionBPSPrice::Cadence } - - # @!attribute item_id - # The id of the item the price will be associated with. - # - # @return [String] - required :item_id, String - - # @!attribute model_type - # - # @return [Symbol, Orb::Models::NewSubscriptionBPSPrice::ModelType] - required :model_type, enum: -> { Orb::NewSubscriptionBPSPrice::ModelType } - - # @!attribute name - # The name of the price. - # - # @return [String] - required :name, String - - # @!attribute billable_metric_id - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - # - # @return [String, nil] - optional :billable_metric_id, String, nil?: true - - # @!attribute billed_in_advance - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - # - # @return [Boolean, nil] - optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true - - # @!attribute billing_cycle_configuration - # For custom cadence: specifies the duration of the billing period in days or - # months. - # - # @return [Orb::Models::NewBillingCycleConfiguration, nil] - optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true - - # @!attribute conversion_rate - # The per unit conversion rate of the price currency to the invoicing currency. - # - # @return [Float, nil] - optional :conversion_rate, Float, nil?: true - - # @!attribute conversion_rate_config - # The configuration for the rate of the price currency to the invoicing currency. - # - # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - optional :conversion_rate_config, - union: -> { Orb::NewSubscriptionBPSPrice::ConversionRateConfig }, - nil?: true - - # @!attribute currency - # An ISO 4217 currency string, or custom pricing unit identifier, in which this - # price is billed. - # - # @return [String, nil] - optional :currency, String, nil?: true - - # @!attribute dimensional_price_configuration - # For dimensional price: specifies a price group and dimension values - # - # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] - optional :dimensional_price_configuration, -> { Orb::NewDimensionalPriceConfiguration }, nil?: true - - # @!attribute external_price_id - # An alias for the price. - # - # @return [String, nil] - optional :external_price_id, String, nil?: true - - # @!attribute fixed_price_quantity - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - # - # @return [Float, nil] - optional :fixed_price_quantity, Float, nil?: true - - # @!attribute invoice_grouping_key - # The property used to group this price on an invoice - # - # @return [String, nil] - optional :invoice_grouping_key, String, nil?: true - - # @!attribute invoicing_cycle_configuration - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - # - # @return [Orb::Models::NewBillingCycleConfiguration, nil] - optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true - - # @!attribute metadata - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - # - # @return [Hash{Symbol=>String, nil}, nil] - optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true - - # @!attribute reference_id - # A transient ID that can be used to reference this price when adding adjustments - # in the same API call. - # - # @return [String, nil] - optional :reference_id, String, nil?: true - - # @!method initialize(bps_config:, cadence:, item_id:, model_type:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil) - # Some parameter documentations has been truncated, see - # {Orb::Models::NewSubscriptionBPSPrice} for more details. - # - # @param bps_config [Orb::Models::BPSConfig] - # - # @param cadence [Symbol, Orb::Models::NewSubscriptionBPSPrice::Cadence] The cadence to bill for this price on. - # - # @param item_id [String] The id of the item the price will be associated with. - # - # @param model_type [Symbol, Orb::Models::NewSubscriptionBPSPrice::ModelType] - # - # @param name [String] The name of the price. - # - # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b - # - # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi - # - # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont - # - # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. - # - # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. - # - # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr - # - # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values - # - # @param external_price_id [String, nil] An alias for the price. - # - # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl - # - # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice - # - # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. - # - # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed - # - # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments - - # The cadence to bill for this price on. - # - # @see Orb::Models::NewSubscriptionBPSPrice#cadence - module Cadence - extend Orb::Internal::Type::Enum - - ANNUAL = :annual - SEMI_ANNUAL = :semi_annual - MONTHLY = :monthly - QUARTERLY = :quarterly - ONE_TIME = :one_time - CUSTOM = :custom - - # @!method self.values - # @return [Array] - end - - # @see Orb::Models::NewSubscriptionBPSPrice#model_type - module ModelType - extend Orb::Internal::Type::Enum - - BPS = :bps - - # @!method self.values - # @return [Array] - end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionBPSPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - end - end -end diff --git a/lib/orb/models/new_subscription_bulk_price.rb b/lib/orb/models/new_subscription_bulk_price.rb index 27d423d9..a275d526 100644 --- a/lib/orb/models/new_subscription_bulk_price.rb +++ b/lib/orb/models/new_subscription_bulk_price.rb @@ -4,6 +4,7 @@ module Orb module Models class NewSubscriptionBulkPrice < Orb::Internal::Type::BaseModel # @!attribute bulk_config + # Configuration for bulk pricing # # @return [Orb::Models::BulkConfig] required :bulk_config, -> { Orb::BulkConfig } @@ -21,6 +22,7 @@ class NewSubscriptionBulkPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionBulkPrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionBulkPrice::ModelType } @@ -124,13 +126,13 @@ class NewSubscriptionBulkPrice < Orb::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {Orb::Models::NewSubscriptionBulkPrice} for more details. # - # @param bulk_config [Orb::Models::BulkConfig] + # @param bulk_config [Orb::Models::BulkConfig] Configuration for bulk pricing # # @param cadence [Symbol, Orb::Models::NewSubscriptionBulkPrice::Cadence] The cadence to bill for this price on. # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionBulkPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionBulkPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -177,6 +179,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewSubscriptionBulkPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +190,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionBulkPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_subscription_bulk_with_proration_price.rb b/lib/orb/models/new_subscription_bulk_with_proration_price.rb index fe37e1ed..75472631 100644 --- a/lib/orb/models/new_subscription_bulk_with_proration_price.rb +++ b/lib/orb/models/new_subscription_bulk_with_proration_price.rb @@ -4,9 +4,11 @@ module Orb module Models class NewSubscriptionBulkWithProrationPrice < Orb::Internal::Type::BaseModel # @!attribute bulk_with_proration_config + # Configuration for bulk_with_proration pricing # - # @return [Hash{Symbol=>Object}] - required :bulk_with_proration_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig] + required :bulk_with_proration_config, + -> { Orb::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig } # @!attribute cadence # The cadence to bill for this price on. @@ -21,6 +23,7 @@ class NewSubscriptionBulkWithProrationPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionBulkWithProrationPrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionBulkWithProrationPrice::ModelType } @@ -124,13 +127,13 @@ class NewSubscriptionBulkWithProrationPrice < Orb::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {Orb::Models::NewSubscriptionBulkWithProrationPrice} for more details. # - # @param bulk_with_proration_config [Hash{Symbol=>Object}] + # @param bulk_with_proration_config [Orb::Models::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig] Configuration for bulk_with_proration pricing # # @param cadence [Symbol, Orb::Models::NewSubscriptionBulkWithProrationPrice::Cadence] The cadence to bill for this price on. # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionBulkWithProrationPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionBulkWithProrationPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -160,6 +163,42 @@ class NewSubscriptionBulkWithProrationPrice < Orb::Internal::Type::BaseModel # # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # @see Orb::Models::NewSubscriptionBulkWithProrationPrice#bulk_with_proration_config + class BulkWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Bulk tiers for rating based on total usage volume + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig::Tier] } + + # @!method initialize(tiers:) + # Configuration for bulk_with_proration pricing + # + # @param tiers [Array] Bulk tiers for rating based on total usage volume + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute unit_amount + # Cost per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute tier_lower_bound + # The lower bound for this tier + # + # @return [String, nil] + optional :tier_lower_bound, String, nil?: true + + # @!method initialize(unit_amount:, tier_lower_bound: nil) + # Configuration for a single bulk pricing tier with proration + # + # @param unit_amount [String] Cost per unit + # + # @param tier_lower_bound [String, nil] The lower bound for this tier + end + end + # The cadence to bill for this price on. # # @see Orb::Models::NewSubscriptionBulkWithProrationPrice#cadence @@ -177,6 +216,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewSubscriptionBulkWithProrationPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +227,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionBulkWithProrationPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_subscription_cumulative_grouped_bulk_price.rb b/lib/orb/models/new_subscription_cumulative_grouped_bulk_price.rb index 3b40ad6f..26f035f5 100644 --- a/lib/orb/models/new_subscription_cumulative_grouped_bulk_price.rb +++ b/lib/orb/models/new_subscription_cumulative_grouped_bulk_price.rb @@ -10,9 +10,11 @@ class NewSubscriptionCumulativeGroupedBulkPrice < Orb::Internal::Type::BaseModel required :cadence, enum: -> { Orb::NewSubscriptionCumulativeGroupedBulkPrice::Cadence } # @!attribute cumulative_grouped_bulk_config + # Configuration for cumulative_grouped_bulk pricing # - # @return [Hash{Symbol=>Object}] - required :cumulative_grouped_bulk_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig] + required :cumulative_grouped_bulk_config, + -> { Orb::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig } # @!attribute item_id # The id of the item the price will be associated with. @@ -21,6 +23,7 @@ class NewSubscriptionCumulativeGroupedBulkPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionCumulativeGroupedBulkPrice::ModelType } @@ -126,11 +129,11 @@ class NewSubscriptionCumulativeGroupedBulkPrice < Orb::Internal::Type::BaseModel # # @param cadence [Symbol, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice::Cadence] The cadence to bill for this price on. # - # @param cumulative_grouped_bulk_config [Hash{Symbol=>Object}] + # @param cumulative_grouped_bulk_config [Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig] Configuration for cumulative_grouped_bulk pricing # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -177,6 +180,60 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice#cumulative_grouped_bulk_config + class CumulativeGroupedBulkConfig < Orb::Internal::Type::BaseModel + # @!attribute dimension_values + # Each tier lower bound must have the same group of values. + # + # @return [Array] + required :dimension_values, + -> { Orb::Internal::Type::ArrayOf[Orb::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue] } + + # @!attribute group + # Grouping key name + # + # @return [String] + required :group, String + + # @!method initialize(dimension_values:, group:) + # Configuration for cumulative_grouped_bulk pricing + # + # @param dimension_values [Array] Each tier lower bound must have the same group of values. + # + # @param group [String] Grouping key name + + class DimensionValue < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # Grouping key value + # + # @return [String] + required :grouping_key, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Unit amount for this combination + # + # @return [String] + required :unit_amount, String + + # @!method initialize(grouping_key:, tier_lower_bound:, unit_amount:) + # Configuration for a dimension value entry + # + # @param grouping_key [String] Grouping key value + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Unit amount for this combination + end + end + + # The pricing model type + # # @see Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +243,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_subscription_grouped_allocation_price.rb b/lib/orb/models/new_subscription_grouped_allocation_price.rb index acbfdbe2..a9076e31 100644 --- a/lib/orb/models/new_subscription_grouped_allocation_price.rb +++ b/lib/orb/models/new_subscription_grouped_allocation_price.rb @@ -10,9 +10,11 @@ class NewSubscriptionGroupedAllocationPrice < Orb::Internal::Type::BaseModel required :cadence, enum: -> { Orb::NewSubscriptionGroupedAllocationPrice::Cadence } # @!attribute grouped_allocation_config + # Configuration for grouped_allocation pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_allocation_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewSubscriptionGroupedAllocationPrice::GroupedAllocationConfig] + required :grouped_allocation_config, + -> { Orb::NewSubscriptionGroupedAllocationPrice::GroupedAllocationConfig } # @!attribute item_id # The id of the item the price will be associated with. @@ -21,6 +23,7 @@ class NewSubscriptionGroupedAllocationPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionGroupedAllocationPrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionGroupedAllocationPrice::ModelType } @@ -126,11 +129,11 @@ class NewSubscriptionGroupedAllocationPrice < Orb::Internal::Type::BaseModel # # @param cadence [Symbol, Orb::Models::NewSubscriptionGroupedAllocationPrice::Cadence] The cadence to bill for this price on. # - # @param grouped_allocation_config [Hash{Symbol=>Object}] + # @param grouped_allocation_config [Orb::Models::NewSubscriptionGroupedAllocationPrice::GroupedAllocationConfig] Configuration for grouped_allocation pricing # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionGroupedAllocationPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionGroupedAllocationPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -177,6 +180,38 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewSubscriptionGroupedAllocationPrice#grouped_allocation_config + class GroupedAllocationConfig < Orb::Internal::Type::BaseModel + # @!attribute allocation + # Usage allocation per group + # + # @return [String] + required :allocation, String + + # @!attribute grouping_key + # How to determine the groups that should each be allocated some quantity + # + # @return [String] + required :grouping_key, String + + # @!attribute overage_unit_rate + # Unit rate for post-allocation + # + # @return [String] + required :overage_unit_rate, String + + # @!method initialize(allocation:, grouping_key:, overage_unit_rate:) + # Configuration for grouped_allocation pricing + # + # @param allocation [String] Usage allocation per group + # + # @param grouping_key [String] How to determine the groups that should each be allocated some quantity + # + # @param overage_unit_rate [String] Unit rate for post-allocation + end + + # The pricing model type + # # @see Orb::Models::NewSubscriptionGroupedAllocationPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +221,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionGroupedAllocationPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_subscription_grouped_tiered_package_price.rb b/lib/orb/models/new_subscription_grouped_tiered_package_price.rb index e30c4205..e937c7d3 100644 --- a/lib/orb/models/new_subscription_grouped_tiered_package_price.rb +++ b/lib/orb/models/new_subscription_grouped_tiered_package_price.rb @@ -10,9 +10,11 @@ class NewSubscriptionGroupedTieredPackagePrice < Orb::Internal::Type::BaseModel required :cadence, enum: -> { Orb::NewSubscriptionGroupedTieredPackagePrice::Cadence } # @!attribute grouped_tiered_package_config + # Configuration for grouped_tiered_package pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_tiered_package_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig] + required :grouped_tiered_package_config, + -> { Orb::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig } # @!attribute item_id # The id of the item the price will be associated with. @@ -21,6 +23,7 @@ class NewSubscriptionGroupedTieredPackagePrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionGroupedTieredPackagePrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionGroupedTieredPackagePrice::ModelType } @@ -126,11 +129,11 @@ class NewSubscriptionGroupedTieredPackagePrice < Orb::Internal::Type::BaseModel # # @param cadence [Symbol, Orb::Models::NewSubscriptionGroupedTieredPackagePrice::Cadence] The cadence to bill for this price on. # - # @param grouped_tiered_package_config [Hash{Symbol=>Object}] + # @param grouped_tiered_package_config [Orb::Models::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig] Configuration for grouped_tiered_package pricing # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionGroupedTieredPackagePrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionGroupedTieredPackagePrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -177,6 +180,65 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewSubscriptionGroupedTieredPackagePrice#grouped_tiered_package_config + class GroupedTieredPackageConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before tiering + # + # @return [String] + required :grouping_key, String + + # @!attribute package_size + # Package size + # + # @return [String] + required :package_size, String + + # @!attribute tiers + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier] } + + # @!method initialize(grouping_key:, package_size:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig} + # for more details. + # + # Configuration for grouped_tiered_package pricing + # + # @param grouping_key [String] The event property used to group before tiering + # + # @param package_size [String] Package size + # + # @param tiers [Array] Apply tiered pricing after rounding up the quantity to the package size. Tiers a + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute per_unit + # Price per package + # + # @return [String] + required :per_unit, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!method initialize(per_unit:, tier_lower_bound:) + # Configuration for a single tier + # + # @param per_unit [String] Price per package + # + # @param tier_lower_bound [String] Tier lower bound + end + end + + # The pricing model type + # # @see Orb::Models::NewSubscriptionGroupedTieredPackagePrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +248,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionGroupedTieredPackagePrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_subscription_grouped_tiered_price.rb b/lib/orb/models/new_subscription_grouped_tiered_price.rb index 4339e5bf..8121d728 100644 --- a/lib/orb/models/new_subscription_grouped_tiered_price.rb +++ b/lib/orb/models/new_subscription_grouped_tiered_price.rb @@ -10,9 +10,10 @@ class NewSubscriptionGroupedTieredPrice < Orb::Internal::Type::BaseModel required :cadence, enum: -> { Orb::NewSubscriptionGroupedTieredPrice::Cadence } # @!attribute grouped_tiered_config + # Configuration for grouped_tiered pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_tiered_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig] + required :grouped_tiered_config, -> { Orb::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig } # @!attribute item_id # The id of the item the price will be associated with. @@ -21,6 +22,7 @@ class NewSubscriptionGroupedTieredPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionGroupedTieredPrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionGroupedTieredPrice::ModelType } @@ -126,11 +128,11 @@ class NewSubscriptionGroupedTieredPrice < Orb::Internal::Type::BaseModel # # @param cadence [Symbol, Orb::Models::NewSubscriptionGroupedTieredPrice::Cadence] The cadence to bill for this price on. # - # @param grouped_tiered_config [Hash{Symbol=>Object}] + # @param grouped_tiered_config [Orb::Models::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig] Configuration for grouped_tiered pricing # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionGroupedTieredPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionGroupedTieredPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -177,6 +179,57 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewSubscriptionGroupedTieredPrice#grouped_tiered_config + class GroupedTieredConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The billable metric property used to group before tiering + # + # @return [String] + required :grouping_key, String + + # @!attribute tiers + # Apply tiered pricing to each segment generated after grouping with the provided + # key + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig::Tier] } + + # @!method initialize(grouping_key:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig} for more + # details. + # + # Configuration for grouped_tiered pricing + # + # @param grouping_key [String] The billable metric property used to group before tiering + # + # @param tiers [Array] Apply tiered pricing to each segment generated after grouping with the provided + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tier + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Per unit amount + end + end + + # The pricing model type + # # @see Orb::Models::NewSubscriptionGroupedTieredPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +239,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionGroupedTieredPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_subscription_grouped_with_metered_minimum_price.rb b/lib/orb/models/new_subscription_grouped_with_metered_minimum_price.rb index ac731464..10f79482 100644 --- a/lib/orb/models/new_subscription_grouped_with_metered_minimum_price.rb +++ b/lib/orb/models/new_subscription_grouped_with_metered_minimum_price.rb @@ -10,9 +10,11 @@ class NewSubscriptionGroupedWithMeteredMinimumPrice < Orb::Internal::Type::BaseM required :cadence, enum: -> { Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::Cadence } # @!attribute grouped_with_metered_minimum_config + # Configuration for grouped_with_metered_minimum pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_with_metered_minimum_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig] + required :grouped_with_metered_minimum_config, + -> { Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig } # @!attribute item_id # The id of the item the price will be associated with. @@ -21,6 +23,7 @@ class NewSubscriptionGroupedWithMeteredMinimumPrice < Orb::Internal::Type::BaseM required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::ModelType } @@ -126,11 +129,11 @@ class NewSubscriptionGroupedWithMeteredMinimumPrice < Orb::Internal::Type::BaseM # # @param cadence [Symbol, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice::Cadence] The cadence to bill for this price on. # - # @param grouped_with_metered_minimum_config [Hash{Symbol=>Object}] + # @param grouped_with_metered_minimum_config [Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig] Configuration for grouped_with_metered_minimum pricing # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -177,6 +180,112 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice#grouped_with_metered_minimum_config + class GroupedWithMeteredMinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # Used to partition the usage into groups. The minimum amount is applied to each + # group. + # + # @return [String] + required :grouping_key, String + + # @!attribute minimum_unit_amount + # The minimum amount to charge per group per unit + # + # @return [String] + required :minimum_unit_amount, String + + # @!attribute pricing_key + # Used to determine the unit rate + # + # @return [String] + required :pricing_key, String + + # @!attribute scaling_factors + # Scale the unit rates by the scaling factor. + # + # @return [Array] + required :scaling_factors, + -> { Orb::Internal::Type::ArrayOf[Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor] } + + # @!attribute scaling_key + # Used to determine the unit rate scaling factor + # + # @return [String] + required :scaling_key, String + + # @!attribute unit_amounts + # Apply per unit pricing to each pricing value. The minimum amount is applied any + # unmatched usage. + # + # @return [Array] + required :unit_amounts, + -> { Orb::Internal::Type::ArrayOf[Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount] } + + # @!method initialize(grouping_key:, minimum_unit_amount:, pricing_key:, scaling_factors:, scaling_key:, unit_amounts:) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig} + # for more details. + # + # Configuration for grouped_with_metered_minimum pricing + # + # @param grouping_key [String] Used to partition the usage into groups. The minimum amount is applied to each g + # + # @param minimum_unit_amount [String] The minimum amount to charge per group per unit + # + # @param pricing_key [String] Used to determine the unit rate + # + # @param scaling_factors [Array] Scale the unit rates by the scaling factor. + # + # @param scaling_key [String] Used to determine the unit rate scaling factor + # + # @param unit_amounts [Array] Apply per unit pricing to each pricing value. The minimum amount is applied any + + class ScalingFactor < Orb::Internal::Type::BaseModel + # @!attribute scaling_factor + # Scaling factor + # + # @return [String] + required :scaling_factor, String + + # @!attribute scaling_value + # Scaling value + # + # @return [String] + required :scaling_value, String + + # @!method initialize(scaling_factor:, scaling_value:) + # Configuration for a scaling factor + # + # @param scaling_factor [String] Scaling factor + # + # @param scaling_value [String] Scaling value + end + + class UnitAmount < Orb::Internal::Type::BaseModel + # @!attribute pricing_value + # Pricing value + # + # @return [String] + required :pricing_value, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(pricing_value:, unit_amount:) + # Configuration for a unit amount + # + # @param pricing_value [String] Pricing value + # + # @param unit_amount [String] Per unit amount + end + end + + # The pricing model type + # # @see Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +295,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_subscription_grouped_with_prorated_minimum_price.rb b/lib/orb/models/new_subscription_grouped_with_prorated_minimum_price.rb index ab3ea7c1..877209d7 100644 --- a/lib/orb/models/new_subscription_grouped_with_prorated_minimum_price.rb +++ b/lib/orb/models/new_subscription_grouped_with_prorated_minimum_price.rb @@ -10,9 +10,11 @@ class NewSubscriptionGroupedWithProratedMinimumPrice < Orb::Internal::Type::Base required :cadence, enum: -> { Orb::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence } # @!attribute grouped_with_prorated_minimum_config + # Configuration for grouped_with_prorated_minimum pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_with_prorated_minimum_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig] + required :grouped_with_prorated_minimum_config, + -> { Orb::NewSubscriptionGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig } # @!attribute item_id # The id of the item the price will be associated with. @@ -21,6 +23,7 @@ class NewSubscriptionGroupedWithProratedMinimumPrice < Orb::Internal::Type::Base required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionGroupedWithProratedMinimumPrice::ModelType } @@ -126,11 +129,11 @@ class NewSubscriptionGroupedWithProratedMinimumPrice < Orb::Internal::Type::Base # # @param cadence [Symbol, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence] The cadence to bill for this price on. # - # @param grouped_with_prorated_minimum_config [Hash{Symbol=>Object}] + # @param grouped_with_prorated_minimum_config [Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig] Configuration for grouped_with_prorated_minimum pricing # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -177,6 +180,38 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice#grouped_with_prorated_minimum_config + class GroupedWithProratedMinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # How to determine the groups that should each have a minimum + # + # @return [String] + required :grouping_key, String + + # @!attribute minimum + # The minimum amount to charge per group + # + # @return [String] + required :minimum, String + + # @!attribute unit_rate + # The amount to charge per unit + # + # @return [String] + required :unit_rate, String + + # @!method initialize(grouping_key:, minimum:, unit_rate:) + # Configuration for grouped_with_prorated_minimum pricing + # + # @param grouping_key [String] How to determine the groups that should each have a minimum + # + # @param minimum [String] The minimum amount to charge per group + # + # @param unit_rate [String] The amount to charge per unit + end + + # The pricing model type + # # @see Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +221,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_subscription_matrix_price.rb b/lib/orb/models/new_subscription_matrix_price.rb index ce963e9d..32caabd8 100644 --- a/lib/orb/models/new_subscription_matrix_price.rb +++ b/lib/orb/models/new_subscription_matrix_price.rb @@ -16,11 +16,13 @@ class NewSubscriptionMatrixPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute matrix_config + # Configuration for matrix pricing # # @return [Orb::Models::MatrixConfig] required :matrix_config, -> { Orb::MatrixConfig } # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionMatrixPrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionMatrixPrice::ModelType } @@ -128,9 +130,9 @@ class NewSubscriptionMatrixPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param matrix_config [Orb::Models::MatrixConfig] + # @param matrix_config [Orb::Models::MatrixConfig] Configuration for matrix pricing # - # @param model_type [Symbol, Orb::Models::NewSubscriptionMatrixPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionMatrixPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -177,6 +179,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewSubscriptionMatrixPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +190,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionMatrixPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_subscription_matrix_with_allocation_price.rb b/lib/orb/models/new_subscription_matrix_with_allocation_price.rb index 89cc310a..7dba2894 100644 --- a/lib/orb/models/new_subscription_matrix_with_allocation_price.rb +++ b/lib/orb/models/new_subscription_matrix_with_allocation_price.rb @@ -16,11 +16,13 @@ class NewSubscriptionMatrixWithAllocationPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute matrix_with_allocation_config + # Configuration for matrix_with_allocation pricing # # @return [Orb::Models::MatrixWithAllocationConfig] required :matrix_with_allocation_config, -> { Orb::MatrixWithAllocationConfig } # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionMatrixWithAllocationPrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionMatrixWithAllocationPrice::ModelType } @@ -128,9 +130,9 @@ class NewSubscriptionMatrixWithAllocationPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param matrix_with_allocation_config [Orb::Models::MatrixWithAllocationConfig] + # @param matrix_with_allocation_config [Orb::Models::MatrixWithAllocationConfig] Configuration for matrix_with_allocation pricing # - # @param model_type [Symbol, Orb::Models::NewSubscriptionMatrixWithAllocationPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionMatrixWithAllocationPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -177,6 +179,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewSubscriptionMatrixWithAllocationPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +190,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionMatrixWithAllocationPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_subscription_matrix_with_display_name_price.rb b/lib/orb/models/new_subscription_matrix_with_display_name_price.rb index 3fa1a290..40b3c03d 100644 --- a/lib/orb/models/new_subscription_matrix_with_display_name_price.rb +++ b/lib/orb/models/new_subscription_matrix_with_display_name_price.rb @@ -16,11 +16,14 @@ class NewSubscriptionMatrixWithDisplayNamePrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute matrix_with_display_name_config + # Configuration for matrix_with_display_name pricing # - # @return [Hash{Symbol=>Object}] - required :matrix_with_display_name_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig] + required :matrix_with_display_name_config, + -> { Orb::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig } # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionMatrixWithDisplayNamePrice::ModelType } @@ -128,9 +131,9 @@ class NewSubscriptionMatrixWithDisplayNamePrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param matrix_with_display_name_config [Hash{Symbol=>Object}] + # @param matrix_with_display_name_config [Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig] Configuration for matrix_with_display_name pricing # - # @param model_type [Symbol, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -177,6 +180,60 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice#matrix_with_display_name_config + class MatrixWithDisplayNameConfig < Orb::Internal::Type::BaseModel + # @!attribute dimension + # Used to determine the unit rate + # + # @return [String] + required :dimension, String + + # @!attribute unit_amounts + # Apply per unit pricing to each dimension value + # + # @return [Array] + required :unit_amounts, + -> { Orb::Internal::Type::ArrayOf[Orb::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount] } + + # @!method initialize(dimension:, unit_amounts:) + # Configuration for matrix_with_display_name pricing + # + # @param dimension [String] Used to determine the unit rate + # + # @param unit_amounts [Array] Apply per unit pricing to each dimension value + + class UnitAmount < Orb::Internal::Type::BaseModel + # @!attribute dimension_value + # The dimension value + # + # @return [String] + required :dimension_value, String + + # @!attribute display_name + # Display name for this dimension value + # + # @return [String] + required :display_name, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(dimension_value:, display_name:, unit_amount:) + # Configuration for a unit amount item + # + # @param dimension_value [String] The dimension value + # + # @param display_name [String] Display name for this dimension value + # + # @param unit_amount [String] Per unit amount + end + end + + # The pricing model type + # # @see Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +243,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_subscription_max_group_tiered_package_price.rb b/lib/orb/models/new_subscription_max_group_tiered_package_price.rb index dc32adb5..d9b8b344 100644 --- a/lib/orb/models/new_subscription_max_group_tiered_package_price.rb +++ b/lib/orb/models/new_subscription_max_group_tiered_package_price.rb @@ -16,11 +16,14 @@ class NewSubscriptionMaxGroupTieredPackagePrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute max_group_tiered_package_config + # Configuration for max_group_tiered_package pricing # - # @return [Hash{Symbol=>Object}] - required :max_group_tiered_package_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig] + required :max_group_tiered_package_config, + -> { Orb::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig } # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionMaxGroupTieredPackagePrice::ModelType } @@ -128,9 +131,9 @@ class NewSubscriptionMaxGroupTieredPackagePrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param max_group_tiered_package_config [Hash{Symbol=>Object}] + # @param max_group_tiered_package_config [Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig] Configuration for max_group_tiered_package pricing # - # @param model_type [Symbol, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -177,6 +180,64 @@ module Cadence # @return [Array] end + # @see Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice#max_group_tiered_package_config + class MaxGroupTieredPackageConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before tiering the group with the highest value + # + # @return [String] + required :grouping_key, String + + # @!attribute package_size + # Package size + # + # @return [String] + required :package_size, String + + # @!attribute tiers + # Apply tiered pricing to the largest group after grouping with the provided key. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier] } + + # @!method initialize(grouping_key:, package_size:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig} + # for more details. + # + # Configuration for max_group_tiered_package pricing + # + # @param grouping_key [String] The event property used to group before tiering the group with the highest value + # + # @param package_size [String] Package size + # + # @param tiers [Array] Apply tiered pricing to the largest group after grouping with the provided key. + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tier + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Per unit amount + end + end + + # The pricing model type + # # @see Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +247,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_subscription_bulk_bps_price.rb b/lib/orb/models/new_subscription_minimum_composite_price.rb similarity index 71% rename from lib/orb/models/new_subscription_bulk_bps_price.rb rename to lib/orb/models/new_subscription_minimum_composite_price.rb index c9824344..c0a7b342 100644 --- a/lib/orb/models/new_subscription_bulk_bps_price.rb +++ b/lib/orb/models/new_subscription_minimum_composite_price.rb @@ -2,17 +2,12 @@ module Orb module Models - class NewSubscriptionBulkBPSPrice < Orb::Internal::Type::BaseModel - # @!attribute bulk_bps_config - # - # @return [Orb::Models::BulkBPSConfig] - required :bulk_bps_config, -> { Orb::BulkBPSConfig } - + class NewSubscriptionMinimumCompositePrice < Orb::Internal::Type::BaseModel # @!attribute cadence # The cadence to bill for this price on. # - # @return [Symbol, Orb::Models::NewSubscriptionBulkBPSPrice::Cadence] - required :cadence, enum: -> { Orb::NewSubscriptionBulkBPSPrice::Cadence } + # @return [Symbol, Orb::Models::NewSubscriptionMinimumCompositePrice::Cadence] + required :cadence, enum: -> { Orb::NewSubscriptionMinimumCompositePrice::Cadence } # @!attribute item_id # The id of the item the price will be associated with. @@ -20,10 +15,17 @@ class NewSubscriptionBulkBPSPrice < Orb::Internal::Type::BaseModel # @return [String] required :item_id, String + # @!attribute minimum_config + # Configuration for minimum pricing + # + # @return [Orb::Models::NewSubscriptionMinimumCompositePrice::MinimumConfig] + required :minimum_config, -> { Orb::NewSubscriptionMinimumCompositePrice::MinimumConfig } + # @!attribute model_type + # The pricing model type # - # @return [Symbol, Orb::Models::NewSubscriptionBulkBPSPrice::ModelType] - required :model_type, enum: -> { Orb::NewSubscriptionBulkBPSPrice::ModelType } + # @return [Symbol, Orb::Models::NewSubscriptionMinimumCompositePrice::ModelType] + required :model_type, enum: -> { Orb::NewSubscriptionMinimumCompositePrice::ModelType } # @!attribute name # The name of the price. @@ -63,7 +65,7 @@ class NewSubscriptionBulkBPSPrice < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] optional :conversion_rate_config, - union: -> { Orb::NewSubscriptionBulkBPSPrice::ConversionRateConfig }, + union: -> { Orb::NewSubscriptionMinimumCompositePrice::ConversionRateConfig }, nil?: true # @!attribute currency @@ -120,17 +122,17 @@ class NewSubscriptionBulkBPSPrice < Orb::Internal::Type::BaseModel # @return [String, nil] optional :reference_id, String, nil?: true - # @!method initialize(bulk_bps_config:, cadence:, item_id:, model_type:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil) + # @!method initialize(cadence:, item_id:, minimum_config:, model_type:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil) # Some parameter documentations has been truncated, see - # {Orb::Models::NewSubscriptionBulkBPSPrice} for more details. + # {Orb::Models::NewSubscriptionMinimumCompositePrice} for more details. # - # @param bulk_bps_config [Orb::Models::BulkBPSConfig] - # - # @param cadence [Symbol, Orb::Models::NewSubscriptionBulkBPSPrice::Cadence] The cadence to bill for this price on. + # @param cadence [Symbol, Orb::Models::NewSubscriptionMinimumCompositePrice::Cadence] The cadence to bill for this price on. # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionBulkBPSPrice::ModelType] + # @param minimum_config [Orb::Models::NewSubscriptionMinimumCompositePrice::MinimumConfig] Configuration for minimum pricing + # + # @param model_type [Symbol, Orb::Models::NewSubscriptionMinimumCompositePrice::ModelType] The pricing model type # # @param name [String] The name of the price. # @@ -162,7 +164,7 @@ class NewSubscriptionBulkBPSPrice < Orb::Internal::Type::BaseModel # The cadence to bill for this price on. # - # @see Orb::Models::NewSubscriptionBulkBPSPrice#cadence + # @see Orb::Models::NewSubscriptionMinimumCompositePrice#cadence module Cadence extend Orb::Internal::Type::Enum @@ -177,31 +179,39 @@ module Cadence # @return [Array] end - # @see Orb::Models::NewSubscriptionBulkBPSPrice#model_type + # @see Orb::Models::NewSubscriptionMinimumCompositePrice#minimum_config + class MinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute minimum_amount + # The minimum amount to apply + # + # @return [String] + required :minimum_amount, String + + # @!attribute prorated + # If true, subtotals from this price are prorated based on the service period + # + # @return [Boolean, nil] + optional :prorated, Orb::Internal::Type::Boolean + + # @!method initialize(minimum_amount:, prorated: nil) + # Configuration for minimum pricing + # + # @param minimum_amount [String] The minimum amount to apply + # + # @param prorated [Boolean] If true, subtotals from this price are prorated based on the service period + end + + # The pricing model type + # + # @see Orb::Models::NewSubscriptionMinimumCompositePrice#model_type module ModelType extend Orb::Internal::Type::Enum - BULK_BPS = :bulk_bps + MINIMUM = :minimum # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionBulkBPSPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_subscription_package_price.rb b/lib/orb/models/new_subscription_package_price.rb index d8c94174..d559ba9c 100644 --- a/lib/orb/models/new_subscription_package_price.rb +++ b/lib/orb/models/new_subscription_package_price.rb @@ -16,6 +16,7 @@ class NewSubscriptionPackagePrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionPackagePrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionPackagePrice::ModelType } @@ -27,6 +28,7 @@ class NewSubscriptionPackagePrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute package_config + # Configuration for package pricing # # @return [Orb::Models::PackageConfig] required :package_config, -> { Orb::PackageConfig } @@ -128,11 +130,11 @@ class NewSubscriptionPackagePrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionPackagePrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionPackagePrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param package_config [Orb::Models::PackageConfig] + # @param package_config [Orb::Models::PackageConfig] Configuration for package pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -177,6 +179,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewSubscriptionPackagePrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +190,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionPackagePrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_subscription_package_with_allocation_price.rb b/lib/orb/models/new_subscription_package_with_allocation_price.rb index c61b563a..161fa710 100644 --- a/lib/orb/models/new_subscription_package_with_allocation_price.rb +++ b/lib/orb/models/new_subscription_package_with_allocation_price.rb @@ -16,6 +16,7 @@ class NewSubscriptionPackageWithAllocationPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionPackageWithAllocationPrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionPackageWithAllocationPrice::ModelType } @@ -27,9 +28,11 @@ class NewSubscriptionPackageWithAllocationPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute package_with_allocation_config + # Configuration for package_with_allocation pricing # - # @return [Hash{Symbol=>Object}] - required :package_with_allocation_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewSubscriptionPackageWithAllocationPrice::PackageWithAllocationConfig] + required :package_with_allocation_config, + -> { Orb::NewSubscriptionPackageWithAllocationPrice::PackageWithAllocationConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -128,11 +131,11 @@ class NewSubscriptionPackageWithAllocationPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionPackageWithAllocationPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionPackageWithAllocationPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param package_with_allocation_config [Hash{Symbol=>Object}] + # @param package_with_allocation_config [Orb::Models::NewSubscriptionPackageWithAllocationPrice::PackageWithAllocationConfig] Configuration for package_with_allocation pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -177,6 +180,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewSubscriptionPackageWithAllocationPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -187,20 +192,34 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionPackageWithAllocationPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::NewSubscriptionPackageWithAllocationPrice#package_with_allocation_config + class PackageWithAllocationConfig < Orb::Internal::Type::BaseModel + # @!attribute allocation + # Usage allocation + # + # @return [String] + required :allocation, String + + # @!attribute package_amount + # Price per package + # + # @return [String] + required :package_amount, String + + # @!attribute package_size + # Package size + # + # @return [String] + required :package_size, String + + # @!method initialize(allocation:, package_amount:, package_size:) + # Configuration for package_with_allocation pricing + # + # @param allocation [String] Usage allocation + # + # @param package_amount [String] Price per package + # + # @param package_size [String] Package size end end end diff --git a/lib/orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rb b/lib/orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rb index 931e2dbf..f060c587 100644 --- a/lib/orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rb +++ b/lib/orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rb @@ -16,6 +16,7 @@ class NewSubscriptionScalableMatrixWithTieredPricingPrice < Orb::Internal::Type: required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ModelType } @@ -27,10 +28,11 @@ class NewSubscriptionScalableMatrixWithTieredPricingPrice < Orb::Internal::Type: required :name, String # @!attribute scalable_matrix_with_tiered_pricing_config + # Configuration for scalable_matrix_with_tiered_pricing pricing # - # @return [Hash{Symbol=>Object}] + # @return [Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig] required :scalable_matrix_with_tiered_pricing_config, - Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + -> { Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -130,11 +132,11 @@ class NewSubscriptionScalableMatrixWithTieredPricingPrice < Orb::Internal::Type: # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param scalable_matrix_with_tiered_pricing_config [Hash{Symbol=>Object}] + # @param scalable_matrix_with_tiered_pricing_config [Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig] Configuration for scalable_matrix_with_tiered_pricing pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -179,6 +181,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -189,20 +193,98 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union + # @see Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice#scalable_matrix_with_tiered_pricing_config + class ScalableMatrixWithTieredPricingConfig < Orb::Internal::Type::BaseModel + # @!attribute first_dimension + # Used for the scalable matrix first dimension + # + # @return [String] + required :first_dimension, String + + # @!attribute matrix_scaling_factors + # Apply a scaling factor to each dimension + # + # @return [Array] + required :matrix_scaling_factors, + -> do + Orb::Internal::Type::ArrayOf[ + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor + ] + end + + # @!attribute tiers + # Tier pricing structure + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier] } + + # @!attribute second_dimension + # Used for the scalable matrix second dimension (optional) + # + # @return [String, nil] + optional :second_dimension, String, nil?: true + + # @!method initialize(first_dimension:, matrix_scaling_factors:, tiers:, second_dimension: nil) + # Configuration for scalable_matrix_with_tiered_pricing pricing + # + # @param first_dimension [String] Used for the scalable matrix first dimension + # + # @param matrix_scaling_factors [Array] Apply a scaling factor to each dimension + # + # @param tiers [Array] Tier pricing structure + # + # @param second_dimension [String, nil] Used for the scalable matrix second dimension (optional) + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + # @!attribute first_dimension_value + # First dimension value + # + # @return [String] + required :first_dimension_value, String + + # @!attribute scaling_factor + # Scaling factor + # + # @return [String] + required :scaling_factor, String + + # @!attribute second_dimension_value + # Second dimension value (optional) + # + # @return [String, nil] + optional :second_dimension_value, String, nil?: true - discriminator :conversion_rate_type + # @!method initialize(first_dimension_value:, scaling_factor:, second_dimension_value: nil) + # Configuration for a single matrix scaling factor + # + # @param first_dimension_value [String] First dimension value + # + # @param scaling_factor [String] Scaling factor + # + # @param second_dimension_value [String, nil] Second dimension value (optional) + end - variant :unit, -> { Orb::UnitConversionRateConfig } + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String - variant :tiered, -> { Orb::TieredConversionRateConfig } + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tier entry with business logic + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Per unit amount + end end end end diff --git a/lib/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rb b/lib/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rb index 5910080d..f909c86e 100644 --- a/lib/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rb +++ b/lib/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rb @@ -16,6 +16,7 @@ class NewSubscriptionScalableMatrixWithUnitPricingPrice < Orb::Internal::Type::B required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ModelType } @@ -27,10 +28,11 @@ class NewSubscriptionScalableMatrixWithUnitPricingPrice < Orb::Internal::Type::B required :name, String # @!attribute scalable_matrix_with_unit_pricing_config + # Configuration for scalable_matrix_with_unit_pricing pricing # - # @return [Hash{Symbol=>Object}] + # @return [Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig] required :scalable_matrix_with_unit_pricing_config, - Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + -> { Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -130,11 +132,11 @@ class NewSubscriptionScalableMatrixWithUnitPricingPrice < Orb::Internal::Type::B # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param scalable_matrix_with_unit_pricing_config [Hash{Symbol=>Object}] + # @param scalable_matrix_with_unit_pricing_config [Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig] Configuration for scalable_matrix_with_unit_pricing pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -179,6 +181,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -189,20 +193,84 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union + # @see Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice#scalable_matrix_with_unit_pricing_config + class ScalableMatrixWithUnitPricingConfig < Orb::Internal::Type::BaseModel + # @!attribute first_dimension + # Used to determine the unit rate + # + # @return [String] + required :first_dimension, String + + # @!attribute matrix_scaling_factors + # Apply a scaling factor to each dimension + # + # @return [Array] + required :matrix_scaling_factors, + -> do + Orb::Internal::Type::ArrayOf[ + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor + ] + end + + # @!attribute unit_price + # The final unit price to rate against the output of the matrix + # + # @return [String] + required :unit_price, String + + # @!attribute prorate + # If true, the unit price will be prorated to the billing period + # + # @return [Boolean, nil] + optional :prorate, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute second_dimension + # Used to determine the unit rate (optional) + # + # @return [String, nil] + optional :second_dimension, String, nil?: true + + # @!method initialize(first_dimension:, matrix_scaling_factors:, unit_price:, prorate: nil, second_dimension: nil) + # Configuration for scalable_matrix_with_unit_pricing pricing + # + # @param first_dimension [String] Used to determine the unit rate + # + # @param matrix_scaling_factors [Array] Apply a scaling factor to each dimension + # + # @param unit_price [String] The final unit price to rate against the output of the matrix + # + # @param prorate [Boolean, nil] If true, the unit price will be prorated to the billing period + # + # @param second_dimension [String, nil] Used to determine the unit rate (optional) - discriminator :conversion_rate_type + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + # @!attribute first_dimension_value + # First dimension value + # + # @return [String] + required :first_dimension_value, String - variant :unit, -> { Orb::UnitConversionRateConfig } + # @!attribute scaling_factor + # Scaling factor + # + # @return [String] + required :scaling_factor, String - variant :tiered, -> { Orb::TieredConversionRateConfig } + # @!attribute second_dimension_value + # Second dimension value (optional) + # + # @return [String, nil] + optional :second_dimension_value, String, nil?: true - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @!method initialize(first_dimension_value:, scaling_factor:, second_dimension_value: nil) + # Configuration for a single matrix scaling factor + # + # @param first_dimension_value [String] First dimension value + # + # @param scaling_factor [String] Scaling factor + # + # @param second_dimension_value [String, nil] Second dimension value (optional) + end end end end diff --git a/lib/orb/models/new_subscription_threshold_total_amount_price.rb b/lib/orb/models/new_subscription_threshold_total_amount_price.rb index c68e0f4f..7382775e 100644 --- a/lib/orb/models/new_subscription_threshold_total_amount_price.rb +++ b/lib/orb/models/new_subscription_threshold_total_amount_price.rb @@ -16,6 +16,7 @@ class NewSubscriptionThresholdTotalAmountPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionThresholdTotalAmountPrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionThresholdTotalAmountPrice::ModelType } @@ -27,9 +28,11 @@ class NewSubscriptionThresholdTotalAmountPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute threshold_total_amount_config + # Configuration for threshold_total_amount pricing # - # @return [Hash{Symbol=>Object}] - required :threshold_total_amount_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig] + required :threshold_total_amount_config, + -> { Orb::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -128,11 +131,11 @@ class NewSubscriptionThresholdTotalAmountPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionThresholdTotalAmountPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionThresholdTotalAmountPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param threshold_total_amount_config [Hash{Symbol=>Object}] + # @param threshold_total_amount_config [Orb::Models::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig] Configuration for threshold_total_amount pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -177,6 +180,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewSubscriptionThresholdTotalAmountPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -187,20 +192,53 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionThresholdTotalAmountPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::NewSubscriptionThresholdTotalAmountPrice#threshold_total_amount_config + class ThresholdTotalAmountConfig < Orb::Internal::Type::BaseModel + # @!attribute consumption_table + # When the quantity consumed passes a provided threshold, the configured total + # will be charged + # + # @return [Array] + required :consumption_table, + -> { Orb::Internal::Type::ArrayOf[Orb::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable] } + + # @!attribute prorate + # If true, the unit price will be prorated to the billing period + # + # @return [Boolean, nil] + optional :prorate, Orb::Internal::Type::Boolean, nil?: true + + # @!method initialize(consumption_table:, prorate: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig} + # for more details. + # + # Configuration for threshold_total_amount pricing + # + # @param consumption_table [Array] When the quantity consumed passes a provided threshold, the configured total wil + # + # @param prorate [Boolean, nil] If true, the unit price will be prorated to the billing period + + class ConsumptionTable < Orb::Internal::Type::BaseModel + # @!attribute threshold + # Quantity threshold + # + # @return [String] + required :threshold, String + + # @!attribute total_amount + # Total amount for this threshold + # + # @return [String] + required :total_amount, String + + # @!method initialize(threshold:, total_amount:) + # Configuration for a single threshold + # + # @param threshold [String] Quantity threshold + # + # @param total_amount [String] Total amount for this threshold + end end end end diff --git a/lib/orb/models/new_subscription_tier_with_proration_price.rb b/lib/orb/models/new_subscription_tier_with_proration_price.rb deleted file mode 100644 index 94d868a6..00000000 --- a/lib/orb/models/new_subscription_tier_with_proration_price.rb +++ /dev/null @@ -1,207 +0,0 @@ -# frozen_string_literal: true - -module Orb - module Models - class NewSubscriptionTierWithProrationPrice < Orb::Internal::Type::BaseModel - # @!attribute cadence - # The cadence to bill for this price on. - # - # @return [Symbol, Orb::Models::NewSubscriptionTierWithProrationPrice::Cadence] - required :cadence, enum: -> { Orb::NewSubscriptionTierWithProrationPrice::Cadence } - - # @!attribute item_id - # The id of the item the price will be associated with. - # - # @return [String] - required :item_id, String - - # @!attribute model_type - # - # @return [Symbol, Orb::Models::NewSubscriptionTierWithProrationPrice::ModelType] - required :model_type, enum: -> { Orb::NewSubscriptionTierWithProrationPrice::ModelType } - - # @!attribute name - # The name of the price. - # - # @return [String] - required :name, String - - # @!attribute tiered_with_proration_config - # - # @return [Hash{Symbol=>Object}] - required :tiered_with_proration_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] - - # @!attribute billable_metric_id - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - # - # @return [String, nil] - optional :billable_metric_id, String, nil?: true - - # @!attribute billed_in_advance - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - # - # @return [Boolean, nil] - optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true - - # @!attribute billing_cycle_configuration - # For custom cadence: specifies the duration of the billing period in days or - # months. - # - # @return [Orb::Models::NewBillingCycleConfiguration, nil] - optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true - - # @!attribute conversion_rate - # The per unit conversion rate of the price currency to the invoicing currency. - # - # @return [Float, nil] - optional :conversion_rate, Float, nil?: true - - # @!attribute conversion_rate_config - # The configuration for the rate of the price currency to the invoicing currency. - # - # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - optional :conversion_rate_config, - union: -> { Orb::NewSubscriptionTierWithProrationPrice::ConversionRateConfig }, - nil?: true - - # @!attribute currency - # An ISO 4217 currency string, or custom pricing unit identifier, in which this - # price is billed. - # - # @return [String, nil] - optional :currency, String, nil?: true - - # @!attribute dimensional_price_configuration - # For dimensional price: specifies a price group and dimension values - # - # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] - optional :dimensional_price_configuration, -> { Orb::NewDimensionalPriceConfiguration }, nil?: true - - # @!attribute external_price_id - # An alias for the price. - # - # @return [String, nil] - optional :external_price_id, String, nil?: true - - # @!attribute fixed_price_quantity - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - # - # @return [Float, nil] - optional :fixed_price_quantity, Float, nil?: true - - # @!attribute invoice_grouping_key - # The property used to group this price on an invoice - # - # @return [String, nil] - optional :invoice_grouping_key, String, nil?: true - - # @!attribute invoicing_cycle_configuration - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - # - # @return [Orb::Models::NewBillingCycleConfiguration, nil] - optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true - - # @!attribute metadata - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - # - # @return [Hash{Symbol=>String, nil}, nil] - optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true - - # @!attribute reference_id - # A transient ID that can be used to reference this price when adding adjustments - # in the same API call. - # - # @return [String, nil] - optional :reference_id, String, nil?: true - - # @!method initialize(cadence:, item_id:, model_type:, name:, tiered_with_proration_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil) - # Some parameter documentations has been truncated, see - # {Orb::Models::NewSubscriptionTierWithProrationPrice} for more details. - # - # @param cadence [Symbol, Orb::Models::NewSubscriptionTierWithProrationPrice::Cadence] The cadence to bill for this price on. - # - # @param item_id [String] The id of the item the price will be associated with. - # - # @param model_type [Symbol, Orb::Models::NewSubscriptionTierWithProrationPrice::ModelType] - # - # @param name [String] The name of the price. - # - # @param tiered_with_proration_config [Hash{Symbol=>Object}] - # - # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b - # - # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi - # - # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont - # - # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. - # - # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. - # - # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr - # - # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values - # - # @param external_price_id [String, nil] An alias for the price. - # - # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl - # - # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice - # - # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. - # - # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed - # - # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments - - # The cadence to bill for this price on. - # - # @see Orb::Models::NewSubscriptionTierWithProrationPrice#cadence - module Cadence - extend Orb::Internal::Type::Enum - - ANNUAL = :annual - SEMI_ANNUAL = :semi_annual - MONTHLY = :monthly - QUARTERLY = :quarterly - ONE_TIME = :one_time - CUSTOM = :custom - - # @!method self.values - # @return [Array] - end - - # @see Orb::Models::NewSubscriptionTierWithProrationPrice#model_type - module ModelType - extend Orb::Internal::Type::Enum - - TIERED_WITH_PRORATION = :tiered_with_proration - - # @!method self.values - # @return [Array] - end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionTierWithProrationPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - end - end -end diff --git a/lib/orb/models/new_subscription_tiered_bps_price.rb b/lib/orb/models/new_subscription_tiered_bps_price.rb deleted file mode 100644 index e3ac3f15..00000000 --- a/lib/orb/models/new_subscription_tiered_bps_price.rb +++ /dev/null @@ -1,207 +0,0 @@ -# frozen_string_literal: true - -module Orb - module Models - class NewSubscriptionTieredBPSPrice < Orb::Internal::Type::BaseModel - # @!attribute cadence - # The cadence to bill for this price on. - # - # @return [Symbol, Orb::Models::NewSubscriptionTieredBPSPrice::Cadence] - required :cadence, enum: -> { Orb::NewSubscriptionTieredBPSPrice::Cadence } - - # @!attribute item_id - # The id of the item the price will be associated with. - # - # @return [String] - required :item_id, String - - # @!attribute model_type - # - # @return [Symbol, Orb::Models::NewSubscriptionTieredBPSPrice::ModelType] - required :model_type, enum: -> { Orb::NewSubscriptionTieredBPSPrice::ModelType } - - # @!attribute name - # The name of the price. - # - # @return [String] - required :name, String - - # @!attribute tiered_bps_config - # - # @return [Orb::Models::TieredBPSConfig] - required :tiered_bps_config, -> { Orb::TieredBPSConfig } - - # @!attribute billable_metric_id - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - # - # @return [String, nil] - optional :billable_metric_id, String, nil?: true - - # @!attribute billed_in_advance - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - # - # @return [Boolean, nil] - optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true - - # @!attribute billing_cycle_configuration - # For custom cadence: specifies the duration of the billing period in days or - # months. - # - # @return [Orb::Models::NewBillingCycleConfiguration, nil] - optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true - - # @!attribute conversion_rate - # The per unit conversion rate of the price currency to the invoicing currency. - # - # @return [Float, nil] - optional :conversion_rate, Float, nil?: true - - # @!attribute conversion_rate_config - # The configuration for the rate of the price currency to the invoicing currency. - # - # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - optional :conversion_rate_config, - union: -> { Orb::NewSubscriptionTieredBPSPrice::ConversionRateConfig }, - nil?: true - - # @!attribute currency - # An ISO 4217 currency string, or custom pricing unit identifier, in which this - # price is billed. - # - # @return [String, nil] - optional :currency, String, nil?: true - - # @!attribute dimensional_price_configuration - # For dimensional price: specifies a price group and dimension values - # - # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] - optional :dimensional_price_configuration, -> { Orb::NewDimensionalPriceConfiguration }, nil?: true - - # @!attribute external_price_id - # An alias for the price. - # - # @return [String, nil] - optional :external_price_id, String, nil?: true - - # @!attribute fixed_price_quantity - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - # - # @return [Float, nil] - optional :fixed_price_quantity, Float, nil?: true - - # @!attribute invoice_grouping_key - # The property used to group this price on an invoice - # - # @return [String, nil] - optional :invoice_grouping_key, String, nil?: true - - # @!attribute invoicing_cycle_configuration - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - # - # @return [Orb::Models::NewBillingCycleConfiguration, nil] - optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true - - # @!attribute metadata - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - # - # @return [Hash{Symbol=>String, nil}, nil] - optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true - - # @!attribute reference_id - # A transient ID that can be used to reference this price when adding adjustments - # in the same API call. - # - # @return [String, nil] - optional :reference_id, String, nil?: true - - # @!method initialize(cadence:, item_id:, model_type:, name:, tiered_bps_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil) - # Some parameter documentations has been truncated, see - # {Orb::Models::NewSubscriptionTieredBPSPrice} for more details. - # - # @param cadence [Symbol, Orb::Models::NewSubscriptionTieredBPSPrice::Cadence] The cadence to bill for this price on. - # - # @param item_id [String] The id of the item the price will be associated with. - # - # @param model_type [Symbol, Orb::Models::NewSubscriptionTieredBPSPrice::ModelType] - # - # @param name [String] The name of the price. - # - # @param tiered_bps_config [Orb::Models::TieredBPSConfig] - # - # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b - # - # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi - # - # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont - # - # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. - # - # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. - # - # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr - # - # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values - # - # @param external_price_id [String, nil] An alias for the price. - # - # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl - # - # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice - # - # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. - # - # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed - # - # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments - - # The cadence to bill for this price on. - # - # @see Orb::Models::NewSubscriptionTieredBPSPrice#cadence - module Cadence - extend Orb::Internal::Type::Enum - - ANNUAL = :annual - SEMI_ANNUAL = :semi_annual - MONTHLY = :monthly - QUARTERLY = :quarterly - ONE_TIME = :one_time - CUSTOM = :custom - - # @!method self.values - # @return [Array] - end - - # @see Orb::Models::NewSubscriptionTieredBPSPrice#model_type - module ModelType - extend Orb::Internal::Type::Enum - - TIERED_BPS = :tiered_bps - - # @!method self.values - # @return [Array] - end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionTieredBPSPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - end - end -end diff --git a/lib/orb/models/new_subscription_tiered_package_price.rb b/lib/orb/models/new_subscription_tiered_package_price.rb index 90a9c94c..101c521c 100644 --- a/lib/orb/models/new_subscription_tiered_package_price.rb +++ b/lib/orb/models/new_subscription_tiered_package_price.rb @@ -16,6 +16,7 @@ class NewSubscriptionTieredPackagePrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionTieredPackagePrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionTieredPackagePrice::ModelType } @@ -27,9 +28,10 @@ class NewSubscriptionTieredPackagePrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute tiered_package_config + # Configuration for tiered_package pricing # - # @return [Hash{Symbol=>Object}] - required :tiered_package_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewSubscriptionTieredPackagePrice::TieredPackageConfig] + required :tiered_package_config, -> { Orb::NewSubscriptionTieredPackagePrice::TieredPackageConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -128,11 +130,11 @@ class NewSubscriptionTieredPackagePrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionTieredPackagePrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionTieredPackagePrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param tiered_package_config [Hash{Symbol=>Object}] + # @param tiered_package_config [Orb::Models::NewSubscriptionTieredPackagePrice::TieredPackageConfig] Configuration for tiered_package pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -177,6 +179,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewSubscriptionTieredPackagePrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -187,20 +191,55 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionTieredPackagePrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::NewSubscriptionTieredPackagePrice#tiered_package_config + class TieredPackageConfig < Orb::Internal::Type::BaseModel + # @!attribute package_size + # Package size + # + # @return [String] + required :package_size, String + + # @!attribute tiers + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. The tier bounds are defined based on + # the total quantity rather than the number of packages, so they must be multiples + # of the package size. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewSubscriptionTieredPackagePrice::TieredPackageConfig::Tier] } + + # @!method initialize(package_size:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewSubscriptionTieredPackagePrice::TieredPackageConfig} for more + # details. + # + # Configuration for tiered_package pricing + # + # @param package_size [String] Package size + # + # @param tiers [Array] Apply tiered pricing after rounding up the quantity to the package size. Tiers a + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute per_unit + # Price per package + # + # @return [String] + required :per_unit, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!method initialize(per_unit:, tier_lower_bound:) + # Configuration for a single tier with business logic + # + # @param per_unit [String] Price per package + # + # @param tier_lower_bound [String] Tier lower bound + end end end end diff --git a/lib/orb/models/new_subscription_tiered_package_with_minimum_price.rb b/lib/orb/models/new_subscription_tiered_package_with_minimum_price.rb index 2f214d5d..0ef6dff1 100644 --- a/lib/orb/models/new_subscription_tiered_package_with_minimum_price.rb +++ b/lib/orb/models/new_subscription_tiered_package_with_minimum_price.rb @@ -16,6 +16,7 @@ class NewSubscriptionTieredPackageWithMinimumPrice < Orb::Internal::Type::BaseMo required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionTieredPackageWithMinimumPrice::ModelType } @@ -27,9 +28,11 @@ class NewSubscriptionTieredPackageWithMinimumPrice < Orb::Internal::Type::BaseMo required :name, String # @!attribute tiered_package_with_minimum_config + # Configuration for tiered_package_with_minimum pricing # - # @return [Hash{Symbol=>Object}] - required :tiered_package_with_minimum_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig] + required :tiered_package_with_minimum_config, + -> { Orb::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -128,11 +131,11 @@ class NewSubscriptionTieredPackageWithMinimumPrice < Orb::Internal::Type::BaseMo # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param tiered_package_with_minimum_config [Hash{Symbol=>Object}] + # @param tiered_package_with_minimum_config [Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig] Configuration for tiered_package_with_minimum pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -177,6 +180,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -187,20 +192,61 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice#tiered_package_with_minimum_config + class TieredPackageWithMinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute package_size + # Package size + # + # @return [Float] + required :package_size, Float + + # @!attribute tiers + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier] } + + # @!method initialize(package_size:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig} + # for more details. + # + # Configuration for tiered_package_with_minimum pricing + # + # @param package_size [Float] Package size + # + # @param tiers [Array] Apply tiered pricing after rounding up the quantity to the package size. Tiers a + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute minimum_amount + # Minimum amount + # + # @return [String] + required :minimum_amount, String + + # @!attribute per_unit + # Price per package + # + # @return [String] + required :per_unit, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!method initialize(minimum_amount:, per_unit:, tier_lower_bound:) + # Configuration for a single tier + # + # @param minimum_amount [String] Minimum amount + # + # @param per_unit [String] Price per package + # + # @param tier_lower_bound [String] Tier lower bound + end end end end diff --git a/lib/orb/models/new_subscription_tiered_price.rb b/lib/orb/models/new_subscription_tiered_price.rb index 07e301b1..5e5054da 100644 --- a/lib/orb/models/new_subscription_tiered_price.rb +++ b/lib/orb/models/new_subscription_tiered_price.rb @@ -16,6 +16,7 @@ class NewSubscriptionTieredPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionTieredPrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionTieredPrice::ModelType } @@ -27,6 +28,7 @@ class NewSubscriptionTieredPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute tiered_config + # Configuration for tiered pricing # # @return [Orb::Models::TieredConfig] required :tiered_config, -> { Orb::TieredConfig } @@ -128,11 +130,11 @@ class NewSubscriptionTieredPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionTieredPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionTieredPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param tiered_config [Orb::Models::TieredConfig] + # @param tiered_config [Orb::Models::TieredConfig] Configuration for tiered pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -177,6 +179,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewSubscriptionTieredPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +190,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionTieredPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_subscription_tiered_with_minimum_price.rb b/lib/orb/models/new_subscription_tiered_with_minimum_price.rb index 519d989b..3a6d5e4f 100644 --- a/lib/orb/models/new_subscription_tiered_with_minimum_price.rb +++ b/lib/orb/models/new_subscription_tiered_with_minimum_price.rb @@ -16,6 +16,7 @@ class NewSubscriptionTieredWithMinimumPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionTieredWithMinimumPrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionTieredWithMinimumPrice::ModelType } @@ -27,9 +28,11 @@ class NewSubscriptionTieredWithMinimumPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute tiered_with_minimum_config + # Configuration for tiered_with_minimum pricing # - # @return [Hash{Symbol=>Object}] - required :tiered_with_minimum_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig] + required :tiered_with_minimum_config, + -> { Orb::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -128,11 +131,11 @@ class NewSubscriptionTieredWithMinimumPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionTieredWithMinimumPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionTieredWithMinimumPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param tiered_with_minimum_config [Hash{Symbol=>Object}] + # @param tiered_with_minimum_config [Orb::Models::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig] Configuration for tiered_with_minimum pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -177,6 +180,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewSubscriptionTieredWithMinimumPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -187,20 +192,69 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionTieredWithMinimumPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union + # @see Orb::Models::NewSubscriptionTieredWithMinimumPrice#tiered_with_minimum_config + class TieredWithMinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Tiered pricing with a minimum amount dependent on the volume tier. Tiers are + # defined using exclusive lower bounds. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig::Tier] } + + # @!attribute hide_zero_amount_tiers + # If true, tiers with an accrued amount of 0 will not be included in the rating. + # + # @return [Boolean, nil] + optional :hide_zero_amount_tiers, Orb::Internal::Type::Boolean + + # @!attribute prorate + # If true, the unit price will be prorated to the billing period + # + # @return [Boolean, nil] + optional :prorate, Orb::Internal::Type::Boolean + + # @!method initialize(tiers:, hide_zero_amount_tiers: nil, prorate: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig} + # for more details. + # + # Configuration for tiered_with_minimum pricing + # + # @param tiers [Array] Tiered pricing with a minimum amount dependent on the volume tier. Tiers are def + # + # @param hide_zero_amount_tiers [Boolean] If true, tiers with an accrued amount of 0 will not be included in the rating. + # + # @param prorate [Boolean] If true, the unit price will be prorated to the billing period - discriminator :conversion_rate_type + class Tier < Orb::Internal::Type::BaseModel + # @!attribute minimum_amount + # Minimum amount + # + # @return [String] + required :minimum_amount, String - variant :unit, -> { Orb::UnitConversionRateConfig } + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String - variant :tiered, -> { Orb::TieredConversionRateConfig } + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @!method initialize(minimum_amount:, tier_lower_bound:, unit_amount:) + # Configuration for a single tier + # + # @param minimum_amount [String] Minimum amount + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Per unit amount + end end end end diff --git a/lib/orb/models/new_subscription_unit_price.rb b/lib/orb/models/new_subscription_unit_price.rb index 4cf03072..91c802a1 100644 --- a/lib/orb/models/new_subscription_unit_price.rb +++ b/lib/orb/models/new_subscription_unit_price.rb @@ -16,6 +16,7 @@ class NewSubscriptionUnitPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionUnitPrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionUnitPrice::ModelType } @@ -27,6 +28,7 @@ class NewSubscriptionUnitPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute unit_config + # Configuration for unit pricing # # @return [Orb::Models::UnitConfig] required :unit_config, -> { Orb::UnitConfig } @@ -128,11 +130,11 @@ class NewSubscriptionUnitPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionUnitPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionUnitPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param unit_config [Orb::Models::UnitConfig] + # @param unit_config [Orb::Models::UnitConfig] Configuration for unit pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -177,6 +179,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewSubscriptionUnitPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -186,22 +190,6 @@ module ModelType # @!method self.values # @return [Array] end - - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionUnitPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end end end end diff --git a/lib/orb/models/new_subscription_unit_with_percent_price.rb b/lib/orb/models/new_subscription_unit_with_percent_price.rb index e57a396c..53036b59 100644 --- a/lib/orb/models/new_subscription_unit_with_percent_price.rb +++ b/lib/orb/models/new_subscription_unit_with_percent_price.rb @@ -16,6 +16,7 @@ class NewSubscriptionUnitWithPercentPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionUnitWithPercentPrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionUnitWithPercentPrice::ModelType } @@ -27,9 +28,10 @@ class NewSubscriptionUnitWithPercentPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute unit_with_percent_config + # Configuration for unit_with_percent pricing # - # @return [Hash{Symbol=>Object}] - required :unit_with_percent_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewSubscriptionUnitWithPercentPrice::UnitWithPercentConfig] + required :unit_with_percent_config, -> { Orb::NewSubscriptionUnitWithPercentPrice::UnitWithPercentConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -128,11 +130,11 @@ class NewSubscriptionUnitWithPercentPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionUnitWithPercentPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionUnitWithPercentPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param unit_with_percent_config [Hash{Symbol=>Object}] + # @param unit_with_percent_config [Orb::Models::NewSubscriptionUnitWithPercentPrice::UnitWithPercentConfig] Configuration for unit_with_percent pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -177,6 +179,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewSubscriptionUnitWithPercentPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -187,20 +191,26 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionUnitWithPercentPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::NewSubscriptionUnitWithPercentPrice#unit_with_percent_config + class UnitWithPercentConfig < Orb::Internal::Type::BaseModel + # @!attribute percent + # What percent, out of 100, of the calculated total to charge + # + # @return [String] + required :percent, String + + # @!attribute unit_amount + # Rate per unit of usage + # + # @return [String] + required :unit_amount, String + + # @!method initialize(percent:, unit_amount:) + # Configuration for unit_with_percent pricing + # + # @param percent [String] What percent, out of 100, of the calculated total to charge + # + # @param unit_amount [String] Rate per unit of usage end end end diff --git a/lib/orb/models/new_subscription_unit_with_proration_price.rb b/lib/orb/models/new_subscription_unit_with_proration_price.rb index 7801b499..523ad62c 100644 --- a/lib/orb/models/new_subscription_unit_with_proration_price.rb +++ b/lib/orb/models/new_subscription_unit_with_proration_price.rb @@ -16,6 +16,7 @@ class NewSubscriptionUnitWithProrationPrice < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::NewSubscriptionUnitWithProrationPrice::ModelType] required :model_type, enum: -> { Orb::NewSubscriptionUnitWithProrationPrice::ModelType } @@ -27,9 +28,11 @@ class NewSubscriptionUnitWithProrationPrice < Orb::Internal::Type::BaseModel required :name, String # @!attribute unit_with_proration_config + # Configuration for unit_with_proration pricing # - # @return [Hash{Symbol=>Object}] - required :unit_with_proration_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::NewSubscriptionUnitWithProrationPrice::UnitWithProrationConfig] + required :unit_with_proration_config, + -> { Orb::NewSubscriptionUnitWithProrationPrice::UnitWithProrationConfig } # @!attribute billable_metric_id # The id of the billable metric for the price. Only needed if the price is @@ -128,11 +131,11 @@ class NewSubscriptionUnitWithProrationPrice < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::NewSubscriptionUnitWithProrationPrice::ModelType] + # @param model_type [Symbol, Orb::Models::NewSubscriptionUnitWithProrationPrice::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param unit_with_proration_config [Hash{Symbol=>Object}] + # @param unit_with_proration_config [Orb::Models::NewSubscriptionUnitWithProrationPrice::UnitWithProrationConfig] Configuration for unit_with_proration pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -177,6 +180,8 @@ module Cadence # @return [Array] end + # The pricing model type + # # @see Orb::Models::NewSubscriptionUnitWithProrationPrice#model_type module ModelType extend Orb::Internal::Type::Enum @@ -187,20 +192,18 @@ module ModelType # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - # - # @see Orb::Models::NewSubscriptionUnitWithProrationPrice#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::NewSubscriptionUnitWithProrationPrice#unit_with_proration_config + class UnitWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute unit_amount + # Rate per unit of usage + # + # @return [String] + required :unit_amount, String + + # @!method initialize(unit_amount:) + # Configuration for unit_with_proration pricing + # + # @param unit_amount [String] Rate per unit of usage end end end diff --git a/lib/orb/models/package_config.rb b/lib/orb/models/package_config.rb index f5fe33f3..9c9946a8 100644 --- a/lib/orb/models/package_config.rb +++ b/lib/orb/models/package_config.rb @@ -20,6 +20,8 @@ class PackageConfig < Orb::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {Orb::Models::PackageConfig} for more details. # + # Configuration for package pricing + # # @param package_amount [String] A currency amount to rate usage by # # @param package_size [Integer] An integer amount to represent package size. For example, 1000 here would divide diff --git a/lib/orb/models/per_price_cost.rb b/lib/orb/models/per_price_cost.rb index e064c068..d2450a0e 100644 --- a/lib/orb/models/per_price_cost.rb +++ b/lib/orb/models/per_price_cost.rb @@ -6,7 +6,7 @@ class PerPriceCost < Orb::Internal::Type::BaseModel # @!attribute price # The price object # - # @return [Orb::Models::Price::Unit, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::Tiered, Orb::Models::Price::TieredBPS, Orb::Models::Price::BPS, Orb::Models::Price::BulkBPS, Orb::Models::Price::Bulk, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::GroupedWithMinMaxThresholds] + # @return [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::Minimum, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput] required :price, union: -> { Orb::Price } # @!attribute price_id @@ -34,7 +34,7 @@ class PerPriceCost < Orb::Internal::Type::BaseModel optional :quantity, Float, nil?: true # @!method initialize(price:, price_id:, subtotal:, total:, quantity: nil) - # @param price [Orb::Models::Price::Unit, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::Tiered, Orb::Models::Price::TieredBPS, Orb::Models::Price::BPS, Orb::Models::Price::BulkBPS, Orb::Models::Price::Bulk, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::GroupedWithMinMaxThresholds] The price object + # @param price [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::Minimum, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput] The price object # # @param price_id [String] The price the cost is associated with # diff --git a/lib/orb/models/plan.rb b/lib/orb/models/plan.rb index a864682b..d8c97e90 100644 --- a/lib/orb/models/plan.rb +++ b/lib/orb/models/plan.rb @@ -132,7 +132,7 @@ class Plan < Orb::Internal::Type::BaseModel # Prices for this plan. If the plan has phases, this includes prices across all # phases of the plan. # - # @return [Array] + # @return [Array] required :prices, -> { Orb::Internal::Type::ArrayOf[union: Orb::Price] } # @!attribute product @@ -202,7 +202,7 @@ class Plan < Orb::Internal::Type::BaseModel # # @param plan_phases [Array, nil] # - # @param prices [Array] Prices for this plan. If the plan has phases, this includes prices across all ph + # @param prices [Array] Prices for this plan. If the plan has phases, this includes prices across all ph # # @param product [Orb::Models::Plan::Product] # diff --git a/lib/orb/models/plan_create_params.rb b/lib/orb/models/plan_create_params.rb index b4129d09..8a026b79 100644 --- a/lib/orb/models/plan_create_params.rb +++ b/lib/orb/models/plan_create_params.rb @@ -118,9 +118,9 @@ class Price < Orb::Internal::Type::BaseModel optional :plan_phase_order, Integer, nil?: true # @!attribute price - # The price to add to the plan + # New plan price request body params. # - # @return [Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanTieredBPSPrice, Orb::Models::NewPlanBPSPrice, Orb::Models::NewPlanBulkBPSPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanTierWithProrationPrice, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::NewPlanGroupedTieredPrice, nil] + # @return [Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanGroupedTieredPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::PlanCreateParams::Price::Price::TieredWithProration, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanMinimumCompositePrice, Orb::Models::PlanCreateParams::Price::Price::Percent, Orb::Models::PlanCreateParams::Price::Price::EventOutput, nil] optional :price, union: -> { Orb::PlanCreateParams::Price::Price }, nil?: true # @!method initialize(allocation_price: nil, plan_phase_order: nil, price: nil) @@ -128,9 +128,9 @@ class Price < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] The phase to add this price to. # - # @param price [Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanTieredBPSPrice, Orb::Models::NewPlanBPSPrice, Orb::Models::NewPlanBulkBPSPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanTierWithProrationPrice, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::NewPlanGroupedTieredPrice, nil] The price to add to the plan + # @param price [Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanGroupedTieredPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::PlanCreateParams::Price::Price::TieredWithProration, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanMinimumCompositePrice, Orb::Models::PlanCreateParams::Price::Price::Percent, Orb::Models::PlanCreateParams::Price::Price::EventOutput, nil] New plan price request body params. - # The price to add to the plan + # New plan price request body params. # # @see Orb::Models::PlanCreateParams::Price#price module Price @@ -140,19 +140,13 @@ module Price variant :unit, -> { Orb::NewPlanUnitPrice } - variant :package, -> { Orb::NewPlanPackagePrice } - - variant :matrix, -> { Orb::NewPlanMatrixPrice } - variant :tiered, -> { Orb::NewPlanTieredPrice } - variant :tiered_bps, -> { Orb::NewPlanTieredBPSPrice } - - variant :bps, -> { Orb::NewPlanBPSPrice } + variant :bulk, -> { Orb::NewPlanBulkPrice } - variant :bulk_bps, -> { Orb::NewPlanBulkBPSPrice } + variant :package, -> { Orb::NewPlanPackagePrice } - variant :bulk, -> { Orb::NewPlanBulkPrice } + variant :matrix, -> { Orb::NewPlanMatrixPrice } variant :threshold_total_amount, -> { Orb::NewPlanThresholdTotalAmountPrice } @@ -160,23 +154,32 @@ module Price variant :tiered_with_minimum, -> { Orb::NewPlanTieredWithMinimumPrice } - variant :unit_with_percent, -> { Orb::NewPlanUnitWithPercentPrice } + variant :grouped_tiered, -> { Orb::NewPlanGroupedTieredPrice } + + variant :tiered_package_with_minimum, -> { Orb::NewPlanTieredPackageWithMinimumPrice } variant :package_with_allocation, -> { Orb::NewPlanPackageWithAllocationPrice } - variant :tiered_with_proration, -> { Orb::NewPlanTierWithProrationPrice } + variant :unit_with_percent, -> { Orb::NewPlanUnitWithPercentPrice } + + variant :matrix_with_allocation, -> { Orb::NewPlanMatrixWithAllocationPrice } + + variant :tiered_with_proration, -> { Orb::PlanCreateParams::Price::Price::TieredWithProration } variant :unit_with_proration, -> { Orb::NewPlanUnitWithProrationPrice } variant :grouped_allocation, -> { Orb::NewPlanGroupedAllocationPrice } + variant :bulk_with_proration, -> { Orb::NewPlanBulkWithProrationPrice } + variant :grouped_with_prorated_minimum, -> { Orb::NewPlanGroupedWithProratedMinimumPrice } variant :grouped_with_metered_minimum, -> { Orb::NewPlanGroupedWithMeteredMinimumPrice } - variant :matrix_with_display_name, -> { Orb::NewPlanMatrixWithDisplayNamePrice } + variant :grouped_with_min_max_thresholds, + -> { Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds } - variant :bulk_with_proration, -> { Orb::NewPlanBulkWithProrationPrice } + variant :matrix_with_display_name, -> { Orb::NewPlanMatrixWithDisplayNamePrice } variant :grouped_tiered_package, -> { Orb::NewPlanGroupedTieredPackagePrice } @@ -188,14 +191,870 @@ module Price variant :cumulative_grouped_bulk, -> { Orb::NewPlanCumulativeGroupedBulkPrice } - variant :tiered_package_with_minimum, -> { Orb::NewPlanTieredPackageWithMinimumPrice } - - variant :matrix_with_allocation, -> { Orb::NewPlanMatrixWithAllocationPrice } - - variant :grouped_tiered, -> { Orb::NewPlanGroupedTieredPrice } + variant :minimum, -> { Orb::NewPlanMinimumCompositePrice } + + variant :percent, -> { Orb::PlanCreateParams::Price::Price::Percent } + + variant :event_output, -> { Orb::PlanCreateParams::Price::Price::EventOutput } + + class TieredWithProration < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::Price::TieredWithProration::Cadence] + required :cadence, enum: -> { Orb::PlanCreateParams::Price::Price::TieredWithProration::Cadence } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :tiered_with_proration] + required :model_type, const: :tiered_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_proration_config + # Configuration for tiered_with_proration pricing + # + # @return [Orb::Models::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig] + required :tiered_with_proration_config, + -> { Orb::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::PlanCreateParams::Price::Price::TieredWithProration::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, item_id:, name:, tiered_with_proration_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :tiered_with_proration) + # Some parameter documentations has been truncated, see + # {Orb::Models::PlanCreateParams::Price::Price::TieredWithProration} for more + # details. + # + # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::Price::TieredWithProration::Cadence] The cadence to bill for this price on. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param tiered_with_proration_config [Orb::Models::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig] Configuration for tiered_with_proration pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :tiered_with_proration] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::PlanCreateParams::Price::Price::TieredWithProration#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::PlanCreateParams::Price::Price::TieredWithProration#tiered_with_proration_config + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Tiers for rating based on total usage quantities into the specified tier with + # proration + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig::Tier] } + + # @!method initialize(tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig} + # for more details. + # + # Configuration for tiered_with_proration pricing + # + # @param tiers [Array] Tiers for rating based on total usage quantities into the specified tier with pr + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Inclusive tier starting value + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tiered with proration tier + # + # @param tier_lower_bound [String] Inclusive tier starting value + # + # @param unit_amount [String] Amount per unit + end + end + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::Cadence] + required :cadence, enum: -> { Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::Cadence } + + # @!attribute grouped_with_min_max_thresholds_config + # Configuration for grouped_with_min_max_thresholds pricing + # + # @return [Orb::Models::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] + required :grouped_with_min_max_thresholds_config, + -> { Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :grouped_with_min_max_thresholds] + required :model_type, const: :grouped_with_min_max_thresholds + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, grouped_with_min_max_thresholds_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :grouped_with_min_max_thresholds) + # Some parameter documentations has been truncated, see + # {Orb::Models::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds} for + # more details. + # + # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::Cadence] The cadence to bill for this price on. + # + # @param grouped_with_min_max_thresholds_config [Orb::Models::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] Configuration for grouped_with_min_max_thresholds pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :grouped_with_min_max_thresholds] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds#grouped_with_min_max_thresholds_config + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before applying thresholds + # + # @return [String] + required :grouping_key, String + + # @!attribute maximum_charge + # The maximum amount to charge each group + # + # @return [String] + required :maximum_charge, String + + # @!attribute minimum_charge + # The minimum amount to charge each group, regardless of usage + # + # @return [String] + required :minimum_charge, String + + # @!attribute per_unit_rate + # The base price charged per group + # + # @return [String] + required :per_unit_rate, String + + # @!method initialize(grouping_key:, maximum_charge:, minimum_charge:, per_unit_rate:) + # Configuration for grouped_with_min_max_thresholds pricing + # + # @param grouping_key [String] The event property used to group before applying thresholds + # + # @param maximum_charge [String] The maximum amount to charge each group + # + # @param minimum_charge [String] The minimum amount to charge each group, regardless of usage + # + # @param per_unit_rate [String] The base price charged per group + end + end + + class Percent < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::Price::Percent::Cadence] + required :cadence, enum: -> { Orb::PlanCreateParams::Price::Price::Percent::Cadence } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :percent] + required :model_type, const: :percent + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute percent_config + # Configuration for percent pricing + # + # @return [Orb::Models::PlanCreateParams::Price::Price::Percent::PercentConfig] + required :percent_config, -> { Orb::PlanCreateParams::Price::Price::Percent::PercentConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { Orb::PlanCreateParams::Price::Price::Percent::ConversionRateConfig }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, item_id:, name:, percent_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :percent) + # Some parameter documentations has been truncated, see + # {Orb::Models::PlanCreateParams::Price::Price::Percent} for more details. + # + # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::Price::Percent::Cadence] The cadence to bill for this price on. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param percent_config [Orb::Models::PlanCreateParams::Price::Price::Percent::PercentConfig] Configuration for percent pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :percent] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::PlanCreateParams::Price::Price::Percent#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::PlanCreateParams::Price::Price::Percent#percent_config + class PercentConfig < Orb::Internal::Type::BaseModel + # @!attribute percent + # What percent of the component subtotals to charge + # + # @return [Float] + required :percent, Float + + # @!method initialize(percent:) + # Configuration for percent pricing + # + # @param percent [Float] What percent of the component subtotals to charge + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::Price::EventOutput::Cadence] + required :cadence, enum: -> { Orb::PlanCreateParams::Price::Price::EventOutput::Cadence } + + # @!attribute event_output_config + # Configuration for event_output pricing + # + # @return [Orb::Models::PlanCreateParams::Price::Price::EventOutput::EventOutputConfig] + required :event_output_config, -> { Orb::PlanCreateParams::Price::Price::EventOutput::EventOutputConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :event_output] + required :model_type, const: :event_output + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { Orb::PlanCreateParams::Price::Price::EventOutput::ConversionRateConfig }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, event_output_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :event_output) + # Some parameter documentations has been truncated, see + # {Orb::Models::PlanCreateParams::Price::Price::EventOutput} for more details. + # + # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::Price::EventOutput::Cadence] The cadence to bill for this price on. + # + # @param event_output_config [Orb::Models::PlanCreateParams::Price::Price::EventOutput::EventOutputConfig] Configuration for event_output pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :event_output] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::PlanCreateParams::Price::Price::EventOutput#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::PlanCreateParams::Price::Price::EventOutput#event_output_config + class EventOutputConfig < Orb::Internal::Type::BaseModel + # @!attribute unit_rating_key + # The key in the event data to extract the unit rate from. + # + # @return [String] + required :unit_rating_key, String + + # @!attribute grouping_key + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + # + # @return [String, nil] + optional :grouping_key, String, nil?: true + + # @!method initialize(unit_rating_key:, grouping_key: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::PlanCreateParams::Price::Price::EventOutput::EventOutputConfig} + # for more details. + # + # Configuration for event_output pricing + # + # @param unit_rating_key [String] The key in the event data to extract the unit rate from. + # + # @param grouping_key [String, nil] An optional key in the event data to group by (e.g., event ID). All events will + end + end # @!method self.variants - # @return [Array(Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanTieredBPSPrice, Orb::Models::NewPlanBPSPrice, Orb::Models::NewPlanBulkBPSPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanTierWithProrationPrice, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::NewPlanGroupedTieredPrice)] + # @return [Array(Orb::Models::NewPlanUnitPrice, Orb::Models::NewPlanTieredPrice, Orb::Models::NewPlanBulkPrice, Orb::Models::NewPlanPackagePrice, Orb::Models::NewPlanMatrixPrice, Orb::Models::NewPlanThresholdTotalAmountPrice, Orb::Models::NewPlanTieredPackagePrice, Orb::Models::NewPlanTieredWithMinimumPrice, Orb::Models::NewPlanGroupedTieredPrice, Orb::Models::NewPlanTieredPackageWithMinimumPrice, Orb::Models::NewPlanPackageWithAllocationPrice, Orb::Models::NewPlanUnitWithPercentPrice, Orb::Models::NewPlanMatrixWithAllocationPrice, Orb::Models::PlanCreateParams::Price::Price::TieredWithProration, Orb::Models::NewPlanUnitWithProrationPrice, Orb::Models::NewPlanGroupedAllocationPrice, Orb::Models::NewPlanBulkWithProrationPrice, Orb::Models::NewPlanGroupedWithProratedMinimumPrice, Orb::Models::NewPlanGroupedWithMeteredMinimumPrice, Orb::Models::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds, Orb::Models::NewPlanMatrixWithDisplayNamePrice, Orb::Models::NewPlanGroupedTieredPackagePrice, Orb::Models::NewPlanMaxGroupTieredPackagePrice, Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice, Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice, Orb::Models::NewPlanCumulativeGroupedBulkPrice, Orb::Models::NewPlanMinimumCompositePrice, Orb::Models::PlanCreateParams::Price::Price::Percent, Orb::Models::PlanCreateParams::Price::Price::EventOutput)] end end diff --git a/lib/orb/models/plan_phase_amount_discount_adjustment.rb b/lib/orb/models/plan_phase_amount_discount_adjustment.rb index 2f40dd9f..0d1f53a5 100644 --- a/lib/orb/models/plan_phase_amount_discount_adjustment.rb +++ b/lib/orb/models/plan_phase_amount_discount_adjustment.rb @@ -35,8 +35,8 @@ class PlanPhaseAmountDiscountAdjustment < Orb::Internal::Type::BaseModel required :filters, -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] } # @!attribute is_invoice_level - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. # # @return [Boolean] required :is_invoice_level, Orb::Internal::Type::Boolean @@ -74,7 +74,7 @@ class PlanPhaseAmountDiscountAdjustment < Orb::Internal::Type::BaseModel # # @param filters [Array] The filters that determine which prices to apply this adjustment to. # - # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha + # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invoice, false for adjustments that # # @param plan_phase_order [Integer, nil] The plan phase in which this adjustment is active. # diff --git a/lib/orb/models/plan_phase_maximum_adjustment.rb b/lib/orb/models/plan_phase_maximum_adjustment.rb index befddba2..b5dae113 100644 --- a/lib/orb/models/plan_phase_maximum_adjustment.rb +++ b/lib/orb/models/plan_phase_maximum_adjustment.rb @@ -28,8 +28,8 @@ class PlanPhaseMaximumAdjustment < Orb::Internal::Type::BaseModel required :filters, -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] } # @!attribute is_invoice_level - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. # # @return [Boolean] required :is_invoice_level, Orb::Internal::Type::Boolean @@ -72,7 +72,7 @@ class PlanPhaseMaximumAdjustment < Orb::Internal::Type::BaseModel # # @param filters [Array] The filters that determine which prices to apply this adjustment to. # - # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha + # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invoice, false for adjustments that # # @param maximum_amount [String] The maximum amount to charge in a given billing period for the prices this adjus # diff --git a/lib/orb/models/plan_phase_minimum_adjustment.rb b/lib/orb/models/plan_phase_minimum_adjustment.rb index 909e05bd..73447908 100644 --- a/lib/orb/models/plan_phase_minimum_adjustment.rb +++ b/lib/orb/models/plan_phase_minimum_adjustment.rb @@ -28,8 +28,8 @@ class PlanPhaseMinimumAdjustment < Orb::Internal::Type::BaseModel required :filters, -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] } # @!attribute is_invoice_level - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. # # @return [Boolean] required :is_invoice_level, Orb::Internal::Type::Boolean @@ -78,7 +78,7 @@ class PlanPhaseMinimumAdjustment < Orb::Internal::Type::BaseModel # # @param filters [Array] The filters that determine which prices to apply this adjustment to. # - # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha + # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invoice, false for adjustments that # # @param item_id [String] The item ID that revenue from this minimum will be attributed to. # diff --git a/lib/orb/models/plan_phase_percentage_discount_adjustment.rb b/lib/orb/models/plan_phase_percentage_discount_adjustment.rb index b969d66d..3ff592a5 100644 --- a/lib/orb/models/plan_phase_percentage_discount_adjustment.rb +++ b/lib/orb/models/plan_phase_percentage_discount_adjustment.rb @@ -28,8 +28,8 @@ class PlanPhasePercentageDiscountAdjustment < Orb::Internal::Type::BaseModel required :filters, -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] } # @!attribute is_invoice_level - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. # # @return [Boolean] required :is_invoice_level, Orb::Internal::Type::Boolean @@ -72,7 +72,7 @@ class PlanPhasePercentageDiscountAdjustment < Orb::Internal::Type::BaseModel # # @param filters [Array] The filters that determine which prices to apply this adjustment to. # - # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha + # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invoice, false for adjustments that # # @param percentage_discount [Float] The percentage (as a value between 0 and 1) by which to discount the price inter # diff --git a/lib/orb/models/plan_phase_usage_discount_adjustment.rb b/lib/orb/models/plan_phase_usage_discount_adjustment.rb index 13b86f2b..c60ec305 100644 --- a/lib/orb/models/plan_phase_usage_discount_adjustment.rb +++ b/lib/orb/models/plan_phase_usage_discount_adjustment.rb @@ -28,8 +28,8 @@ class PlanPhaseUsageDiscountAdjustment < Orb::Internal::Type::BaseModel required :filters, -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] } # @!attribute is_invoice_level - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. # # @return [Boolean] required :is_invoice_level, Orb::Internal::Type::Boolean @@ -72,7 +72,7 @@ class PlanPhaseUsageDiscountAdjustment < Orb::Internal::Type::BaseModel # # @param filters [Array] The filters that determine which prices to apply this adjustment to. # - # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha + # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invoice, false for adjustments that # # @param plan_phase_order [Integer, nil] The plan phase in which this adjustment is active. # diff --git a/lib/orb/models/plan_version.rb b/lib/orb/models/plan_version.rb index ba5072b9..1442795f 100644 --- a/lib/orb/models/plan_version.rb +++ b/lib/orb/models/plan_version.rb @@ -25,7 +25,7 @@ class PlanVersion < Orb::Internal::Type::BaseModel # Prices for this plan. If the plan has phases, this includes prices across all # phases of the plan. # - # @return [Array] + # @return [Array] required :prices, -> { Orb::Internal::Type::ArrayOf[union: Orb::Price] } # @!attribute version @@ -46,7 +46,7 @@ class PlanVersion < Orb::Internal::Type::BaseModel # # @param plan_phases [Array, nil] # - # @param prices [Array] Prices for this plan. If the plan has phases, this includes prices across all ph + # @param prices [Array] Prices for this plan. If the plan has phases, this includes prices across all ph # # @param version [Integer] diff --git a/lib/orb/models/price.rb b/lib/orb/models/price.rb index a5f45b84..913c7025 100644 --- a/lib/orb/models/price.rb +++ b/lib/orb/models/price.rb @@ -19,28 +19,22 @@ module Price variant :unit, -> { Orb::Price::Unit } - variant :package, -> { Orb::Price::Package } - - variant :matrix, -> { Orb::Price::Matrix } - variant :tiered, -> { Orb::Price::Tiered } - variant :tiered_bps, -> { Orb::Price::TieredBPS } - - variant :bps, -> { Orb::Price::BPS } + variant :bulk, -> { Orb::Price::Bulk } - variant :bulk_bps, -> { Orb::Price::BulkBPS } + variant :package, -> { Orb::Price::Package } - variant :bulk, -> { Orb::Price::Bulk } + variant :matrix, -> { Orb::Price::Matrix } variant :threshold_total_amount, -> { Orb::Price::ThresholdTotalAmount } variant :tiered_package, -> { Orb::Price::TieredPackage } - variant :grouped_tiered, -> { Orb::Price::GroupedTiered } - variant :tiered_with_minimum, -> { Orb::Price::TieredWithMinimum } + variant :grouped_tiered, -> { Orb::Price::GroupedTiered } + variant :tiered_package_with_minimum, -> { Orb::Price::TieredPackageWithMinimum } variant :package_with_allocation, -> { Orb::Price::PackageWithAllocation } @@ -55,13 +49,15 @@ module Price variant :grouped_allocation, -> { Orb::Price::GroupedAllocation } + variant :bulk_with_proration, -> { Orb::Price::BulkWithProration } + variant :grouped_with_prorated_minimum, -> { Orb::Price::GroupedWithProratedMinimum } variant :grouped_with_metered_minimum, -> { Orb::Price::GroupedWithMeteredMinimum } - variant :matrix_with_display_name, -> { Orb::Price::MatrixWithDisplayName } + variant :grouped_with_min_max_thresholds, -> { Orb::Price::GroupedWithMinMaxThresholds } - variant :bulk_with_proration, -> { Orb::Price::BulkWithProration } + variant :matrix_with_display_name, -> { Orb::Price::MatrixWithDisplayName } variant :grouped_tiered_package, -> { Orb::Price::GroupedTieredPackage } @@ -73,7 +69,11 @@ module Price variant :cumulative_grouped_bulk, -> { Orb::Price::CumulativeGroupedBulk } - variant :grouped_with_min_max_thresholds, -> { Orb::Price::GroupedWithMinMaxThresholds } + variant :minimum, -> { Orb::Price::Minimum } + + variant :percent, -> { Orb::Price::Percent } + + variant :event_output, -> { Orb::Price::EventOutput } class Unit < Orb::Internal::Type::BaseModel # @!attribute id @@ -91,11 +91,23 @@ class Unit < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::Unit::BillingMode] + required :billing_mode, enum: -> { Orb::Price::Unit::BillingMode } + # @!attribute cadence # # @return [Symbol, Orb::Models::Price::Unit::Cadence] required :cadence, enum: -> { Orb::Price::Unit::Cadence } + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true + # @!attribute conversion_rate # # @return [Float, nil] @@ -143,6 +155,8 @@ class Unit < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -181,6 +195,7 @@ class Unit < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # # @return [Symbol, :unit] required :model_type, const: :unit @@ -208,6 +223,7 @@ class Unit < Orb::Internal::Type::BaseModel required :replaces_price_id, String, nil?: true # @!attribute unit_config + # Configuration for unit pricing # # @return [Orb::Models::UnitConfig] required :unit_config, -> { Orb::UnitConfig } @@ -217,7 +233,7 @@ class Unit < Orb::Internal::Type::BaseModel # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, unit_config:, dimensional_price_configuration: nil, model_type: :unit) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, unit_config:, dimensional_price_configuration: nil, model_type: :unit) # Some parameter documentations has been truncated, see {Orb::Models::Price::Unit} # for more details. # @@ -227,8 +243,12 @@ class Unit < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # + # @param billing_mode [Symbol, Orb::Models::Price::Unit::BillingMode] + # # @param cadence [Symbol, Orb::Models::Price::Unit::Cadence] # + # @param composite_price_filters [Array, nil] + # # @param conversion_rate [Float, nil] # # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] @@ -247,7 +267,7 @@ class Unit < Orb::Internal::Type::BaseModel # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -267,11 +287,22 @@ class Unit < Orb::Internal::Type::BaseModel # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # - # @param unit_config [Orb::Models::UnitConfig] + # @param unit_config [Orb::Models::UnitConfig] Configuration for unit pricing # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :unit] + # @param model_type [Symbol, :unit] The pricing model type + + # @see Orb::Models::Price::Unit#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end # @see Orb::Models::Price::Unit#cadence module Cadence @@ -288,33 +319,20 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::Unit#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - # @see Orb::Models::Price::Unit#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end end - class Package < Orb::Internal::Type::BaseModel + class Tiered < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -330,10 +348,22 @@ class Package < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::Tiered::BillingMode] + required :billing_mode, enum: -> { Orb::Price::Tiered::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::Package::Cadence] - required :cadence, enum: -> { Orb::Price::Package::Cadence } + # @return [Symbol, Orb::Models::Price::Tiered::Cadence] + required :cadence, enum: -> { Orb::Price::Tiered::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -343,7 +373,7 @@ class Package < Orb::Internal::Type::BaseModel # @!attribute conversion_rate_config # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - required :conversion_rate_config, union: -> { Orb::Price::Package::ConversionRateConfig }, nil?: true + required :conversion_rate_config, union: -> { Orb::Price::Tiered::ConversionRateConfig }, nil?: true # @!attribute created_at # @@ -382,6 +412,8 @@ class Package < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -420,20 +452,16 @@ class Package < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :package] - required :model_type, const: :package + # @return [Symbol, :tiered] + required :model_type, const: :tiered # @!attribute name # # @return [String] required :name, String - # @!attribute package_config - # - # @return [Orb::Models::PackageConfig] - required :package_config, -> { Orb::PackageConfig } - # @!attribute plan_phase_order # # @return [Integer, nil] @@ -441,8 +469,8 @@ class Package < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::Package::PriceType] - required :price_type, enum: -> { Orb::Price::Package::PriceType } + # @return [Symbol, Orb::Models::Price::Tiered::PriceType] + required :price_type, enum: -> { Orb::Price::Tiered::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -451,14 +479,20 @@ class Package < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true + # @!attribute tiered_config + # Configuration for tiered pricing + # + # @return [Orb::Models::TieredConfig] + required :tiered_config, -> { Orb::TieredConfig } + # @!attribute dimensional_price_configuration # # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, package_config:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :package) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, tiered_config:, dimensional_price_configuration: nil, model_type: :tiered) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::Package} for more details. + # {Orb::Models::Price::Tiered} for more details. # # @param id [String] # @@ -466,7 +500,11 @@ class Package < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::Package::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::Tiered::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::Tiered::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -486,7 +524,7 @@ class Package < Orb::Internal::Type::BaseModel # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -500,19 +538,30 @@ class Package < Orb::Internal::Type::BaseModel # # @param name [String] # - # @param package_config [Orb::Models::PackageConfig] - # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::Package::PriceType] + # @param price_type [Symbol, Orb::Models::Price::Tiered::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # + # @param tiered_config [Orb::Models::TieredConfig] Configuration for tiered pricing + # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :package] + # @param model_type [Symbol, :tiered] The pricing model type - # @see Orb::Models::Price::Package#cadence + # @see Orb::Models::Price::Tiered#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::Tiered#cadence module Cadence extend Orb::Internal::Type::Enum @@ -527,33 +576,20 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::Package#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - - # @see Orb::Models::Price::Package#price_type + # @see Orb::Models::Price::Tiered#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end end - class Matrix < Orb::Internal::Type::BaseModel + class Bulk < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -569,10 +605,28 @@ class Matrix < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::Bulk::BillingMode] + required :billing_mode, enum: -> { Orb::Price::Bulk::BillingMode } + + # @!attribute bulk_config + # Configuration for bulk pricing + # + # @return [Orb::Models::BulkConfig] + required :bulk_config, -> { Orb::BulkConfig } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::Matrix::Cadence] - required :cadence, enum: -> { Orb::Price::Matrix::Cadence } + # @return [Symbol, Orb::Models::Price::Bulk::Cadence] + required :cadence, enum: -> { Orb::Price::Bulk::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -582,7 +636,7 @@ class Matrix < Orb::Internal::Type::BaseModel # @!attribute conversion_rate_config # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - required :conversion_rate_config, union: -> { Orb::Price::Matrix::ConversionRateConfig }, nil?: true + required :conversion_rate_config, union: -> { Orb::Price::Bulk::ConversionRateConfig }, nil?: true # @!attribute created_at # @@ -621,15 +675,12 @@ class Matrix < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } - # @!attribute matrix_config - # - # @return [Orb::Models::MatrixConfig] - required :matrix_config, -> { Orb::MatrixConfig } - # @!attribute maximum # @deprecated # @@ -664,9 +715,10 @@ class Matrix < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :matrix] - required :model_type, const: :matrix + # @return [Symbol, :bulk] + required :model_type, const: :bulk # @!attribute name # @@ -680,8 +732,8 @@ class Matrix < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::Matrix::PriceType] - required :price_type, enum: -> { Orb::Price::Matrix::PriceType } + # @return [Symbol, Orb::Models::Price::Bulk::PriceType] + required :price_type, enum: -> { Orb::Price::Bulk::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -695,9 +747,9 @@ class Matrix < Orb::Internal::Type::BaseModel # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, matrix_config:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :matrix) - # Some parameter documentations has been truncated, see - # {Orb::Models::Price::Matrix} for more details. + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, bulk_config:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :bulk) + # Some parameter documentations has been truncated, see {Orb::Models::Price::Bulk} + # for more details. # # @param id [String] # @@ -705,7 +757,13 @@ class Matrix < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::Matrix::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::Bulk::BillingMode] + # + # @param bulk_config [Orb::Models::BulkConfig] Configuration for bulk pricing + # + # @param cadence [Symbol, Orb::Models::Price::Bulk::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -725,9 +783,7 @@ class Matrix < Orb::Internal::Type::BaseModel # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] - # - # @param matrix_config [Orb::Models::MatrixConfig] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -743,15 +799,26 @@ class Matrix < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::Matrix::PriceType] + # @param price_type [Symbol, Orb::Models::Price::Bulk::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :matrix] + # @param model_type [Symbol, :bulk] The pricing model type - # @see Orb::Models::Price::Matrix#cadence + # @see Orb::Models::Price::Bulk#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::Bulk#cadence module Cadence extend Orb::Internal::Type::Enum @@ -766,33 +833,20 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::Matrix#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - - # @see Orb::Models::Price::Matrix#price_type + # @see Orb::Models::Price::Bulk#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end end - class Tiered < Orb::Internal::Type::BaseModel + class Package < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -808,10 +862,22 @@ class Tiered < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::Package::BillingMode] + required :billing_mode, enum: -> { Orb::Price::Package::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::Tiered::Cadence] - required :cadence, enum: -> { Orb::Price::Tiered::Cadence } + # @return [Symbol, Orb::Models::Price::Package::Cadence] + required :cadence, enum: -> { Orb::Price::Package::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -821,7 +887,7 @@ class Tiered < Orb::Internal::Type::BaseModel # @!attribute conversion_rate_config # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - required :conversion_rate_config, union: -> { Orb::Price::Tiered::ConversionRateConfig }, nil?: true + required :conversion_rate_config, union: -> { Orb::Price::Package::ConversionRateConfig }, nil?: true # @!attribute created_at # @@ -860,6 +926,8 @@ class Tiered < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -898,15 +966,22 @@ class Tiered < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :tiered] - required :model_type, const: :tiered + # @return [Symbol, :package] + required :model_type, const: :package # @!attribute name # # @return [String] required :name, String + # @!attribute package_config + # Configuration for package pricing + # + # @return [Orb::Models::PackageConfig] + required :package_config, -> { Orb::PackageConfig } + # @!attribute plan_phase_order # # @return [Integer, nil] @@ -914,8 +989,8 @@ class Tiered < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::Tiered::PriceType] - required :price_type, enum: -> { Orb::Price::Tiered::PriceType } + # @return [Symbol, Orb::Models::Price::Package::PriceType] + required :price_type, enum: -> { Orb::Price::Package::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -924,19 +999,14 @@ class Tiered < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true - # @!attribute tiered_config - # - # @return [Orb::Models::TieredConfig] - required :tiered_config, -> { Orb::TieredConfig } - # @!attribute dimensional_price_configuration # # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, tiered_config:, dimensional_price_configuration: nil, model_type: :tiered) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, package_config:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :package) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::Tiered} for more details. + # {Orb::Models::Price::Package} for more details. # # @param id [String] # @@ -944,7 +1014,11 @@ class Tiered < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::Tiered::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::Package::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::Package::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -964,7 +1038,7 @@ class Tiered < Orb::Internal::Type::BaseModel # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -978,19 +1052,30 @@ class Tiered < Orb::Internal::Type::BaseModel # # @param name [String] # + # @param package_config [Orb::Models::PackageConfig] Configuration for package pricing + # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::Tiered::PriceType] + # @param price_type [Symbol, Orb::Models::Price::Package::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # - # @param tiered_config [Orb::Models::TieredConfig] - # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :tiered] + # @param model_type [Symbol, :package] The pricing model type - # @see Orb::Models::Price::Tiered#cadence + # @see Orb::Models::Price::Package#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::Package#cadence module Cadence extend Orb::Internal::Type::Enum @@ -1005,33 +1090,20 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::Tiered#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - - # @see Orb::Models::Price::Tiered#price_type + # @see Orb::Models::Price::Package#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end end - class TieredBPS < Orb::Internal::Type::BaseModel + class Matrix < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -1047,10 +1119,22 @@ class TieredBPS < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::Matrix::BillingMode] + required :billing_mode, enum: -> { Orb::Price::Matrix::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::TieredBPS::Cadence] - required :cadence, enum: -> { Orb::Price::TieredBPS::Cadence } + # @return [Symbol, Orb::Models::Price::Matrix::Cadence] + required :cadence, enum: -> { Orb::Price::Matrix::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -1060,11 +1144,7 @@ class TieredBPS < Orb::Internal::Type::BaseModel # @!attribute conversion_rate_config # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - required :conversion_rate_config, - union: -> { - Orb::Price::TieredBPS::ConversionRateConfig - }, - nil?: true + required :conversion_rate_config, union: -> { Orb::Price::Matrix::ConversionRateConfig }, nil?: true # @!attribute created_at # @@ -1103,10 +1183,18 @@ class TieredBPS < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } + # @!attribute matrix_config + # Configuration for matrix pricing + # + # @return [Orb::Models::MatrixConfig] + required :matrix_config, -> { Orb::MatrixConfig } + # @!attribute maximum # @deprecated # @@ -1141,9 +1229,10 @@ class TieredBPS < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :tiered_bps] - required :model_type, const: :tiered_bps + # @return [Symbol, :matrix] + required :model_type, const: :matrix # @!attribute name # @@ -1157,8 +1246,8 @@ class TieredBPS < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::TieredBPS::PriceType] - required :price_type, enum: -> { Orb::Price::TieredBPS::PriceType } + # @return [Symbol, Orb::Models::Price::Matrix::PriceType] + required :price_type, enum: -> { Orb::Price::Matrix::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -1167,19 +1256,14 @@ class TieredBPS < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true - # @!attribute tiered_bps_config - # - # @return [Orb::Models::TieredBPSConfig] - required :tiered_bps_config, -> { Orb::TieredBPSConfig } - # @!attribute dimensional_price_configuration # # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, tiered_bps_config:, dimensional_price_configuration: nil, model_type: :tiered_bps) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, matrix_config:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :matrix) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::TieredBPS} for more details. + # {Orb::Models::Price::Matrix} for more details. # # @param id [String] # @@ -1187,7 +1271,11 @@ class TieredBPS < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::TieredBPS::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::Matrix::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::Matrix::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -1207,7 +1295,9 @@ class TieredBPS < Orb::Internal::Type::BaseModel # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in + # + # @param matrix_config [Orb::Models::MatrixConfig] Configuration for matrix pricing # # @param maximum [Orb::Models::Maximum, nil] # @@ -1223,58 +1313,54 @@ class TieredBPS < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::TieredBPS::PriceType] + # @param price_type [Symbol, Orb::Models::Price::Matrix::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # - # @param tiered_bps_config [Orb::Models::TieredBPSConfig] - # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :tiered_bps] + # @param model_type [Symbol, :matrix] The pricing model type - # @see Orb::Models::Price::TieredBPS#cadence - module Cadence + # @see Orb::Models::Price::Matrix#billing_mode + module BillingMode extend Orb::Internal::Type::Enum - ONE_TIME = :one_time - MONTHLY = :monthly - QUARTERLY = :quarterly - SEMI_ANNUAL = :semi_annual - ANNUAL = :annual - CUSTOM = :custom + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear # @!method self.values # @return [Array] end - # @see Orb::Models::Price::TieredBPS#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } + # @see Orb::Models::Price::Matrix#cadence + module Cadence + extend Orb::Internal::Type::Enum - variant :tiered, -> { Orb::TieredConversionRateConfig } + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @!method self.values + # @return [Array] end - # @see Orb::Models::Price::TieredBPS#price_type + # @see Orb::Models::Price::Matrix#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end end - class BPS < Orb::Internal::Type::BaseModel + class ThresholdTotalAmount < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -1290,15 +1376,22 @@ class BPS < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } - # @!attribute bps_config + # @!attribute billing_mode # - # @return [Orb::Models::BPSConfig] - required :bps_config, -> { Orb::BPSConfig } + # @return [Symbol, Orb::Models::Price::ThresholdTotalAmount::BillingMode] + required :billing_mode, enum: -> { Orb::Price::ThresholdTotalAmount::BillingMode } # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::BPS::Cadence] - required :cadence, enum: -> { Orb::Price::BPS::Cadence } + # @return [Symbol, Orb::Models::Price::ThresholdTotalAmount::Cadence] + required :cadence, enum: -> { Orb::Price::ThresholdTotalAmount::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -1308,7 +1401,9 @@ class BPS < Orb::Internal::Type::BaseModel # @!attribute conversion_rate_config # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - required :conversion_rate_config, union: -> { Orb::Price::BPS::ConversionRateConfig }, nil?: true + required :conversion_rate_config, + union: -> { Orb::Price::ThresholdTotalAmount::ConversionRateConfig }, + nil?: true # @!attribute created_at # @@ -1347,6 +1442,8 @@ class BPS < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -1385,9 +1482,10 @@ class BPS < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :bps] - required :model_type, const: :bps + # @return [Symbol, :threshold_total_amount] + required :model_type, const: :threshold_total_amount # @!attribute name # @@ -1401,8 +1499,8 @@ class BPS < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::BPS::PriceType] - required :price_type, enum: -> { Orb::Price::BPS::PriceType } + # @return [Symbol, Orb::Models::Price::ThresholdTotalAmount::PriceType] + required :price_type, enum: -> { Orb::Price::ThresholdTotalAmount::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -1411,14 +1509,21 @@ class BPS < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true + # @!attribute threshold_total_amount_config + # Configuration for threshold_total_amount pricing + # + # @return [Orb::Models::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig] + required :threshold_total_amount_config, + -> { Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig } + # @!attribute dimensional_price_configuration # # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, bps_config:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :bps) - # Some parameter documentations has been truncated, see {Orb::Models::Price::BPS} - # for more details. + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, threshold_total_amount_config:, dimensional_price_configuration: nil, model_type: :threshold_total_amount) + # Some parameter documentations has been truncated, see + # {Orb::Models::Price::ThresholdTotalAmount} for more details. # # @param id [String] # @@ -1426,9 +1531,11 @@ class BPS < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param bps_config [Orb::Models::BPSConfig] + # @param billing_mode [Symbol, Orb::Models::Price::ThresholdTotalAmount::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::ThresholdTotalAmount::Cadence] # - # @param cadence [Symbol, Orb::Models::Price::BPS::Cadence] + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -1448,7 +1555,7 @@ class BPS < Orb::Internal::Type::BaseModel # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -1464,15 +1571,28 @@ class BPS < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::BPS::PriceType] + # @param price_type [Symbol, Orb::Models::Price::ThresholdTotalAmount::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # + # @param threshold_total_amount_config [Orb::Models::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig] Configuration for threshold_total_amount pricing + # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :bps] + # @param model_type [Symbol, :threshold_total_amount] The pricing model type + + # @see Orb::Models::Price::ThresholdTotalAmount#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear - # @see Orb::Models::Price::BPS#cadence + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::ThresholdTotalAmount#cadence module Cadence extend Orb::Internal::Type::Enum @@ -1487,33 +1607,69 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::BPS#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - - # @see Orb::Models::Price::BPS#price_type + # @see Orb::Models::Price::ThresholdTotalAmount#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end + + # @see Orb::Models::Price::ThresholdTotalAmount#threshold_total_amount_config + class ThresholdTotalAmountConfig < Orb::Internal::Type::BaseModel + # @!attribute consumption_table + # When the quantity consumed passes a provided threshold, the configured total + # will be charged + # + # @return [Array] + required :consumption_table, + -> { Orb::Internal::Type::ArrayOf[Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig::ConsumptionTable] } + + # @!attribute prorate + # If true, the unit price will be prorated to the billing period + # + # @return [Boolean, nil] + optional :prorate, Orb::Internal::Type::Boolean, nil?: true + + # @!method initialize(consumption_table:, prorate: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig} for more + # details. + # + # Configuration for threshold_total_amount pricing + # + # @param consumption_table [Array] When the quantity consumed passes a provided threshold, the configured total wil + # + # @param prorate [Boolean, nil] If true, the unit price will be prorated to the billing period + + class ConsumptionTable < Orb::Internal::Type::BaseModel + # @!attribute threshold + # Quantity threshold + # + # @return [String] + required :threshold, String + + # @!attribute total_amount + # Total amount for this threshold + # + # @return [String] + required :total_amount, String + + # @!method initialize(threshold:, total_amount:) + # Configuration for a single threshold + # + # @param threshold [String] Quantity threshold + # + # @param total_amount [String] Total amount for this threshold + end + end end - class BulkBPS < Orb::Internal::Type::BaseModel + class TieredPackage < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -1529,15 +1685,22 @@ class BulkBPS < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } - # @!attribute bulk_bps_config + # @!attribute billing_mode # - # @return [Orb::Models::BulkBPSConfig] - required :bulk_bps_config, -> { Orb::BulkBPSConfig } + # @return [Symbol, Orb::Models::Price::TieredPackage::BillingMode] + required :billing_mode, enum: -> { Orb::Price::TieredPackage::BillingMode } # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::BulkBPS::Cadence] - required :cadence, enum: -> { Orb::Price::BulkBPS::Cadence } + # @return [Symbol, Orb::Models::Price::TieredPackage::Cadence] + required :cadence, enum: -> { Orb::Price::TieredPackage::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -1547,7 +1710,9 @@ class BulkBPS < Orb::Internal::Type::BaseModel # @!attribute conversion_rate_config # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - required :conversion_rate_config, union: -> { Orb::Price::BulkBPS::ConversionRateConfig }, nil?: true + required :conversion_rate_config, + union: -> { Orb::Price::TieredPackage::ConversionRateConfig }, + nil?: true # @!attribute created_at # @@ -1586,6 +1751,8 @@ class BulkBPS < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -1624,9 +1791,10 @@ class BulkBPS < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :bulk_bps] - required :model_type, const: :bulk_bps + # @return [Symbol, :tiered_package] + required :model_type, const: :tiered_package # @!attribute name # @@ -1640,8 +1808,8 @@ class BulkBPS < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::BulkBPS::PriceType] - required :price_type, enum: -> { Orb::Price::BulkBPS::PriceType } + # @return [Symbol, Orb::Models::Price::TieredPackage::PriceType] + required :price_type, enum: -> { Orb::Price::TieredPackage::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -1650,14 +1818,20 @@ class BulkBPS < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true + # @!attribute tiered_package_config + # Configuration for tiered_package pricing + # + # @return [Orb::Models::Price::TieredPackage::TieredPackageConfig] + required :tiered_package_config, -> { Orb::Price::TieredPackage::TieredPackageConfig } + # @!attribute dimensional_price_configuration # # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, bulk_bps_config:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :bulk_bps) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, tiered_package_config:, dimensional_price_configuration: nil, model_type: :tiered_package) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::BulkBPS} for more details. + # {Orb::Models::Price::TieredPackage} for more details. # # @param id [String] # @@ -1665,9 +1839,11 @@ class BulkBPS < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param bulk_bps_config [Orb::Models::BulkBPSConfig] + # @param billing_mode [Symbol, Orb::Models::Price::TieredPackage::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::TieredPackage::Cadence] # - # @param cadence [Symbol, Orb::Models::Price::BulkBPS::Cadence] + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -1687,7 +1863,7 @@ class BulkBPS < Orb::Internal::Type::BaseModel # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -1703,15 +1879,28 @@ class BulkBPS < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::BulkBPS::PriceType] + # @param price_type [Symbol, Orb::Models::Price::TieredPackage::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # + # @param tiered_package_config [Orb::Models::Price::TieredPackage::TieredPackageConfig] Configuration for tiered_package pricing + # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :bulk_bps] + # @param model_type [Symbol, :tiered_package] The pricing model type + + # @see Orb::Models::Price::TieredPackage#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end - # @see Orb::Models::Price::BulkBPS#cadence + # @see Orb::Models::Price::TieredPackage#cadence module Cadence extend Orb::Internal::Type::Enum @@ -1726,33 +1915,69 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::BulkBPS#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - - # @see Orb::Models::Price::BulkBPS#price_type + # @see Orb::Models::Price::TieredPackage#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end + + # @see Orb::Models::Price::TieredPackage#tiered_package_config + class TieredPackageConfig < Orb::Internal::Type::BaseModel + # @!attribute package_size + # Package size + # + # @return [String] + required :package_size, String + + # @!attribute tiers + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. The tier bounds are defined based on + # the total quantity rather than the number of packages, so they must be multiples + # of the package size. + # + # @return [Array] + required :tiers, -> { Orb::Internal::Type::ArrayOf[Orb::Price::TieredPackage::TieredPackageConfig::Tier] } + + # @!method initialize(package_size:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::Price::TieredPackage::TieredPackageConfig} for more details. + # + # Configuration for tiered_package pricing + # + # @param package_size [String] Package size + # + # @param tiers [Array] Apply tiered pricing after rounding up the quantity to the package size. Tiers a + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute per_unit + # Price per package + # + # @return [String] + required :per_unit, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!method initialize(per_unit:, tier_lower_bound:) + # Configuration for a single tier with business logic + # + # @param per_unit [String] Price per package + # + # @param tier_lower_bound [String] Tier lower bound + end + end end - class Bulk < Orb::Internal::Type::BaseModel + class TieredWithMinimum < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -1768,15 +1993,22 @@ class Bulk < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } - # @!attribute bulk_config + # @!attribute billing_mode # - # @return [Orb::Models::BulkConfig] - required :bulk_config, -> { Orb::BulkConfig } + # @return [Symbol, Orb::Models::Price::TieredWithMinimum::BillingMode] + required :billing_mode, enum: -> { Orb::Price::TieredWithMinimum::BillingMode } # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::Bulk::Cadence] - required :cadence, enum: -> { Orb::Price::Bulk::Cadence } + # @return [Symbol, Orb::Models::Price::TieredWithMinimum::Cadence] + required :cadence, enum: -> { Orb::Price::TieredWithMinimum::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -1786,7 +2018,9 @@ class Bulk < Orb::Internal::Type::BaseModel # @!attribute conversion_rate_config # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - required :conversion_rate_config, union: -> { Orb::Price::Bulk::ConversionRateConfig }, nil?: true + required :conversion_rate_config, + union: -> { Orb::Price::TieredWithMinimum::ConversionRateConfig }, + nil?: true # @!attribute created_at # @@ -1825,6 +2059,8 @@ class Bulk < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -1863,9 +2099,10 @@ class Bulk < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :bulk] - required :model_type, const: :bulk + # @return [Symbol, :tiered_with_minimum] + required :model_type, const: :tiered_with_minimum # @!attribute name # @@ -1879,8 +2116,8 @@ class Bulk < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::Bulk::PriceType] - required :price_type, enum: -> { Orb::Price::Bulk::PriceType } + # @return [Symbol, Orb::Models::Price::TieredWithMinimum::PriceType] + required :price_type, enum: -> { Orb::Price::TieredWithMinimum::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -1889,14 +2126,20 @@ class Bulk < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true + # @!attribute tiered_with_minimum_config + # Configuration for tiered_with_minimum pricing + # + # @return [Orb::Models::Price::TieredWithMinimum::TieredWithMinimumConfig] + required :tiered_with_minimum_config, -> { Orb::Price::TieredWithMinimum::TieredWithMinimumConfig } + # @!attribute dimensional_price_configuration # # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, bulk_config:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :bulk) - # Some parameter documentations has been truncated, see {Orb::Models::Price::Bulk} - # for more details. + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, tiered_with_minimum_config:, dimensional_price_configuration: nil, model_type: :tiered_with_minimum) + # Some parameter documentations has been truncated, see + # {Orb::Models::Price::TieredWithMinimum} for more details. # # @param id [String] # @@ -1904,9 +2147,11 @@ class Bulk < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param bulk_config [Orb::Models::BulkConfig] + # @param billing_mode [Symbol, Orb::Models::Price::TieredWithMinimum::BillingMode] # - # @param cadence [Symbol, Orb::Models::Price::Bulk::Cadence] + # @param cadence [Symbol, Orb::Models::Price::TieredWithMinimum::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -1926,7 +2171,7 @@ class Bulk < Orb::Internal::Type::BaseModel # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -1942,15 +2187,28 @@ class Bulk < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::Bulk::PriceType] + # @param price_type [Symbol, Orb::Models::Price::TieredWithMinimum::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # + # @param tiered_with_minimum_config [Orb::Models::Price::TieredWithMinimum::TieredWithMinimumConfig] Configuration for tiered_with_minimum pricing + # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :bulk] + # @param model_type [Symbol, :tiered_with_minimum] The pricing model type - # @see Orb::Models::Price::Bulk#cadence + # @see Orb::Models::Price::TieredWithMinimum#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::TieredWithMinimum#cadence module Cadence extend Orb::Internal::Type::Enum @@ -1965,33 +2223,85 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::Bulk#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - - # @see Orb::Models::Price::Bulk#price_type + # @see Orb::Models::Price::TieredWithMinimum#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end + + # @see Orb::Models::Price::TieredWithMinimum#tiered_with_minimum_config + class TieredWithMinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Tiered pricing with a minimum amount dependent on the volume tier. Tiers are + # defined using exclusive lower bounds. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::Price::TieredWithMinimum::TieredWithMinimumConfig::Tier] } + + # @!attribute hide_zero_amount_tiers + # If true, tiers with an accrued amount of 0 will not be included in the rating. + # + # @return [Boolean, nil] + optional :hide_zero_amount_tiers, Orb::Internal::Type::Boolean + + # @!attribute prorate + # If true, the unit price will be prorated to the billing period + # + # @return [Boolean, nil] + optional :prorate, Orb::Internal::Type::Boolean + + # @!method initialize(tiers:, hide_zero_amount_tiers: nil, prorate: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::Price::TieredWithMinimum::TieredWithMinimumConfig} for more + # details. + # + # Configuration for tiered_with_minimum pricing + # + # @param tiers [Array] Tiered pricing with a minimum amount dependent on the volume tier. Tiers are def + # + # @param hide_zero_amount_tiers [Boolean] If true, tiers with an accrued amount of 0 will not be included in the rating. + # + # @param prorate [Boolean] If true, the unit price will be prorated to the billing period + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute minimum_amount + # Minimum amount + # + # @return [String] + required :minimum_amount, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(minimum_amount:, tier_lower_bound:, unit_amount:) + # Configuration for a single tier + # + # @param minimum_amount [String] Minimum amount + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Per unit amount + end + end end - class ThresholdTotalAmount < Orb::Internal::Type::BaseModel + class GroupedTiered < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -2007,10 +2317,22 @@ class ThresholdTotalAmount < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::GroupedTiered::BillingMode] + required :billing_mode, enum: -> { Orb::Price::GroupedTiered::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::ThresholdTotalAmount::Cadence] - required :cadence, enum: -> { Orb::Price::ThresholdTotalAmount::Cadence } + # @return [Symbol, Orb::Models::Price::GroupedTiered::Cadence] + required :cadence, enum: -> { Orb::Price::GroupedTiered::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -2021,7 +2343,7 @@ class ThresholdTotalAmount < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] required :conversion_rate_config, - union: -> { Orb::Price::ThresholdTotalAmount::ConversionRateConfig }, + union: -> { Orb::Price::GroupedTiered::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -2055,12 +2377,20 @@ class ThresholdTotalAmount < Orb::Internal::Type::BaseModel # @return [Float, nil] required :fixed_price_quantity, Float, nil?: true + # @!attribute grouped_tiered_config + # Configuration for grouped_tiered pricing + # + # @return [Orb::Models::Price::GroupedTiered::GroupedTieredConfig] + required :grouped_tiered_config, -> { Orb::Price::GroupedTiered::GroupedTieredConfig } + # @!attribute invoicing_cycle_configuration # # @return [Orb::Models::BillingCycleConfiguration, nil] required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -2099,9 +2429,10 @@ class ThresholdTotalAmount < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :threshold_total_amount] - required :model_type, const: :threshold_total_amount + # @return [Symbol, :grouped_tiered] + required :model_type, const: :grouped_tiered # @!attribute name # @@ -2115,8 +2446,8 @@ class ThresholdTotalAmount < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::ThresholdTotalAmount::PriceType] - required :price_type, enum: -> { Orb::Price::ThresholdTotalAmount::PriceType } + # @return [Symbol, Orb::Models::Price::GroupedTiered::PriceType] + required :price_type, enum: -> { Orb::Price::GroupedTiered::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -2125,19 +2456,14 @@ class ThresholdTotalAmount < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true - # @!attribute threshold_total_amount_config - # - # @return [Hash{Symbol=>Object}] - required :threshold_total_amount_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] - # @!attribute dimensional_price_configuration # # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, threshold_total_amount_config:, dimensional_price_configuration: nil, model_type: :threshold_total_amount) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, grouped_tiered_config:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :grouped_tiered) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::ThresholdTotalAmount} for more details. + # {Orb::Models::Price::GroupedTiered} for more details. # # @param id [String] # @@ -2145,7 +2471,11 @@ class ThresholdTotalAmount < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::ThresholdTotalAmount::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::GroupedTiered::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::GroupedTiered::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -2163,9 +2493,11 @@ class ThresholdTotalAmount < Orb::Internal::Type::BaseModel # # @param fixed_price_quantity [Float, nil] # + # @param grouped_tiered_config [Orb::Models::Price::GroupedTiered::GroupedTieredConfig] Configuration for grouped_tiered pricing + # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -2181,17 +2513,26 @@ class ThresholdTotalAmount < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::ThresholdTotalAmount::PriceType] + # @param price_type [Symbol, Orb::Models::Price::GroupedTiered::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # - # @param threshold_total_amount_config [Hash{Symbol=>Object}] - # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :threshold_total_amount] + # @param model_type [Symbol, :grouped_tiered] The pricing model type - # @see Orb::Models::Price::ThresholdTotalAmount#cadence + # @see Orb::Models::Price::GroupedTiered#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::GroupedTiered#cadence module Cadence extend Orb::Internal::Type::Enum @@ -2206,33 +2547,67 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::ThresholdTotalAmount#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::Price::GroupedTiered#grouped_tiered_config + class GroupedTieredConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The billable metric property used to group before tiering + # + # @return [String] + required :grouping_key, String + + # @!attribute tiers + # Apply tiered pricing to each segment generated after grouping with the provided + # key + # + # @return [Array] + required :tiers, -> { Orb::Internal::Type::ArrayOf[Orb::Price::GroupedTiered::GroupedTieredConfig::Tier] } + + # @!method initialize(grouping_key:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::Price::GroupedTiered::GroupedTieredConfig} for more details. + # + # Configuration for grouped_tiered pricing + # + # @param grouping_key [String] The billable metric property used to group before tiering + # + # @param tiers [Array] Apply tiered pricing to each segment generated after grouping with the provided + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tier + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Per unit amount + end end - # @see Orb::Models::Price::ThresholdTotalAmount#price_type + # @see Orb::Models::Price::GroupedTiered#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end end - class TieredPackage < Orb::Internal::Type::BaseModel + class TieredPackageWithMinimum < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -2248,10 +2623,22 @@ class TieredPackage < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::TieredPackageWithMinimum::BillingMode] + required :billing_mode, enum: -> { Orb::Price::TieredPackageWithMinimum::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::TieredPackage::Cadence] - required :cadence, enum: -> { Orb::Price::TieredPackage::Cadence } + # @return [Symbol, Orb::Models::Price::TieredPackageWithMinimum::Cadence] + required :cadence, enum: -> { Orb::Price::TieredPackageWithMinimum::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -2262,7 +2649,7 @@ class TieredPackage < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] required :conversion_rate_config, - union: -> { Orb::Price::TieredPackage::ConversionRateConfig }, + union: -> { Orb::Price::TieredPackageWithMinimum::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -2302,6 +2689,8 @@ class TieredPackage < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -2340,9 +2729,10 @@ class TieredPackage < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :tiered_package] - required :model_type, const: :tiered_package + # @return [Symbol, :tiered_package_with_minimum] + required :model_type, const: :tiered_package_with_minimum # @!attribute name # @@ -2356,8 +2746,8 @@ class TieredPackage < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::TieredPackage::PriceType] - required :price_type, enum: -> { Orb::Price::TieredPackage::PriceType } + # @return [Symbol, Orb::Models::Price::TieredPackageWithMinimum::PriceType] + required :price_type, enum: -> { Orb::Price::TieredPackageWithMinimum::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -2366,19 +2756,21 @@ class TieredPackage < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true - # @!attribute tiered_package_config + # @!attribute tiered_package_with_minimum_config + # Configuration for tiered_package_with_minimum pricing # - # @return [Hash{Symbol=>Object}] - required :tiered_package_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig] + required :tiered_package_with_minimum_config, + -> { Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig } # @!attribute dimensional_price_configuration # # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, tiered_package_config:, dimensional_price_configuration: nil, model_type: :tiered_package) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, tiered_package_with_minimum_config:, dimensional_price_configuration: nil, model_type: :tiered_package_with_minimum) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::TieredPackage} for more details. + # {Orb::Models::Price::TieredPackageWithMinimum} for more details. # # @param id [String] # @@ -2386,7 +2778,11 @@ class TieredPackage < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::TieredPackage::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::TieredPackageWithMinimum::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::TieredPackageWithMinimum::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -2406,7 +2802,7 @@ class TieredPackage < Orb::Internal::Type::BaseModel # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -2422,17 +2818,28 @@ class TieredPackage < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::TieredPackage::PriceType] + # @param price_type [Symbol, Orb::Models::Price::TieredPackageWithMinimum::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # - # @param tiered_package_config [Hash{Symbol=>Object}] + # @param tiered_package_with_minimum_config [Orb::Models::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig] Configuration for tiered_package_with_minimum pricing # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :tiered_package] + # @param model_type [Symbol, :tiered_package_with_minimum] The pricing model type - # @see Orb::Models::Price::TieredPackage#cadence + # @see Orb::Models::Price::TieredPackageWithMinimum#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::TieredPackageWithMinimum#cadence module Cadence extend Orb::Internal::Type::Enum @@ -2447,33 +2854,77 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::TieredPackage#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - - # @see Orb::Models::Price::TieredPackage#price_type + # @see Orb::Models::Price::TieredPackageWithMinimum#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end + + # @see Orb::Models::Price::TieredPackageWithMinimum#tiered_package_with_minimum_config + class TieredPackageWithMinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute package_size + # Package size + # + # @return [Float] + required :package_size, Float + + # @!attribute tiers + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig::Tier] } + + # @!method initialize(package_size:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig} + # for more details. + # + # Configuration for tiered_package_with_minimum pricing + # + # @param package_size [Float] Package size + # + # @param tiers [Array] Apply tiered pricing after rounding up the quantity to the package size. Tiers a + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute minimum_amount + # Minimum amount + # + # @return [String] + required :minimum_amount, String + + # @!attribute per_unit + # Price per package + # + # @return [String] + required :per_unit, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!method initialize(minimum_amount:, per_unit:, tier_lower_bound:) + # Configuration for a single tier + # + # @param minimum_amount [String] Minimum amount + # + # @param per_unit [String] Price per package + # + # @param tier_lower_bound [String] Tier lower bound + end + end end - class GroupedTiered < Orb::Internal::Type::BaseModel + class PackageWithAllocation < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -2489,12 +2940,24 @@ class GroupedTiered < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } - # @!attribute cadence + # @!attribute billing_mode # - # @return [Symbol, Orb::Models::Price::GroupedTiered::Cadence] - required :cadence, enum: -> { Orb::Price::GroupedTiered::Cadence } + # @return [Symbol, Orb::Models::Price::PackageWithAllocation::BillingMode] + required :billing_mode, enum: -> { Orb::Price::PackageWithAllocation::BillingMode } - # @!attribute conversion_rate + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::PackageWithAllocation::Cadence] + required :cadence, enum: -> { Orb::Price::PackageWithAllocation::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true + + # @!attribute conversion_rate # # @return [Float, nil] required :conversion_rate, Float, nil?: true @@ -2503,7 +2966,7 @@ class GroupedTiered < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] required :conversion_rate_config, - union: -> { Orb::Price::GroupedTiered::ConversionRateConfig }, + union: -> { Orb::Price::PackageWithAllocation::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -2537,17 +3000,14 @@ class GroupedTiered < Orb::Internal::Type::BaseModel # @return [Float, nil] required :fixed_price_quantity, Float, nil?: true - # @!attribute grouped_tiered_config - # - # @return [Hash{Symbol=>Object}] - required :grouped_tiered_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] - # @!attribute invoicing_cycle_configuration # # @return [Orb::Models::BillingCycleConfiguration, nil] required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -2586,15 +3046,23 @@ class GroupedTiered < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :grouped_tiered] - required :model_type, const: :grouped_tiered + # @return [Symbol, :package_with_allocation] + required :model_type, const: :package_with_allocation # @!attribute name # # @return [String] required :name, String + # @!attribute package_with_allocation_config + # Configuration for package_with_allocation pricing + # + # @return [Orb::Models::Price::PackageWithAllocation::PackageWithAllocationConfig] + required :package_with_allocation_config, + -> { Orb::Price::PackageWithAllocation::PackageWithAllocationConfig } + # @!attribute plan_phase_order # # @return [Integer, nil] @@ -2602,8 +3070,8 @@ class GroupedTiered < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::GroupedTiered::PriceType] - required :price_type, enum: -> { Orb::Price::GroupedTiered::PriceType } + # @return [Symbol, Orb::Models::Price::PackageWithAllocation::PriceType] + required :price_type, enum: -> { Orb::Price::PackageWithAllocation::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -2617,9 +3085,9 @@ class GroupedTiered < Orb::Internal::Type::BaseModel # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, grouped_tiered_config:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :grouped_tiered) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, package_with_allocation_config:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :package_with_allocation) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::GroupedTiered} for more details. + # {Orb::Models::Price::PackageWithAllocation} for more details. # # @param id [String] # @@ -2627,7 +3095,11 @@ class GroupedTiered < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::GroupedTiered::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::PackageWithAllocation::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::PackageWithAllocation::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -2645,11 +3117,9 @@ class GroupedTiered < Orb::Internal::Type::BaseModel # # @param fixed_price_quantity [Float, nil] # - # @param grouped_tiered_config [Hash{Symbol=>Object}] - # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -2663,17 +3133,30 @@ class GroupedTiered < Orb::Internal::Type::BaseModel # # @param name [String] # + # @param package_with_allocation_config [Orb::Models::Price::PackageWithAllocation::PackageWithAllocationConfig] Configuration for package_with_allocation pricing + # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::GroupedTiered::PriceType] + # @param price_type [Symbol, Orb::Models::Price::PackageWithAllocation::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :grouped_tiered] + # @param model_type [Symbol, :package_with_allocation] The pricing model type - # @see Orb::Models::Price::GroupedTiered#cadence + # @see Orb::Models::Price::PackageWithAllocation#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::PackageWithAllocation#cadence module Cadence extend Orb::Internal::Type::Enum @@ -2688,33 +3171,50 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::GroupedTiered#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::Price::PackageWithAllocation#package_with_allocation_config + class PackageWithAllocationConfig < Orb::Internal::Type::BaseModel + # @!attribute allocation + # Usage allocation + # + # @return [String] + required :allocation, String + + # @!attribute package_amount + # Price per package + # + # @return [String] + required :package_amount, String + + # @!attribute package_size + # Package size + # + # @return [String] + required :package_size, String + + # @!method initialize(allocation:, package_amount:, package_size:) + # Configuration for package_with_allocation pricing + # + # @param allocation [String] Usage allocation + # + # @param package_amount [String] Price per package + # + # @param package_size [String] Package size end - # @see Orb::Models::Price::GroupedTiered#price_type + # @see Orb::Models::Price::PackageWithAllocation#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end end - class TieredWithMinimum < Orb::Internal::Type::BaseModel + class UnitWithPercent < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -2730,10 +3230,22 @@ class TieredWithMinimum < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::UnitWithPercent::BillingMode] + required :billing_mode, enum: -> { Orb::Price::UnitWithPercent::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::TieredWithMinimum::Cadence] - required :cadence, enum: -> { Orb::Price::TieredWithMinimum::Cadence } + # @return [Symbol, Orb::Models::Price::UnitWithPercent::Cadence] + required :cadence, enum: -> { Orb::Price::UnitWithPercent::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -2744,7 +3256,7 @@ class TieredWithMinimum < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] required :conversion_rate_config, - union: -> { Orb::Price::TieredWithMinimum::ConversionRateConfig }, + union: -> { Orb::Price::UnitWithPercent::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -2784,6 +3296,8 @@ class TieredWithMinimum < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -2822,9 +3336,10 @@ class TieredWithMinimum < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :tiered_with_minimum] - required :model_type, const: :tiered_with_minimum + # @return [Symbol, :unit_with_percent] + required :model_type, const: :unit_with_percent # @!attribute name # @@ -2838,8 +3353,8 @@ class TieredWithMinimum < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::TieredWithMinimum::PriceType] - required :price_type, enum: -> { Orb::Price::TieredWithMinimum::PriceType } + # @return [Symbol, Orb::Models::Price::UnitWithPercent::PriceType] + required :price_type, enum: -> { Orb::Price::UnitWithPercent::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -2848,19 +3363,20 @@ class TieredWithMinimum < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true - # @!attribute tiered_with_minimum_config + # @!attribute unit_with_percent_config + # Configuration for unit_with_percent pricing # - # @return [Hash{Symbol=>Object}] - required :tiered_with_minimum_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::Price::UnitWithPercent::UnitWithPercentConfig] + required :unit_with_percent_config, -> { Orb::Price::UnitWithPercent::UnitWithPercentConfig } # @!attribute dimensional_price_configuration # # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, tiered_with_minimum_config:, dimensional_price_configuration: nil, model_type: :tiered_with_minimum) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, unit_with_percent_config:, dimensional_price_configuration: nil, model_type: :unit_with_percent) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::TieredWithMinimum} for more details. + # {Orb::Models::Price::UnitWithPercent} for more details. # # @param id [String] # @@ -2868,7 +3384,11 @@ class TieredWithMinimum < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::TieredWithMinimum::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::UnitWithPercent::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::UnitWithPercent::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -2888,7 +3408,7 @@ class TieredWithMinimum < Orb::Internal::Type::BaseModel # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -2904,17 +3424,28 @@ class TieredWithMinimum < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::TieredWithMinimum::PriceType] + # @param price_type [Symbol, Orb::Models::Price::UnitWithPercent::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # - # @param tiered_with_minimum_config [Hash{Symbol=>Object}] + # @param unit_with_percent_config [Orb::Models::Price::UnitWithPercent::UnitWithPercentConfig] Configuration for unit_with_percent pricing # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :tiered_with_minimum] + # @param model_type [Symbol, :unit_with_percent] The pricing model type - # @see Orb::Models::Price::TieredWithMinimum#cadence + # @see Orb::Models::Price::UnitWithPercent#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::UnitWithPercent#cadence module Cadence extend Orb::Internal::Type::Enum @@ -2929,33 +3460,42 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::TieredWithMinimum#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - - # @see Orb::Models::Price::TieredWithMinimum#price_type + # @see Orb::Models::Price::UnitWithPercent#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end + + # @see Orb::Models::Price::UnitWithPercent#unit_with_percent_config + class UnitWithPercentConfig < Orb::Internal::Type::BaseModel + # @!attribute percent + # What percent, out of 100, of the calculated total to charge + # + # @return [String] + required :percent, String + + # @!attribute unit_amount + # Rate per unit of usage + # + # @return [String] + required :unit_amount, String + + # @!method initialize(percent:, unit_amount:) + # Configuration for unit_with_percent pricing + # + # @param percent [String] What percent, out of 100, of the calculated total to charge + # + # @param unit_amount [String] Rate per unit of usage + end end - class TieredPackageWithMinimum < Orb::Internal::Type::BaseModel + class MatrixWithAllocation < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -2971,10 +3511,22 @@ class TieredPackageWithMinimum < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::MatrixWithAllocation::BillingMode] + required :billing_mode, enum: -> { Orb::Price::MatrixWithAllocation::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::TieredPackageWithMinimum::Cadence] - required :cadence, enum: -> { Orb::Price::TieredPackageWithMinimum::Cadence } + # @return [Symbol, Orb::Models::Price::MatrixWithAllocation::Cadence] + required :cadence, enum: -> { Orb::Price::MatrixWithAllocation::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -2985,7 +3537,7 @@ class TieredPackageWithMinimum < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] required :conversion_rate_config, - union: -> { Orb::Price::TieredPackageWithMinimum::ConversionRateConfig }, + union: -> { Orb::Price::MatrixWithAllocation::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -3025,10 +3577,18 @@ class TieredPackageWithMinimum < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } + # @!attribute matrix_with_allocation_config + # Configuration for matrix_with_allocation pricing + # + # @return [Orb::Models::MatrixWithAllocationConfig] + required :matrix_with_allocation_config, -> { Orb::MatrixWithAllocationConfig } + # @!attribute maximum # @deprecated # @@ -3063,9 +3623,10 @@ class TieredPackageWithMinimum < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :tiered_package_with_minimum] - required :model_type, const: :tiered_package_with_minimum + # @return [Symbol, :matrix_with_allocation] + required :model_type, const: :matrix_with_allocation # @!attribute name # @@ -3079,8 +3640,8 @@ class TieredPackageWithMinimum < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::TieredPackageWithMinimum::PriceType] - required :price_type, enum: -> { Orb::Price::TieredPackageWithMinimum::PriceType } + # @return [Symbol, Orb::Models::Price::MatrixWithAllocation::PriceType] + required :price_type, enum: -> { Orb::Price::MatrixWithAllocation::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -3089,19 +3650,14 @@ class TieredPackageWithMinimum < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true - # @!attribute tiered_package_with_minimum_config - # - # @return [Hash{Symbol=>Object}] - required :tiered_package_with_minimum_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] - # @!attribute dimensional_price_configuration # # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, tiered_package_with_minimum_config:, dimensional_price_configuration: nil, model_type: :tiered_package_with_minimum) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, matrix_with_allocation_config:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :matrix_with_allocation) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::TieredPackageWithMinimum} for more details. + # {Orb::Models::Price::MatrixWithAllocation} for more details. # # @param id [String] # @@ -3109,7 +3665,11 @@ class TieredPackageWithMinimum < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::TieredPackageWithMinimum::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::MatrixWithAllocation::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::MatrixWithAllocation::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -3129,7 +3689,9 @@ class TieredPackageWithMinimum < Orb::Internal::Type::BaseModel # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in + # + # @param matrix_with_allocation_config [Orb::Models::MatrixWithAllocationConfig] Configuration for matrix_with_allocation pricing # # @param maximum [Orb::Models::Maximum, nil] # @@ -3145,17 +3707,26 @@ class TieredPackageWithMinimum < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::TieredPackageWithMinimum::PriceType] + # @param price_type [Symbol, Orb::Models::Price::MatrixWithAllocation::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # - # @param tiered_package_with_minimum_config [Hash{Symbol=>Object}] - # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :tiered_package_with_minimum] + # @param model_type [Symbol, :matrix_with_allocation] The pricing model type - # @see Orb::Models::Price::TieredPackageWithMinimum#cadence + # @see Orb::Models::Price::MatrixWithAllocation#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::MatrixWithAllocation#cadence module Cadence extend Orb::Internal::Type::Enum @@ -3170,33 +3741,20 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::TieredPackageWithMinimum#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - - # @see Orb::Models::Price::TieredPackageWithMinimum#price_type + # @see Orb::Models::Price::MatrixWithAllocation#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end end - class PackageWithAllocation < Orb::Internal::Type::BaseModel + class TieredWithProration < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -3212,10 +3770,22 @@ class PackageWithAllocation < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::TieredWithProration::BillingMode] + required :billing_mode, enum: -> { Orb::Price::TieredWithProration::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::PackageWithAllocation::Cadence] - required :cadence, enum: -> { Orb::Price::PackageWithAllocation::Cadence } + # @return [Symbol, Orb::Models::Price::TieredWithProration::Cadence] + required :cadence, enum: -> { Orb::Price::TieredWithProration::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -3226,7 +3796,7 @@ class PackageWithAllocation < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] required :conversion_rate_config, - union: -> { Orb::Price::PackageWithAllocation::ConversionRateConfig }, + union: -> { Orb::Price::TieredWithProration::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -3266,6 +3836,8 @@ class PackageWithAllocation < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -3304,20 +3876,16 @@ class PackageWithAllocation < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :package_with_allocation] - required :model_type, const: :package_with_allocation + # @return [Symbol, :tiered_with_proration] + required :model_type, const: :tiered_with_proration # @!attribute name # # @return [String] required :name, String - # @!attribute package_with_allocation_config - # - # @return [Hash{Symbol=>Object}] - required :package_with_allocation_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] - # @!attribute plan_phase_order # # @return [Integer, nil] @@ -3325,8 +3893,8 @@ class PackageWithAllocation < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::PackageWithAllocation::PriceType] - required :price_type, enum: -> { Orb::Price::PackageWithAllocation::PriceType } + # @return [Symbol, Orb::Models::Price::TieredWithProration::PriceType] + required :price_type, enum: -> { Orb::Price::TieredWithProration::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -3335,14 +3903,20 @@ class PackageWithAllocation < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true + # @!attribute tiered_with_proration_config + # Configuration for tiered_with_proration pricing + # + # @return [Orb::Models::Price::TieredWithProration::TieredWithProrationConfig] + required :tiered_with_proration_config, -> { Orb::Price::TieredWithProration::TieredWithProrationConfig } + # @!attribute dimensional_price_configuration # # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, package_with_allocation_config:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :package_with_allocation) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, tiered_with_proration_config:, dimensional_price_configuration: nil, model_type: :tiered_with_proration) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::PackageWithAllocation} for more details. + # {Orb::Models::Price::TieredWithProration} for more details. # # @param id [String] # @@ -3350,7 +3924,11 @@ class PackageWithAllocation < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::PackageWithAllocation::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::TieredWithProration::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::TieredWithProration::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -3370,7 +3948,7 @@ class PackageWithAllocation < Orb::Internal::Type::BaseModel # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -3384,19 +3962,30 @@ class PackageWithAllocation < Orb::Internal::Type::BaseModel # # @param name [String] # - # @param package_with_allocation_config [Hash{Symbol=>Object}] - # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::PackageWithAllocation::PriceType] + # @param price_type [Symbol, Orb::Models::Price::TieredWithProration::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # + # @param tiered_with_proration_config [Orb::Models::Price::TieredWithProration::TieredWithProrationConfig] Configuration for tiered_with_proration pricing + # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :package_with_allocation] + # @param model_type [Symbol, :tiered_with_proration] The pricing model type - # @see Orb::Models::Price::PackageWithAllocation#cadence + # @see Orb::Models::Price::TieredWithProration#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::TieredWithProration#cadence module Cadence extend Orb::Internal::Type::Enum @@ -3411,33 +4000,61 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::PackageWithAllocation#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - - # @see Orb::Models::Price::PackageWithAllocation#price_type + # @see Orb::Models::Price::TieredWithProration#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end + + # @see Orb::Models::Price::TieredWithProration#tiered_with_proration_config + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Tiers for rating based on total usage quantities into the specified tier with + # proration + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::Price::TieredWithProration::TieredWithProrationConfig::Tier] } + + # @!method initialize(tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::Price::TieredWithProration::TieredWithProrationConfig} for more + # details. + # + # Configuration for tiered_with_proration pricing + # + # @param tiers [Array] Tiers for rating based on total usage quantities into the specified tier with pr + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Inclusive tier starting value + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tiered with proration tier + # + # @param tier_lower_bound [String] Inclusive tier starting value + # + # @param unit_amount [String] Amount per unit + end + end end - class UnitWithPercent < Orb::Internal::Type::BaseModel + class UnitWithProration < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -3453,10 +4070,22 @@ class UnitWithPercent < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::UnitWithProration::BillingMode] + required :billing_mode, enum: -> { Orb::Price::UnitWithProration::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::UnitWithPercent::Cadence] - required :cadence, enum: -> { Orb::Price::UnitWithPercent::Cadence } + # @return [Symbol, Orb::Models::Price::UnitWithProration::Cadence] + required :cadence, enum: -> { Orb::Price::UnitWithProration::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -3467,7 +4096,7 @@ class UnitWithPercent < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] required :conversion_rate_config, - union: -> { Orb::Price::UnitWithPercent::ConversionRateConfig }, + union: -> { Orb::Price::UnitWithProration::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -3507,6 +4136,8 @@ class UnitWithPercent < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -3545,9 +4176,10 @@ class UnitWithPercent < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :unit_with_percent] - required :model_type, const: :unit_with_percent + # @return [Symbol, :unit_with_proration] + required :model_type, const: :unit_with_proration # @!attribute name # @@ -3561,8 +4193,8 @@ class UnitWithPercent < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::UnitWithPercent::PriceType] - required :price_type, enum: -> { Orb::Price::UnitWithPercent::PriceType } + # @return [Symbol, Orb::Models::Price::UnitWithProration::PriceType] + required :price_type, enum: -> { Orb::Price::UnitWithProration::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -3571,19 +4203,20 @@ class UnitWithPercent < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true - # @!attribute unit_with_percent_config + # @!attribute unit_with_proration_config + # Configuration for unit_with_proration pricing # - # @return [Hash{Symbol=>Object}] - required :unit_with_percent_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::Price::UnitWithProration::UnitWithProrationConfig] + required :unit_with_proration_config, -> { Orb::Price::UnitWithProration::UnitWithProrationConfig } # @!attribute dimensional_price_configuration # # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, unit_with_percent_config:, dimensional_price_configuration: nil, model_type: :unit_with_percent) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, unit_with_proration_config:, dimensional_price_configuration: nil, model_type: :unit_with_proration) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::UnitWithPercent} for more details. + # {Orb::Models::Price::UnitWithProration} for more details. # # @param id [String] # @@ -3591,7 +4224,11 @@ class UnitWithPercent < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::UnitWithPercent::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::UnitWithProration::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::UnitWithProration::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -3611,7 +4248,7 @@ class UnitWithPercent < Orb::Internal::Type::BaseModel # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -3627,17 +4264,28 @@ class UnitWithPercent < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::UnitWithPercent::PriceType] + # @param price_type [Symbol, Orb::Models::Price::UnitWithProration::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # - # @param unit_with_percent_config [Hash{Symbol=>Object}] + # @param unit_with_proration_config [Orb::Models::Price::UnitWithProration::UnitWithProrationConfig] Configuration for unit_with_proration pricing # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :unit_with_percent] + # @param model_type [Symbol, :unit_with_proration] The pricing model type - # @see Orb::Models::Price::UnitWithPercent#cadence + # @see Orb::Models::Price::UnitWithProration#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::UnitWithProration#cadence module Cadence extend Orb::Internal::Type::Enum @@ -3652,33 +4300,34 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::UnitWithPercent#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - - # @see Orb::Models::Price::UnitWithPercent#price_type + # @see Orb::Models::Price::UnitWithProration#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end + + # @see Orb::Models::Price::UnitWithProration#unit_with_proration_config + class UnitWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute unit_amount + # Rate per unit of usage + # + # @return [String] + required :unit_amount, String + + # @!method initialize(unit_amount:) + # Configuration for unit_with_proration pricing + # + # @param unit_amount [String] Rate per unit of usage + end end - class MatrixWithAllocation < Orb::Internal::Type::BaseModel + class GroupedAllocation < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -3694,10 +4343,22 @@ class MatrixWithAllocation < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::GroupedAllocation::BillingMode] + required :billing_mode, enum: -> { Orb::Price::GroupedAllocation::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::MatrixWithAllocation::Cadence] - required :cadence, enum: -> { Orb::Price::MatrixWithAllocation::Cadence } + # @return [Symbol, Orb::Models::Price::GroupedAllocation::Cadence] + required :cadence, enum: -> { Orb::Price::GroupedAllocation::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -3708,7 +4369,7 @@ class MatrixWithAllocation < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] required :conversion_rate_config, - union: -> { Orb::Price::MatrixWithAllocation::ConversionRateConfig }, + union: -> { Orb::Price::GroupedAllocation::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -3742,21 +4403,24 @@ class MatrixWithAllocation < Orb::Internal::Type::BaseModel # @return [Float, nil] required :fixed_price_quantity, Float, nil?: true + # @!attribute grouped_allocation_config + # Configuration for grouped_allocation pricing + # + # @return [Orb::Models::Price::GroupedAllocation::GroupedAllocationConfig] + required :grouped_allocation_config, -> { Orb::Price::GroupedAllocation::GroupedAllocationConfig } + # @!attribute invoicing_cycle_configuration # # @return [Orb::Models::BillingCycleConfiguration, nil] required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } - # @!attribute matrix_with_allocation_config - # - # @return [Orb::Models::MatrixWithAllocationConfig] - required :matrix_with_allocation_config, -> { Orb::MatrixWithAllocationConfig } - # @!attribute maximum # @deprecated # @@ -3791,9 +4455,10 @@ class MatrixWithAllocation < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :matrix_with_allocation] - required :model_type, const: :matrix_with_allocation + # @return [Symbol, :grouped_allocation] + required :model_type, const: :grouped_allocation # @!attribute name # @@ -3807,8 +4472,8 @@ class MatrixWithAllocation < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::MatrixWithAllocation::PriceType] - required :price_type, enum: -> { Orb::Price::MatrixWithAllocation::PriceType } + # @return [Symbol, Orb::Models::Price::GroupedAllocation::PriceType] + required :price_type, enum: -> { Orb::Price::GroupedAllocation::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -3822,9 +4487,9 @@ class MatrixWithAllocation < Orb::Internal::Type::BaseModel # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, matrix_with_allocation_config:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :matrix_with_allocation) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, grouped_allocation_config:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :grouped_allocation) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::MatrixWithAllocation} for more details. + # {Orb::Models::Price::GroupedAllocation} for more details. # # @param id [String] # @@ -3832,7 +4497,11 @@ class MatrixWithAllocation < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::MatrixWithAllocation::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::GroupedAllocation::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::GroupedAllocation::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -3850,11 +4519,11 @@ class MatrixWithAllocation < Orb::Internal::Type::BaseModel # # @param fixed_price_quantity [Float, nil] # - # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] + # @param grouped_allocation_config [Orb::Models::Price::GroupedAllocation::GroupedAllocationConfig] Configuration for grouped_allocation pricing # - # @param item [Orb::Models::ItemSlim] + # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param matrix_with_allocation_config [Orb::Models::MatrixWithAllocationConfig] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -3870,15 +4539,26 @@ class MatrixWithAllocation < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::MatrixWithAllocation::PriceType] + # @param price_type [Symbol, Orb::Models::Price::GroupedAllocation::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :matrix_with_allocation] + # @param model_type [Symbol, :grouped_allocation] The pricing model type - # @see Orb::Models::Price::MatrixWithAllocation#cadence + # @see Orb::Models::Price::GroupedAllocation#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::GroupedAllocation#cadence module Cadence extend Orb::Internal::Type::Enum @@ -3893,33 +4573,50 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::MatrixWithAllocation#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::Price::GroupedAllocation#grouped_allocation_config + class GroupedAllocationConfig < Orb::Internal::Type::BaseModel + # @!attribute allocation + # Usage allocation per group + # + # @return [String] + required :allocation, String + + # @!attribute grouping_key + # How to determine the groups that should each be allocated some quantity + # + # @return [String] + required :grouping_key, String + + # @!attribute overage_unit_rate + # Unit rate for post-allocation + # + # @return [String] + required :overage_unit_rate, String + + # @!method initialize(allocation:, grouping_key:, overage_unit_rate:) + # Configuration for grouped_allocation pricing + # + # @param allocation [String] Usage allocation per group + # + # @param grouping_key [String] How to determine the groups that should each be allocated some quantity + # + # @param overage_unit_rate [String] Unit rate for post-allocation end - # @see Orb::Models::Price::MatrixWithAllocation#price_type + # @see Orb::Models::Price::GroupedAllocation#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end end - class TieredWithProration < Orb::Internal::Type::BaseModel + class BulkWithProration < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -3935,10 +4632,28 @@ class TieredWithProration < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::BulkWithProration::BillingMode] + required :billing_mode, enum: -> { Orb::Price::BulkWithProration::BillingMode } + + # @!attribute bulk_with_proration_config + # Configuration for bulk_with_proration pricing + # + # @return [Orb::Models::Price::BulkWithProration::BulkWithProrationConfig] + required :bulk_with_proration_config, -> { Orb::Price::BulkWithProration::BulkWithProrationConfig } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::TieredWithProration::Cadence] - required :cadence, enum: -> { Orb::Price::TieredWithProration::Cadence } + # @return [Symbol, Orb::Models::Price::BulkWithProration::Cadence] + required :cadence, enum: -> { Orb::Price::BulkWithProration::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -3949,7 +4664,7 @@ class TieredWithProration < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] required :conversion_rate_config, - union: -> { Orb::Price::TieredWithProration::ConversionRateConfig }, + union: -> { Orb::Price::BulkWithProration::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -3989,6 +4704,8 @@ class TieredWithProration < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -4027,9 +4744,10 @@ class TieredWithProration < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :tiered_with_proration] - required :model_type, const: :tiered_with_proration + # @return [Symbol, :bulk_with_proration] + required :model_type, const: :bulk_with_proration # @!attribute name # @@ -4043,8 +4761,8 @@ class TieredWithProration < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::TieredWithProration::PriceType] - required :price_type, enum: -> { Orb::Price::TieredWithProration::PriceType } + # @return [Symbol, Orb::Models::Price::BulkWithProration::PriceType] + required :price_type, enum: -> { Orb::Price::BulkWithProration::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -4053,19 +4771,14 @@ class TieredWithProration < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true - # @!attribute tiered_with_proration_config - # - # @return [Hash{Symbol=>Object}] - required :tiered_with_proration_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] - # @!attribute dimensional_price_configuration # # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, tiered_with_proration_config:, dimensional_price_configuration: nil, model_type: :tiered_with_proration) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, bulk_with_proration_config:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :bulk_with_proration) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::TieredWithProration} for more details. + # {Orb::Models::Price::BulkWithProration} for more details. # # @param id [String] # @@ -4073,7 +4786,13 @@ class TieredWithProration < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::TieredWithProration::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::BulkWithProration::BillingMode] + # + # @param bulk_with_proration_config [Orb::Models::Price::BulkWithProration::BulkWithProrationConfig] Configuration for bulk_with_proration pricing + # + # @param cadence [Symbol, Orb::Models::Price::BulkWithProration::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -4093,7 +4812,7 @@ class TieredWithProration < Orb::Internal::Type::BaseModel # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -4109,17 +4828,62 @@ class TieredWithProration < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::TieredWithProration::PriceType] + # @param price_type [Symbol, Orb::Models::Price::BulkWithProration::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # - # @param tiered_with_proration_config [Hash{Symbol=>Object}] - # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :tiered_with_proration] + # @param model_type [Symbol, :bulk_with_proration] The pricing model type - # @see Orb::Models::Price::TieredWithProration#cadence + # @see Orb::Models::Price::BulkWithProration#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::BulkWithProration#bulk_with_proration_config + class BulkWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Bulk tiers for rating based on total usage volume + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::Price::BulkWithProration::BulkWithProrationConfig::Tier] } + + # @!method initialize(tiers:) + # Configuration for bulk_with_proration pricing + # + # @param tiers [Array] Bulk tiers for rating based on total usage volume + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute unit_amount + # Cost per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute tier_lower_bound + # The lower bound for this tier + # + # @return [String, nil] + optional :tier_lower_bound, String, nil?: true + + # @!method initialize(unit_amount:, tier_lower_bound: nil) + # Configuration for a single bulk pricing tier with proration + # + # @param unit_amount [String] Cost per unit + # + # @param tier_lower_bound [String, nil] The lower bound for this tier + end + end + + # @see Orb::Models::Price::BulkWithProration#cadence module Cadence extend Orb::Internal::Type::Enum @@ -4134,33 +4898,20 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::TieredWithProration#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - - # @see Orb::Models::Price::TieredWithProration#price_type + # @see Orb::Models::Price::BulkWithProration#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end end - class UnitWithProration < Orb::Internal::Type::BaseModel + class GroupedWithProratedMinimum < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -4176,10 +4927,22 @@ class UnitWithProration < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::GroupedWithProratedMinimum::BillingMode] + required :billing_mode, enum: -> { Orb::Price::GroupedWithProratedMinimum::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::UnitWithProration::Cadence] - required :cadence, enum: -> { Orb::Price::UnitWithProration::Cadence } + # @return [Symbol, Orb::Models::Price::GroupedWithProratedMinimum::Cadence] + required :cadence, enum: -> { Orb::Price::GroupedWithProratedMinimum::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -4190,7 +4953,7 @@ class UnitWithProration < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] required :conversion_rate_config, - union: -> { Orb::Price::UnitWithProration::ConversionRateConfig }, + union: -> { Orb::Price::GroupedWithProratedMinimum::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -4224,12 +4987,21 @@ class UnitWithProration < Orb::Internal::Type::BaseModel # @return [Float, nil] required :fixed_price_quantity, Float, nil?: true + # @!attribute grouped_with_prorated_minimum_config + # Configuration for grouped_with_prorated_minimum pricing + # + # @return [Orb::Models::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig] + required :grouped_with_prorated_minimum_config, + -> { Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig } + # @!attribute invoicing_cycle_configuration # # @return [Orb::Models::BillingCycleConfiguration, nil] required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -4268,9 +5040,10 @@ class UnitWithProration < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :unit_with_proration] - required :model_type, const: :unit_with_proration + # @return [Symbol, :grouped_with_prorated_minimum] + required :model_type, const: :grouped_with_prorated_minimum # @!attribute name # @@ -4284,8 +5057,8 @@ class UnitWithProration < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::UnitWithProration::PriceType] - required :price_type, enum: -> { Orb::Price::UnitWithProration::PriceType } + # @return [Symbol, Orb::Models::Price::GroupedWithProratedMinimum::PriceType] + required :price_type, enum: -> { Orb::Price::GroupedWithProratedMinimum::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -4294,19 +5067,14 @@ class UnitWithProration < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true - # @!attribute unit_with_proration_config - # - # @return [Hash{Symbol=>Object}] - required :unit_with_proration_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] - # @!attribute dimensional_price_configuration # # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, unit_with_proration_config:, dimensional_price_configuration: nil, model_type: :unit_with_proration) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, grouped_with_prorated_minimum_config:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :grouped_with_prorated_minimum) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::UnitWithProration} for more details. + # {Orb::Models::Price::GroupedWithProratedMinimum} for more details. # # @param id [String] # @@ -4314,7 +5082,11 @@ class UnitWithProration < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::UnitWithProration::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::GroupedWithProratedMinimum::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::GroupedWithProratedMinimum::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -4332,9 +5104,11 @@ class UnitWithProration < Orb::Internal::Type::BaseModel # # @param fixed_price_quantity [Float, nil] # + # @param grouped_with_prorated_minimum_config [Orb::Models::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig] Configuration for grouped_with_prorated_minimum pricing + # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -4350,17 +5124,26 @@ class UnitWithProration < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::UnitWithProration::PriceType] + # @param price_type [Symbol, Orb::Models::Price::GroupedWithProratedMinimum::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # - # @param unit_with_proration_config [Hash{Symbol=>Object}] - # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :unit_with_proration] + # @param model_type [Symbol, :grouped_with_prorated_minimum] The pricing model type - # @see Orb::Models::Price::UnitWithProration#cadence + # @see Orb::Models::Price::GroupedWithProratedMinimum#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::GroupedWithProratedMinimum#cadence module Cadence extend Orb::Internal::Type::Enum @@ -4375,33 +5158,50 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::UnitWithProration#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::Price::GroupedWithProratedMinimum#grouped_with_prorated_minimum_config + class GroupedWithProratedMinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # How to determine the groups that should each have a minimum + # + # @return [String] + required :grouping_key, String + + # @!attribute minimum + # The minimum amount to charge per group + # + # @return [String] + required :minimum, String + + # @!attribute unit_rate + # The amount to charge per unit + # + # @return [String] + required :unit_rate, String + + # @!method initialize(grouping_key:, minimum:, unit_rate:) + # Configuration for grouped_with_prorated_minimum pricing + # + # @param grouping_key [String] How to determine the groups that should each have a minimum + # + # @param minimum [String] The minimum amount to charge per group + # + # @param unit_rate [String] The amount to charge per unit end - # @see Orb::Models::Price::UnitWithProration#price_type + # @see Orb::Models::Price::GroupedWithProratedMinimum#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end end - class GroupedAllocation < Orb::Internal::Type::BaseModel + class GroupedWithMeteredMinimum < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -4417,10 +5217,22 @@ class GroupedAllocation < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::GroupedWithMeteredMinimum::BillingMode] + required :billing_mode, enum: -> { Orb::Price::GroupedWithMeteredMinimum::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::GroupedAllocation::Cadence] - required :cadence, enum: -> { Orb::Price::GroupedAllocation::Cadence } + # @return [Symbol, Orb::Models::Price::GroupedWithMeteredMinimum::Cadence] + required :cadence, enum: -> { Orb::Price::GroupedWithMeteredMinimum::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -4431,7 +5243,7 @@ class GroupedAllocation < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] required :conversion_rate_config, - union: -> { Orb::Price::GroupedAllocation::ConversionRateConfig }, + union: -> { Orb::Price::GroupedWithMeteredMinimum::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -4465,10 +5277,12 @@ class GroupedAllocation < Orb::Internal::Type::BaseModel # @return [Float, nil] required :fixed_price_quantity, Float, nil?: true - # @!attribute grouped_allocation_config + # @!attribute grouped_with_metered_minimum_config + # Configuration for grouped_with_metered_minimum pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_allocation_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig] + required :grouped_with_metered_minimum_config, + -> { Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig } # @!attribute invoicing_cycle_configuration # @@ -4476,6 +5290,8 @@ class GroupedAllocation < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -4514,9 +5330,10 @@ class GroupedAllocation < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :grouped_allocation] - required :model_type, const: :grouped_allocation + # @return [Symbol, :grouped_with_metered_minimum] + required :model_type, const: :grouped_with_metered_minimum # @!attribute name # @@ -4529,9 +5346,9 @@ class GroupedAllocation < Orb::Internal::Type::BaseModel required :plan_phase_order, Integer, nil?: true # @!attribute price_type - # - # @return [Symbol, Orb::Models::Price::GroupedAllocation::PriceType] - required :price_type, enum: -> { Orb::Price::GroupedAllocation::PriceType } + # + # @return [Symbol, Orb::Models::Price::GroupedWithMeteredMinimum::PriceType] + required :price_type, enum: -> { Orb::Price::GroupedWithMeteredMinimum::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -4545,9 +5362,9 @@ class GroupedAllocation < Orb::Internal::Type::BaseModel # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, grouped_allocation_config:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :grouped_allocation) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, grouped_with_metered_minimum_config:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :grouped_with_metered_minimum) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::GroupedAllocation} for more details. + # {Orb::Models::Price::GroupedWithMeteredMinimum} for more details. # # @param id [String] # @@ -4555,7 +5372,11 @@ class GroupedAllocation < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::GroupedAllocation::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::GroupedWithMeteredMinimum::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::GroupedWithMeteredMinimum::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -4573,11 +5394,11 @@ class GroupedAllocation < Orb::Internal::Type::BaseModel # # @param fixed_price_quantity [Float, nil] # - # @param grouped_allocation_config [Hash{Symbol=>Object}] + # @param grouped_with_metered_minimum_config [Orb::Models::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig] Configuration for grouped_with_metered_minimum pricing # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -4593,15 +5414,26 @@ class GroupedAllocation < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::GroupedAllocation::PriceType] + # @param price_type [Symbol, Orb::Models::Price::GroupedWithMeteredMinimum::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :grouped_allocation] + # @param model_type [Symbol, :grouped_with_metered_minimum] The pricing model type - # @see Orb::Models::Price::GroupedAllocation#cadence + # @see Orb::Models::Price::GroupedWithMeteredMinimum#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::GroupedWithMeteredMinimum#cadence module Cadence extend Orb::Internal::Type::Enum @@ -4616,33 +5448,124 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::GroupedAllocation#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::Price::GroupedWithMeteredMinimum#grouped_with_metered_minimum_config + class GroupedWithMeteredMinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # Used to partition the usage into groups. The minimum amount is applied to each + # group. + # + # @return [String] + required :grouping_key, String + + # @!attribute minimum_unit_amount + # The minimum amount to charge per group per unit + # + # @return [String] + required :minimum_unit_amount, String + + # @!attribute pricing_key + # Used to determine the unit rate + # + # @return [String] + required :pricing_key, String + + # @!attribute scaling_factors + # Scale the unit rates by the scaling factor. + # + # @return [Array] + required :scaling_factors, + -> { Orb::Internal::Type::ArrayOf[Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig::ScalingFactor] } + + # @!attribute scaling_key + # Used to determine the unit rate scaling factor + # + # @return [String] + required :scaling_key, String + + # @!attribute unit_amounts + # Apply per unit pricing to each pricing value. The minimum amount is applied any + # unmatched usage. + # + # @return [Array] + required :unit_amounts, + -> { Orb::Internal::Type::ArrayOf[Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig::UnitAmount] } + + # @!method initialize(grouping_key:, minimum_unit_amount:, pricing_key:, scaling_factors:, scaling_key:, unit_amounts:) + # Some parameter documentations has been truncated, see + # {Orb::Models::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig} + # for more details. + # + # Configuration for grouped_with_metered_minimum pricing + # + # @param grouping_key [String] Used to partition the usage into groups. The minimum amount is applied to each g + # + # @param minimum_unit_amount [String] The minimum amount to charge per group per unit + # + # @param pricing_key [String] Used to determine the unit rate + # + # @param scaling_factors [Array] Scale the unit rates by the scaling factor. + # + # @param scaling_key [String] Used to determine the unit rate scaling factor + # + # @param unit_amounts [Array] Apply per unit pricing to each pricing value. The minimum amount is applied any + + class ScalingFactor < Orb::Internal::Type::BaseModel + # @!attribute scaling_factor + # Scaling factor + # + # @return [String] + required :scaling_factor, String + + # @!attribute scaling_value + # Scaling value + # + # @return [String] + required :scaling_value, String + + # @!method initialize(scaling_factor:, scaling_value:) + # Configuration for a scaling factor + # + # @param scaling_factor [String] Scaling factor + # + # @param scaling_value [String] Scaling value + end + + class UnitAmount < Orb::Internal::Type::BaseModel + # @!attribute pricing_value + # Pricing value + # + # @return [String] + required :pricing_value, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(pricing_value:, unit_amount:) + # Configuration for a unit amount + # + # @param pricing_value [String] Pricing value + # + # @param unit_amount [String] Per unit amount + end end - # @see Orb::Models::Price::GroupedAllocation#price_type + # @see Orb::Models::Price::GroupedWithMeteredMinimum#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end end - class GroupedWithProratedMinimum < Orb::Internal::Type::BaseModel + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -4658,10 +5581,22 @@ class GroupedWithProratedMinimum < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::GroupedWithMinMaxThresholds::BillingMode] + required :billing_mode, enum: -> { Orb::Price::GroupedWithMinMaxThresholds::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::GroupedWithProratedMinimum::Cadence] - required :cadence, enum: -> { Orb::Price::GroupedWithProratedMinimum::Cadence } + # @return [Symbol, Orb::Models::Price::GroupedWithMinMaxThresholds::Cadence] + required :cadence, enum: -> { Orb::Price::GroupedWithMinMaxThresholds::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -4672,7 +5607,7 @@ class GroupedWithProratedMinimum < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] required :conversion_rate_config, - union: -> { Orb::Price::GroupedWithProratedMinimum::ConversionRateConfig }, + union: -> { Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -4706,10 +5641,12 @@ class GroupedWithProratedMinimum < Orb::Internal::Type::BaseModel # @return [Float, nil] required :fixed_price_quantity, Float, nil?: true - # @!attribute grouped_with_prorated_minimum_config + # @!attribute grouped_with_min_max_thresholds_config + # Configuration for grouped_with_min_max_thresholds pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_with_prorated_minimum_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] + required :grouped_with_min_max_thresholds_config, + -> { Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig } # @!attribute invoicing_cycle_configuration # @@ -4717,6 +5654,8 @@ class GroupedWithProratedMinimum < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -4755,9 +5694,10 @@ class GroupedWithProratedMinimum < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :grouped_with_prorated_minimum] - required :model_type, const: :grouped_with_prorated_minimum + # @return [Symbol, :grouped_with_min_max_thresholds] + required :model_type, const: :grouped_with_min_max_thresholds # @!attribute name # @@ -4771,8 +5711,8 @@ class GroupedWithProratedMinimum < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::GroupedWithProratedMinimum::PriceType] - required :price_type, enum: -> { Orb::Price::GroupedWithProratedMinimum::PriceType } + # @return [Symbol, Orb::Models::Price::GroupedWithMinMaxThresholds::PriceType] + required :price_type, enum: -> { Orb::Price::GroupedWithMinMaxThresholds::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -4786,9 +5726,9 @@ class GroupedWithProratedMinimum < Orb::Internal::Type::BaseModel # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, grouped_with_prorated_minimum_config:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :grouped_with_prorated_minimum) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, grouped_with_min_max_thresholds_config:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :grouped_with_min_max_thresholds) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::GroupedWithProratedMinimum} for more details. + # {Orb::Models::Price::GroupedWithMinMaxThresholds} for more details. # # @param id [String] # @@ -4796,7 +5736,11 @@ class GroupedWithProratedMinimum < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::GroupedWithProratedMinimum::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::GroupedWithMinMaxThresholds::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::GroupedWithMinMaxThresholds::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -4814,11 +5758,11 @@ class GroupedWithProratedMinimum < Orb::Internal::Type::BaseModel # # @param fixed_price_quantity [Float, nil] # - # @param grouped_with_prorated_minimum_config [Hash{Symbol=>Object}] + # @param grouped_with_min_max_thresholds_config [Orb::Models::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] Configuration for grouped_with_min_max_thresholds pricing # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -4834,15 +5778,26 @@ class GroupedWithProratedMinimum < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::GroupedWithProratedMinimum::PriceType] + # @param price_type [Symbol, Orb::Models::Price::GroupedWithMinMaxThresholds::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :grouped_with_prorated_minimum] + # @param model_type [Symbol, :grouped_with_min_max_thresholds] The pricing model type - # @see Orb::Models::Price::GroupedWithProratedMinimum#cadence + # @see Orb::Models::Price::GroupedWithMinMaxThresholds#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::GroupedWithMinMaxThresholds#cadence module Cadence extend Orb::Internal::Type::Enum @@ -4857,33 +5812,58 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::GroupedWithProratedMinimum#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::Price::GroupedWithMinMaxThresholds#grouped_with_min_max_thresholds_config + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before applying thresholds + # + # @return [String] + required :grouping_key, String + + # @!attribute maximum_charge + # The maximum amount to charge each group + # + # @return [String] + required :maximum_charge, String + + # @!attribute minimum_charge + # The minimum amount to charge each group, regardless of usage + # + # @return [String] + required :minimum_charge, String + + # @!attribute per_unit_rate + # The base price charged per group + # + # @return [String] + required :per_unit_rate, String + + # @!method initialize(grouping_key:, maximum_charge:, minimum_charge:, per_unit_rate:) + # Configuration for grouped_with_min_max_thresholds pricing + # + # @param grouping_key [String] The event property used to group before applying thresholds + # + # @param maximum_charge [String] The maximum amount to charge each group + # + # @param minimum_charge [String] The minimum amount to charge each group, regardless of usage + # + # @param per_unit_rate [String] The base price charged per group end - # @see Orb::Models::Price::GroupedWithProratedMinimum#price_type + # @see Orb::Models::Price::GroupedWithMinMaxThresholds#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end end - class GroupedWithMeteredMinimum < Orb::Internal::Type::BaseModel + class MatrixWithDisplayName < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -4899,10 +5879,22 @@ class GroupedWithMeteredMinimum < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::MatrixWithDisplayName::BillingMode] + required :billing_mode, enum: -> { Orb::Price::MatrixWithDisplayName::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::GroupedWithMeteredMinimum::Cadence] - required :cadence, enum: -> { Orb::Price::GroupedWithMeteredMinimum::Cadence } + # @return [Symbol, Orb::Models::Price::MatrixWithDisplayName::Cadence] + required :cadence, enum: -> { Orb::Price::MatrixWithDisplayName::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -4913,7 +5905,7 @@ class GroupedWithMeteredMinimum < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] required :conversion_rate_config, - union: -> { Orb::Price::GroupedWithMeteredMinimum::ConversionRateConfig }, + union: -> { Orb::Price::MatrixWithDisplayName::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -4947,21 +5939,25 @@ class GroupedWithMeteredMinimum < Orb::Internal::Type::BaseModel # @return [Float, nil] required :fixed_price_quantity, Float, nil?: true - # @!attribute grouped_with_metered_minimum_config - # - # @return [Hash{Symbol=>Object}] - required :grouped_with_metered_minimum_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] - # @!attribute invoicing_cycle_configuration # # @return [Orb::Models::BillingCycleConfiguration, nil] required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } + # @!attribute matrix_with_display_name_config + # Configuration for matrix_with_display_name pricing + # + # @return [Orb::Models::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig] + required :matrix_with_display_name_config, + -> { Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig } + # @!attribute maximum # @deprecated # @@ -4996,9 +5992,10 @@ class GroupedWithMeteredMinimum < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :grouped_with_metered_minimum] - required :model_type, const: :grouped_with_metered_minimum + # @return [Symbol, :matrix_with_display_name] + required :model_type, const: :matrix_with_display_name # @!attribute name # @@ -5012,8 +6009,8 @@ class GroupedWithMeteredMinimum < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::GroupedWithMeteredMinimum::PriceType] - required :price_type, enum: -> { Orb::Price::GroupedWithMeteredMinimum::PriceType } + # @return [Symbol, Orb::Models::Price::MatrixWithDisplayName::PriceType] + required :price_type, enum: -> { Orb::Price::MatrixWithDisplayName::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -5027,9 +6024,9 @@ class GroupedWithMeteredMinimum < Orb::Internal::Type::BaseModel # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, grouped_with_metered_minimum_config:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :grouped_with_metered_minimum) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, matrix_with_display_name_config:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :matrix_with_display_name) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::GroupedWithMeteredMinimum} for more details. + # {Orb::Models::Price::MatrixWithDisplayName} for more details. # # @param id [String] # @@ -5037,7 +6034,11 @@ class GroupedWithMeteredMinimum < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::GroupedWithMeteredMinimum::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::MatrixWithDisplayName::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::MatrixWithDisplayName::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -5055,11 +6056,11 @@ class GroupedWithMeteredMinimum < Orb::Internal::Type::BaseModel # # @param fixed_price_quantity [Float, nil] # - # @param grouped_with_metered_minimum_config [Hash{Symbol=>Object}] - # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in + # + # @param matrix_with_display_name_config [Orb::Models::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig] Configuration for matrix_with_display_name pricing # # @param maximum [Orb::Models::Maximum, nil] # @@ -5075,15 +6076,26 @@ class GroupedWithMeteredMinimum < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::GroupedWithMeteredMinimum::PriceType] + # @param price_type [Symbol, Orb::Models::Price::MatrixWithDisplayName::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :grouped_with_metered_minimum] + # @param model_type [Symbol, :matrix_with_display_name] The pricing model type - # @see Orb::Models::Price::GroupedWithMeteredMinimum#cadence + # @see Orb::Models::Price::MatrixWithDisplayName#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::MatrixWithDisplayName#cadence module Cadence extend Orb::Internal::Type::Enum @@ -5098,33 +6110,72 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::GroupedWithMeteredMinimum#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::Price::MatrixWithDisplayName#matrix_with_display_name_config + class MatrixWithDisplayNameConfig < Orb::Internal::Type::BaseModel + # @!attribute dimension + # Used to determine the unit rate + # + # @return [String] + required :dimension, String + + # @!attribute unit_amounts + # Apply per unit pricing to each dimension value + # + # @return [Array] + required :unit_amounts, + -> { Orb::Internal::Type::ArrayOf[Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig::UnitAmount] } + + # @!method initialize(dimension:, unit_amounts:) + # Configuration for matrix_with_display_name pricing + # + # @param dimension [String] Used to determine the unit rate + # + # @param unit_amounts [Array] Apply per unit pricing to each dimension value + + class UnitAmount < Orb::Internal::Type::BaseModel + # @!attribute dimension_value + # The dimension value + # + # @return [String] + required :dimension_value, String + + # @!attribute display_name + # Display name for this dimension value + # + # @return [String] + required :display_name, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(dimension_value:, display_name:, unit_amount:) + # Configuration for a unit amount item + # + # @param dimension_value [String] The dimension value + # + # @param display_name [String] Display name for this dimension value + # + # @param unit_amount [String] Per unit amount + end end - # @see Orb::Models::Price::GroupedWithMeteredMinimum#price_type + # @see Orb::Models::Price::MatrixWithDisplayName#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end end - class MatrixWithDisplayName < Orb::Internal::Type::BaseModel + class GroupedTieredPackage < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -5140,10 +6191,22 @@ class MatrixWithDisplayName < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::GroupedTieredPackage::BillingMode] + required :billing_mode, enum: -> { Orb::Price::GroupedTieredPackage::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::MatrixWithDisplayName::Cadence] - required :cadence, enum: -> { Orb::Price::MatrixWithDisplayName::Cadence } + # @return [Symbol, Orb::Models::Price::GroupedTieredPackage::Cadence] + required :cadence, enum: -> { Orb::Price::GroupedTieredPackage::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -5154,7 +6217,7 @@ class MatrixWithDisplayName < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] required :conversion_rate_config, - union: -> { Orb::Price::MatrixWithDisplayName::ConversionRateConfig }, + union: -> { Orb::Price::GroupedTieredPackage::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -5188,21 +6251,25 @@ class MatrixWithDisplayName < Orb::Internal::Type::BaseModel # @return [Float, nil] required :fixed_price_quantity, Float, nil?: true + # @!attribute grouped_tiered_package_config + # Configuration for grouped_tiered_package pricing + # + # @return [Orb::Models::Price::GroupedTieredPackage::GroupedTieredPackageConfig] + required :grouped_tiered_package_config, + -> { Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig } + # @!attribute invoicing_cycle_configuration # # @return [Orb::Models::BillingCycleConfiguration, nil] required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } - # @!attribute matrix_with_display_name_config - # - # @return [Hash{Symbol=>Object}] - required :matrix_with_display_name_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] - # @!attribute maximum # @deprecated # @@ -5237,9 +6304,10 @@ class MatrixWithDisplayName < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :matrix_with_display_name] - required :model_type, const: :matrix_with_display_name + # @return [Symbol, :grouped_tiered_package] + required :model_type, const: :grouped_tiered_package # @!attribute name # @@ -5253,8 +6321,8 @@ class MatrixWithDisplayName < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::MatrixWithDisplayName::PriceType] - required :price_type, enum: -> { Orb::Price::MatrixWithDisplayName::PriceType } + # @return [Symbol, Orb::Models::Price::GroupedTieredPackage::PriceType] + required :price_type, enum: -> { Orb::Price::GroupedTieredPackage::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -5268,9 +6336,9 @@ class MatrixWithDisplayName < Orb::Internal::Type::BaseModel # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, matrix_with_display_name_config:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :matrix_with_display_name) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, grouped_tiered_package_config:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :grouped_tiered_package) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::MatrixWithDisplayName} for more details. + # {Orb::Models::Price::GroupedTieredPackage} for more details. # # @param id [String] # @@ -5278,7 +6346,11 @@ class MatrixWithDisplayName < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::MatrixWithDisplayName::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::GroupedTieredPackage::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::GroupedTieredPackage::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -5296,11 +6368,11 @@ class MatrixWithDisplayName < Orb::Internal::Type::BaseModel # # @param fixed_price_quantity [Float, nil] # - # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] + # @param grouped_tiered_package_config [Orb::Models::Price::GroupedTieredPackage::GroupedTieredPackageConfig] Configuration for grouped_tiered_package pricing # - # @param item [Orb::Models::ItemSlim] + # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param matrix_with_display_name_config [Hash{Symbol=>Object}] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -5316,15 +6388,26 @@ class MatrixWithDisplayName < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::MatrixWithDisplayName::PriceType] + # @param price_type [Symbol, Orb::Models::Price::GroupedTieredPackage::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :matrix_with_display_name] + # @param model_type [Symbol, :grouped_tiered_package] The pricing model type - # @see Orb::Models::Price::MatrixWithDisplayName#cadence + # @see Orb::Models::Price::GroupedTieredPackage#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::GroupedTieredPackage#cadence module Cadence extend Orb::Internal::Type::Enum @@ -5339,33 +6422,77 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::MatrixWithDisplayName#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::Price::GroupedTieredPackage#grouped_tiered_package_config + class GroupedTieredPackageConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before tiering + # + # @return [String] + required :grouping_key, String + + # @!attribute package_size + # Package size + # + # @return [String] + required :package_size, String + + # @!attribute tiers + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig::Tier] } + + # @!method initialize(grouping_key:, package_size:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::Price::GroupedTieredPackage::GroupedTieredPackageConfig} for more + # details. + # + # Configuration for grouped_tiered_package pricing + # + # @param grouping_key [String] The event property used to group before tiering + # + # @param package_size [String] Package size + # + # @param tiers [Array] Apply tiered pricing after rounding up the quantity to the package size. Tiers a + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute per_unit + # Price per package + # + # @return [String] + required :per_unit, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!method initialize(per_unit:, tier_lower_bound:) + # Configuration for a single tier + # + # @param per_unit [String] Price per package + # + # @param tier_lower_bound [String] Tier lower bound + end end - # @see Orb::Models::Price::MatrixWithDisplayName#price_type + # @see Orb::Models::Price::GroupedTieredPackage#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end end - class BulkWithProration < Orb::Internal::Type::BaseModel + class MaxGroupTieredPackage < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -5381,15 +6508,22 @@ class BulkWithProration < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } - # @!attribute bulk_with_proration_config + # @!attribute billing_mode # - # @return [Hash{Symbol=>Object}] - required :bulk_with_proration_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Symbol, Orb::Models::Price::MaxGroupTieredPackage::BillingMode] + required :billing_mode, enum: -> { Orb::Price::MaxGroupTieredPackage::BillingMode } # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::BulkWithProration::Cadence] - required :cadence, enum: -> { Orb::Price::BulkWithProration::Cadence } + # @return [Symbol, Orb::Models::Price::MaxGroupTieredPackage::Cadence] + required :cadence, enum: -> { Orb::Price::MaxGroupTieredPackage::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -5400,7 +6534,7 @@ class BulkWithProration < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] required :conversion_rate_config, - union: -> { Orb::Price::BulkWithProration::ConversionRateConfig }, + union: -> { Orb::Price::MaxGroupTieredPackage::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -5440,10 +6574,19 @@ class BulkWithProration < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } + # @!attribute max_group_tiered_package_config + # Configuration for max_group_tiered_package pricing + # + # @return [Orb::Models::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig] + required :max_group_tiered_package_config, + -> { Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig } + # @!attribute maximum # @deprecated # @@ -5478,9 +6621,10 @@ class BulkWithProration < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :bulk_with_proration] - required :model_type, const: :bulk_with_proration + # @return [Symbol, :max_group_tiered_package] + required :model_type, const: :max_group_tiered_package # @!attribute name # @@ -5494,8 +6638,8 @@ class BulkWithProration < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::BulkWithProration::PriceType] - required :price_type, enum: -> { Orb::Price::BulkWithProration::PriceType } + # @return [Symbol, Orb::Models::Price::MaxGroupTieredPackage::PriceType] + required :price_type, enum: -> { Orb::Price::MaxGroupTieredPackage::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -5509,9 +6653,9 @@ class BulkWithProration < Orb::Internal::Type::BaseModel # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, bulk_with_proration_config:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :bulk_with_proration) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, max_group_tiered_package_config:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :max_group_tiered_package) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::BulkWithProration} for more details. + # {Orb::Models::Price::MaxGroupTieredPackage} for more details. # # @param id [String] # @@ -5519,9 +6663,11 @@ class BulkWithProration < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param bulk_with_proration_config [Hash{Symbol=>Object}] + # @param billing_mode [Symbol, Orb::Models::Price::MaxGroupTieredPackage::BillingMode] # - # @param cadence [Symbol, Orb::Models::Price::BulkWithProration::Cadence] + # @param cadence [Symbol, Orb::Models::Price::MaxGroupTieredPackage::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -5541,7 +6687,9 @@ class BulkWithProration < Orb::Internal::Type::BaseModel # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in + # + # @param max_group_tiered_package_config [Orb::Models::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig] Configuration for max_group_tiered_package pricing # # @param maximum [Orb::Models::Maximum, nil] # @@ -5557,15 +6705,26 @@ class BulkWithProration < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::BulkWithProration::PriceType] + # @param price_type [Symbol, Orb::Models::Price::MaxGroupTieredPackage::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :bulk_with_proration] + # @param model_type [Symbol, :max_group_tiered_package] The pricing model type - # @see Orb::Models::Price::BulkWithProration#cadence + # @see Orb::Models::Price::MaxGroupTieredPackage#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::MaxGroupTieredPackage#cadence module Cadence extend Orb::Internal::Type::Enum @@ -5580,33 +6739,76 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::BulkWithProration#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::Price::MaxGroupTieredPackage#max_group_tiered_package_config + class MaxGroupTieredPackageConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before tiering the group with the highest value + # + # @return [String] + required :grouping_key, String + + # @!attribute package_size + # Package size + # + # @return [String] + required :package_size, String + + # @!attribute tiers + # Apply tiered pricing to the largest group after grouping with the provided key. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig::Tier] } + + # @!method initialize(grouping_key:, package_size:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig} for + # more details. + # + # Configuration for max_group_tiered_package pricing + # + # @param grouping_key [String] The event property used to group before tiering the group with the highest value + # + # @param package_size [String] Package size + # + # @param tiers [Array] Apply tiered pricing to the largest group after grouping with the provided key. + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tier + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Per unit amount + end end - # @see Orb::Models::Price::BulkWithProration#price_type + # @see Orb::Models::Price::MaxGroupTieredPackage#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end end - class GroupedTieredPackage < Orb::Internal::Type::BaseModel + class ScalableMatrixWithUnitPricing < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -5622,10 +6824,22 @@ class GroupedTieredPackage < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::ScalableMatrixWithUnitPricing::BillingMode] + required :billing_mode, enum: -> { Orb::Price::ScalableMatrixWithUnitPricing::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::GroupedTieredPackage::Cadence] - required :cadence, enum: -> { Orb::Price::GroupedTieredPackage::Cadence } + # @return [Symbol, Orb::Models::Price::ScalableMatrixWithUnitPricing::Cadence] + required :cadence, enum: -> { Orb::Price::ScalableMatrixWithUnitPricing::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -5636,7 +6850,7 @@ class GroupedTieredPackage < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] required :conversion_rate_config, - union: -> { Orb::Price::GroupedTieredPackage::ConversionRateConfig }, + union: -> { Orb::Price::ScalableMatrixWithUnitPricing::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -5670,17 +6884,14 @@ class GroupedTieredPackage < Orb::Internal::Type::BaseModel # @return [Float, nil] required :fixed_price_quantity, Float, nil?: true - # @!attribute grouped_tiered_package_config - # - # @return [Hash{Symbol=>Object}] - required :grouped_tiered_package_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] - # @!attribute invoicing_cycle_configuration # # @return [Orb::Models::BillingCycleConfiguration, nil] required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -5719,9 +6930,10 @@ class GroupedTieredPackage < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :grouped_tiered_package] - required :model_type, const: :grouped_tiered_package + # @return [Symbol, :scalable_matrix_with_unit_pricing] + required :model_type, const: :scalable_matrix_with_unit_pricing # @!attribute name # @@ -5735,8 +6947,8 @@ class GroupedTieredPackage < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::GroupedTieredPackage::PriceType] - required :price_type, enum: -> { Orb::Price::GroupedTieredPackage::PriceType } + # @return [Symbol, Orb::Models::Price::ScalableMatrixWithUnitPricing::PriceType] + required :price_type, enum: -> { Orb::Price::ScalableMatrixWithUnitPricing::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -5745,14 +6957,21 @@ class GroupedTieredPackage < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true + # @!attribute scalable_matrix_with_unit_pricing_config + # Configuration for scalable_matrix_with_unit_pricing pricing + # + # @return [Orb::Models::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig] + required :scalable_matrix_with_unit_pricing_config, + -> { Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig } + # @!attribute dimensional_price_configuration # # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, grouped_tiered_package_config:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :grouped_tiered_package) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, scalable_matrix_with_unit_pricing_config:, dimensional_price_configuration: nil, model_type: :scalable_matrix_with_unit_pricing) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::GroupedTieredPackage} for more details. + # {Orb::Models::Price::ScalableMatrixWithUnitPricing} for more details. # # @param id [String] # @@ -5760,7 +6979,11 @@ class GroupedTieredPackage < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::GroupedTieredPackage::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::ScalableMatrixWithUnitPricing::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::ScalableMatrixWithUnitPricing::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -5778,11 +7001,9 @@ class GroupedTieredPackage < Orb::Internal::Type::BaseModel # # @param fixed_price_quantity [Float, nil] # - # @param grouped_tiered_package_config [Hash{Symbol=>Object}] - # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -5798,15 +7019,28 @@ class GroupedTieredPackage < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::GroupedTieredPackage::PriceType] + # @param price_type [Symbol, Orb::Models::Price::ScalableMatrixWithUnitPricing::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # + # @param scalable_matrix_with_unit_pricing_config [Orb::Models::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig] Configuration for scalable_matrix_with_unit_pricing pricing + # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :grouped_tiered_package] + # @param model_type [Symbol, :scalable_matrix_with_unit_pricing] The pricing model type - # @see Orb::Models::Price::GroupedTieredPackage#cadence + # @see Orb::Models::Price::ScalableMatrixWithUnitPricing#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::ScalableMatrixWithUnitPricing#cadence module Cadence extend Orb::Internal::Type::Enum @@ -5821,33 +7055,96 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::GroupedTieredPackage#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - - # @see Orb::Models::Price::GroupedTieredPackage#price_type + # @see Orb::Models::Price::ScalableMatrixWithUnitPricing#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end + + # @see Orb::Models::Price::ScalableMatrixWithUnitPricing#scalable_matrix_with_unit_pricing_config + class ScalableMatrixWithUnitPricingConfig < Orb::Internal::Type::BaseModel + # @!attribute first_dimension + # Used to determine the unit rate + # + # @return [String] + required :first_dimension, String + + # @!attribute matrix_scaling_factors + # Apply a scaling factor to each dimension + # + # @return [Array] + required :matrix_scaling_factors, + -> { Orb::Internal::Type::ArrayOf[Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor] } + + # @!attribute unit_price + # The final unit price to rate against the output of the matrix + # + # @return [String] + required :unit_price, String + + # @!attribute prorate + # If true, the unit price will be prorated to the billing period + # + # @return [Boolean, nil] + optional :prorate, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute second_dimension + # Used to determine the unit rate (optional) + # + # @return [String, nil] + optional :second_dimension, String, nil?: true + + # @!method initialize(first_dimension:, matrix_scaling_factors:, unit_price:, prorate: nil, second_dimension: nil) + # Configuration for scalable_matrix_with_unit_pricing pricing + # + # @param first_dimension [String] Used to determine the unit rate + # + # @param matrix_scaling_factors [Array] Apply a scaling factor to each dimension + # + # @param unit_price [String] The final unit price to rate against the output of the matrix + # + # @param prorate [Boolean, nil] If true, the unit price will be prorated to the billing period + # + # @param second_dimension [String, nil] Used to determine the unit rate (optional) + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + # @!attribute first_dimension_value + # First dimension value + # + # @return [String] + required :first_dimension_value, String + + # @!attribute scaling_factor + # Scaling factor + # + # @return [String] + required :scaling_factor, String + + # @!attribute second_dimension_value + # Second dimension value (optional) + # + # @return [String, nil] + optional :second_dimension_value, String, nil?: true + + # @!method initialize(first_dimension_value:, scaling_factor:, second_dimension_value: nil) + # Configuration for a single matrix scaling factor + # + # @param first_dimension_value [String] First dimension value + # + # @param scaling_factor [String] Scaling factor + # + # @param second_dimension_value [String, nil] Second dimension value (optional) + end + end end - class MaxGroupTieredPackage < Orb::Internal::Type::BaseModel + class ScalableMatrixWithTieredPricing < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -5863,10 +7160,22 @@ class MaxGroupTieredPackage < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::ScalableMatrixWithTieredPricing::BillingMode] + required :billing_mode, enum: -> { Orb::Price::ScalableMatrixWithTieredPricing::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::MaxGroupTieredPackage::Cadence] - required :cadence, enum: -> { Orb::Price::MaxGroupTieredPackage::Cadence } + # @return [Symbol, Orb::Models::Price::ScalableMatrixWithTieredPricing::Cadence] + required :cadence, enum: -> { Orb::Price::ScalableMatrixWithTieredPricing::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -5877,7 +7186,7 @@ class MaxGroupTieredPackage < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] required :conversion_rate_config, - union: -> { Orb::Price::MaxGroupTieredPackage::ConversionRateConfig }, + union: -> { Orb::Price::ScalableMatrixWithTieredPricing::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -5917,15 +7226,12 @@ class MaxGroupTieredPackage < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } - # @!attribute max_group_tiered_package_config - # - # @return [Hash{Symbol=>Object}] - required :max_group_tiered_package_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] - # @!attribute maximum # @deprecated # @@ -5960,9 +7266,10 @@ class MaxGroupTieredPackage < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :max_group_tiered_package] - required :model_type, const: :max_group_tiered_package + # @return [Symbol, :scalable_matrix_with_tiered_pricing] + required :model_type, const: :scalable_matrix_with_tiered_pricing # @!attribute name # @@ -5976,8 +7283,8 @@ class MaxGroupTieredPackage < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::MaxGroupTieredPackage::PriceType] - required :price_type, enum: -> { Orb::Price::MaxGroupTieredPackage::PriceType } + # @return [Symbol, Orb::Models::Price::ScalableMatrixWithTieredPricing::PriceType] + required :price_type, enum: -> { Orb::Price::ScalableMatrixWithTieredPricing::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -5986,14 +7293,21 @@ class MaxGroupTieredPackage < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true + # @!attribute scalable_matrix_with_tiered_pricing_config + # Configuration for scalable_matrix_with_tiered_pricing pricing + # + # @return [Orb::Models::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig] + required :scalable_matrix_with_tiered_pricing_config, + -> { Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig } + # @!attribute dimensional_price_configuration # # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, max_group_tiered_package_config:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :max_group_tiered_package) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, scalable_matrix_with_tiered_pricing_config:, dimensional_price_configuration: nil, model_type: :scalable_matrix_with_tiered_pricing) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::MaxGroupTieredPackage} for more details. + # {Orb::Models::Price::ScalableMatrixWithTieredPricing} for more details. # # @param id [String] # @@ -6001,7 +7315,11 @@ class MaxGroupTieredPackage < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::MaxGroupTieredPackage::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::ScalableMatrixWithTieredPricing::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::ScalableMatrixWithTieredPricing::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -6021,9 +7339,7 @@ class MaxGroupTieredPackage < Orb::Internal::Type::BaseModel # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] - # - # @param max_group_tiered_package_config [Hash{Symbol=>Object}] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -6039,15 +7355,28 @@ class MaxGroupTieredPackage < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::MaxGroupTieredPackage::PriceType] + # @param price_type [Symbol, Orb::Models::Price::ScalableMatrixWithTieredPricing::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # + # @param scalable_matrix_with_tiered_pricing_config [Orb::Models::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig] Configuration for scalable_matrix_with_tiered_pricing pricing + # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :max_group_tiered_package] + # @param model_type [Symbol, :scalable_matrix_with_tiered_pricing] The pricing model type - # @see Orb::Models::Price::MaxGroupTieredPackage#cadence + # @see Orb::Models::Price::ScalableMatrixWithTieredPricing#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::ScalableMatrixWithTieredPricing#cadence module Cadence extend Orb::Internal::Type::Enum @@ -6062,33 +7391,110 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::MaxGroupTieredPackage#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - - # @see Orb::Models::Price::MaxGroupTieredPackage#price_type + # @see Orb::Models::Price::ScalableMatrixWithTieredPricing#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end + + # @see Orb::Models::Price::ScalableMatrixWithTieredPricing#scalable_matrix_with_tiered_pricing_config + class ScalableMatrixWithTieredPricingConfig < Orb::Internal::Type::BaseModel + # @!attribute first_dimension + # Used for the scalable matrix first dimension + # + # @return [String] + required :first_dimension, String + + # @!attribute matrix_scaling_factors + # Apply a scaling factor to each dimension + # + # @return [Array] + required :matrix_scaling_factors, + -> { Orb::Internal::Type::ArrayOf[Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor] } + + # @!attribute tiers + # Tier pricing structure + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::Tier] } + + # @!attribute second_dimension + # Used for the scalable matrix second dimension (optional) + # + # @return [String, nil] + optional :second_dimension, String, nil?: true + + # @!method initialize(first_dimension:, matrix_scaling_factors:, tiers:, second_dimension: nil) + # Configuration for scalable_matrix_with_tiered_pricing pricing + # + # @param first_dimension [String] Used for the scalable matrix first dimension + # + # @param matrix_scaling_factors [Array] Apply a scaling factor to each dimension + # + # @param tiers [Array] Tier pricing structure + # + # @param second_dimension [String, nil] Used for the scalable matrix second dimension (optional) + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + # @!attribute first_dimension_value + # First dimension value + # + # @return [String] + required :first_dimension_value, String + + # @!attribute scaling_factor + # Scaling factor + # + # @return [String] + required :scaling_factor, String + + # @!attribute second_dimension_value + # Second dimension value (optional) + # + # @return [String, nil] + optional :second_dimension_value, String, nil?: true + + # @!method initialize(first_dimension_value:, scaling_factor:, second_dimension_value: nil) + # Configuration for a single matrix scaling factor + # + # @param first_dimension_value [String] First dimension value + # + # @param scaling_factor [String] Scaling factor + # + # @param second_dimension_value [String, nil] Second dimension value (optional) + end + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tier entry with business logic + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Per unit amount + end + end end - class ScalableMatrixWithUnitPricing < Orb::Internal::Type::BaseModel + class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -6104,10 +7510,22 @@ class ScalableMatrixWithUnitPricing < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::CumulativeGroupedBulk::BillingMode] + required :billing_mode, enum: -> { Orb::Price::CumulativeGroupedBulk::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::ScalableMatrixWithUnitPricing::Cadence] - required :cadence, enum: -> { Orb::Price::ScalableMatrixWithUnitPricing::Cadence } + # @return [Symbol, Orb::Models::Price::CumulativeGroupedBulk::Cadence] + required :cadence, enum: -> { Orb::Price::CumulativeGroupedBulk::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -6118,7 +7536,7 @@ class ScalableMatrixWithUnitPricing < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] required :conversion_rate_config, - union: -> { Orb::Price::ScalableMatrixWithUnitPricing::ConversionRateConfig }, + union: -> { Orb::Price::CumulativeGroupedBulk::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -6131,6 +7549,13 @@ class ScalableMatrixWithUnitPricing < Orb::Internal::Type::BaseModel # @return [Orb::Models::Allocation, nil] required :credit_allocation, -> { Orb::Allocation }, nil?: true + # @!attribute cumulative_grouped_bulk_config + # Configuration for cumulative_grouped_bulk pricing + # + # @return [Orb::Models::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig] + required :cumulative_grouped_bulk_config, + -> { Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig } + # @!attribute currency # # @return [String] @@ -6158,6 +7583,8 @@ class ScalableMatrixWithUnitPricing < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -6196,9 +7623,10 @@ class ScalableMatrixWithUnitPricing < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :scalable_matrix_with_unit_pricing] - required :model_type, const: :scalable_matrix_with_unit_pricing + # @return [Symbol, :cumulative_grouped_bulk] + required :model_type, const: :cumulative_grouped_bulk # @!attribute name # @@ -6212,8 +7640,8 @@ class ScalableMatrixWithUnitPricing < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::ScalableMatrixWithUnitPricing::PriceType] - required :price_type, enum: -> { Orb::Price::ScalableMatrixWithUnitPricing::PriceType } + # @return [Symbol, Orb::Models::Price::CumulativeGroupedBulk::PriceType] + required :price_type, enum: -> { Orb::Price::CumulativeGroupedBulk::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -6222,20 +7650,14 @@ class ScalableMatrixWithUnitPricing < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true - # @!attribute scalable_matrix_with_unit_pricing_config - # - # @return [Hash{Symbol=>Object}] - required :scalable_matrix_with_unit_pricing_config, - Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] - # @!attribute dimensional_price_configuration # # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, scalable_matrix_with_unit_pricing_config:, dimensional_price_configuration: nil, model_type: :scalable_matrix_with_unit_pricing) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, cumulative_grouped_bulk_config:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :cumulative_grouped_bulk) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::ScalableMatrixWithUnitPricing} for more details. + # {Orb::Models::Price::CumulativeGroupedBulk} for more details. # # @param id [String] # @@ -6243,7 +7665,11 @@ class ScalableMatrixWithUnitPricing < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::ScalableMatrixWithUnitPricing::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::CumulativeGroupedBulk::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::CumulativeGroupedBulk::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -6253,6 +7679,8 @@ class ScalableMatrixWithUnitPricing < Orb::Internal::Type::BaseModel # # @param credit_allocation [Orb::Models::Allocation, nil] # + # @param cumulative_grouped_bulk_config [Orb::Models::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig] Configuration for cumulative_grouped_bulk pricing + # # @param currency [String] # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::UsageDiscount, Orb::Models::AmountDiscount, nil] @@ -6263,7 +7691,7 @@ class ScalableMatrixWithUnitPricing < Orb::Internal::Type::BaseModel # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -6279,17 +7707,26 @@ class ScalableMatrixWithUnitPricing < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::ScalableMatrixWithUnitPricing::PriceType] + # @param price_type [Symbol, Orb::Models::Price::CumulativeGroupedBulk::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # - # @param scalable_matrix_with_unit_pricing_config [Hash{Symbol=>Object}] - # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :scalable_matrix_with_unit_pricing] + # @param model_type [Symbol, :cumulative_grouped_bulk] The pricing model type - # @see Orb::Models::Price::ScalableMatrixWithUnitPricing#cadence + # @see Orb::Models::Price::CumulativeGroupedBulk#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::CumulativeGroupedBulk#cadence module Cadence extend Orb::Internal::Type::Enum @@ -6304,33 +7741,72 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::ScalableMatrixWithUnitPricing#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::Price::CumulativeGroupedBulk#cumulative_grouped_bulk_config + class CumulativeGroupedBulkConfig < Orb::Internal::Type::BaseModel + # @!attribute dimension_values + # Each tier lower bound must have the same group of values. + # + # @return [Array] + required :dimension_values, + -> { Orb::Internal::Type::ArrayOf[Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig::DimensionValue] } + + # @!attribute group + # Grouping key name + # + # @return [String] + required :group, String + + # @!method initialize(dimension_values:, group:) + # Configuration for cumulative_grouped_bulk pricing + # + # @param dimension_values [Array] Each tier lower bound must have the same group of values. + # + # @param group [String] Grouping key name + + class DimensionValue < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # Grouping key value + # + # @return [String] + required :grouping_key, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Unit amount for this combination + # + # @return [String] + required :unit_amount, String + + # @!method initialize(grouping_key:, tier_lower_bound:, unit_amount:) + # Configuration for a dimension value entry + # + # @param grouping_key [String] Grouping key value + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Unit amount for this combination + end end - # @see Orb::Models::Price::ScalableMatrixWithUnitPricing#price_type + # @see Orb::Models::Price::CumulativeGroupedBulk#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end end - class ScalableMatrixWithTieredPricing < Orb::Internal::Type::BaseModel + class Minimum < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -6346,10 +7822,22 @@ class ScalableMatrixWithTieredPricing < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::Minimum::BillingMode] + required :billing_mode, enum: -> { Orb::Price::Minimum::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::ScalableMatrixWithTieredPricing::Cadence] - required :cadence, enum: -> { Orb::Price::ScalableMatrixWithTieredPricing::Cadence } + # @return [Symbol, Orb::Models::Price::Minimum::Cadence] + required :cadence, enum: -> { Orb::Price::Minimum::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -6359,9 +7847,7 @@ class ScalableMatrixWithTieredPricing < Orb::Internal::Type::BaseModel # @!attribute conversion_rate_config # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - required :conversion_rate_config, - union: -> { Orb::Price::ScalableMatrixWithTieredPricing::ConversionRateConfig }, - nil?: true + required :conversion_rate_config, union: -> { Orb::Price::Minimum::ConversionRateConfig }, nil?: true # @!attribute created_at # @@ -6400,6 +7886,8 @@ class ScalableMatrixWithTieredPricing < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -6437,10 +7925,17 @@ class ScalableMatrixWithTieredPricing < Orb::Internal::Type::BaseModel # @return [String, nil] required :minimum_amount, String, nil?: true + # @!attribute minimum_config + # Configuration for minimum pricing + # + # @return [Orb::Models::Price::Minimum::MinimumConfig] + required :minimum_config, -> { Orb::Price::Minimum::MinimumConfig } + # @!attribute model_type + # The pricing model type # - # @return [Symbol, :scalable_matrix_with_tiered_pricing] - required :model_type, const: :scalable_matrix_with_tiered_pricing + # @return [Symbol, :minimum] + required :model_type, const: :minimum # @!attribute name # @@ -6454,8 +7949,8 @@ class ScalableMatrixWithTieredPricing < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::ScalableMatrixWithTieredPricing::PriceType] - required :price_type, enum: -> { Orb::Price::ScalableMatrixWithTieredPricing::PriceType } + # @return [Symbol, Orb::Models::Price::Minimum::PriceType] + required :price_type, enum: -> { Orb::Price::Minimum::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -6464,20 +7959,14 @@ class ScalableMatrixWithTieredPricing < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true - # @!attribute scalable_matrix_with_tiered_pricing_config - # - # @return [Hash{Symbol=>Object}] - required :scalable_matrix_with_tiered_pricing_config, - Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] - # @!attribute dimensional_price_configuration # # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, scalable_matrix_with_tiered_pricing_config:, dimensional_price_configuration: nil, model_type: :scalable_matrix_with_tiered_pricing) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, minimum_config:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :minimum) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::ScalableMatrixWithTieredPricing} for more details. + # {Orb::Models::Price::Minimum} for more details. # # @param id [String] # @@ -6485,7 +7974,11 @@ class ScalableMatrixWithTieredPricing < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::ScalableMatrixWithTieredPricing::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::Minimum::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::Minimum::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -6505,7 +7998,7 @@ class ScalableMatrixWithTieredPricing < Orb::Internal::Type::BaseModel # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -6517,21 +8010,32 @@ class ScalableMatrixWithTieredPricing < Orb::Internal::Type::BaseModel # # @param minimum_amount [String, nil] # + # @param minimum_config [Orb::Models::Price::Minimum::MinimumConfig] Configuration for minimum pricing + # # @param name [String] # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::ScalableMatrixWithTieredPricing::PriceType] + # @param price_type [Symbol, Orb::Models::Price::Minimum::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # - # @param scalable_matrix_with_tiered_pricing_config [Hash{Symbol=>Object}] - # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :scalable_matrix_with_tiered_pricing] + # @param model_type [Symbol, :minimum] The pricing model type - # @see Orb::Models::Price::ScalableMatrixWithTieredPricing#cadence + # @see Orb::Models::Price::Minimum#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::Minimum#cadence module Cadence extend Orb::Internal::Type::Enum @@ -6546,33 +8050,42 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::ScalableMatrixWithTieredPricing#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::Price::Minimum#minimum_config + class MinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute minimum_amount + # The minimum amount to apply + # + # @return [String] + required :minimum_amount, String + + # @!attribute prorated + # If true, subtotals from this price are prorated based on the service period + # + # @return [Boolean, nil] + optional :prorated, Orb::Internal::Type::Boolean + + # @!method initialize(minimum_amount:, prorated: nil) + # Configuration for minimum pricing + # + # @param minimum_amount [String] The minimum amount to apply + # + # @param prorated [Boolean] If true, subtotals from this price are prorated based on the service period end - # @see Orb::Models::Price::ScalableMatrixWithTieredPricing#price_type + # @see Orb::Models::Price::Minimum#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end end - class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel + class Percent < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -6588,10 +8101,22 @@ class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::Percent::BillingMode] + required :billing_mode, enum: -> { Orb::Price::Percent::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::CumulativeGroupedBulk::Cadence] - required :cadence, enum: -> { Orb::Price::CumulativeGroupedBulk::Cadence } + # @return [Symbol, Orb::Models::Price::Percent::Cadence] + required :cadence, enum: -> { Orb::Price::Percent::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -6601,9 +8126,7 @@ class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel # @!attribute conversion_rate_config # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - required :conversion_rate_config, - union: -> { Orb::Price::CumulativeGroupedBulk::ConversionRateConfig }, - nil?: true + required :conversion_rate_config, union: -> { Orb::Price::Percent::ConversionRateConfig }, nil?: true # @!attribute created_at # @@ -6615,11 +8138,6 @@ class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel # @return [Orb::Models::Allocation, nil] required :credit_allocation, -> { Orb::Allocation }, nil?: true - # @!attribute cumulative_grouped_bulk_config - # - # @return [Hash{Symbol=>Object}] - required :cumulative_grouped_bulk_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] - # @!attribute currency # # @return [String] @@ -6647,6 +8165,8 @@ class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -6685,15 +8205,22 @@ class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :cumulative_grouped_bulk] - required :model_type, const: :cumulative_grouped_bulk + # @return [Symbol, :percent] + required :model_type, const: :percent # @!attribute name # # @return [String] required :name, String + # @!attribute percent_config + # Configuration for percent pricing + # + # @return [Orb::Models::Price::Percent::PercentConfig] + required :percent_config, -> { Orb::Price::Percent::PercentConfig } + # @!attribute plan_phase_order # # @return [Integer, nil] @@ -6701,8 +8228,8 @@ class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::CumulativeGroupedBulk::PriceType] - required :price_type, enum: -> { Orb::Price::CumulativeGroupedBulk::PriceType } + # @return [Symbol, Orb::Models::Price::Percent::PriceType] + required :price_type, enum: -> { Orb::Price::Percent::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -6716,9 +8243,9 @@ class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, cumulative_grouped_bulk_config:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :cumulative_grouped_bulk) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, percent_config:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :percent) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::CumulativeGroupedBulk} for more details. + # {Orb::Models::Price::Percent} for more details. # # @param id [String] # @@ -6726,7 +8253,11 @@ class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::CumulativeGroupedBulk::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::Percent::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::Percent::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -6736,8 +8267,6 @@ class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel # # @param credit_allocation [Orb::Models::Allocation, nil] # - # @param cumulative_grouped_bulk_config [Hash{Symbol=>Object}] - # # @param currency [String] # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::UsageDiscount, Orb::Models::AmountDiscount, nil] @@ -6748,7 +8277,7 @@ class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -6762,17 +8291,30 @@ class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel # # @param name [String] # + # @param percent_config [Orb::Models::Price::Percent::PercentConfig] Configuration for percent pricing + # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::CumulativeGroupedBulk::PriceType] + # @param price_type [Symbol, Orb::Models::Price::Percent::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :cumulative_grouped_bulk] + # @param model_type [Symbol, :percent] The pricing model type - # @see Orb::Models::Price::CumulativeGroupedBulk#cadence + # @see Orb::Models::Price::Percent#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::Percent#cadence module Cadence extend Orb::Internal::Type::Enum @@ -6787,33 +8329,34 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::CumulativeGroupedBulk#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::Price::Percent#percent_config + class PercentConfig < Orb::Internal::Type::BaseModel + # @!attribute percent + # What percent of the component subtotals to charge + # + # @return [Float] + required :percent, Float + + # @!method initialize(percent:) + # Configuration for percent pricing + # + # @param percent [Float] What percent of the component subtotals to charge end - # @see Orb::Models::Price::CumulativeGroupedBulk#price_type + # @see Orb::Models::Price::Percent#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] end end - class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + class EventOutput < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -6829,10 +8372,22 @@ class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::EventOutput::BillingMode] + required :billing_mode, enum: -> { Orb::Price::EventOutput::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::GroupedWithMinMaxThresholds::Cadence] - required :cadence, enum: -> { Orb::Price::GroupedWithMinMaxThresholds::Cadence } + # @return [Symbol, Orb::Models::Price::EventOutput::Cadence] + required :cadence, enum: -> { Orb::Price::EventOutput::Cadence } + + # @!attribute composite_price_filters + # + # @return [Array, nil] + required :composite_price_filters, + -> { Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter] }, + nil?: true # @!attribute conversion_rate # @@ -6843,7 +8398,9 @@ class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] required :conversion_rate_config, - union: -> { Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig }, + union: -> { + Orb::Price::EventOutput::ConversionRateConfig + }, nil?: true # @!attribute created_at @@ -6867,6 +8424,12 @@ class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::UsageDiscount, Orb::Models::AmountDiscount, nil] required :discount, union: -> { Orb::Discount }, nil?: true + # @!attribute event_output_config + # Configuration for event_output pricing + # + # @return [Orb::Models::Price::EventOutput::EventOutputConfig] + required :event_output_config, -> { Orb::Price::EventOutput::EventOutputConfig } + # @!attribute external_price_id # # @return [String, nil] @@ -6877,18 +8440,14 @@ class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel # @return [Float, nil] required :fixed_price_quantity, Float, nil?: true - # @!attribute grouped_with_min_max_thresholds_config - # - # @return [Hash{Symbol=>Object}] - required :grouped_with_min_max_thresholds_config, - Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] - # @!attribute invoicing_cycle_configuration # # @return [Orb::Models::BillingCycleConfiguration, nil] required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true # @!attribute item + # A minimal representation of an Item containing only the essential identifying + # information. # # @return [Orb::Models::ItemSlim] required :item, -> { Orb::ItemSlim } @@ -6927,9 +8486,10 @@ class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # - # @return [Symbol, :grouped_with_min_max_thresholds] - required :model_type, const: :grouped_with_min_max_thresholds + # @return [Symbol, :event_output] + required :model_type, const: :event_output # @!attribute name # @@ -6943,8 +8503,8 @@ class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::GroupedWithMinMaxThresholds::PriceType] - required :price_type, enum: -> { Orb::Price::GroupedWithMinMaxThresholds::PriceType } + # @return [Symbol, Orb::Models::Price::EventOutput::PriceType] + required :price_type, enum: -> { Orb::Price::EventOutput::PriceType } # @!attribute replaces_price_id # The price id this price replaces. This price will take the place of the replaced @@ -6958,9 +8518,9 @@ class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel # @return [Orb::Models::DimensionalPriceConfiguration, nil] optional :dimensional_price_configuration, -> { Orb::DimensionalPriceConfiguration }, nil?: true - # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, cadence:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, external_price_id:, fixed_price_quantity:, grouped_with_min_max_thresholds_config:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :grouped_with_min_max_thresholds) + # @!method initialize(id:, billable_metric:, billing_cycle_configuration:, billing_mode:, cadence:, composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, event_output_config:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, item:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, plan_phase_order:, price_type:, replaces_price_id:, dimensional_price_configuration: nil, model_type: :event_output) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::GroupedWithMinMaxThresholds} for more details. + # {Orb::Models::Price::EventOutput} for more details. # # @param id [String] # @@ -6968,7 +8528,11 @@ class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # - # @param cadence [Symbol, Orb::Models::Price::GroupedWithMinMaxThresholds::Cadence] + # @param billing_mode [Symbol, Orb::Models::Price::EventOutput::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::EventOutput::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -6982,15 +8546,15 @@ class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::UsageDiscount, Orb::Models::AmountDiscount, nil] # + # @param event_output_config [Orb::Models::Price::EventOutput::EventOutputConfig] Configuration for event_output pricing + # # @param external_price_id [String, nil] # # @param fixed_price_quantity [Float, nil] # - # @param grouped_with_min_max_thresholds_config [Hash{Symbol=>Object}] - # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # - # @param item [Orb::Models::ItemSlim] + # @param item [Orb::Models::ItemSlim] A minimal representation of an Item containing only the essential identifying in # # @param maximum [Orb::Models::Maximum, nil] # @@ -7006,15 +8570,26 @@ class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] # - # @param price_type [Symbol, Orb::Models::Price::GroupedWithMinMaxThresholds::PriceType] + # @param price_type [Symbol, Orb::Models::Price::EventOutput::PriceType] # # @param replaces_price_id [String, nil] The price id this price replaces. This price will take the place of the replaced # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :grouped_with_min_max_thresholds] + # @param model_type [Symbol, :event_output] The pricing model type - # @see Orb::Models::Price::GroupedWithMinMaxThresholds#cadence + # @see Orb::Models::Price::EventOutput#billing_mode + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE = :in_advance + IN_ARREAR = :in_arrear + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::Price::EventOutput#cadence module Cadence extend Orb::Internal::Type::Enum @@ -7029,26 +8604,39 @@ module Cadence # @return [Array] end - # @see Orb::Models::Price::GroupedWithMinMaxThresholds#conversion_rate_config - module ConversionRateConfig - extend Orb::Internal::Type::Union - - discriminator :conversion_rate_type - - variant :unit, -> { Orb::UnitConversionRateConfig } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @see Orb::Models::Price::EventOutput#event_output_config + class EventOutputConfig < Orb::Internal::Type::BaseModel + # @!attribute unit_rating_key + # The key in the event data to extract the unit rate from. + # + # @return [String] + required :unit_rating_key, String + + # @!attribute grouping_key + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + # + # @return [String, nil] + optional :grouping_key, String, nil?: true + + # @!method initialize(unit_rating_key:, grouping_key: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::Price::EventOutput::EventOutputConfig} for more details. + # + # Configuration for event_output pricing + # + # @param unit_rating_key [String] The key in the event data to extract the unit rate from. + # + # @param grouping_key [String, nil] An optional key in the event data to group by (e.g., event ID). All events will end - # @see Orb::Models::Price::GroupedWithMinMaxThresholds#price_type + # @see Orb::Models::Price::EventOutput#price_type module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] @@ -7056,7 +8644,7 @@ module PriceType end # @!method self.variants - # @return [Array(Orb::Models::Price::Unit, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::Tiered, Orb::Models::Price::TieredBPS, Orb::Models::Price::BPS, Orb::Models::Price::BulkBPS, Orb::Models::Price::Bulk, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::GroupedWithMinMaxThresholds)] + # @return [Array(Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::Minimum, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput)] end end end diff --git a/lib/orb/models/price_create_params.rb b/lib/orb/models/price_create_params.rb index fb9cc042..e97089fa 100644 --- a/lib/orb/models/price_create_params.rb +++ b/lib/orb/models/price_create_params.rb @@ -26,6 +26,7 @@ class PriceCreateParams < Orb::Internal::Type::BaseModel required :item_id, String # @!attribute model_type + # The pricing model type # # @return [Symbol, Orb::Models::PriceCreateParams::ModelType] required :model_type, enum: -> { Orb::PriceCreateParams::ModelType } @@ -37,6 +38,7 @@ class PriceCreateParams < Orb::Internal::Type::BaseModel required :name, String # @!attribute unit_config + # Configuration for unit pricing # # @return [Orb::Models::UnitConfig] required :unit_config, -> { Orb::UnitConfig } @@ -114,144 +116,181 @@ class PriceCreateParams < Orb::Internal::Type::BaseModel # @return [Hash{Symbol=>String, nil}, nil] optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true - # @!attribute package_config - # - # @return [Orb::Models::PackageConfig] - required :package_config, -> { Orb::PackageConfig } - - # @!attribute matrix_config - # - # @return [Orb::Models::MatrixConfig] - required :matrix_config, -> { Orb::MatrixConfig } - - # @!attribute matrix_with_allocation_config - # - # @return [Orb::Models::MatrixWithAllocationConfig] - required :matrix_with_allocation_config, -> { Orb::MatrixWithAllocationConfig } - # @!attribute tiered_config + # Configuration for tiered pricing # # @return [Orb::Models::TieredConfig] required :tiered_config, -> { Orb::TieredConfig } - # @!attribute tiered_bps_config - # - # @return [Orb::Models::TieredBPSConfig] - required :tiered_bps_config, -> { Orb::TieredBPSConfig } - - # @!attribute bps_config + # @!attribute bulk_config + # Configuration for bulk pricing # - # @return [Orb::Models::BPSConfig] - required :bps_config, -> { Orb::BPSConfig } + # @return [Orb::Models::BulkConfig] + required :bulk_config, -> { Orb::BulkConfig } - # @!attribute bulk_bps_config + # @!attribute package_config + # Configuration for package pricing # - # @return [Orb::Models::BulkBPSConfig] - required :bulk_bps_config, -> { Orb::BulkBPSConfig } + # @return [Orb::Models::PackageConfig] + required :package_config, -> { Orb::PackageConfig } - # @!attribute bulk_config + # @!attribute matrix_config + # Configuration for matrix pricing # - # @return [Orb::Models::BulkConfig] - required :bulk_config, -> { Orb::BulkConfig } + # @return [Orb::Models::MatrixConfig] + required :matrix_config, -> { Orb::MatrixConfig } # @!attribute threshold_total_amount_config + # Configuration for threshold_total_amount pricing # - # @return [Hash{Symbol=>Object}] - required :threshold_total_amount_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::PriceCreateParams::ThresholdTotalAmountConfig] + required :threshold_total_amount_config, -> { Orb::PriceCreateParams::ThresholdTotalAmountConfig } # @!attribute tiered_package_config + # Configuration for tiered_package pricing # - # @return [Hash{Symbol=>Object}] - required :tiered_package_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::PriceCreateParams::TieredPackageConfig] + required :tiered_package_config, -> { Orb::PriceCreateParams::TieredPackageConfig } - # @!attribute grouped_tiered_config + # @!attribute tiered_with_minimum_config + # Configuration for tiered_with_minimum pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_tiered_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::PriceCreateParams::TieredWithMinimumConfig] + required :tiered_with_minimum_config, -> { Orb::PriceCreateParams::TieredWithMinimumConfig } - # @!attribute max_group_tiered_package_config + # @!attribute grouped_tiered_config + # Configuration for grouped_tiered pricing # - # @return [Hash{Symbol=>Object}] - required :max_group_tiered_package_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::PriceCreateParams::GroupedTieredConfig] + required :grouped_tiered_config, -> { Orb::PriceCreateParams::GroupedTieredConfig } - # @!attribute tiered_with_minimum_config + # @!attribute tiered_package_with_minimum_config + # Configuration for tiered_package_with_minimum pricing # - # @return [Hash{Symbol=>Object}] - required :tiered_with_minimum_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::PriceCreateParams::TieredPackageWithMinimumConfig] + required :tiered_package_with_minimum_config, + -> { Orb::PriceCreateParams::TieredPackageWithMinimumConfig } # @!attribute package_with_allocation_config + # Configuration for package_with_allocation pricing # - # @return [Hash{Symbol=>Object}] - required :package_with_allocation_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::PriceCreateParams::PackageWithAllocationConfig] + required :package_with_allocation_config, -> { Orb::PriceCreateParams::PackageWithAllocationConfig } - # @!attribute tiered_package_with_minimum_config + # @!attribute unit_with_percent_config + # Configuration for unit_with_percent pricing # - # @return [Hash{Symbol=>Object}] - required :tiered_package_with_minimum_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::PriceCreateParams::UnitWithPercentConfig] + required :unit_with_percent_config, -> { Orb::PriceCreateParams::UnitWithPercentConfig } - # @!attribute unit_with_percent_config + # @!attribute matrix_with_allocation_config + # Configuration for matrix_with_allocation pricing # - # @return [Hash{Symbol=>Object}] - required :unit_with_percent_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::MatrixWithAllocationConfig] + required :matrix_with_allocation_config, -> { Orb::MatrixWithAllocationConfig } # @!attribute tiered_with_proration_config + # Configuration for tiered_with_proration pricing # - # @return [Hash{Symbol=>Object}] - required :tiered_with_proration_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::PriceCreateParams::TieredWithProrationConfig] + required :tiered_with_proration_config, -> { Orb::PriceCreateParams::TieredWithProrationConfig } # @!attribute unit_with_proration_config + # Configuration for unit_with_proration pricing # - # @return [Hash{Symbol=>Object}] - required :unit_with_proration_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::PriceCreateParams::UnitWithProrationConfig] + required :unit_with_proration_config, -> { Orb::PriceCreateParams::UnitWithProrationConfig } # @!attribute grouped_allocation_config + # Configuration for grouped_allocation pricing + # + # @return [Orb::Models::PriceCreateParams::GroupedAllocationConfig] + required :grouped_allocation_config, -> { Orb::PriceCreateParams::GroupedAllocationConfig } + + # @!attribute bulk_with_proration_config + # Configuration for bulk_with_proration pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_allocation_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::PriceCreateParams::BulkWithProrationConfig] + required :bulk_with_proration_config, -> { Orb::PriceCreateParams::BulkWithProrationConfig } # @!attribute grouped_with_prorated_minimum_config + # Configuration for grouped_with_prorated_minimum pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_with_prorated_minimum_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::PriceCreateParams::GroupedWithProratedMinimumConfig] + required :grouped_with_prorated_minimum_config, + -> { Orb::PriceCreateParams::GroupedWithProratedMinimumConfig } # @!attribute grouped_with_metered_minimum_config + # Configuration for grouped_with_metered_minimum pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_with_metered_minimum_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::PriceCreateParams::GroupedWithMeteredMinimumConfig] + required :grouped_with_metered_minimum_config, + -> { Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig } - # @!attribute matrix_with_display_name_config + # @!attribute grouped_with_min_max_thresholds_config + # Configuration for grouped_with_min_max_thresholds pricing # - # @return [Hash{Symbol=>Object}] - required :matrix_with_display_name_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::PriceCreateParams::GroupedWithMinMaxThresholdsConfig] + required :grouped_with_min_max_thresholds_config, + -> { Orb::PriceCreateParams::GroupedWithMinMaxThresholdsConfig } - # @!attribute bulk_with_proration_config + # @!attribute matrix_with_display_name_config + # Configuration for matrix_with_display_name pricing # - # @return [Hash{Symbol=>Object}] - required :bulk_with_proration_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::PriceCreateParams::MatrixWithDisplayNameConfig] + required :matrix_with_display_name_config, -> { Orb::PriceCreateParams::MatrixWithDisplayNameConfig } # @!attribute grouped_tiered_package_config + # Configuration for grouped_tiered_package pricing # - # @return [Hash{Symbol=>Object}] - required :grouped_tiered_package_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::PriceCreateParams::GroupedTieredPackageConfig] + required :grouped_tiered_package_config, -> { Orb::PriceCreateParams::GroupedTieredPackageConfig } + + # @!attribute max_group_tiered_package_config + # Configuration for max_group_tiered_package pricing + # + # @return [Orb::Models::PriceCreateParams::MaxGroupTieredPackageConfig] + required :max_group_tiered_package_config, -> { Orb::PriceCreateParams::MaxGroupTieredPackageConfig } # @!attribute scalable_matrix_with_unit_pricing_config + # Configuration for scalable_matrix_with_unit_pricing pricing # - # @return [Hash{Symbol=>Object}] + # @return [Orb::Models::PriceCreateParams::ScalableMatrixWithUnitPricingConfig] required :scalable_matrix_with_unit_pricing_config, - Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + -> { Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig } # @!attribute scalable_matrix_with_tiered_pricing_config + # Configuration for scalable_matrix_with_tiered_pricing pricing # - # @return [Hash{Symbol=>Object}] + # @return [Orb::Models::PriceCreateParams::ScalableMatrixWithTieredPricingConfig] required :scalable_matrix_with_tiered_pricing_config, - Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + -> { Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig } # @!attribute cumulative_grouped_bulk_config + # Configuration for cumulative_grouped_bulk pricing # - # @return [Hash{Symbol=>Object}] - required :cumulative_grouped_bulk_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @return [Orb::Models::PriceCreateParams::CumulativeGroupedBulkConfig] + required :cumulative_grouped_bulk_config, -> { Orb::PriceCreateParams::CumulativeGroupedBulkConfig } - # @!method initialize(cadence:, currency:, item_id:, model_type:, name:, unit_config:, package_config:, matrix_config:, matrix_with_allocation_config:, tiered_config:, tiered_bps_config:, bps_config:, bulk_bps_config:, bulk_config:, threshold_total_amount_config:, tiered_package_config:, grouped_tiered_config:, max_group_tiered_package_config:, tiered_with_minimum_config:, package_with_allocation_config:, tiered_package_with_minimum_config:, unit_with_percent_config:, tiered_with_proration_config:, unit_with_proration_config:, grouped_allocation_config:, grouped_with_prorated_minimum_config:, grouped_with_metered_minimum_config:, matrix_with_display_name_config:, bulk_with_proration_config:, grouped_tiered_package_config:, scalable_matrix_with_unit_pricing_config:, scalable_matrix_with_tiered_pricing_config:, cumulative_grouped_bulk_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, request_options: {}) + # @!attribute minimum_config + # Configuration for minimum pricing + # + # @return [Orb::Models::PriceCreateParams::MinimumConfig] + required :minimum_config, -> { Orb::PriceCreateParams::MinimumConfig } + + # @!attribute percent_config + # Configuration for percent pricing + # + # @return [Orb::Models::PriceCreateParams::PercentConfig] + required :percent_config, -> { Orb::PriceCreateParams::PercentConfig } + + # @!attribute event_output_config + # Configuration for event_output pricing + # + # @return [Orb::Models::PriceCreateParams::EventOutputConfig] + required :event_output_config, -> { Orb::PriceCreateParams::EventOutputConfig } + + # @!method initialize(cadence:, currency:, item_id:, model_type:, name:, unit_config:, tiered_config:, bulk_config:, package_config:, matrix_config:, threshold_total_amount_config:, tiered_package_config:, tiered_with_minimum_config:, grouped_tiered_config:, tiered_package_with_minimum_config:, package_with_allocation_config:, unit_with_percent_config:, matrix_with_allocation_config:, tiered_with_proration_config:, unit_with_proration_config:, grouped_allocation_config:, bulk_with_proration_config:, grouped_with_prorated_minimum_config:, grouped_with_metered_minimum_config:, grouped_with_min_max_thresholds_config:, matrix_with_display_name_config:, grouped_tiered_package_config:, max_group_tiered_package_config:, scalable_matrix_with_unit_pricing_config:, scalable_matrix_with_tiered_pricing_config:, cumulative_grouped_bulk_config:, minimum_config:, percent_config:, event_output_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, request_options: {}) # Some parameter documentations has been truncated, see # {Orb::Models::PriceCreateParams} for more details. # @@ -261,65 +300,67 @@ class PriceCreateParams < Orb::Internal::Type::BaseModel # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::PriceCreateParams::ModelType] + # @param model_type [Symbol, Orb::Models::PriceCreateParams::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param unit_config [Orb::Models::UnitConfig] + # @param unit_config [Orb::Models::UnitConfig] Configuration for unit pricing + # + # @param tiered_config [Orb::Models::TieredConfig] Configuration for tiered pricing # - # @param package_config [Orb::Models::PackageConfig] + # @param bulk_config [Orb::Models::BulkConfig] Configuration for bulk pricing # - # @param matrix_config [Orb::Models::MatrixConfig] + # @param package_config [Orb::Models::PackageConfig] Configuration for package pricing # - # @param matrix_with_allocation_config [Orb::Models::MatrixWithAllocationConfig] + # @param matrix_config [Orb::Models::MatrixConfig] Configuration for matrix pricing # - # @param tiered_config [Orb::Models::TieredConfig] + # @param threshold_total_amount_config [Orb::Models::PriceCreateParams::ThresholdTotalAmountConfig] Configuration for threshold_total_amount pricing # - # @param tiered_bps_config [Orb::Models::TieredBPSConfig] + # @param tiered_package_config [Orb::Models::PriceCreateParams::TieredPackageConfig] Configuration for tiered_package pricing # - # @param bps_config [Orb::Models::BPSConfig] + # @param tiered_with_minimum_config [Orb::Models::PriceCreateParams::TieredWithMinimumConfig] Configuration for tiered_with_minimum pricing # - # @param bulk_bps_config [Orb::Models::BulkBPSConfig] + # @param grouped_tiered_config [Orb::Models::PriceCreateParams::GroupedTieredConfig] Configuration for grouped_tiered pricing # - # @param bulk_config [Orb::Models::BulkConfig] + # @param tiered_package_with_minimum_config [Orb::Models::PriceCreateParams::TieredPackageWithMinimumConfig] Configuration for tiered_package_with_minimum pricing # - # @param threshold_total_amount_config [Hash{Symbol=>Object}] + # @param package_with_allocation_config [Orb::Models::PriceCreateParams::PackageWithAllocationConfig] Configuration for package_with_allocation pricing # - # @param tiered_package_config [Hash{Symbol=>Object}] + # @param unit_with_percent_config [Orb::Models::PriceCreateParams::UnitWithPercentConfig] Configuration for unit_with_percent pricing # - # @param grouped_tiered_config [Hash{Symbol=>Object}] + # @param matrix_with_allocation_config [Orb::Models::MatrixWithAllocationConfig] Configuration for matrix_with_allocation pricing # - # @param max_group_tiered_package_config [Hash{Symbol=>Object}] + # @param tiered_with_proration_config [Orb::Models::PriceCreateParams::TieredWithProrationConfig] Configuration for tiered_with_proration pricing # - # @param tiered_with_minimum_config [Hash{Symbol=>Object}] + # @param unit_with_proration_config [Orb::Models::PriceCreateParams::UnitWithProrationConfig] Configuration for unit_with_proration pricing # - # @param package_with_allocation_config [Hash{Symbol=>Object}] + # @param grouped_allocation_config [Orb::Models::PriceCreateParams::GroupedAllocationConfig] Configuration for grouped_allocation pricing # - # @param tiered_package_with_minimum_config [Hash{Symbol=>Object}] + # @param bulk_with_proration_config [Orb::Models::PriceCreateParams::BulkWithProrationConfig] Configuration for bulk_with_proration pricing # - # @param unit_with_percent_config [Hash{Symbol=>Object}] + # @param grouped_with_prorated_minimum_config [Orb::Models::PriceCreateParams::GroupedWithProratedMinimumConfig] Configuration for grouped_with_prorated_minimum pricing # - # @param tiered_with_proration_config [Hash{Symbol=>Object}] + # @param grouped_with_metered_minimum_config [Orb::Models::PriceCreateParams::GroupedWithMeteredMinimumConfig] Configuration for grouped_with_metered_minimum pricing # - # @param unit_with_proration_config [Hash{Symbol=>Object}] + # @param grouped_with_min_max_thresholds_config [Orb::Models::PriceCreateParams::GroupedWithMinMaxThresholdsConfig] Configuration for grouped_with_min_max_thresholds pricing # - # @param grouped_allocation_config [Hash{Symbol=>Object}] + # @param matrix_with_display_name_config [Orb::Models::PriceCreateParams::MatrixWithDisplayNameConfig] Configuration for matrix_with_display_name pricing # - # @param grouped_with_prorated_minimum_config [Hash{Symbol=>Object}] + # @param grouped_tiered_package_config [Orb::Models::PriceCreateParams::GroupedTieredPackageConfig] Configuration for grouped_tiered_package pricing # - # @param grouped_with_metered_minimum_config [Hash{Symbol=>Object}] + # @param max_group_tiered_package_config [Orb::Models::PriceCreateParams::MaxGroupTieredPackageConfig] Configuration for max_group_tiered_package pricing # - # @param matrix_with_display_name_config [Hash{Symbol=>Object}] + # @param scalable_matrix_with_unit_pricing_config [Orb::Models::PriceCreateParams::ScalableMatrixWithUnitPricingConfig] Configuration for scalable_matrix_with_unit_pricing pricing # - # @param bulk_with_proration_config [Hash{Symbol=>Object}] + # @param scalable_matrix_with_tiered_pricing_config [Orb::Models::PriceCreateParams::ScalableMatrixWithTieredPricingConfig] Configuration for scalable_matrix_with_tiered_pricing pricing # - # @param grouped_tiered_package_config [Hash{Symbol=>Object}] + # @param cumulative_grouped_bulk_config [Orb::Models::PriceCreateParams::CumulativeGroupedBulkConfig] Configuration for cumulative_grouped_bulk pricing # - # @param scalable_matrix_with_unit_pricing_config [Hash{Symbol=>Object}] + # @param minimum_config [Orb::Models::PriceCreateParams::MinimumConfig] Configuration for minimum pricing # - # @param scalable_matrix_with_tiered_pricing_config [Hash{Symbol=>Object}] + # @param percent_config [Orb::Models::PriceCreateParams::PercentConfig] Configuration for percent pricing # - # @param cumulative_grouped_bulk_config [Hash{Symbol=>Object}] + # @param event_output_config [Orb::Models::PriceCreateParams::EventOutputConfig] Configuration for event_output pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -360,27 +401,1043 @@ module Cadence # @return [Array] end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum - CUMULATIVE_GROUPED_BULK = :cumulative_grouped_bulk + EVENT_OUTPUT = :event_output # @!method self.values # @return [Array] end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union + class ThresholdTotalAmountConfig < Orb::Internal::Type::BaseModel + # @!attribute consumption_table + # When the quantity consumed passes a provided threshold, the configured total + # will be charged + # + # @return [Array] + required :consumption_table, + -> { Orb::Internal::Type::ArrayOf[Orb::PriceCreateParams::ThresholdTotalAmountConfig::ConsumptionTable] } + + # @!attribute prorate + # If true, the unit price will be prorated to the billing period + # + # @return [Boolean, nil] + optional :prorate, Orb::Internal::Type::Boolean, nil?: true + + # @!method initialize(consumption_table:, prorate: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::PriceCreateParams::ThresholdTotalAmountConfig} for more details. + # + # Configuration for threshold_total_amount pricing + # + # @param consumption_table [Array] When the quantity consumed passes a provided threshold, the configured total wil + # + # @param prorate [Boolean, nil] If true, the unit price will be prorated to the billing period + + class ConsumptionTable < Orb::Internal::Type::BaseModel + # @!attribute threshold + # Quantity threshold + # + # @return [String] + required :threshold, String + + # @!attribute total_amount + # Total amount for this threshold + # + # @return [String] + required :total_amount, String + + # @!method initialize(threshold:, total_amount:) + # Configuration for a single threshold + # + # @param threshold [String] Quantity threshold + # + # @param total_amount [String] Total amount for this threshold + end + end + + class TieredPackageConfig < Orb::Internal::Type::BaseModel + # @!attribute package_size + # Package size + # + # @return [String] + required :package_size, String + + # @!attribute tiers + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. The tier bounds are defined based on + # the total quantity rather than the number of packages, so they must be multiples + # of the package size. + # + # @return [Array] + required :tiers, -> { Orb::Internal::Type::ArrayOf[Orb::PriceCreateParams::TieredPackageConfig::Tier] } + + # @!method initialize(package_size:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::PriceCreateParams::TieredPackageConfig} for more details. + # + # Configuration for tiered_package pricing + # + # @param package_size [String] Package size + # + # @param tiers [Array] Apply tiered pricing after rounding up the quantity to the package size. Tiers a + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute per_unit + # Price per package + # + # @return [String] + required :per_unit, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!method initialize(per_unit:, tier_lower_bound:) + # Configuration for a single tier with business logic + # + # @param per_unit [String] Price per package + # + # @param tier_lower_bound [String] Tier lower bound + end + end + + class TieredWithMinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Tiered pricing with a minimum amount dependent on the volume tier. Tiers are + # defined using exclusive lower bounds. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::PriceCreateParams::TieredWithMinimumConfig::Tier] } + + # @!attribute hide_zero_amount_tiers + # If true, tiers with an accrued amount of 0 will not be included in the rating. + # + # @return [Boolean, nil] + optional :hide_zero_amount_tiers, Orb::Internal::Type::Boolean + + # @!attribute prorate + # If true, the unit price will be prorated to the billing period + # + # @return [Boolean, nil] + optional :prorate, Orb::Internal::Type::Boolean + + # @!method initialize(tiers:, hide_zero_amount_tiers: nil, prorate: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::PriceCreateParams::TieredWithMinimumConfig} for more details. + # + # Configuration for tiered_with_minimum pricing + # + # @param tiers [Array] Tiered pricing with a minimum amount dependent on the volume tier. Tiers are def + # + # @param hide_zero_amount_tiers [Boolean] If true, tiers with an accrued amount of 0 will not be included in the rating. + # + # @param prorate [Boolean] If true, the unit price will be prorated to the billing period + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute minimum_amount + # Minimum amount + # + # @return [String] + required :minimum_amount, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(minimum_amount:, tier_lower_bound:, unit_amount:) + # Configuration for a single tier + # + # @param minimum_amount [String] Minimum amount + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Per unit amount + end + end + + class GroupedTieredConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The billable metric property used to group before tiering + # + # @return [String] + required :grouping_key, String + + # @!attribute tiers + # Apply tiered pricing to each segment generated after grouping with the provided + # key + # + # @return [Array] + required :tiers, -> { Orb::Internal::Type::ArrayOf[Orb::PriceCreateParams::GroupedTieredConfig::Tier] } + + # @!method initialize(grouping_key:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::PriceCreateParams::GroupedTieredConfig} for more details. + # + # Configuration for grouped_tiered pricing + # + # @param grouping_key [String] The billable metric property used to group before tiering + # + # @param tiers [Array] Apply tiered pricing to each segment generated after grouping with the provided + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tier + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Per unit amount + end + end + + class TieredPackageWithMinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute package_size + # Package size + # + # @return [Float] + required :package_size, Float + + # @!attribute tiers + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::PriceCreateParams::TieredPackageWithMinimumConfig::Tier] } + + # @!method initialize(package_size:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::PriceCreateParams::TieredPackageWithMinimumConfig} for more + # details. + # + # Configuration for tiered_package_with_minimum pricing + # + # @param package_size [Float] Package size + # + # @param tiers [Array] Apply tiered pricing after rounding up the quantity to the package size. Tiers a + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute minimum_amount + # Minimum amount + # + # @return [String] + required :minimum_amount, String + + # @!attribute per_unit + # Price per package + # + # @return [String] + required :per_unit, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!method initialize(minimum_amount:, per_unit:, tier_lower_bound:) + # Configuration for a single tier + # + # @param minimum_amount [String] Minimum amount + # + # @param per_unit [String] Price per package + # + # @param tier_lower_bound [String] Tier lower bound + end + end + + class PackageWithAllocationConfig < Orb::Internal::Type::BaseModel + # @!attribute allocation + # Usage allocation + # + # @return [String] + required :allocation, String + + # @!attribute package_amount + # Price per package + # + # @return [String] + required :package_amount, String + + # @!attribute package_size + # Package size + # + # @return [String] + required :package_size, String + + # @!method initialize(allocation:, package_amount:, package_size:) + # Configuration for package_with_allocation pricing + # + # @param allocation [String] Usage allocation + # + # @param package_amount [String] Price per package + # + # @param package_size [String] Package size + end + + class UnitWithPercentConfig < Orb::Internal::Type::BaseModel + # @!attribute percent + # What percent, out of 100, of the calculated total to charge + # + # @return [String] + required :percent, String + + # @!attribute unit_amount + # Rate per unit of usage + # + # @return [String] + required :unit_amount, String + + # @!method initialize(percent:, unit_amount:) + # Configuration for unit_with_percent pricing + # + # @param percent [String] What percent, out of 100, of the calculated total to charge + # + # @param unit_amount [String] Rate per unit of usage + end + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Tiers for rating based on total usage quantities into the specified tier with + # proration + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::PriceCreateParams::TieredWithProrationConfig::Tier] } + + # @!method initialize(tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::PriceCreateParams::TieredWithProrationConfig} for more details. + # + # Configuration for tiered_with_proration pricing + # + # @param tiers [Array] Tiers for rating based on total usage quantities into the specified tier with pr + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Inclusive tier starting value + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tiered with proration tier + # + # @param tier_lower_bound [String] Inclusive tier starting value + # + # @param unit_amount [String] Amount per unit + end + end + + class UnitWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute unit_amount + # Rate per unit of usage + # + # @return [String] + required :unit_amount, String + + # @!method initialize(unit_amount:) + # Configuration for unit_with_proration pricing + # + # @param unit_amount [String] Rate per unit of usage + end + + class GroupedAllocationConfig < Orb::Internal::Type::BaseModel + # @!attribute allocation + # Usage allocation per group + # + # @return [String] + required :allocation, String + + # @!attribute grouping_key + # How to determine the groups that should each be allocated some quantity + # + # @return [String] + required :grouping_key, String + + # @!attribute overage_unit_rate + # Unit rate for post-allocation + # + # @return [String] + required :overage_unit_rate, String + + # @!method initialize(allocation:, grouping_key:, overage_unit_rate:) + # Configuration for grouped_allocation pricing + # + # @param allocation [String] Usage allocation per group + # + # @param grouping_key [String] How to determine the groups that should each be allocated some quantity + # + # @param overage_unit_rate [String] Unit rate for post-allocation + end + + class BulkWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Bulk tiers for rating based on total usage volume + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::PriceCreateParams::BulkWithProrationConfig::Tier] } + + # @!method initialize(tiers:) + # Configuration for bulk_with_proration pricing + # + # @param tiers [Array] Bulk tiers for rating based on total usage volume + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute unit_amount + # Cost per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute tier_lower_bound + # The lower bound for this tier + # + # @return [String, nil] + optional :tier_lower_bound, String, nil?: true + + # @!method initialize(unit_amount:, tier_lower_bound: nil) + # Configuration for a single bulk pricing tier with proration + # + # @param unit_amount [String] Cost per unit + # + # @param tier_lower_bound [String, nil] The lower bound for this tier + end + end + + class GroupedWithProratedMinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # How to determine the groups that should each have a minimum + # + # @return [String] + required :grouping_key, String + + # @!attribute minimum + # The minimum amount to charge per group + # + # @return [String] + required :minimum, String + + # @!attribute unit_rate + # The amount to charge per unit + # + # @return [String] + required :unit_rate, String + + # @!method initialize(grouping_key:, minimum:, unit_rate:) + # Configuration for grouped_with_prorated_minimum pricing + # + # @param grouping_key [String] How to determine the groups that should each have a minimum + # + # @param minimum [String] The minimum amount to charge per group + # + # @param unit_rate [String] The amount to charge per unit + end + + class GroupedWithMeteredMinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # Used to partition the usage into groups. The minimum amount is applied to each + # group. + # + # @return [String] + required :grouping_key, String + + # @!attribute minimum_unit_amount + # The minimum amount to charge per group per unit + # + # @return [String] + required :minimum_unit_amount, String + + # @!attribute pricing_key + # Used to determine the unit rate + # + # @return [String] + required :pricing_key, String + + # @!attribute scaling_factors + # Scale the unit rates by the scaling factor. + # + # @return [Array] + required :scaling_factors, + -> { Orb::Internal::Type::ArrayOf[Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::ScalingFactor] } + + # @!attribute scaling_key + # Used to determine the unit rate scaling factor + # + # @return [String] + required :scaling_key, String + + # @!attribute unit_amounts + # Apply per unit pricing to each pricing value. The minimum amount is applied any + # unmatched usage. + # + # @return [Array] + required :unit_amounts, + -> { Orb::Internal::Type::ArrayOf[Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::UnitAmount] } + + # @!method initialize(grouping_key:, minimum_unit_amount:, pricing_key:, scaling_factors:, scaling_key:, unit_amounts:) + # Some parameter documentations has been truncated, see + # {Orb::Models::PriceCreateParams::GroupedWithMeteredMinimumConfig} for more + # details. + # + # Configuration for grouped_with_metered_minimum pricing + # + # @param grouping_key [String] Used to partition the usage into groups. The minimum amount is applied to each g + # + # @param minimum_unit_amount [String] The minimum amount to charge per group per unit + # + # @param pricing_key [String] Used to determine the unit rate + # + # @param scaling_factors [Array] Scale the unit rates by the scaling factor. + # + # @param scaling_key [String] Used to determine the unit rate scaling factor + # + # @param unit_amounts [Array] Apply per unit pricing to each pricing value. The minimum amount is applied any + + class ScalingFactor < Orb::Internal::Type::BaseModel + # @!attribute scaling_factor + # Scaling factor + # + # @return [String] + required :scaling_factor, String + + # @!attribute scaling_value + # Scaling value + # + # @return [String] + required :scaling_value, String + + # @!method initialize(scaling_factor:, scaling_value:) + # Configuration for a scaling factor + # + # @param scaling_factor [String] Scaling factor + # + # @param scaling_value [String] Scaling value + end + + class UnitAmount < Orb::Internal::Type::BaseModel + # @!attribute pricing_value + # Pricing value + # + # @return [String] + required :pricing_value, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(pricing_value:, unit_amount:) + # Configuration for a unit amount + # + # @param pricing_value [String] Pricing value + # + # @param unit_amount [String] Per unit amount + end + end + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before applying thresholds + # + # @return [String] + required :grouping_key, String + + # @!attribute maximum_charge + # The maximum amount to charge each group + # + # @return [String] + required :maximum_charge, String + + # @!attribute minimum_charge + # The minimum amount to charge each group, regardless of usage + # + # @return [String] + required :minimum_charge, String + + # @!attribute per_unit_rate + # The base price charged per group + # + # @return [String] + required :per_unit_rate, String + + # @!method initialize(grouping_key:, maximum_charge:, minimum_charge:, per_unit_rate:) + # Configuration for grouped_with_min_max_thresholds pricing + # + # @param grouping_key [String] The event property used to group before applying thresholds + # + # @param maximum_charge [String] The maximum amount to charge each group + # + # @param minimum_charge [String] The minimum amount to charge each group, regardless of usage + # + # @param per_unit_rate [String] The base price charged per group + end + + class MatrixWithDisplayNameConfig < Orb::Internal::Type::BaseModel + # @!attribute dimension + # Used to determine the unit rate + # + # @return [String] + required :dimension, String + + # @!attribute unit_amounts + # Apply per unit pricing to each dimension value + # + # @return [Array] + required :unit_amounts, + -> { Orb::Internal::Type::ArrayOf[Orb::PriceCreateParams::MatrixWithDisplayNameConfig::UnitAmount] } + + # @!method initialize(dimension:, unit_amounts:) + # Configuration for matrix_with_display_name pricing + # + # @param dimension [String] Used to determine the unit rate + # + # @param unit_amounts [Array] Apply per unit pricing to each dimension value + + class UnitAmount < Orb::Internal::Type::BaseModel + # @!attribute dimension_value + # The dimension value + # + # @return [String] + required :dimension_value, String + + # @!attribute display_name + # Display name for this dimension value + # + # @return [String] + required :display_name, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(dimension_value:, display_name:, unit_amount:) + # Configuration for a unit amount item + # + # @param dimension_value [String] The dimension value + # + # @param display_name [String] Display name for this dimension value + # + # @param unit_amount [String] Per unit amount + end + end + + class GroupedTieredPackageConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before tiering + # + # @return [String] + required :grouping_key, String + + # @!attribute package_size + # Package size + # + # @return [String] + required :package_size, String - discriminator :conversion_rate_type + # @!attribute tiers + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::PriceCreateParams::GroupedTieredPackageConfig::Tier] } + + # @!method initialize(grouping_key:, package_size:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::PriceCreateParams::GroupedTieredPackageConfig} for more details. + # + # Configuration for grouped_tiered_package pricing + # + # @param grouping_key [String] The event property used to group before tiering + # + # @param package_size [String] Package size + # + # @param tiers [Array] Apply tiered pricing after rounding up the quantity to the package size. Tiers a + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute per_unit + # Price per package + # + # @return [String] + required :per_unit, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!method initialize(per_unit:, tier_lower_bound:) + # Configuration for a single tier + # + # @param per_unit [String] Price per package + # + # @param tier_lower_bound [String] Tier lower bound + end + end + + class MaxGroupTieredPackageConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before tiering the group with the highest value + # + # @return [String] + required :grouping_key, String + + # @!attribute package_size + # Package size + # + # @return [String] + required :package_size, String + + # @!attribute tiers + # Apply tiered pricing to the largest group after grouping with the provided key. + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::PriceCreateParams::MaxGroupTieredPackageConfig::Tier] } + + # @!method initialize(grouping_key:, package_size:, tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::PriceCreateParams::MaxGroupTieredPackageConfig} for more details. + # + # Configuration for max_group_tiered_package pricing + # + # @param grouping_key [String] The event property used to group before tiering the group with the highest value + # + # @param package_size [String] Package size + # + # @param tiers [Array] Apply tiered pricing to the largest group after grouping with the provided key. + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tier + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Per unit amount + end + end + + class ScalableMatrixWithUnitPricingConfig < Orb::Internal::Type::BaseModel + # @!attribute first_dimension + # Used to determine the unit rate + # + # @return [String] + required :first_dimension, String + + # @!attribute matrix_scaling_factors + # Apply a scaling factor to each dimension + # + # @return [Array] + required :matrix_scaling_factors, + -> { Orb::Internal::Type::ArrayOf[Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor] } + + # @!attribute unit_price + # The final unit price to rate against the output of the matrix + # + # @return [String] + required :unit_price, String + + # @!attribute prorate + # If true, the unit price will be prorated to the billing period + # + # @return [Boolean, nil] + optional :prorate, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute second_dimension + # Used to determine the unit rate (optional) + # + # @return [String, nil] + optional :second_dimension, String, nil?: true + + # @!method initialize(first_dimension:, matrix_scaling_factors:, unit_price:, prorate: nil, second_dimension: nil) + # Configuration for scalable_matrix_with_unit_pricing pricing + # + # @param first_dimension [String] Used to determine the unit rate + # + # @param matrix_scaling_factors [Array] Apply a scaling factor to each dimension + # + # @param unit_price [String] The final unit price to rate against the output of the matrix + # + # @param prorate [Boolean, nil] If true, the unit price will be prorated to the billing period + # + # @param second_dimension [String, nil] Used to determine the unit rate (optional) + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + # @!attribute first_dimension_value + # First dimension value + # + # @return [String] + required :first_dimension_value, String + + # @!attribute scaling_factor + # Scaling factor + # + # @return [String] + required :scaling_factor, String + + # @!attribute second_dimension_value + # Second dimension value (optional) + # + # @return [String, nil] + optional :second_dimension_value, String, nil?: true + + # @!method initialize(first_dimension_value:, scaling_factor:, second_dimension_value: nil) + # Configuration for a single matrix scaling factor + # + # @param first_dimension_value [String] First dimension value + # + # @param scaling_factor [String] Scaling factor + # + # @param second_dimension_value [String, nil] Second dimension value (optional) + end + end + + class ScalableMatrixWithTieredPricingConfig < Orb::Internal::Type::BaseModel + # @!attribute first_dimension + # Used for the scalable matrix first dimension + # + # @return [String] + required :first_dimension, String + + # @!attribute matrix_scaling_factors + # Apply a scaling factor to each dimension + # + # @return [Array] + required :matrix_scaling_factors, + -> { Orb::Internal::Type::ArrayOf[Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor] } + + # @!attribute tiers + # Tier pricing structure + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::Tier] } + + # @!attribute second_dimension + # Used for the scalable matrix second dimension (optional) + # + # @return [String, nil] + optional :second_dimension, String, nil?: true + + # @!method initialize(first_dimension:, matrix_scaling_factors:, tiers:, second_dimension: nil) + # Configuration for scalable_matrix_with_tiered_pricing pricing + # + # @param first_dimension [String] Used for the scalable matrix first dimension + # + # @param matrix_scaling_factors [Array] Apply a scaling factor to each dimension + # + # @param tiers [Array] Tier pricing structure + # + # @param second_dimension [String, nil] Used for the scalable matrix second dimension (optional) + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + # @!attribute first_dimension_value + # First dimension value + # + # @return [String] + required :first_dimension_value, String + + # @!attribute scaling_factor + # Scaling factor + # + # @return [String] + required :scaling_factor, String + + # @!attribute second_dimension_value + # Second dimension value (optional) + # + # @return [String, nil] + optional :second_dimension_value, String, nil?: true + + # @!method initialize(first_dimension_value:, scaling_factor:, second_dimension_value: nil) + # Configuration for a single matrix scaling factor + # + # @param first_dimension_value [String] First dimension value + # + # @param scaling_factor [String] Scaling factor + # + # @param second_dimension_value [String, nil] Second dimension value (optional) + end + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Per unit amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tier entry with business logic + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Per unit amount + end + end + + class CumulativeGroupedBulkConfig < Orb::Internal::Type::BaseModel + # @!attribute dimension_values + # Each tier lower bound must have the same group of values. + # + # @return [Array] + required :dimension_values, + -> { Orb::Internal::Type::ArrayOf[Orb::PriceCreateParams::CumulativeGroupedBulkConfig::DimensionValue] } + + # @!attribute group + # Grouping key name + # + # @return [String] + required :group, String + + # @!method initialize(dimension_values:, group:) + # Configuration for cumulative_grouped_bulk pricing + # + # @param dimension_values [Array] Each tier lower bound must have the same group of values. + # + # @param group [String] Grouping key name + + class DimensionValue < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # Grouping key value + # + # @return [String] + required :grouping_key, String + + # @!attribute tier_lower_bound + # Tier lower bound + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Unit amount for this combination + # + # @return [String] + required :unit_amount, String + + # @!method initialize(grouping_key:, tier_lower_bound:, unit_amount:) + # Configuration for a dimension value entry + # + # @param grouping_key [String] Grouping key value + # + # @param tier_lower_bound [String] Tier lower bound + # + # @param unit_amount [String] Unit amount for this combination + end + end + + class MinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute minimum_amount + # The minimum amount to apply + # + # @return [String] + required :minimum_amount, String + + # @!attribute prorated + # If true, subtotals from this price are prorated based on the service period + # + # @return [Boolean, nil] + optional :prorated, Orb::Internal::Type::Boolean + + # @!method initialize(minimum_amount:, prorated: nil) + # Configuration for minimum pricing + # + # @param minimum_amount [String] The minimum amount to apply + # + # @param prorated [Boolean] If true, subtotals from this price are prorated based on the service period + end + + class PercentConfig < Orb::Internal::Type::BaseModel + # @!attribute percent + # What percent of the component subtotals to charge + # + # @return [Float] + required :percent, Float + + # @!method initialize(percent:) + # Configuration for percent pricing + # + # @param percent [Float] What percent of the component subtotals to charge + end - variant :unit, -> { Orb::UnitConversionRateConfig } + class EventOutputConfig < Orb::Internal::Type::BaseModel + # @!attribute unit_rating_key + # The key in the event data to extract the unit rate from. + # + # @return [String] + required :unit_rating_key, String - variant :tiered, -> { Orb::TieredConversionRateConfig } + # @!attribute grouping_key + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + # + # @return [String, nil] + optional :grouping_key, String, nil?: true - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @!method initialize(unit_rating_key:, grouping_key: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::PriceCreateParams::EventOutputConfig} for more details. + # + # Configuration for event_output pricing + # + # @param unit_rating_key [String] The key in the event data to extract the unit rate from. + # + # @param grouping_key [String, nil] An optional key in the event data to group by (e.g., event ID). All events will end end end diff --git a/lib/orb/models/price_evaluate_multiple_params.rb b/lib/orb/models/price_evaluate_multiple_params.rb index 4670fb80..da355df9 100644 --- a/lib/orb/models/price_evaluate_multiple_params.rb +++ b/lib/orb/models/price_evaluate_multiple_params.rb @@ -75,10 +75,9 @@ class PriceEvaluation < Orb::Internal::Type::BaseModel optional :grouping_keys, Orb::Internal::Type::ArrayOf[String] # @!attribute price - # An inline price definition to evaluate, allowing you to test price - # configurations before adding them to Orb. + # New floating price request body params. # - # @return [Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingPackagePrice, Orb::Models::NewFloatingMatrixPrice, Orb::Models::NewFloatingMatrixWithAllocationPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingTieredBPSPrice, Orb::Models::NewFloatingBPSPrice, Orb::Models::NewFloatingBulkBPSPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::NewFloatingThresholdTotalAmountPrice, Orb::Models::NewFloatingTieredPackagePrice, Orb::Models::NewFloatingGroupedTieredPrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingTieredWithMinimumPrice, Orb::Models::NewFloatingPackageWithAllocationPrice, Orb::Models::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::NewFloatingUnitWithPercentPrice, Orb::Models::NewFloatingTieredWithProrationPrice, Orb::Models::NewFloatingUnitWithProrationPrice, Orb::Models::NewFloatingGroupedAllocationPrice, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingBulkWithProrationPrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice, nil] + # @return [Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::NewFloatingPackagePrice, Orb::Models::NewFloatingMatrixPrice, Orb::Models::NewFloatingThresholdTotalAmountPrice, Orb::Models::NewFloatingTieredPackagePrice, Orb::Models::NewFloatingTieredWithMinimumPrice, Orb::Models::NewFloatingGroupedTieredPrice, Orb::Models::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::NewFloatingPackageWithAllocationPrice, Orb::Models::NewFloatingUnitWithPercentPrice, Orb::Models::NewFloatingMatrixWithAllocationPrice, Orb::Models::NewFloatingTieredWithProrationPrice, Orb::Models::NewFloatingUnitWithProrationPrice, Orb::Models::NewFloatingGroupedAllocationPrice, Orb::Models::NewFloatingBulkWithProrationPrice, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice, Orb::Models::NewFloatingMinimumCompositePrice, Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent, Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput, nil] optional :price, union: -> { Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price }, nil?: true # @!attribute price_id @@ -97,12 +96,11 @@ class PriceEvaluation < Orb::Internal::Type::BaseModel # # @param grouping_keys [Array] Properties (or [computed properties](/extensibility/advanced-metrics#computed-pr # - # @param price [Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingPackagePrice, Orb::Models::NewFloatingMatrixPrice, Orb::Models::NewFloatingMatrixWithAllocationPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingTieredBPSPrice, Orb::Models::NewFloatingBPSPrice, Orb::Models::NewFloatingBulkBPSPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::NewFloatingThresholdTotalAmountPrice, Orb::Models::NewFloatingTieredPackagePrice, Orb::Models::NewFloatingGroupedTieredPrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingTieredWithMinimumPrice, Orb::Models::NewFloatingPackageWithAllocationPrice, Orb::Models::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::NewFloatingUnitWithPercentPrice, Orb::Models::NewFloatingTieredWithProrationPrice, Orb::Models::NewFloatingUnitWithProrationPrice, Orb::Models::NewFloatingGroupedAllocationPrice, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingBulkWithProrationPrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice, nil] An inline price definition to evaluate, allowing you to test price configuration + # @param price [Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::NewFloatingPackagePrice, Orb::Models::NewFloatingMatrixPrice, Orb::Models::NewFloatingThresholdTotalAmountPrice, Orb::Models::NewFloatingTieredPackagePrice, Orb::Models::NewFloatingTieredWithMinimumPrice, Orb::Models::NewFloatingGroupedTieredPrice, Orb::Models::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::NewFloatingPackageWithAllocationPrice, Orb::Models::NewFloatingUnitWithPercentPrice, Orb::Models::NewFloatingMatrixWithAllocationPrice, Orb::Models::NewFloatingTieredWithProrationPrice, Orb::Models::NewFloatingUnitWithProrationPrice, Orb::Models::NewFloatingGroupedAllocationPrice, Orb::Models::NewFloatingBulkWithProrationPrice, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice, Orb::Models::NewFloatingMinimumCompositePrice, Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent, Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput, nil] New floating price request body params. # # @param price_id [String, nil] The ID of a price to evaluate that exists in your Orb account. - # An inline price definition to evaluate, allowing you to test price - # configurations before adding them to Orb. + # New floating price request body params. # # @see Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation#price module Price @@ -112,62 +110,674 @@ module Price variant :unit, -> { Orb::NewFloatingUnitPrice } - variant :package, -> { Orb::NewFloatingPackagePrice } - - variant :matrix, -> { Orb::NewFloatingMatrixPrice } - - variant :matrix_with_allocation, -> { Orb::NewFloatingMatrixWithAllocationPrice } - variant :tiered, -> { Orb::NewFloatingTieredPrice } - variant :tiered_bps, -> { Orb::NewFloatingTieredBPSPrice } - - variant :bps, -> { Orb::NewFloatingBPSPrice } + variant :bulk, -> { Orb::NewFloatingBulkPrice } - variant :bulk_bps, -> { Orb::NewFloatingBulkBPSPrice } + variant :package, -> { Orb::NewFloatingPackagePrice } - variant :bulk, -> { Orb::NewFloatingBulkPrice } + variant :matrix, -> { Orb::NewFloatingMatrixPrice } variant :threshold_total_amount, -> { Orb::NewFloatingThresholdTotalAmountPrice } variant :tiered_package, -> { Orb::NewFloatingTieredPackagePrice } - variant :grouped_tiered, -> { Orb::NewFloatingGroupedTieredPrice } - - variant :max_group_tiered_package, -> { Orb::NewFloatingMaxGroupTieredPackagePrice } - variant :tiered_with_minimum, -> { Orb::NewFloatingTieredWithMinimumPrice } - variant :package_with_allocation, -> { Orb::NewFloatingPackageWithAllocationPrice } + variant :grouped_tiered, -> { Orb::NewFloatingGroupedTieredPrice } variant :tiered_package_with_minimum, -> { Orb::NewFloatingTieredPackageWithMinimumPrice } + variant :package_with_allocation, -> { Orb::NewFloatingPackageWithAllocationPrice } + variant :unit_with_percent, -> { Orb::NewFloatingUnitWithPercentPrice } + variant :matrix_with_allocation, -> { Orb::NewFloatingMatrixWithAllocationPrice } + variant :tiered_with_proration, -> { Orb::NewFloatingTieredWithProrationPrice } variant :unit_with_proration, -> { Orb::NewFloatingUnitWithProrationPrice } variant :grouped_allocation, -> { Orb::NewFloatingGroupedAllocationPrice } + variant :bulk_with_proration, -> { Orb::NewFloatingBulkWithProrationPrice } + variant :grouped_with_prorated_minimum, -> { Orb::NewFloatingGroupedWithProratedMinimumPrice } variant :grouped_with_metered_minimum, -> { Orb::NewFloatingGroupedWithMeteredMinimumPrice } - variant :matrix_with_display_name, -> { Orb::NewFloatingMatrixWithDisplayNamePrice } + variant :grouped_with_min_max_thresholds, + -> { Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds } - variant :bulk_with_proration, -> { Orb::NewFloatingBulkWithProrationPrice } + variant :matrix_with_display_name, -> { Orb::NewFloatingMatrixWithDisplayNamePrice } variant :grouped_tiered_package, -> { Orb::NewFloatingGroupedTieredPackagePrice } + variant :max_group_tiered_package, -> { Orb::NewFloatingMaxGroupTieredPackagePrice } + variant :scalable_matrix_with_unit_pricing, -> { Orb::NewFloatingScalableMatrixWithUnitPricingPrice } variant :scalable_matrix_with_tiered_pricing, -> { Orb::NewFloatingScalableMatrixWithTieredPricingPrice } variant :cumulative_grouped_bulk, -> { Orb::NewFloatingCumulativeGroupedBulkPrice } + variant :minimum, -> { Orb::NewFloatingMinimumCompositePrice } + + variant :percent, -> { Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent } + + variant :event_output, -> { Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput } + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence] + required :cadence, + enum: -> { Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute grouped_with_min_max_thresholds_config + # Configuration for grouped_with_min_max_thresholds pricing + # + # @return [Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] + required :grouped_with_min_max_thresholds_config, + -> { Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :grouped_with_min_max_thresholds] + required :model_type, const: :grouped_with_min_max_thresholds + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::ConversionRateConfig + }, + nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!method initialize(cadence:, currency:, grouped_with_min_max_thresholds_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, model_type: :grouped_with_min_max_thresholds) + # Some parameter documentations has been truncated, see + # {Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds} + # for more details. + # + # @param cadence [Symbol, Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence] The cadence to bill for this price on. + # + # @param currency [String] An ISO 4217 currency string for which this price is billed in. + # + # @param grouped_with_min_max_thresholds_config [Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] Configuration for grouped_with_min_max_thresholds pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param model_type [Symbol, :grouped_with_min_max_thresholds] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds#grouped_with_min_max_thresholds_config + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before applying thresholds + # + # @return [String] + required :grouping_key, String + + # @!attribute maximum_charge + # The maximum amount to charge each group + # + # @return [String] + required :maximum_charge, String + + # @!attribute minimum_charge + # The minimum amount to charge each group, regardless of usage + # + # @return [String] + required :minimum_charge, String + + # @!attribute per_unit_rate + # The base price charged per group + # + # @return [String] + required :per_unit_rate, String + + # @!method initialize(grouping_key:, maximum_charge:, minimum_charge:, per_unit_rate:) + # Configuration for grouped_with_min_max_thresholds pricing + # + # @param grouping_key [String] The event property used to group before applying thresholds + # + # @param maximum_charge [String] The maximum amount to charge each group + # + # @param minimum_charge [String] The minimum amount to charge each group, regardless of usage + # + # @param per_unit_rate [String] The base price charged per group + end + end + + class Percent < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::Cadence] + required :cadence, enum: -> { Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::Cadence } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :percent] + required :model_type, const: :percent + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute percent_config + # Configuration for percent pricing + # + # @return [Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::PercentConfig] + required :percent_config, + -> { Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::PercentConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::ConversionRateConfig + }, + nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!method initialize(cadence:, currency:, item_id:, name:, percent_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, model_type: :percent) + # Some parameter documentations has been truncated, see + # {Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent} for + # more details. + # + # @param cadence [Symbol, Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::Cadence] The cadence to bill for this price on. + # + # @param currency [String] An ISO 4217 currency string for which this price is billed in. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param percent_config [Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::PercentConfig] Configuration for percent pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param model_type [Symbol, :percent] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent#percent_config + class PercentConfig < Orb::Internal::Type::BaseModel + # @!attribute percent + # What percent of the component subtotals to charge + # + # @return [Float] + required :percent, Float + + # @!method initialize(percent:) + # Configuration for percent pricing + # + # @param percent [Float] What percent of the component subtotals to charge + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::Cadence] + required :cadence, + enum: -> { Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::Cadence } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute event_output_config + # Configuration for event_output pricing + # + # @return [Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::EventOutputConfig] + required :event_output_config, + -> { Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::EventOutputConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :event_output] + required :model_type, const: :event_output + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::ConversionRateConfig + }, + nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!method initialize(cadence:, currency:, event_output_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, model_type: :event_output) + # Some parameter documentations has been truncated, see + # {Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput} + # for more details. + # + # @param cadence [Symbol, Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::Cadence] The cadence to bill for this price on. + # + # @param currency [String] An ISO 4217 currency string for which this price is billed in. + # + # @param event_output_config [Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::EventOutputConfig] Configuration for event_output pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param model_type [Symbol, :event_output] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput#event_output_config + class EventOutputConfig < Orb::Internal::Type::BaseModel + # @!attribute unit_rating_key + # The key in the event data to extract the unit rate from. + # + # @return [String] + required :unit_rating_key, String + + # @!attribute grouping_key + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + # + # @return [String, nil] + optional :grouping_key, String, nil?: true + + # @!method initialize(unit_rating_key:, grouping_key: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::EventOutputConfig} + # for more details. + # + # Configuration for event_output pricing + # + # @param unit_rating_key [String] The key in the event data to extract the unit rate from. + # + # @param grouping_key [String, nil] An optional key in the event data to group by (e.g., event ID). All events will + end + end + # @!method self.variants - # @return [Array(Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingPackagePrice, Orb::Models::NewFloatingMatrixPrice, Orb::Models::NewFloatingMatrixWithAllocationPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingTieredBPSPrice, Orb::Models::NewFloatingBPSPrice, Orb::Models::NewFloatingBulkBPSPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::NewFloatingThresholdTotalAmountPrice, Orb::Models::NewFloatingTieredPackagePrice, Orb::Models::NewFloatingGroupedTieredPrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingTieredWithMinimumPrice, Orb::Models::NewFloatingPackageWithAllocationPrice, Orb::Models::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::NewFloatingUnitWithPercentPrice, Orb::Models::NewFloatingTieredWithProrationPrice, Orb::Models::NewFloatingUnitWithProrationPrice, Orb::Models::NewFloatingGroupedAllocationPrice, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingBulkWithProrationPrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice)] + # @return [Array(Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::NewFloatingPackagePrice, Orb::Models::NewFloatingMatrixPrice, Orb::Models::NewFloatingThresholdTotalAmountPrice, Orb::Models::NewFloatingTieredPackagePrice, Orb::Models::NewFloatingTieredWithMinimumPrice, Orb::Models::NewFloatingGroupedTieredPrice, Orb::Models::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::NewFloatingPackageWithAllocationPrice, Orb::Models::NewFloatingUnitWithPercentPrice, Orb::Models::NewFloatingMatrixWithAllocationPrice, Orb::Models::NewFloatingTieredWithProrationPrice, Orb::Models::NewFloatingUnitWithProrationPrice, Orb::Models::NewFloatingGroupedAllocationPrice, Orb::Models::NewFloatingBulkWithProrationPrice, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice, Orb::Models::NewFloatingMinimumCompositePrice, Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent, Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput)] end end end diff --git a/lib/orb/models/price_evaluate_preview_events_params.rb b/lib/orb/models/price_evaluate_preview_events_params.rb index 79a173cf..8fc0e0bb 100644 --- a/lib/orb/models/price_evaluate_preview_events_params.rb +++ b/lib/orb/models/price_evaluate_preview_events_params.rb @@ -133,10 +133,9 @@ class PriceEvaluation < Orb::Internal::Type::BaseModel optional :grouping_keys, Orb::Internal::Type::ArrayOf[String] # @!attribute price - # An inline price definition to evaluate, allowing you to test price - # configurations before adding them to Orb. + # New floating price request body params. # - # @return [Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingPackagePrice, Orb::Models::NewFloatingMatrixPrice, Orb::Models::NewFloatingMatrixWithAllocationPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingTieredBPSPrice, Orb::Models::NewFloatingBPSPrice, Orb::Models::NewFloatingBulkBPSPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::NewFloatingThresholdTotalAmountPrice, Orb::Models::NewFloatingTieredPackagePrice, Orb::Models::NewFloatingGroupedTieredPrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingTieredWithMinimumPrice, Orb::Models::NewFloatingPackageWithAllocationPrice, Orb::Models::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::NewFloatingUnitWithPercentPrice, Orb::Models::NewFloatingTieredWithProrationPrice, Orb::Models::NewFloatingUnitWithProrationPrice, Orb::Models::NewFloatingGroupedAllocationPrice, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingBulkWithProrationPrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice, nil] + # @return [Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::NewFloatingPackagePrice, Orb::Models::NewFloatingMatrixPrice, Orb::Models::NewFloatingThresholdTotalAmountPrice, Orb::Models::NewFloatingTieredPackagePrice, Orb::Models::NewFloatingTieredWithMinimumPrice, Orb::Models::NewFloatingGroupedTieredPrice, Orb::Models::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::NewFloatingPackageWithAllocationPrice, Orb::Models::NewFloatingUnitWithPercentPrice, Orb::Models::NewFloatingMatrixWithAllocationPrice, Orb::Models::NewFloatingTieredWithProrationPrice, Orb::Models::NewFloatingUnitWithProrationPrice, Orb::Models::NewFloatingGroupedAllocationPrice, Orb::Models::NewFloatingBulkWithProrationPrice, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice, Orb::Models::NewFloatingMinimumCompositePrice, Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent, Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput, nil] optional :price, union: -> { Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price @@ -160,12 +159,11 @@ class PriceEvaluation < Orb::Internal::Type::BaseModel # # @param grouping_keys [Array] Properties (or [computed properties](/extensibility/advanced-metrics#computed-pr # - # @param price [Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingPackagePrice, Orb::Models::NewFloatingMatrixPrice, Orb::Models::NewFloatingMatrixWithAllocationPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingTieredBPSPrice, Orb::Models::NewFloatingBPSPrice, Orb::Models::NewFloatingBulkBPSPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::NewFloatingThresholdTotalAmountPrice, Orb::Models::NewFloatingTieredPackagePrice, Orb::Models::NewFloatingGroupedTieredPrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingTieredWithMinimumPrice, Orb::Models::NewFloatingPackageWithAllocationPrice, Orb::Models::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::NewFloatingUnitWithPercentPrice, Orb::Models::NewFloatingTieredWithProrationPrice, Orb::Models::NewFloatingUnitWithProrationPrice, Orb::Models::NewFloatingGroupedAllocationPrice, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingBulkWithProrationPrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice, nil] An inline price definition to evaluate, allowing you to test price configuration + # @param price [Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::NewFloatingPackagePrice, Orb::Models::NewFloatingMatrixPrice, Orb::Models::NewFloatingThresholdTotalAmountPrice, Orb::Models::NewFloatingTieredPackagePrice, Orb::Models::NewFloatingTieredWithMinimumPrice, Orb::Models::NewFloatingGroupedTieredPrice, Orb::Models::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::NewFloatingPackageWithAllocationPrice, Orb::Models::NewFloatingUnitWithPercentPrice, Orb::Models::NewFloatingMatrixWithAllocationPrice, Orb::Models::NewFloatingTieredWithProrationPrice, Orb::Models::NewFloatingUnitWithProrationPrice, Orb::Models::NewFloatingGroupedAllocationPrice, Orb::Models::NewFloatingBulkWithProrationPrice, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice, Orb::Models::NewFloatingMinimumCompositePrice, Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent, Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput, nil] New floating price request body params. # # @param price_id [String, nil] The ID of a price to evaluate that exists in your Orb account. - # An inline price definition to evaluate, allowing you to test price - # configurations before adding them to Orb. + # New floating price request body params. # # @see Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation#price module Price @@ -175,62 +173,675 @@ module Price variant :unit, -> { Orb::NewFloatingUnitPrice } - variant :package, -> { Orb::NewFloatingPackagePrice } - - variant :matrix, -> { Orb::NewFloatingMatrixPrice } - - variant :matrix_with_allocation, -> { Orb::NewFloatingMatrixWithAllocationPrice } - variant :tiered, -> { Orb::NewFloatingTieredPrice } - variant :tiered_bps, -> { Orb::NewFloatingTieredBPSPrice } - - variant :bps, -> { Orb::NewFloatingBPSPrice } + variant :bulk, -> { Orb::NewFloatingBulkPrice } - variant :bulk_bps, -> { Orb::NewFloatingBulkBPSPrice } + variant :package, -> { Orb::NewFloatingPackagePrice } - variant :bulk, -> { Orb::NewFloatingBulkPrice } + variant :matrix, -> { Orb::NewFloatingMatrixPrice } variant :threshold_total_amount, -> { Orb::NewFloatingThresholdTotalAmountPrice } variant :tiered_package, -> { Orb::NewFloatingTieredPackagePrice } - variant :grouped_tiered, -> { Orb::NewFloatingGroupedTieredPrice } - - variant :max_group_tiered_package, -> { Orb::NewFloatingMaxGroupTieredPackagePrice } - variant :tiered_with_minimum, -> { Orb::NewFloatingTieredWithMinimumPrice } - variant :package_with_allocation, -> { Orb::NewFloatingPackageWithAllocationPrice } + variant :grouped_tiered, -> { Orb::NewFloatingGroupedTieredPrice } variant :tiered_package_with_minimum, -> { Orb::NewFloatingTieredPackageWithMinimumPrice } + variant :package_with_allocation, -> { Orb::NewFloatingPackageWithAllocationPrice } + variant :unit_with_percent, -> { Orb::NewFloatingUnitWithPercentPrice } + variant :matrix_with_allocation, -> { Orb::NewFloatingMatrixWithAllocationPrice } + variant :tiered_with_proration, -> { Orb::NewFloatingTieredWithProrationPrice } variant :unit_with_proration, -> { Orb::NewFloatingUnitWithProrationPrice } variant :grouped_allocation, -> { Orb::NewFloatingGroupedAllocationPrice } + variant :bulk_with_proration, -> { Orb::NewFloatingBulkWithProrationPrice } + variant :grouped_with_prorated_minimum, -> { Orb::NewFloatingGroupedWithProratedMinimumPrice } variant :grouped_with_metered_minimum, -> { Orb::NewFloatingGroupedWithMeteredMinimumPrice } - variant :matrix_with_display_name, -> { Orb::NewFloatingMatrixWithDisplayNamePrice } + variant :grouped_with_min_max_thresholds, + -> { Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds } - variant :bulk_with_proration, -> { Orb::NewFloatingBulkWithProrationPrice } + variant :matrix_with_display_name, -> { Orb::NewFloatingMatrixWithDisplayNamePrice } variant :grouped_tiered_package, -> { Orb::NewFloatingGroupedTieredPackagePrice } + variant :max_group_tiered_package, -> { Orb::NewFloatingMaxGroupTieredPackagePrice } + variant :scalable_matrix_with_unit_pricing, -> { Orb::NewFloatingScalableMatrixWithUnitPricingPrice } variant :scalable_matrix_with_tiered_pricing, -> { Orb::NewFloatingScalableMatrixWithTieredPricingPrice } variant :cumulative_grouped_bulk, -> { Orb::NewFloatingCumulativeGroupedBulkPrice } + variant :minimum, -> { Orb::NewFloatingMinimumCompositePrice } + + variant :percent, -> { Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent } + + variant :event_output, -> { Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput } + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence] + required :cadence, + enum: -> { Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute grouped_with_min_max_thresholds_config + # Configuration for grouped_with_min_max_thresholds pricing + # + # @return [Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] + required :grouped_with_min_max_thresholds_config, + -> { Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :grouped_with_min_max_thresholds] + required :model_type, const: :grouped_with_min_max_thresholds + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::ConversionRateConfig + }, + nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!method initialize(cadence:, currency:, grouped_with_min_max_thresholds_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, model_type: :grouped_with_min_max_thresholds) + # Some parameter documentations has been truncated, see + # {Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds} + # for more details. + # + # @param cadence [Symbol, Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence] The cadence to bill for this price on. + # + # @param currency [String] An ISO 4217 currency string for which this price is billed in. + # + # @param grouped_with_min_max_thresholds_config [Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] Configuration for grouped_with_min_max_thresholds pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param model_type [Symbol, :grouped_with_min_max_thresholds] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds#grouped_with_min_max_thresholds_config + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before applying thresholds + # + # @return [String] + required :grouping_key, String + + # @!attribute maximum_charge + # The maximum amount to charge each group + # + # @return [String] + required :maximum_charge, String + + # @!attribute minimum_charge + # The minimum amount to charge each group, regardless of usage + # + # @return [String] + required :minimum_charge, String + + # @!attribute per_unit_rate + # The base price charged per group + # + # @return [String] + required :per_unit_rate, String + + # @!method initialize(grouping_key:, maximum_charge:, minimum_charge:, per_unit_rate:) + # Configuration for grouped_with_min_max_thresholds pricing + # + # @param grouping_key [String] The event property used to group before applying thresholds + # + # @param maximum_charge [String] The maximum amount to charge each group + # + # @param minimum_charge [String] The minimum amount to charge each group, regardless of usage + # + # @param per_unit_rate [String] The base price charged per group + end + end + + class Percent < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::Cadence] + required :cadence, + enum: -> { Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::Cadence } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :percent] + required :model_type, const: :percent + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute percent_config + # Configuration for percent pricing + # + # @return [Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::PercentConfig] + required :percent_config, + -> { Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::PercentConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::ConversionRateConfig + }, + nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!method initialize(cadence:, currency:, item_id:, name:, percent_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, model_type: :percent) + # Some parameter documentations has been truncated, see + # {Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent} + # for more details. + # + # @param cadence [Symbol, Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::Cadence] The cadence to bill for this price on. + # + # @param currency [String] An ISO 4217 currency string for which this price is billed in. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param percent_config [Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::PercentConfig] Configuration for percent pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param model_type [Symbol, :percent] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent#percent_config + class PercentConfig < Orb::Internal::Type::BaseModel + # @!attribute percent + # What percent of the component subtotals to charge + # + # @return [Float] + required :percent, Float + + # @!method initialize(percent:) + # Configuration for percent pricing + # + # @param percent [Float] What percent of the component subtotals to charge + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::Cadence] + required :cadence, + enum: -> { Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::Cadence } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute event_output_config + # Configuration for event_output pricing + # + # @return [Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::EventOutputConfig] + required :event_output_config, + -> { Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::EventOutputConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :event_output] + required :model_type, const: :event_output + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::ConversionRateConfig + }, + nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!method initialize(cadence:, currency:, event_output_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, model_type: :event_output) + # Some parameter documentations has been truncated, see + # {Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput} + # for more details. + # + # @param cadence [Symbol, Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::Cadence] The cadence to bill for this price on. + # + # @param currency [String] An ISO 4217 currency string for which this price is billed in. + # + # @param event_output_config [Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::EventOutputConfig] Configuration for event_output pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param model_type [Symbol, :event_output] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput#event_output_config + class EventOutputConfig < Orb::Internal::Type::BaseModel + # @!attribute unit_rating_key + # The key in the event data to extract the unit rate from. + # + # @return [String] + required :unit_rating_key, String + + # @!attribute grouping_key + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + # + # @return [String, nil] + optional :grouping_key, String, nil?: true + + # @!method initialize(unit_rating_key:, grouping_key: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::EventOutputConfig} + # for more details. + # + # Configuration for event_output pricing + # + # @param unit_rating_key [String] The key in the event data to extract the unit rate from. + # + # @param grouping_key [String, nil] An optional key in the event data to group by (e.g., event ID). All events will + end + end + # @!method self.variants - # @return [Array(Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingPackagePrice, Orb::Models::NewFloatingMatrixPrice, Orb::Models::NewFloatingMatrixWithAllocationPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingTieredBPSPrice, Orb::Models::NewFloatingBPSPrice, Orb::Models::NewFloatingBulkBPSPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::NewFloatingThresholdTotalAmountPrice, Orb::Models::NewFloatingTieredPackagePrice, Orb::Models::NewFloatingGroupedTieredPrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingTieredWithMinimumPrice, Orb::Models::NewFloatingPackageWithAllocationPrice, Orb::Models::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::NewFloatingUnitWithPercentPrice, Orb::Models::NewFloatingTieredWithProrationPrice, Orb::Models::NewFloatingUnitWithProrationPrice, Orb::Models::NewFloatingGroupedAllocationPrice, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingBulkWithProrationPrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice)] + # @return [Array(Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::NewFloatingPackagePrice, Orb::Models::NewFloatingMatrixPrice, Orb::Models::NewFloatingThresholdTotalAmountPrice, Orb::Models::NewFloatingTieredPackagePrice, Orb::Models::NewFloatingTieredWithMinimumPrice, Orb::Models::NewFloatingGroupedTieredPrice, Orb::Models::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::NewFloatingPackageWithAllocationPrice, Orb::Models::NewFloatingUnitWithPercentPrice, Orb::Models::NewFloatingMatrixWithAllocationPrice, Orb::Models::NewFloatingTieredWithProrationPrice, Orb::Models::NewFloatingUnitWithProrationPrice, Orb::Models::NewFloatingGroupedAllocationPrice, Orb::Models::NewFloatingBulkWithProrationPrice, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice, Orb::Models::NewFloatingMinimumCompositePrice, Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent, Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput)] end end end diff --git a/lib/orb/models/price_interval.rb b/lib/orb/models/price_interval.rb index 3ba3f270..db38ea72 100644 --- a/lib/orb/models/price_interval.rb +++ b/lib/orb/models/price_interval.rb @@ -64,7 +64,7 @@ class PriceInterval < Orb::Internal::Type::BaseModel # For more on the types of prices, see # [the core concepts documentation](/core-concepts#plan-and-price) # - # @return [Orb::Models::Price::Unit, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::Tiered, Orb::Models::Price::TieredBPS, Orb::Models::Price::BPS, Orb::Models::Price::BulkBPS, Orb::Models::Price::Bulk, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::GroupedWithMinMaxThresholds] + # @return [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::Minimum, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput] required :price, union: -> { Orb::Price } # @!attribute start_date @@ -103,7 +103,7 @@ class PriceInterval < Orb::Internal::Type::BaseModel # # @param fixed_fee_quantity_transitions [Array, nil] The fixed fee quantity transitions for this price interval. This is only relevan # - # @param price [Orb::Models::Price::Unit, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::Tiered, Orb::Models::Price::TieredBPS, Orb::Models::Price::BPS, Orb::Models::Price::BulkBPS, Orb::Models::Price::Bulk, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::GroupedWithMinMaxThresholds] The Price resource represents a price that can be billed on a subscription, resu + # @param price [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::Minimum, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput] The Price resource represents a price that can be billed on a subscription, resu # # @param start_date [Time] The start date of the price interval. This is the date that Orb starts billing f # diff --git a/lib/orb/models/subscription_change_apply_params.rb b/lib/orb/models/subscription_change_apply_params.rb index 8a2c1c21..5f35fe41 100644 --- a/lib/orb/models/subscription_change_apply_params.rb +++ b/lib/orb/models/subscription_change_apply_params.rb @@ -13,16 +13,29 @@ class SubscriptionChangeApplyParams < Orb::Internal::Type::BaseModel # @return [String, nil] optional :description, String, nil?: true + # @!attribute mark_as_paid + # Mark all pending invoices that are payable as paid. If amount is also provided, + # mark as paid and credit the difference to the customer's balance. + # + # @return [Boolean, nil] + optional :mark_as_paid, Orb::Internal::Type::Boolean, nil?: true + # @!attribute previously_collected_amount - # Amount already collected to apply to the customer's balance. + # Amount already collected to apply to the customer's balance. If mark_as_paid is + # also provided, credit the difference to the customer's balance. # # @return [String, nil] optional :previously_collected_amount, String, nil?: true - # @!method initialize(description: nil, previously_collected_amount: nil, request_options: {}) + # @!method initialize(description: nil, mark_as_paid: nil, previously_collected_amount: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionChangeApplyParams} for more details. + # # @param description [String, nil] Description to apply to the balance transaction representing this credit. # - # @param previously_collected_amount [String, nil] Amount already collected to apply to the customer's balance. + # @param mark_as_paid [Boolean, nil] Mark all pending invoices that are payable as paid. If amount is also provided, + # + # @param previously_collected_amount [String, nil] Amount already collected to apply to the customer's balance. If mark_as_paid is # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/orb/models/subscription_create_params.rb b/lib/orb/models/subscription_create_params.rb index 877037fa..4b6d20cd 100644 --- a/lib/orb/models/subscription_create_params.rb +++ b/lib/orb/models/subscription_create_params.rb @@ -438,9 +438,9 @@ class AddPrice < Orb::Internal::Type::BaseModel optional :plan_phase_order, Integer, nil?: true # @!attribute price - # The definition of a new price to create and add to the subscription. + # New subscription price request body params. # - # @return [Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionTieredBPSPrice, Orb::Models::NewSubscriptionBPSPrice, Orb::Models::NewSubscriptionBulkBPSPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionTierWithProrationPrice, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, nil] + # @return [Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::TieredWithProration, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMinimumCompositePrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::Percent, Orb::Models::SubscriptionCreateParams::AddPrice::Price::EventOutput, nil] optional :price, union: -> { Orb::SubscriptionCreateParams::AddPrice::Price }, nil?: true # @!attribute price_id @@ -475,13 +475,13 @@ class AddPrice < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] The phase to add this price to. # - # @param price [Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionTieredBPSPrice, Orb::Models::NewSubscriptionBPSPrice, Orb::Models::NewSubscriptionBulkBPSPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionTierWithProrationPrice, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, nil] The definition of a new price to create and add to the subscription. + # @param price [Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::TieredWithProration, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMinimumCompositePrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::Percent, Orb::Models::SubscriptionCreateParams::AddPrice::Price::EventOutput, nil] New subscription price request body params. # # @param price_id [String, nil] The id of the price to add to the subscription. # # @param start_date [Time, nil] The start date of the price interval. This is the date that the price will start - # The definition of a new price to create and add to the subscription. + # New subscription price request body params. # # @see Orb::Models::SubscriptionCreateParams::AddPrice#price module Price @@ -491,19 +491,13 @@ module Price variant :unit, -> { Orb::NewSubscriptionUnitPrice } - variant :package, -> { Orb::NewSubscriptionPackagePrice } - - variant :matrix, -> { Orb::NewSubscriptionMatrixPrice } - variant :tiered, -> { Orb::NewSubscriptionTieredPrice } - variant :tiered_bps, -> { Orb::NewSubscriptionTieredBPSPrice } - - variant :bps, -> { Orb::NewSubscriptionBPSPrice } + variant :bulk, -> { Orb::NewSubscriptionBulkPrice } - variant :bulk_bps, -> { Orb::NewSubscriptionBulkBPSPrice } + variant :package, -> { Orb::NewSubscriptionPackagePrice } - variant :bulk, -> { Orb::NewSubscriptionBulkPrice } + variant :matrix, -> { Orb::NewSubscriptionMatrixPrice } variant :threshold_total_amount, -> { Orb::NewSubscriptionThresholdTotalAmountPrice } @@ -511,43 +505,917 @@ module Price variant :tiered_with_minimum, -> { Orb::NewSubscriptionTieredWithMinimumPrice } - variant :unit_with_percent, -> { Orb::NewSubscriptionUnitWithPercentPrice } + variant :grouped_tiered, -> { Orb::NewSubscriptionGroupedTieredPrice } + + variant :tiered_package_with_minimum, -> { Orb::NewSubscriptionTieredPackageWithMinimumPrice } variant :package_with_allocation, -> { Orb::NewSubscriptionPackageWithAllocationPrice } - variant :tiered_with_proration, -> { Orb::NewSubscriptionTierWithProrationPrice } + variant :unit_with_percent, -> { Orb::NewSubscriptionUnitWithPercentPrice } + + variant :matrix_with_allocation, -> { Orb::NewSubscriptionMatrixWithAllocationPrice } + + variant :tiered_with_proration, -> { Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration } variant :unit_with_proration, -> { Orb::NewSubscriptionUnitWithProrationPrice } variant :grouped_allocation, -> { Orb::NewSubscriptionGroupedAllocationPrice } - variant :grouped_with_prorated_minimum, -> { Orb::NewSubscriptionGroupedWithProratedMinimumPrice } - variant :bulk_with_proration, -> { Orb::NewSubscriptionBulkWithProrationPrice } - variant :scalable_matrix_with_unit_pricing, -> { Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice } - - variant :scalable_matrix_with_tiered_pricing, - -> { Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice } - - variant :cumulative_grouped_bulk, -> { Orb::NewSubscriptionCumulativeGroupedBulkPrice } - - variant :max_group_tiered_package, -> { Orb::NewSubscriptionMaxGroupTieredPackagePrice } + variant :grouped_with_prorated_minimum, -> { Orb::NewSubscriptionGroupedWithProratedMinimumPrice } variant :grouped_with_metered_minimum, -> { Orb::NewSubscriptionGroupedWithMeteredMinimumPrice } + variant :grouped_with_min_max_thresholds, + -> { Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds } + variant :matrix_with_display_name, -> { Orb::NewSubscriptionMatrixWithDisplayNamePrice } variant :grouped_tiered_package, -> { Orb::NewSubscriptionGroupedTieredPackagePrice } - variant :matrix_with_allocation, -> { Orb::NewSubscriptionMatrixWithAllocationPrice } + variant :max_group_tiered_package, -> { Orb::NewSubscriptionMaxGroupTieredPackagePrice } - variant :tiered_package_with_minimum, -> { Orb::NewSubscriptionTieredPackageWithMinimumPrice } + variant :scalable_matrix_with_unit_pricing, -> { Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice } - variant :grouped_tiered, -> { Orb::NewSubscriptionGroupedTieredPrice } + variant :scalable_matrix_with_tiered_pricing, + -> { Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice } + + variant :cumulative_grouped_bulk, -> { Orb::NewSubscriptionCumulativeGroupedBulkPrice } + + variant :minimum, -> { Orb::NewSubscriptionMinimumCompositePrice } + + variant :percent, -> { Orb::SubscriptionCreateParams::AddPrice::Price::Percent } + + variant :event_output, -> { Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput } + + class TieredWithProration < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::Cadence] + required :cadence, + enum: -> { Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::Cadence } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :tiered_with_proration] + required :model_type, const: :tiered_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_proration_config + # Configuration for tiered_with_proration pricing + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig] + required :tiered_with_proration_config, + -> { Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, item_id:, name:, tiered_with_proration_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :tiered_with_proration) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionCreateParams::AddPrice::Price::TieredWithProration} + # for more details. + # + # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::Cadence] The cadence to bill for this price on. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param tiered_with_proration_config [Orb::Models::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig] Configuration for tiered_with_proration pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :tiered_with_proration] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::SubscriptionCreateParams::AddPrice::Price::TieredWithProration#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::SubscriptionCreateParams::AddPrice::Price::TieredWithProration#tiered_with_proration_config + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Tiers for rating based on total usage quantities into the specified tier with + # proration + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] } + + # @!method initialize(tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig} + # for more details. + # + # Configuration for tiered_with_proration pricing + # + # @param tiers [Array] Tiers for rating based on total usage quantities into the specified tier with pr + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Inclusive tier starting value + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tiered with proration tier + # + # @param tier_lower_bound [String] Inclusive tier starting value + # + # @param unit_amount [String] Amount per unit + end + end + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence] + required :cadence, + enum: -> { Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence } + + # @!attribute grouped_with_min_max_thresholds_config + # Configuration for grouped_with_min_max_thresholds pricing + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] + required :grouped_with_min_max_thresholds_config, + -> { Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :grouped_with_min_max_thresholds] + required :model_type, const: :grouped_with_min_max_thresholds + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, grouped_with_min_max_thresholds_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :grouped_with_min_max_thresholds) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds} + # for more details. + # + # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence] The cadence to bill for this price on. + # + # @param grouped_with_min_max_thresholds_config [Orb::Models::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] Configuration for grouped_with_min_max_thresholds pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :grouped_with_min_max_thresholds] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds#grouped_with_min_max_thresholds_config + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before applying thresholds + # + # @return [String] + required :grouping_key, String + + # @!attribute maximum_charge + # The maximum amount to charge each group + # + # @return [String] + required :maximum_charge, String + + # @!attribute minimum_charge + # The minimum amount to charge each group, regardless of usage + # + # @return [String] + required :minimum_charge, String + + # @!attribute per_unit_rate + # The base price charged per group + # + # @return [String] + required :per_unit_rate, String + + # @!method initialize(grouping_key:, maximum_charge:, minimum_charge:, per_unit_rate:) + # Configuration for grouped_with_min_max_thresholds pricing + # + # @param grouping_key [String] The event property used to group before applying thresholds + # + # @param maximum_charge [String] The maximum amount to charge each group + # + # @param minimum_charge [String] The minimum amount to charge each group, regardless of usage + # + # @param per_unit_rate [String] The base price charged per group + end + end + + class Percent < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::Percent::Cadence] + required :cadence, enum: -> { Orb::SubscriptionCreateParams::AddPrice::Price::Percent::Cadence } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :percent] + required :model_type, const: :percent + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute percent_config + # Configuration for percent pricing + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::Percent::PercentConfig] + required :percent_config, -> { Orb::SubscriptionCreateParams::AddPrice::Price::Percent::PercentConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::SubscriptionCreateParams::AddPrice::Price::Percent::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, item_id:, name:, percent_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :percent) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionCreateParams::AddPrice::Price::Percent} for more + # details. + # + # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::Percent::Cadence] The cadence to bill for this price on. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param percent_config [Orb::Models::SubscriptionCreateParams::AddPrice::Price::Percent::PercentConfig] Configuration for percent pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :percent] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::SubscriptionCreateParams::AddPrice::Price::Percent#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::SubscriptionCreateParams::AddPrice::Price::Percent#percent_config + class PercentConfig < Orb::Internal::Type::BaseModel + # @!attribute percent + # What percent of the component subtotals to charge + # + # @return [Float] + required :percent, Float + + # @!method initialize(percent:) + # Configuration for percent pricing + # + # @param percent [Float] What percent of the component subtotals to charge + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::EventOutput::Cadence] + required :cadence, enum: -> { Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::Cadence } + + # @!attribute event_output_config + # Configuration for event_output pricing + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::EventOutput::EventOutputConfig] + required :event_output_config, + -> { Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::EventOutputConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :event_output] + required :model_type, const: :event_output + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, event_output_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :event_output) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionCreateParams::AddPrice::Price::EventOutput} for more + # details. + # + # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::EventOutput::Cadence] The cadence to bill for this price on. + # + # @param event_output_config [Orb::Models::SubscriptionCreateParams::AddPrice::Price::EventOutput::EventOutputConfig] Configuration for event_output pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :event_output] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::SubscriptionCreateParams::AddPrice::Price::EventOutput#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::SubscriptionCreateParams::AddPrice::Price::EventOutput#event_output_config + class EventOutputConfig < Orb::Internal::Type::BaseModel + # @!attribute unit_rating_key + # The key in the event data to extract the unit rate from. + # + # @return [String] + required :unit_rating_key, String + + # @!attribute grouping_key + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + # + # @return [String, nil] + optional :grouping_key, String, nil?: true + + # @!method initialize(unit_rating_key:, grouping_key: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionCreateParams::AddPrice::Price::EventOutput::EventOutputConfig} + # for more details. + # + # Configuration for event_output pricing + # + # @param unit_rating_key [String] The key in the event data to extract the unit rate from. + # + # @param grouping_key [String, nil] An optional key in the event data to group by (e.g., event ID). All events will + end + end # @!method self.variants - # @return [Array(Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionTieredBPSPrice, Orb::Models::NewSubscriptionBPSPrice, Orb::Models::NewSubscriptionBulkBPSPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionTierWithProrationPrice, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice)] + # @return [Array(Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::TieredWithProration, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMinimumCompositePrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::Percent, Orb::Models::SubscriptionCreateParams::AddPrice::Price::EventOutput)] end end @@ -687,9 +1555,9 @@ class ReplacePrice < Orb::Internal::Type::BaseModel optional :minimum_amount, String, nil?: true # @!attribute price - # The definition of a new price to create and add to the subscription. + # New subscription price request body params. # - # @return [Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionTieredBPSPrice, Orb::Models::NewSubscriptionBPSPrice, Orb::Models::NewSubscriptionBulkBPSPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionTierWithProrationPrice, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, nil] + # @return [Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMinimumCompositePrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Percent, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput, nil] optional :price, union: -> { Orb::SubscriptionCreateParams::ReplacePrice::Price }, nil?: true # @!attribute price_id @@ -716,11 +1584,11 @@ class ReplacePrice < Orb::Internal::Type::BaseModel # # @param minimum_amount [String, nil] [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for # - # @param price [Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionTieredBPSPrice, Orb::Models::NewSubscriptionBPSPrice, Orb::Models::NewSubscriptionBulkBPSPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionTierWithProrationPrice, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, nil] The definition of a new price to create and add to the subscription. + # @param price [Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMinimumCompositePrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Percent, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput, nil] New subscription price request body params. # # @param price_id [String, nil] The id of the price to add to the subscription. - # The definition of a new price to create and add to the subscription. + # New subscription price request body params. # # @see Orb::Models::SubscriptionCreateParams::ReplacePrice#price module Price @@ -730,19 +1598,13 @@ module Price variant :unit, -> { Orb::NewSubscriptionUnitPrice } - variant :package, -> { Orb::NewSubscriptionPackagePrice } - - variant :matrix, -> { Orb::NewSubscriptionMatrixPrice } - variant :tiered, -> { Orb::NewSubscriptionTieredPrice } - variant :tiered_bps, -> { Orb::NewSubscriptionTieredBPSPrice } - - variant :bps, -> { Orb::NewSubscriptionBPSPrice } + variant :bulk, -> { Orb::NewSubscriptionBulkPrice } - variant :bulk_bps, -> { Orb::NewSubscriptionBulkBPSPrice } + variant :package, -> { Orb::NewSubscriptionPackagePrice } - variant :bulk, -> { Orb::NewSubscriptionBulkPrice } + variant :matrix, -> { Orb::NewSubscriptionMatrixPrice } variant :threshold_total_amount, -> { Orb::NewSubscriptionThresholdTotalAmountPrice } @@ -750,43 +1612,919 @@ module Price variant :tiered_with_minimum, -> { Orb::NewSubscriptionTieredWithMinimumPrice } - variant :unit_with_percent, -> { Orb::NewSubscriptionUnitWithPercentPrice } + variant :grouped_tiered, -> { Orb::NewSubscriptionGroupedTieredPrice } + + variant :tiered_package_with_minimum, -> { Orb::NewSubscriptionTieredPackageWithMinimumPrice } variant :package_with_allocation, -> { Orb::NewSubscriptionPackageWithAllocationPrice } - variant :tiered_with_proration, -> { Orb::NewSubscriptionTierWithProrationPrice } + variant :unit_with_percent, -> { Orb::NewSubscriptionUnitWithPercentPrice } + + variant :matrix_with_allocation, -> { Orb::NewSubscriptionMatrixWithAllocationPrice } + + variant :tiered_with_proration, + -> { Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration } variant :unit_with_proration, -> { Orb::NewSubscriptionUnitWithProrationPrice } variant :grouped_allocation, -> { Orb::NewSubscriptionGroupedAllocationPrice } - variant :grouped_with_prorated_minimum, -> { Orb::NewSubscriptionGroupedWithProratedMinimumPrice } - variant :bulk_with_proration, -> { Orb::NewSubscriptionBulkWithProrationPrice } - variant :scalable_matrix_with_unit_pricing, -> { Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice } - - variant :scalable_matrix_with_tiered_pricing, - -> { Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice } - - variant :cumulative_grouped_bulk, -> { Orb::NewSubscriptionCumulativeGroupedBulkPrice } - - variant :max_group_tiered_package, -> { Orb::NewSubscriptionMaxGroupTieredPackagePrice } + variant :grouped_with_prorated_minimum, -> { Orb::NewSubscriptionGroupedWithProratedMinimumPrice } variant :grouped_with_metered_minimum, -> { Orb::NewSubscriptionGroupedWithMeteredMinimumPrice } + variant :grouped_with_min_max_thresholds, + -> { Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds } + variant :matrix_with_display_name, -> { Orb::NewSubscriptionMatrixWithDisplayNamePrice } variant :grouped_tiered_package, -> { Orb::NewSubscriptionGroupedTieredPackagePrice } - variant :matrix_with_allocation, -> { Orb::NewSubscriptionMatrixWithAllocationPrice } + variant :max_group_tiered_package, -> { Orb::NewSubscriptionMaxGroupTieredPackagePrice } - variant :tiered_package_with_minimum, -> { Orb::NewSubscriptionTieredPackageWithMinimumPrice } + variant :scalable_matrix_with_unit_pricing, -> { Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice } - variant :grouped_tiered, -> { Orb::NewSubscriptionGroupedTieredPrice } + variant :scalable_matrix_with_tiered_pricing, + -> { Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice } + + variant :cumulative_grouped_bulk, -> { Orb::NewSubscriptionCumulativeGroupedBulkPrice } + + variant :minimum, -> { Orb::NewSubscriptionMinimumCompositePrice } + + variant :percent, -> { Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent } + + variant :event_output, -> { Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput } + + class TieredWithProration < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::Cadence] + required :cadence, + enum: -> { Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::Cadence } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :tiered_with_proration] + required :model_type, const: :tiered_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_proration_config + # Configuration for tiered_with_proration pricing + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig] + required :tiered_with_proration_config, + -> { Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, item_id:, name:, tiered_with_proration_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :tiered_with_proration) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration} + # for more details. + # + # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::Cadence] The cadence to bill for this price on. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param tiered_with_proration_config [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig] Configuration for tiered_with_proration pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :tiered_with_proration] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration#tiered_with_proration_config + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Tiers for rating based on total usage quantities into the specified tier with + # proration + # + # @return [Array] + required :tiers, + -> { Orb::Internal::Type::ArrayOf[Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] } + + # @!method initialize(tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig} + # for more details. + # + # Configuration for tiered_with_proration pricing + # + # @param tiers [Array] Tiers for rating based on total usage quantities into the specified tier with pr + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Inclusive tier starting value + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tiered with proration tier + # + # @param tier_lower_bound [String] Inclusive tier starting value + # + # @param unit_amount [String] Amount per unit + end + end + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence] + required :cadence, + enum: -> { Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence } + + # @!attribute grouped_with_min_max_thresholds_config + # Configuration for grouped_with_min_max_thresholds pricing + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] + required :grouped_with_min_max_thresholds_config, + -> { Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :grouped_with_min_max_thresholds] + required :model_type, const: :grouped_with_min_max_thresholds + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, grouped_with_min_max_thresholds_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :grouped_with_min_max_thresholds) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds} + # for more details. + # + # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence] The cadence to bill for this price on. + # + # @param grouped_with_min_max_thresholds_config [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] Configuration for grouped_with_min_max_thresholds pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :grouped_with_min_max_thresholds] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds#grouped_with_min_max_thresholds_config + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before applying thresholds + # + # @return [String] + required :grouping_key, String + + # @!attribute maximum_charge + # The maximum amount to charge each group + # + # @return [String] + required :maximum_charge, String + + # @!attribute minimum_charge + # The minimum amount to charge each group, regardless of usage + # + # @return [String] + required :minimum_charge, String + + # @!attribute per_unit_rate + # The base price charged per group + # + # @return [String] + required :per_unit_rate, String + + # @!method initialize(grouping_key:, maximum_charge:, minimum_charge:, per_unit_rate:) + # Configuration for grouped_with_min_max_thresholds pricing + # + # @param grouping_key [String] The event property used to group before applying thresholds + # + # @param maximum_charge [String] The maximum amount to charge each group + # + # @param minimum_charge [String] The minimum amount to charge each group, regardless of usage + # + # @param per_unit_rate [String] The base price charged per group + end + end + + class Percent < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Percent::Cadence] + required :cadence, enum: -> { Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::Cadence } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :percent] + required :model_type, const: :percent + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute percent_config + # Configuration for percent pricing + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Percent::PercentConfig] + required :percent_config, + -> { Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::PercentConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, item_id:, name:, percent_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :percent) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Percent} for more + # details. + # + # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Percent::Cadence] The cadence to bill for this price on. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param percent_config [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Percent::PercentConfig] Configuration for percent pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :percent] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Percent#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Percent#percent_config + class PercentConfig < Orb::Internal::Type::BaseModel + # @!attribute percent + # What percent of the component subtotals to charge + # + # @return [Float] + required :percent, Float + + # @!method initialize(percent:) + # Configuration for percent pricing + # + # @param percent [Float] What percent of the component subtotals to charge + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::Cadence] + required :cadence, enum: -> { Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::Cadence } + + # @!attribute event_output_config + # Configuration for event_output pricing + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::EventOutputConfig] + required :event_output_config, + -> { Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::EventOutputConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :event_output] + required :model_type, const: :event_output + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, event_output_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :event_output) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput} for + # more details. + # + # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::Cadence] The cadence to bill for this price on. + # + # @param event_output_config [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::EventOutputConfig] Configuration for event_output pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :event_output] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput#event_output_config + class EventOutputConfig < Orb::Internal::Type::BaseModel + # @!attribute unit_rating_key + # The key in the event data to extract the unit rate from. + # + # @return [String] + required :unit_rating_key, String + + # @!attribute grouping_key + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + # + # @return [String, nil] + optional :grouping_key, String, nil?: true + + # @!method initialize(unit_rating_key:, grouping_key: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::EventOutputConfig} + # for more details. + # + # Configuration for event_output pricing + # + # @param unit_rating_key [String] The key in the event data to extract the unit rate from. + # + # @param grouping_key [String, nil] An optional key in the event data to group by (e.g., event ID). All events will + end + end # @!method self.variants - # @return [Array(Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionTieredBPSPrice, Orb::Models::NewSubscriptionBPSPrice, Orb::Models::NewSubscriptionBulkBPSPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionTierWithProrationPrice, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice)] + # @return [Array(Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMinimumCompositePrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Percent, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput)] end end end diff --git a/lib/orb/models/subscription_list_params.rb b/lib/orb/models/subscription_list_params.rb index 7c4b8565..55e1c4da 100644 --- a/lib/orb/models/subscription_list_params.rb +++ b/lib/orb/models/subscription_list_params.rb @@ -44,18 +44,28 @@ class SubscriptionListParams < Orb::Internal::Type::BaseModel # @return [Array, nil] optional :external_customer_id, Orb::Internal::Type::ArrayOf[String], nil?: true + # @!attribute external_plan_id + # + # @return [String, nil] + optional :external_plan_id, String, nil?: true + # @!attribute limit # The number of items to fetch. Defaults to 20. # # @return [Integer, nil] optional :limit, Integer + # @!attribute plan_id + # + # @return [String, nil] + optional :plan_id, String, nil?: true + # @!attribute status # # @return [Symbol, Orb::Models::SubscriptionListParams::Status, nil] optional :status, enum: -> { Orb::SubscriptionListParams::Status }, nil?: true - # @!method initialize(created_at_gt: nil, created_at_gte: nil, created_at_lt: nil, created_at_lte: nil, cursor: nil, customer_id: nil, external_customer_id: nil, limit: nil, status: nil, request_options: {}) + # @!method initialize(created_at_gt: nil, created_at_gte: nil, created_at_lt: nil, created_at_lte: nil, cursor: nil, customer_id: nil, external_customer_id: nil, external_plan_id: nil, limit: nil, plan_id: nil, status: nil, request_options: {}) # Some parameter documentations has been truncated, see # {Orb::Models::SubscriptionListParams} for more details. # @@ -73,8 +83,12 @@ class SubscriptionListParams < Orb::Internal::Type::BaseModel # # @param external_customer_id [Array, nil] # + # @param external_plan_id [String, nil] + # # @param limit [Integer] The number of items to fetch. Defaults to 20. # + # @param plan_id [String, nil] + # # @param status [Symbol, Orb::Models::SubscriptionListParams::Status, nil] # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/orb/models/subscription_price_intervals_params.rb b/lib/orb/models/subscription_price_intervals_params.rb index 22229a7f..bb214351 100644 --- a/lib/orb/models/subscription_price_intervals_params.rb +++ b/lib/orb/models/subscription_price_intervals_params.rb @@ -128,9 +128,9 @@ class Add < Orb::Internal::Type::BaseModel optional :minimum_amount, Float, nil?: true # @!attribute price - # The definition of a new price to create and add to the subscription. + # New floating price request body params. # - # @return [Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingPackagePrice, Orb::Models::NewFloatingMatrixPrice, Orb::Models::NewFloatingMatrixWithAllocationPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingTieredBPSPrice, Orb::Models::NewFloatingBPSPrice, Orb::Models::NewFloatingBulkBPSPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::NewFloatingThresholdTotalAmountPrice, Orb::Models::NewFloatingTieredPackagePrice, Orb::Models::NewFloatingGroupedTieredPrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingTieredWithMinimumPrice, Orb::Models::NewFloatingPackageWithAllocationPrice, Orb::Models::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::NewFloatingUnitWithPercentPrice, Orb::Models::NewFloatingTieredWithProrationPrice, Orb::Models::NewFloatingUnitWithProrationPrice, Orb::Models::NewFloatingGroupedAllocationPrice, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingBulkWithProrationPrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice, nil] + # @return [Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::NewFloatingPackagePrice, Orb::Models::NewFloatingMatrixPrice, Orb::Models::NewFloatingThresholdTotalAmountPrice, Orb::Models::NewFloatingTieredPackagePrice, Orb::Models::NewFloatingTieredWithMinimumPrice, Orb::Models::NewFloatingGroupedTieredPrice, Orb::Models::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::NewFloatingPackageWithAllocationPrice, Orb::Models::NewFloatingUnitWithPercentPrice, Orb::Models::NewFloatingMatrixWithAllocationPrice, Orb::Models::NewFloatingTieredWithProrationPrice, Orb::Models::NewFloatingUnitWithProrationPrice, Orb::Models::NewFloatingGroupedAllocationPrice, Orb::Models::NewFloatingBulkWithProrationPrice, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice, Orb::Models::NewFloatingMinimumCompositePrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Percent, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput, nil] optional :price, union: -> { Orb::SubscriptionPriceIntervalsParams::Add::Price }, nil?: true # @!attribute price_id @@ -172,7 +172,7 @@ class Add < Orb::Internal::Type::BaseModel # # @param minimum_amount [Float, nil] The minimum amount that will be billed for this price interval for a given billi # - # @param price [Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingPackagePrice, Orb::Models::NewFloatingMatrixPrice, Orb::Models::NewFloatingMatrixWithAllocationPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingTieredBPSPrice, Orb::Models::NewFloatingBPSPrice, Orb::Models::NewFloatingBulkBPSPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::NewFloatingThresholdTotalAmountPrice, Orb::Models::NewFloatingTieredPackagePrice, Orb::Models::NewFloatingGroupedTieredPrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingTieredWithMinimumPrice, Orb::Models::NewFloatingPackageWithAllocationPrice, Orb::Models::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::NewFloatingUnitWithPercentPrice, Orb::Models::NewFloatingTieredWithProrationPrice, Orb::Models::NewFloatingUnitWithProrationPrice, Orb::Models::NewFloatingGroupedAllocationPrice, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingBulkWithProrationPrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice, nil] The definition of a new price to create and add to the subscription. + # @param price [Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::NewFloatingPackagePrice, Orb::Models::NewFloatingMatrixPrice, Orb::Models::NewFloatingThresholdTotalAmountPrice, Orb::Models::NewFloatingTieredPackagePrice, Orb::Models::NewFloatingTieredWithMinimumPrice, Orb::Models::NewFloatingGroupedTieredPrice, Orb::Models::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::NewFloatingPackageWithAllocationPrice, Orb::Models::NewFloatingUnitWithPercentPrice, Orb::Models::NewFloatingMatrixWithAllocationPrice, Orb::Models::NewFloatingTieredWithProrationPrice, Orb::Models::NewFloatingUnitWithProrationPrice, Orb::Models::NewFloatingGroupedAllocationPrice, Orb::Models::NewFloatingBulkWithProrationPrice, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice, Orb::Models::NewFloatingMinimumCompositePrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Percent, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput, nil] New floating price request body params. # # @param price_id [String, nil] The id of the price to add to the subscription. # @@ -306,7 +306,7 @@ class FixedFeeQuantityTransition < Orb::Internal::Type::BaseModel # @param quantity [Integer] The quantity of the fixed fee quantity transition. end - # The definition of a new price to create and add to the subscription. + # New floating price request body params. # # @see Orb::Models::SubscriptionPriceIntervalsParams::Add#price module Price @@ -316,72 +316,676 @@ module Price variant :unit, -> { Orb::NewFloatingUnitPrice } - variant :package, -> { Orb::NewFloatingPackagePrice } - - variant :matrix, -> { Orb::NewFloatingMatrixPrice } - - variant :matrix_with_allocation, -> { Orb::NewFloatingMatrixWithAllocationPrice } - variant :tiered, -> { Orb::NewFloatingTieredPrice } - variant :tiered_bps, -> { Orb::NewFloatingTieredBPSPrice } - - variant :bps, -> { Orb::NewFloatingBPSPrice } + variant :bulk, -> { Orb::NewFloatingBulkPrice } - variant :bulk_bps, -> { Orb::NewFloatingBulkBPSPrice } + variant :package, -> { Orb::NewFloatingPackagePrice } - variant :bulk, -> { Orb::NewFloatingBulkPrice } + variant :matrix, -> { Orb::NewFloatingMatrixPrice } variant :threshold_total_amount, -> { Orb::NewFloatingThresholdTotalAmountPrice } variant :tiered_package, -> { Orb::NewFloatingTieredPackagePrice } - variant :grouped_tiered, -> { Orb::NewFloatingGroupedTieredPrice } - - variant :max_group_tiered_package, -> { Orb::NewFloatingMaxGroupTieredPackagePrice } - variant :tiered_with_minimum, -> { Orb::NewFloatingTieredWithMinimumPrice } - variant :package_with_allocation, -> { Orb::NewFloatingPackageWithAllocationPrice } + variant :grouped_tiered, -> { Orb::NewFloatingGroupedTieredPrice } variant :tiered_package_with_minimum, -> { Orb::NewFloatingTieredPackageWithMinimumPrice } + variant :package_with_allocation, -> { Orb::NewFloatingPackageWithAllocationPrice } + variant :unit_with_percent, -> { Orb::NewFloatingUnitWithPercentPrice } + variant :matrix_with_allocation, -> { Orb::NewFloatingMatrixWithAllocationPrice } + variant :tiered_with_proration, -> { Orb::NewFloatingTieredWithProrationPrice } variant :unit_with_proration, -> { Orb::NewFloatingUnitWithProrationPrice } variant :grouped_allocation, -> { Orb::NewFloatingGroupedAllocationPrice } + variant :bulk_with_proration, -> { Orb::NewFloatingBulkWithProrationPrice } + variant :grouped_with_prorated_minimum, -> { Orb::NewFloatingGroupedWithProratedMinimumPrice } variant :grouped_with_metered_minimum, -> { Orb::NewFloatingGroupedWithMeteredMinimumPrice } - variant :matrix_with_display_name, -> { Orb::NewFloatingMatrixWithDisplayNamePrice } + variant :grouped_with_min_max_thresholds, + -> { Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds } - variant :bulk_with_proration, -> { Orb::NewFloatingBulkWithProrationPrice } + variant :matrix_with_display_name, -> { Orb::NewFloatingMatrixWithDisplayNamePrice } variant :grouped_tiered_package, -> { Orb::NewFloatingGroupedTieredPackagePrice } + variant :max_group_tiered_package, -> { Orb::NewFloatingMaxGroupTieredPackagePrice } + variant :scalable_matrix_with_unit_pricing, -> { Orb::NewFloatingScalableMatrixWithUnitPricingPrice } variant :scalable_matrix_with_tiered_pricing, -> { Orb::NewFloatingScalableMatrixWithTieredPricingPrice } variant :cumulative_grouped_bulk, -> { Orb::NewFloatingCumulativeGroupedBulkPrice } + variant :minimum, -> { Orb::NewFloatingMinimumCompositePrice } + + variant :percent, -> { Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent } + + variant :event_output, -> { Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput } + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence] + required :cadence, + enum: -> { Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute grouped_with_min_max_thresholds_config + # Configuration for grouped_with_min_max_thresholds pricing + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] + required :grouped_with_min_max_thresholds_config, + -> { Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :grouped_with_min_max_thresholds] + required :model_type, const: :grouped_with_min_max_thresholds + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::ConversionRateConfig + }, + nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!method initialize(cadence:, currency:, grouped_with_min_max_thresholds_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, model_type: :grouped_with_min_max_thresholds) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds} + # for more details. + # + # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence] The cadence to bill for this price on. + # + # @param currency [String] An ISO 4217 currency string for which this price is billed in. + # + # @param grouped_with_min_max_thresholds_config [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] Configuration for grouped_with_min_max_thresholds pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param model_type [Symbol, :grouped_with_min_max_thresholds] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds#grouped_with_min_max_thresholds_config + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before applying thresholds + # + # @return [String] + required :grouping_key, String + + # @!attribute maximum_charge + # The maximum amount to charge each group + # + # @return [String] + required :maximum_charge, String + + # @!attribute minimum_charge + # The minimum amount to charge each group, regardless of usage + # + # @return [String] + required :minimum_charge, String + + # @!attribute per_unit_rate + # The base price charged per group + # + # @return [String] + required :per_unit_rate, String + + # @!method initialize(grouping_key:, maximum_charge:, minimum_charge:, per_unit_rate:) + # Configuration for grouped_with_min_max_thresholds pricing + # + # @param grouping_key [String] The event property used to group before applying thresholds + # + # @param maximum_charge [String] The maximum amount to charge each group + # + # @param minimum_charge [String] The minimum amount to charge each group, regardless of usage + # + # @param per_unit_rate [String] The base price charged per group + end + end + + class Percent < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence] + required :cadence, enum: -> { Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :percent] + required :model_type, const: :percent + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute percent_config + # Configuration for percent pricing + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig] + required :percent_config, -> { Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::ConversionRateConfig + }, + nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!method initialize(cadence:, currency:, item_id:, name:, percent_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, model_type: :percent) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Percent} for more + # details. + # + # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence] The cadence to bill for this price on. + # + # @param currency [String] An ISO 4217 currency string for which this price is billed in. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param percent_config [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig] Configuration for percent pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param model_type [Symbol, :percent] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Percent#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Percent#percent_config + class PercentConfig < Orb::Internal::Type::BaseModel + # @!attribute percent + # What percent of the component subtotals to charge + # + # @return [Float] + required :percent, Float + + # @!method initialize(percent:) + # Configuration for percent pricing + # + # @param percent [Float] What percent of the component subtotals to charge + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence] + required :cadence, enum: -> { Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute event_output_config + # Configuration for event_output pricing + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig] + required :event_output_config, + -> { Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :event_output] + required :model_type, const: :event_output + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::ConversionRateConfig + }, + nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!method initialize(cadence:, currency:, event_output_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, model_type: :event_output) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput} for + # more details. + # + # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence] The cadence to bill for this price on. + # + # @param currency [String] An ISO 4217 currency string for which this price is billed in. + # + # @param event_output_config [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig] Configuration for event_output pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param model_type [Symbol, :event_output] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput#event_output_config + class EventOutputConfig < Orb::Internal::Type::BaseModel + # @!attribute unit_rating_key + # The key in the event data to extract the unit rate from. + # + # @return [String] + required :unit_rating_key, String + + # @!attribute grouping_key + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + # + # @return [String, nil] + optional :grouping_key, String, nil?: true + + # @!method initialize(unit_rating_key:, grouping_key: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig} + # for more details. + # + # Configuration for event_output pricing + # + # @param unit_rating_key [String] The key in the event data to extract the unit rate from. + # + # @param grouping_key [String, nil] An optional key in the event data to group by (e.g., event ID). All events will + end + end + # @!method self.variants - # @return [Array(Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingPackagePrice, Orb::Models::NewFloatingMatrixPrice, Orb::Models::NewFloatingMatrixWithAllocationPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingTieredBPSPrice, Orb::Models::NewFloatingBPSPrice, Orb::Models::NewFloatingBulkBPSPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::NewFloatingThresholdTotalAmountPrice, Orb::Models::NewFloatingTieredPackagePrice, Orb::Models::NewFloatingGroupedTieredPrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingTieredWithMinimumPrice, Orb::Models::NewFloatingPackageWithAllocationPrice, Orb::Models::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::NewFloatingUnitWithPercentPrice, Orb::Models::NewFloatingTieredWithProrationPrice, Orb::Models::NewFloatingUnitWithProrationPrice, Orb::Models::NewFloatingGroupedAllocationPrice, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingBulkWithProrationPrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice)] + # @return [Array(Orb::Models::NewFloatingUnitPrice, Orb::Models::NewFloatingTieredPrice, Orb::Models::NewFloatingBulkPrice, Orb::Models::NewFloatingPackagePrice, Orb::Models::NewFloatingMatrixPrice, Orb::Models::NewFloatingThresholdTotalAmountPrice, Orb::Models::NewFloatingTieredPackagePrice, Orb::Models::NewFloatingTieredWithMinimumPrice, Orb::Models::NewFloatingGroupedTieredPrice, Orb::Models::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::NewFloatingPackageWithAllocationPrice, Orb::Models::NewFloatingUnitWithPercentPrice, Orb::Models::NewFloatingMatrixWithAllocationPrice, Orb::Models::NewFloatingTieredWithProrationPrice, Orb::Models::NewFloatingUnitWithProrationPrice, Orb::Models::NewFloatingGroupedAllocationPrice, Orb::Models::NewFloatingBulkWithProrationPrice, Orb::Models::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds, Orb::Models::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::NewFloatingGroupedTieredPackagePrice, Orb::Models::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice, Orb::Models::NewFloatingCumulativeGroupedBulkPrice, Orb::Models::NewFloatingMinimumCompositePrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Percent, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput)] end end class AddAdjustment < Orb::Internal::Type::BaseModel - # @!attribute adjustment - # The definition of a new adjustment to create and add to the subscription. - # - # @return [Orb::Models::NewPercentageDiscount, Orb::Models::NewUsageDiscount, Orb::Models::NewAmountDiscount, Orb::Models::NewMinimum, Orb::Models::NewMaximum] - required :adjustment, union: -> { Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment } - # @!attribute start_date # The start date of the adjustment interval. This is the date that the adjustment # will start affecting prices on the subscription. The adjustment will apply to @@ -391,6 +995,22 @@ class AddAdjustment < Orb::Internal::Type::BaseModel # @return [Time, Symbol, Orb::Models::BillingCycleRelativeDate] required :start_date, union: -> { Orb::SubscriptionPriceIntervalsParams::AddAdjustment::StartDate } + # @!attribute adjustment + # The definition of a new adjustment to create and add to the subscription. + # + # @return [Orb::Models::NewPercentageDiscount, Orb::Models::NewUsageDiscount, Orb::Models::NewAmountDiscount, Orb::Models::NewMinimum, Orb::Models::NewMaximum, nil] + optional :adjustment, + union: -> { Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment }, + nil?: true + + # @!attribute adjustment_id + # The ID of the adjustment to add to the subscription. Adjustment IDs can be + # re-used from existing subscriptions or plans, but adjustments associated with + # coupon redemptions cannot be re-used. + # + # @return [String, nil] + optional :adjustment_id, String, nil?: true + # @!attribute end_date # The end date of the adjustment interval. This is the date that the adjustment # will stop affecting prices on the subscription. The adjustment will apply to @@ -402,16 +1022,35 @@ class AddAdjustment < Orb::Internal::Type::BaseModel union: -> { Orb::SubscriptionPriceIntervalsParams::AddAdjustment::EndDate }, nil?: true - # @!method initialize(adjustment:, start_date:, end_date: nil) + # @!method initialize(start_date:, adjustment: nil, adjustment_id: nil, end_date: nil) # Some parameter documentations has been truncated, see # {Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment} for more details. # - # @param adjustment [Orb::Models::NewPercentageDiscount, Orb::Models::NewUsageDiscount, Orb::Models::NewAmountDiscount, Orb::Models::NewMinimum, Orb::Models::NewMaximum] The definition of a new adjustment to create and add to the subscription. - # # @param start_date [Time, Symbol, Orb::Models::BillingCycleRelativeDate] The start date of the adjustment interval. This is the date that the adjustment # + # @param adjustment [Orb::Models::NewPercentageDiscount, Orb::Models::NewUsageDiscount, Orb::Models::NewAmountDiscount, Orb::Models::NewMinimum, Orb::Models::NewMaximum, nil] The definition of a new adjustment to create and add to the subscription. + # + # @param adjustment_id [String, nil] The ID of the adjustment to add to the subscription. Adjustment IDs can be re-us + # # @param end_date [Time, Symbol, Orb::Models::BillingCycleRelativeDate, nil] The end date of the adjustment interval. This is the date that the adjustment wi + # The start date of the adjustment interval. This is the date that the adjustment + # will start affecting prices on the subscription. The adjustment will apply to + # invoice dates that overlap with this `start_date`. This `start_date` is treated + # as inclusive for in-advance prices, and exclusive for in-arrears prices. + # + # @see Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment#start_date + module StartDate + extend Orb::Internal::Type::Union + + variant Time + + variant enum: -> { Orb::BillingCycleRelativeDate } + + # @!method self.variants + # @return [Array(Time, Symbol, Orb::Models::BillingCycleRelativeDate)] + end + # The definition of a new adjustment to create and add to the subscription. # # @see Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment#adjustment @@ -434,23 +1073,6 @@ module Adjustment # @return [Array(Orb::Models::NewPercentageDiscount, Orb::Models::NewUsageDiscount, Orb::Models::NewAmountDiscount, Orb::Models::NewMinimum, Orb::Models::NewMaximum)] end - # The start date of the adjustment interval. This is the date that the adjustment - # will start affecting prices on the subscription. The adjustment will apply to - # invoice dates that overlap with this `start_date`. This `start_date` is treated - # as inclusive for in-advance prices, and exclusive for in-arrears prices. - # - # @see Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment#start_date - module StartDate - extend Orb::Internal::Type::Union - - variant Time - - variant enum: -> { Orb::BillingCycleRelativeDate } - - # @!method self.variants - # @return [Array(Time, Symbol, Orb::Models::BillingCycleRelativeDate)] - end - # The end date of the adjustment interval. This is the date that the adjustment # will stop affecting prices on the subscription. The adjustment will apply to # invoice dates that overlap with this `end_date`.This `end_date` is treated as diff --git a/lib/orb/models/subscription_schedule_plan_change_params.rb b/lib/orb/models/subscription_schedule_plan_change_params.rb index c65da79b..a32088fd 100644 --- a/lib/orb/models/subscription_schedule_plan_change_params.rb +++ b/lib/orb/models/subscription_schedule_plan_change_params.rb @@ -403,9 +403,9 @@ class AddPrice < Orb::Internal::Type::BaseModel optional :plan_phase_order, Integer, nil?: true # @!attribute price - # The definition of a new price to create and add to the subscription. + # New subscription price request body params. # - # @return [Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionTieredBPSPrice, Orb::Models::NewSubscriptionBPSPrice, Orb::Models::NewSubscriptionBulkBPSPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionTierWithProrationPrice, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, nil] + # @return [Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMinimumCompositePrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput, nil] optional :price, union: -> { Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price }, nil?: true # @!attribute price_id @@ -440,13 +440,13 @@ class AddPrice < Orb::Internal::Type::BaseModel # # @param plan_phase_order [Integer, nil] The phase to add this price to. # - # @param price [Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionTieredBPSPrice, Orb::Models::NewSubscriptionBPSPrice, Orb::Models::NewSubscriptionBulkBPSPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionTierWithProrationPrice, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, nil] The definition of a new price to create and add to the subscription. + # @param price [Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMinimumCompositePrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput, nil] New subscription price request body params. # # @param price_id [String, nil] The id of the price to add to the subscription. # # @param start_date [Time, nil] The start date of the price interval. This is the date that the price will start - # The definition of a new price to create and add to the subscription. + # New subscription price request body params. # # @see Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice#price module Price @@ -456,19 +456,13 @@ module Price variant :unit, -> { Orb::NewSubscriptionUnitPrice } - variant :package, -> { Orb::NewSubscriptionPackagePrice } - - variant :matrix, -> { Orb::NewSubscriptionMatrixPrice } - variant :tiered, -> { Orb::NewSubscriptionTieredPrice } - variant :tiered_bps, -> { Orb::NewSubscriptionTieredBPSPrice } - - variant :bps, -> { Orb::NewSubscriptionBPSPrice } + variant :bulk, -> { Orb::NewSubscriptionBulkPrice } - variant :bulk_bps, -> { Orb::NewSubscriptionBulkBPSPrice } + variant :package, -> { Orb::NewSubscriptionPackagePrice } - variant :bulk, -> { Orb::NewSubscriptionBulkPrice } + variant :matrix, -> { Orb::NewSubscriptionMatrixPrice } variant :threshold_total_amount, -> { Orb::NewSubscriptionThresholdTotalAmountPrice } @@ -476,43 +470,925 @@ module Price variant :tiered_with_minimum, -> { Orb::NewSubscriptionTieredWithMinimumPrice } - variant :unit_with_percent, -> { Orb::NewSubscriptionUnitWithPercentPrice } + variant :grouped_tiered, -> { Orb::NewSubscriptionGroupedTieredPrice } + + variant :tiered_package_with_minimum, -> { Orb::NewSubscriptionTieredPackageWithMinimumPrice } variant :package_with_allocation, -> { Orb::NewSubscriptionPackageWithAllocationPrice } - variant :tiered_with_proration, -> { Orb::NewSubscriptionTierWithProrationPrice } + variant :unit_with_percent, -> { Orb::NewSubscriptionUnitWithPercentPrice } + + variant :matrix_with_allocation, -> { Orb::NewSubscriptionMatrixWithAllocationPrice } + + variant :tiered_with_proration, + -> { Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration } variant :unit_with_proration, -> { Orb::NewSubscriptionUnitWithProrationPrice } variant :grouped_allocation, -> { Orb::NewSubscriptionGroupedAllocationPrice } - variant :grouped_with_prorated_minimum, -> { Orb::NewSubscriptionGroupedWithProratedMinimumPrice } - variant :bulk_with_proration, -> { Orb::NewSubscriptionBulkWithProrationPrice } - variant :scalable_matrix_with_unit_pricing, -> { Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice } - - variant :scalable_matrix_with_tiered_pricing, - -> { Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice } - - variant :cumulative_grouped_bulk, -> { Orb::NewSubscriptionCumulativeGroupedBulkPrice } - - variant :max_group_tiered_package, -> { Orb::NewSubscriptionMaxGroupTieredPackagePrice } + variant :grouped_with_prorated_minimum, -> { Orb::NewSubscriptionGroupedWithProratedMinimumPrice } variant :grouped_with_metered_minimum, -> { Orb::NewSubscriptionGroupedWithMeteredMinimumPrice } + variant :grouped_with_min_max_thresholds, + -> { Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds } + variant :matrix_with_display_name, -> { Orb::NewSubscriptionMatrixWithDisplayNamePrice } variant :grouped_tiered_package, -> { Orb::NewSubscriptionGroupedTieredPackagePrice } - variant :matrix_with_allocation, -> { Orb::NewSubscriptionMatrixWithAllocationPrice } + variant :max_group_tiered_package, -> { Orb::NewSubscriptionMaxGroupTieredPackagePrice } - variant :tiered_package_with_minimum, -> { Orb::NewSubscriptionTieredPackageWithMinimumPrice } + variant :scalable_matrix_with_unit_pricing, -> { Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice } - variant :grouped_tiered, -> { Orb::NewSubscriptionGroupedTieredPrice } + variant :scalable_matrix_with_tiered_pricing, + -> { Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice } + + variant :cumulative_grouped_bulk, -> { Orb::NewSubscriptionCumulativeGroupedBulkPrice } + + variant :minimum, -> { Orb::NewSubscriptionMinimumCompositePrice } + + variant :percent, -> { Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent } + + variant :event_output, -> { Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput } + + class TieredWithProration < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::Cadence] + required :cadence, + enum: -> { Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::Cadence } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :tiered_with_proration] + required :model_type, const: :tiered_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_proration_config + # Configuration for tiered_with_proration pricing + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig] + required :tiered_with_proration_config, + -> { Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, item_id:, name:, tiered_with_proration_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :tiered_with_proration) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration} + # for more details. + # + # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::Cadence] The cadence to bill for this price on. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param tiered_with_proration_config [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig] Configuration for tiered_with_proration pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :tiered_with_proration] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration#tiered_with_proration_config + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Tiers for rating based on total usage quantities into the specified tier with + # proration + # + # @return [Array] + required :tiers, + -> do + Orb::Internal::Type::ArrayOf[ + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + end + + # @!method initialize(tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig} + # for more details. + # + # Configuration for tiered_with_proration pricing + # + # @param tiers [Array] Tiers for rating based on total usage quantities into the specified tier with pr + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Inclusive tier starting value + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tiered with proration tier + # + # @param tier_lower_bound [String] Inclusive tier starting value + # + # @param unit_amount [String] Amount per unit + end + end + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence] + required :cadence, + enum: -> { Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence } + + # @!attribute grouped_with_min_max_thresholds_config + # Configuration for grouped_with_min_max_thresholds pricing + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] + required :grouped_with_min_max_thresholds_config, + -> { Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :grouped_with_min_max_thresholds] + required :model_type, const: :grouped_with_min_max_thresholds + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, grouped_with_min_max_thresholds_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :grouped_with_min_max_thresholds) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds} + # for more details. + # + # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence] The cadence to bill for this price on. + # + # @param grouped_with_min_max_thresholds_config [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] Configuration for grouped_with_min_max_thresholds pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :grouped_with_min_max_thresholds] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds#grouped_with_min_max_thresholds_config + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before applying thresholds + # + # @return [String] + required :grouping_key, String + + # @!attribute maximum_charge + # The maximum amount to charge each group + # + # @return [String] + required :maximum_charge, String + + # @!attribute minimum_charge + # The minimum amount to charge each group, regardless of usage + # + # @return [String] + required :minimum_charge, String + + # @!attribute per_unit_rate + # The base price charged per group + # + # @return [String] + required :per_unit_rate, String + + # @!method initialize(grouping_key:, maximum_charge:, minimum_charge:, per_unit_rate:) + # Configuration for grouped_with_min_max_thresholds pricing + # + # @param grouping_key [String] The event property used to group before applying thresholds + # + # @param maximum_charge [String] The maximum amount to charge each group + # + # @param minimum_charge [String] The minimum amount to charge each group, regardless of usage + # + # @param per_unit_rate [String] The base price charged per group + end + end + + class Percent < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::Cadence] + required :cadence, + enum: -> { Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::Cadence } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :percent] + required :model_type, const: :percent + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute percent_config + # Configuration for percent pricing + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::PercentConfig] + required :percent_config, + -> { Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::PercentConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, item_id:, name:, percent_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :percent) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent} + # for more details. + # + # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::Cadence] The cadence to bill for this price on. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param percent_config [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::PercentConfig] Configuration for percent pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :percent] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent#percent_config + class PercentConfig < Orb::Internal::Type::BaseModel + # @!attribute percent + # What percent of the component subtotals to charge + # + # @return [Float] + required :percent, Float + + # @!method initialize(percent:) + # Configuration for percent pricing + # + # @param percent [Float] What percent of the component subtotals to charge + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::Cadence] + required :cadence, + enum: -> { Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::Cadence } + + # @!attribute event_output_config + # Configuration for event_output pricing + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::EventOutputConfig] + required :event_output_config, + -> { Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::EventOutputConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :event_output] + required :model_type, const: :event_output + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, event_output_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :event_output) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput} + # for more details. + # + # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::Cadence] The cadence to bill for this price on. + # + # @param event_output_config [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::EventOutputConfig] Configuration for event_output pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :event_output] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput#event_output_config + class EventOutputConfig < Orb::Internal::Type::BaseModel + # @!attribute unit_rating_key + # The key in the event data to extract the unit rate from. + # + # @return [String] + required :unit_rating_key, String + + # @!attribute grouping_key + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + # + # @return [String, nil] + optional :grouping_key, String, nil?: true + + # @!method initialize(unit_rating_key:, grouping_key: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::EventOutputConfig} + # for more details. + # + # Configuration for event_output pricing + # + # @param unit_rating_key [String] The key in the event data to extract the unit rate from. + # + # @param grouping_key [String, nil] An optional key in the event data to group by (e.g., event ID). All events will + end + end # @!method self.variants - # @return [Array(Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionTieredBPSPrice, Orb::Models::NewSubscriptionBPSPrice, Orb::Models::NewSubscriptionBulkBPSPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionTierWithProrationPrice, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice)] + # @return [Array(Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMinimumCompositePrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput)] end end @@ -655,9 +1531,9 @@ class ReplacePrice < Orb::Internal::Type::BaseModel optional :minimum_amount, String, nil?: true # @!attribute price - # The definition of a new price to create and add to the subscription. + # New subscription price request body params. # - # @return [Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionTieredBPSPrice, Orb::Models::NewSubscriptionBPSPrice, Orb::Models::NewSubscriptionBulkBPSPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionTierWithProrationPrice, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, nil] + # @return [Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMinimumCompositePrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput, nil] optional :price, union: -> { Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price @@ -689,11 +1565,11 @@ class ReplacePrice < Orb::Internal::Type::BaseModel # # @param minimum_amount [String, nil] [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for # - # @param price [Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionTieredBPSPrice, Orb::Models::NewSubscriptionBPSPrice, Orb::Models::NewSubscriptionBulkBPSPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionTierWithProrationPrice, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, nil] The definition of a new price to create and add to the subscription. + # @param price [Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMinimumCompositePrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput, nil] New subscription price request body params. # # @param price_id [String, nil] The id of the price to add to the subscription. - # The definition of a new price to create and add to the subscription. + # New subscription price request body params. # # @see Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice#price module Price @@ -703,19 +1579,13 @@ module Price variant :unit, -> { Orb::NewSubscriptionUnitPrice } - variant :package, -> { Orb::NewSubscriptionPackagePrice } - - variant :matrix, -> { Orb::NewSubscriptionMatrixPrice } - variant :tiered, -> { Orb::NewSubscriptionTieredPrice } - variant :tiered_bps, -> { Orb::NewSubscriptionTieredBPSPrice } - - variant :bps, -> { Orb::NewSubscriptionBPSPrice } + variant :bulk, -> { Orb::NewSubscriptionBulkPrice } - variant :bulk_bps, -> { Orb::NewSubscriptionBulkBPSPrice } + variant :package, -> { Orb::NewSubscriptionPackagePrice } - variant :bulk, -> { Orb::NewSubscriptionBulkPrice } + variant :matrix, -> { Orb::NewSubscriptionMatrixPrice } variant :threshold_total_amount, -> { Orb::NewSubscriptionThresholdTotalAmountPrice } @@ -723,43 +1593,925 @@ module Price variant :tiered_with_minimum, -> { Orb::NewSubscriptionTieredWithMinimumPrice } - variant :unit_with_percent, -> { Orb::NewSubscriptionUnitWithPercentPrice } + variant :grouped_tiered, -> { Orb::NewSubscriptionGroupedTieredPrice } + + variant :tiered_package_with_minimum, -> { Orb::NewSubscriptionTieredPackageWithMinimumPrice } variant :package_with_allocation, -> { Orb::NewSubscriptionPackageWithAllocationPrice } - variant :tiered_with_proration, -> { Orb::NewSubscriptionTierWithProrationPrice } + variant :unit_with_percent, -> { Orb::NewSubscriptionUnitWithPercentPrice } + + variant :matrix_with_allocation, -> { Orb::NewSubscriptionMatrixWithAllocationPrice } + + variant :tiered_with_proration, + -> { Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration } variant :unit_with_proration, -> { Orb::NewSubscriptionUnitWithProrationPrice } variant :grouped_allocation, -> { Orb::NewSubscriptionGroupedAllocationPrice } - variant :grouped_with_prorated_minimum, -> { Orb::NewSubscriptionGroupedWithProratedMinimumPrice } - variant :bulk_with_proration, -> { Orb::NewSubscriptionBulkWithProrationPrice } - variant :scalable_matrix_with_unit_pricing, -> { Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice } - - variant :scalable_matrix_with_tiered_pricing, - -> { Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice } - - variant :cumulative_grouped_bulk, -> { Orb::NewSubscriptionCumulativeGroupedBulkPrice } - - variant :max_group_tiered_package, -> { Orb::NewSubscriptionMaxGroupTieredPackagePrice } + variant :grouped_with_prorated_minimum, -> { Orb::NewSubscriptionGroupedWithProratedMinimumPrice } variant :grouped_with_metered_minimum, -> { Orb::NewSubscriptionGroupedWithMeteredMinimumPrice } + variant :grouped_with_min_max_thresholds, + -> { Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds } + variant :matrix_with_display_name, -> { Orb::NewSubscriptionMatrixWithDisplayNamePrice } variant :grouped_tiered_package, -> { Orb::NewSubscriptionGroupedTieredPackagePrice } - variant :matrix_with_allocation, -> { Orb::NewSubscriptionMatrixWithAllocationPrice } + variant :max_group_tiered_package, -> { Orb::NewSubscriptionMaxGroupTieredPackagePrice } - variant :tiered_package_with_minimum, -> { Orb::NewSubscriptionTieredPackageWithMinimumPrice } + variant :scalable_matrix_with_unit_pricing, -> { Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice } - variant :grouped_tiered, -> { Orb::NewSubscriptionGroupedTieredPrice } + variant :scalable_matrix_with_tiered_pricing, + -> { Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice } + + variant :cumulative_grouped_bulk, -> { Orb::NewSubscriptionCumulativeGroupedBulkPrice } + + variant :minimum, -> { Orb::NewSubscriptionMinimumCompositePrice } + + variant :percent, -> { Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent } + + variant :event_output, -> { Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput } + + class TieredWithProration < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::Cadence] + required :cadence, + enum: -> { Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::Cadence } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :tiered_with_proration] + required :model_type, const: :tiered_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_proration_config + # Configuration for tiered_with_proration pricing + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig] + required :tiered_with_proration_config, + -> { Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, item_id:, name:, tiered_with_proration_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :tiered_with_proration) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration} + # for more details. + # + # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::Cadence] The cadence to bill for this price on. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param tiered_with_proration_config [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig] Configuration for tiered_with_proration pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :tiered_with_proration] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration#tiered_with_proration_config + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + # @!attribute tiers + # Tiers for rating based on total usage quantities into the specified tier with + # proration + # + # @return [Array] + required :tiers, + -> do + Orb::Internal::Type::ArrayOf[ + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + end + + # @!method initialize(tiers:) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig} + # for more details. + # + # Configuration for tiered_with_proration pricing + # + # @param tiers [Array] Tiers for rating based on total usage quantities into the specified tier with pr + + class Tier < Orb::Internal::Type::BaseModel + # @!attribute tier_lower_bound + # Inclusive tier starting value + # + # @return [String] + required :tier_lower_bound, String + + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!method initialize(tier_lower_bound:, unit_amount:) + # Configuration for a single tiered with proration tier + # + # @param tier_lower_bound [String] Inclusive tier starting value + # + # @param unit_amount [String] Amount per unit + end + end + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence] + required :cadence, + enum: -> { Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence } + + # @!attribute grouped_with_min_max_thresholds_config + # Configuration for grouped_with_min_max_thresholds pricing + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] + required :grouped_with_min_max_thresholds_config, + -> { Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :grouped_with_min_max_thresholds] + required :model_type, const: :grouped_with_min_max_thresholds + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, grouped_with_min_max_thresholds_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :grouped_with_min_max_thresholds) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds} + # for more details. + # + # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence] The cadence to bill for this price on. + # + # @param grouped_with_min_max_thresholds_config [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] Configuration for grouped_with_min_max_thresholds pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :grouped_with_min_max_thresholds] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds#grouped_with_min_max_thresholds_config + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + # @!attribute grouping_key + # The event property used to group before applying thresholds + # + # @return [String] + required :grouping_key, String + + # @!attribute maximum_charge + # The maximum amount to charge each group + # + # @return [String] + required :maximum_charge, String + + # @!attribute minimum_charge + # The minimum amount to charge each group, regardless of usage + # + # @return [String] + required :minimum_charge, String + + # @!attribute per_unit_rate + # The base price charged per group + # + # @return [String] + required :per_unit_rate, String + + # @!method initialize(grouping_key:, maximum_charge:, minimum_charge:, per_unit_rate:) + # Configuration for grouped_with_min_max_thresholds pricing + # + # @param grouping_key [String] The event property used to group before applying thresholds + # + # @param maximum_charge [String] The maximum amount to charge each group + # + # @param minimum_charge [String] The minimum amount to charge each group, regardless of usage + # + # @param per_unit_rate [String] The base price charged per group + end + end + + class Percent < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::Cadence] + required :cadence, + enum: -> { Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::Cadence } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :percent] + required :model_type, const: :percent + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute percent_config + # Configuration for percent pricing + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::PercentConfig] + required :percent_config, + -> { Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::PercentConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, item_id:, name:, percent_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :percent) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent} + # for more details. + # + # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::Cadence] The cadence to bill for this price on. + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param percent_config [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::PercentConfig] Configuration for percent pricing + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :percent] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent#percent_config + class PercentConfig < Orb::Internal::Type::BaseModel + # @!attribute percent + # What percent of the component subtotals to charge + # + # @return [Float] + required :percent, Float + + # @!method initialize(percent:) + # Configuration for percent pricing + # + # @param percent [Float] What percent of the component subtotals to charge + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::Cadence] + required :cadence, + enum: -> { Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::Cadence } + + # @!attribute event_output_config + # Configuration for event_output pricing + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::EventOutputConfig] + required :event_output_config, + -> { Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::EventOutputConfig } + + # @!attribute item_id + # The id of the item the price will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # The pricing model type + # + # @return [Symbol, :event_output] + required :model_type, const: :event_output + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::Internal::Type::Boolean, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :billing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute conversion_rate_config + # The configuration for the rate of the price currency to the invoicing currency. + # + # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] + optional :conversion_rate_config, + union: -> { + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::ConversionRateConfig + }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute dimensional_price_configuration + # For dimensional price: specifies a price group and dimension values + # + # @return [Orb::Models::NewDimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::NewDimensionalPriceConfiguration + }, + nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::NewBillingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, -> { Orb::NewBillingCycleConfiguration }, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(cadence:, event_output_config:, item_id:, name:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, currency: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, reference_id: nil, model_type: :event_output) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput} + # for more details. + # + # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::Cadence] The cadence to bill for this price on. + # + # @param event_output_config [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::EventOutputConfig] Configuration for event_output pricing + # + # @param item_id [String] The id of the item the price will be associated with. + # + # @param name [String] The name of the price. + # + # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b + # + # @param billed_in_advance [Boolean, nil] If the Price represents a fixed cost, the price will be billed in-advance if thi + # + # @param billing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] For custom cadence: specifies the duration of the billing period in days or mont + # + # @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency. + # + # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] The configuration for the rate of the price currency to the invoicing currency. + # + # @param currency [String, nil] An ISO 4217 currency string, or custom pricing unit identifier, in which this pr + # + # @param dimensional_price_configuration [Orb::Models::NewDimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values + # + # @param external_price_id [String, nil] An alias for the price. + # + # @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl + # + # @param invoice_grouping_key [String, nil] The property used to group this price on an invoice + # + # @param invoicing_cycle_configuration [Orb::Models::NewBillingCycleConfiguration, nil] Within each billing cycle, specifies the cadence at which invoices are produced. + # + # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed + # + # @param reference_id [String, nil] A transient ID that can be used to reference this price when adding adjustments + # + # @param model_type [Symbol, :event_output] The pricing model type + + # The cadence to bill for this price on. + # + # @see Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput#cadence + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # @see Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput#event_output_config + class EventOutputConfig < Orb::Internal::Type::BaseModel + # @!attribute unit_rating_key + # The key in the event data to extract the unit rate from. + # + # @return [String] + required :unit_rating_key, String + + # @!attribute grouping_key + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + # + # @return [String, nil] + optional :grouping_key, String, nil?: true + + # @!method initialize(unit_rating_key:, grouping_key: nil) + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::EventOutputConfig} + # for more details. + # + # Configuration for event_output pricing + # + # @param unit_rating_key [String] The key in the event data to extract the unit rate from. + # + # @param grouping_key [String, nil] An optional key in the event data to group by (e.g., event ID). All events will + end + end # @!method self.variants - # @return [Array(Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionTieredBPSPrice, Orb::Models::NewSubscriptionBPSPrice, Orb::Models::NewSubscriptionBulkBPSPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionTierWithProrationPrice, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice)] + # @return [Array(Orb::Models::NewSubscriptionUnitPrice, Orb::Models::NewSubscriptionTieredPrice, Orb::Models::NewSubscriptionBulkPrice, Orb::Models::NewSubscriptionPackagePrice, Orb::Models::NewSubscriptionMatrixPrice, Orb::Models::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::NewSubscriptionTieredPackagePrice, Orb::Models::NewSubscriptionTieredWithMinimumPrice, Orb::Models::NewSubscriptionGroupedTieredPrice, Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice, Orb::Models::NewSubscriptionPackageWithAllocationPrice, Orb::Models::NewSubscriptionUnitWithPercentPrice, Orb::Models::NewSubscriptionMatrixWithAllocationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration, Orb::Models::NewSubscriptionUnitWithProrationPrice, Orb::Models::NewSubscriptionGroupedAllocationPrice, Orb::Models::NewSubscriptionBulkWithProrationPrice, Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice, Orb::Models::NewSubscriptionGroupedTieredPackagePrice, Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice, Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice, Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice, Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice, Orb::Models::NewSubscriptionMinimumCompositePrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput)] end end end diff --git a/lib/orb/models/tier.rb b/lib/orb/models/tier.rb index a229376b..4fc23d9b 100644 --- a/lib/orb/models/tier.rb +++ b/lib/orb/models/tier.rb @@ -16,17 +16,23 @@ class Tier < Orb::Internal::Type::BaseModel required :unit_amount, String # @!attribute last_unit - # Inclusive tier ending value. If null, this is treated as the last tier + # Inclusive tier ending value. This value is null if and only if this is the last + # tier. # # @return [Float, nil] optional :last_unit, Float, nil?: true # @!method initialize(first_unit:, unit_amount:, last_unit: nil) + # Some parameter documentations has been truncated, see {Orb::Models::Tier} for + # more details. + # + # Configuration for a single tier + # # @param first_unit [Float] Exclusive tier starting value # # @param unit_amount [String] Amount per unit # - # @param last_unit [Float, nil] Inclusive tier ending value. If null, this is treated as the last tier + # @param last_unit [Float, nil] Inclusive tier ending value. This value is null if and only if this is the last end end end diff --git a/lib/orb/models/tier_config.rb b/lib/orb/models/tier_config.rb deleted file mode 100644 index f2bd3bbd..00000000 --- a/lib/orb/models/tier_config.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -module Orb - module Models - class TierConfig < Orb::Internal::Type::BaseModel - # @!attribute first_unit - # - # @return [Float] - required :first_unit, Float - - # @!attribute last_unit - # - # @return [Float, nil] - required :last_unit, Float, nil?: true - - # @!attribute unit_amount - # - # @return [String] - required :unit_amount, String - - # @!method initialize(first_unit:, last_unit:, unit_amount:) - # @param first_unit [Float] - # @param last_unit [Float, nil] - # @param unit_amount [String] - end - end -end diff --git a/lib/orb/models/tier_sub_line_item.rb b/lib/orb/models/tier_sub_line_item.rb index 5ffdfba6..acd3c6a2 100644 --- a/lib/orb/models/tier_sub_line_item.rb +++ b/lib/orb/models/tier_sub_line_item.rb @@ -26,8 +26,8 @@ class TierSubLineItem < Orb::Internal::Type::BaseModel # @!attribute tier_config # - # @return [Orb::Models::TierConfig] - required :tier_config, -> { Orb::TierConfig } + # @return [Orb::Models::TierSubLineItem::TierConfig] + required :tier_config, -> { Orb::TierSubLineItem::TierConfig } # @!attribute type # @@ -43,10 +43,33 @@ class TierSubLineItem < Orb::Internal::Type::BaseModel # # @param quantity [Float] # - # @param tier_config [Orb::Models::TierConfig] + # @param tier_config [Orb::Models::TierSubLineItem::TierConfig] # # @param type [Symbol, Orb::Models::TierSubLineItem::Type] + # @see Orb::Models::TierSubLineItem#tier_config + class TierConfig < Orb::Internal::Type::BaseModel + # @!attribute first_unit + # + # @return [Float] + required :first_unit, Float + + # @!attribute last_unit + # + # @return [Float, nil] + required :last_unit, Float, nil?: true + + # @!attribute unit_amount + # + # @return [String] + required :unit_amount, String + + # @!method initialize(first_unit:, last_unit:, unit_amount:) + # @param first_unit [Float] + # @param last_unit [Float, nil] + # @param unit_amount [String] + end + # @see Orb::Models::TierSubLineItem#type module Type extend Orb::Internal::Type::Enum diff --git a/lib/orb/models/tiered_bps_config.rb b/lib/orb/models/tiered_bps_config.rb deleted file mode 100644 index 46086138..00000000 --- a/lib/orb/models/tiered_bps_config.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module Orb - module Models - class TieredBPSConfig < Orb::Internal::Type::BaseModel - # @!attribute tiers - # Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - # tiers - # - # @return [Array] - required :tiers, -> { Orb::Internal::Type::ArrayOf[Orb::BPSTier] } - - # @!method initialize(tiers:) - # Some parameter documentations has been truncated, see - # {Orb::Models::TieredBPSConfig} for more details. - # - # @param tiers [Array] Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - end - end -end diff --git a/lib/orb/models/tiered_config.rb b/lib/orb/models/tiered_config.rb index 3d4884dd..c5cdc393 100644 --- a/lib/orb/models/tiered_config.rb +++ b/lib/orb/models/tiered_config.rb @@ -10,6 +10,8 @@ class TieredConfig < Orb::Internal::Type::BaseModel required :tiers, -> { Orb::Internal::Type::ArrayOf[Orb::Tier] } # @!method initialize(tiers:) + # Configuration for tiered pricing + # # @param tiers [Array] Tiers for rating based on total usage quantities into the specified tier end end diff --git a/lib/orb/models/unit_config.rb b/lib/orb/models/unit_config.rb index 3a191ac9..c862ac2e 100644 --- a/lib/orb/models/unit_config.rb +++ b/lib/orb/models/unit_config.rb @@ -10,6 +10,8 @@ class UnitConfig < Orb::Internal::Type::BaseModel required :unit_amount, String # @!method initialize(unit_amount:) + # Configuration for unit pricing + # # @param unit_amount [String] Rate per unit of usage end end diff --git a/lib/orb/resources/alerts.rb b/lib/orb/resources/alerts.rb index d2536302..a8a2400e 100644 --- a/lib/orb/resources/alerts.rb +++ b/lib/orb/resources/alerts.rb @@ -54,7 +54,7 @@ def update(alert_configuration_id, params) # The request must specify one of `customer_id`, `external_customer_id`, or # `subscription_id`. # - # If querying by subscripion_id, the endpoint will return the subscription level + # If querying by subscription_id, the endpoint will return the subscription level # alerts as well as the plan level alerts associated with the subscription. # # The list of alerts is ordered starting from the most recently created alert. diff --git a/lib/orb/resources/beta.rb b/lib/orb/resources/beta.rb index 0dcffdb1..862d68fa 100644 --- a/lib/orb/resources/beta.rb +++ b/lib/orb/resources/beta.rb @@ -6,9 +6,6 @@ class Beta # @return [Orb::Resources::Beta::ExternalPlanID] attr_reader :external_plan_id - # This API endpoint is in beta and its interface may change. It is recommended for - # use only in test mode. - # # This endpoint allows the creation of a new plan version for an existing plan. # # @overload create_plan_version(plan_id, version:, add_adjustments: nil, add_prices: nil, remove_adjustments: nil, remove_prices: nil, replace_adjustments: nil, replace_prices: nil, set_as_default: nil, request_options: {}) diff --git a/lib/orb/resources/beta/external_plan_id.rb b/lib/orb/resources/beta/external_plan_id.rb index 4a609681..5a0a6cb1 100644 --- a/lib/orb/resources/beta/external_plan_id.rb +++ b/lib/orb/resources/beta/external_plan_id.rb @@ -4,9 +4,6 @@ module Orb module Resources class Beta class ExternalPlanID - # This API endpoint is in beta and its interface may change. It is recommended for - # use only in test mode. - # # This endpoint allows the creation of a new plan version for an existing plan. # # @overload create_plan_version(external_plan_id, version:, add_adjustments: nil, add_prices: nil, remove_adjustments: nil, remove_prices: nil, replace_adjustments: nil, replace_prices: nil, set_as_default: nil, request_options: {}) diff --git a/lib/orb/resources/customers.rb b/lib/orb/resources/customers.rb index 3a80be05..e16f9393 100644 --- a/lib/orb/resources/customers.rb +++ b/lib/orb/resources/customers.rb @@ -28,7 +28,7 @@ class Customers # - [Timezone localization](/essentials/timezones) can be configured on a # per-customer basis by setting the `timezone` parameter # - # @overload create(email:, name:, accounting_sync_configuration: nil, additional_emails: nil, auto_collection: nil, billing_address: nil, currency: nil, email_delivery: nil, external_customer_id: nil, hierarchy: nil, metadata: nil, payment_provider: nil, payment_provider_id: nil, reporting_configuration: nil, shipping_address: nil, tax_configuration: nil, tax_id: nil, timezone: nil, request_options: {}) + # @overload create(email:, name:, accounting_sync_configuration: nil, additional_emails: nil, auto_collection: nil, auto_issuance: nil, billing_address: nil, currency: nil, email_delivery: nil, external_customer_id: nil, hierarchy: nil, metadata: nil, payment_provider: nil, payment_provider_id: nil, reporting_configuration: nil, shipping_address: nil, tax_configuration: nil, tax_id: nil, timezone: nil, request_options: {}) # # @param email [String] A valid customer email, to be used for notifications. When Orb triggers payment # @@ -40,6 +40,8 @@ class Customers # # @param auto_collection [Boolean, nil] Used to determine if invoices for this customer will automatically attempt to ch # + # @param auto_issuance [Boolean, nil] Used to determine if invoices for this customer will be automatically issued. If + # # @param billing_address [Orb::Models::AddressInput, nil] # # @param currency [String, nil] An ISO 4217 currency string used for the customer's invoices and balance. If not @@ -60,7 +62,7 @@ class Customers # # @param shipping_address [Orb::Models::AddressInput, nil] # - # @param tax_configuration [Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, nil] + # @param tax_configuration [Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, Orb::Models::CustomerCreateParams::TaxConfiguration::Numeral, nil] # # @param tax_id [Orb::Models::CustomerTaxID, nil] Tax IDs are commonly required to be displayed on customer invoices, which are ad # @@ -91,7 +93,7 @@ def create(params) # `additional_emails` of an existing customer. Other fields on a customer are # currently immutable. # - # @overload update(customer_id, accounting_sync_configuration: nil, additional_emails: nil, auto_collection: nil, billing_address: nil, currency: nil, email: nil, email_delivery: nil, external_customer_id: nil, hierarchy: nil, metadata: nil, name: nil, payment_provider: nil, payment_provider_id: nil, reporting_configuration: nil, shipping_address: nil, tax_configuration: nil, tax_id: nil, request_options: {}) + # @overload update(customer_id, accounting_sync_configuration: nil, additional_emails: nil, auto_collection: nil, auto_issuance: nil, billing_address: nil, currency: nil, email: nil, email_delivery: nil, external_customer_id: nil, hierarchy: nil, metadata: nil, name: nil, payment_provider: nil, payment_provider_id: nil, reporting_configuration: nil, shipping_address: nil, tax_configuration: nil, tax_id: nil, request_options: {}) # # @param customer_id [String] # @@ -101,6 +103,8 @@ def create(params) # # @param auto_collection [Boolean, nil] Used to determine if invoices for this customer will automatically attempt to ch # + # @param auto_issuance [Boolean, nil] Used to determine if invoices for this customer will be automatically issued. If + # # @param billing_address [Orb::Models::AddressInput, nil] # # @param currency [String, nil] An ISO 4217 currency string used for the customer's invoices and balance. If not @@ -125,7 +129,7 @@ def create(params) # # @param shipping_address [Orb::Models::AddressInput, nil] # - # @param tax_configuration [Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, nil] + # @param tax_configuration [Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, Orb::Models::CustomerUpdateParams::TaxConfiguration::Numeral, nil] # # @param tax_id [Orb::Models::CustomerTaxID, nil] Tax IDs are commonly required to be displayed on customer invoices, which are ad # @@ -327,7 +331,7 @@ def sync_payment_methods_from_gateway_by_external_customer_id(external_customer_ # resource and semantics of this endpoint exactly mirror # [Update Customer](update-customer). # - # @overload update_by_external_id(id, accounting_sync_configuration: nil, additional_emails: nil, auto_collection: nil, billing_address: nil, currency: nil, email: nil, email_delivery: nil, external_customer_id: nil, hierarchy: nil, metadata: nil, name: nil, payment_provider: nil, payment_provider_id: nil, reporting_configuration: nil, shipping_address: nil, tax_configuration: nil, tax_id: nil, request_options: {}) + # @overload update_by_external_id(id, accounting_sync_configuration: nil, additional_emails: nil, auto_collection: nil, auto_issuance: nil, billing_address: nil, currency: nil, email: nil, email_delivery: nil, external_customer_id: nil, hierarchy: nil, metadata: nil, name: nil, payment_provider: nil, payment_provider_id: nil, reporting_configuration: nil, shipping_address: nil, tax_configuration: nil, tax_id: nil, request_options: {}) # # @param id [String] # @@ -337,6 +341,8 @@ def sync_payment_methods_from_gateway_by_external_customer_id(external_customer_ # # @param auto_collection [Boolean, nil] Used to determine if invoices for this customer will automatically attempt to ch # + # @param auto_issuance [Boolean, nil] Used to determine if invoices for this customer will be automatically issued. If + # # @param billing_address [Orb::Models::AddressInput, nil] # # @param currency [String, nil] An ISO 4217 currency string used for the customer's invoices and balance. If not @@ -361,7 +367,7 @@ def sync_payment_methods_from_gateway_by_external_customer_id(external_customer_ # # @param shipping_address [Orb::Models::AddressInput, nil] # - # @param tax_configuration [Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, nil] + # @param tax_configuration [Orb::Models::NewAvalaraTaxConfiguration, Orb::Models::NewTaxJarConfiguration, Orb::Models::NewSphereConfiguration, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Numeral, nil] # # @param tax_id [Orb::Models::CustomerTaxID, nil] Tax IDs are commonly required to be displayed on customer invoices, which are ad # diff --git a/lib/orb/resources/customers/credits/ledger.rb b/lib/orb/resources/customers/credits/ledger.rb index ac631fcd..0ff7d5b6 100644 --- a/lib/orb/resources/customers/credits/ledger.rb +++ b/lib/orb/resources/customers/credits/ledger.rb @@ -65,7 +65,7 @@ class Ledger # Note that for this entry type, `starting_balance` will equal `ending_balance`, # and the `amount` represents the balance transferred. The credit block linked to # the ledger entry is the source credit block from which there was an expiration - # change + # change. # # ## Credits expiry # @@ -514,7 +514,7 @@ def create_entry_by_external_id(external_customer_id, params) # Note that for this entry type, `starting_balance` will equal `ending_balance`, # and the `amount` represents the balance transferred. The credit block linked to # the ledger entry is the source credit block from which there was an expiration - # change + # change. # # ## Credits expiry # diff --git a/lib/orb/resources/dimensional_price_groups.rb b/lib/orb/resources/dimensional_price_groups.rb index 1c4b151b..c2741d78 100644 --- a/lib/orb/resources/dimensional_price_groups.rb +++ b/lib/orb/resources/dimensional_price_groups.rb @@ -10,7 +10,7 @@ class DimensionalPriceGroups # {Orb::Models::DimensionalPriceGroupCreateParams} for more details. # # A dimensional price group is used to partition the result of a billable metric - # by a set of dimensions. Prices in a price group must specify the parition used + # by a set of dimensions. Prices in a price group must specify the partition used # to derive their usage. # # For example, suppose we have a billable metric that measures the number of diff --git a/lib/orb/resources/events/backfills.rb b/lib/orb/resources/events/backfills.rb index 3e979fb7..98afe235 100644 --- a/lib/orb/resources/events/backfills.rb +++ b/lib/orb/resources/events/backfills.rb @@ -39,8 +39,8 @@ class Backfills # # When `replace_existing_events` is `true`, this indicates that existing events in # the timeframe should no longer be counted towards invoiced usage. In this - # scenario, the parameter `filter` can be optionally added which enables filtering - # using + # scenario, the parameter `deprecation_filter` can be optionally added which + # enables filtering using # [computed properties](/extensibility/advanced-metrics#computed-properties). The # expressiveness of computed properties allows you to deprecate existing events # based on both a period of time and specific property values. diff --git a/lib/orb/resources/invoice_line_items.rb b/lib/orb/resources/invoice_line_items.rb index 0b481ecb..1ab149bd 100644 --- a/lib/orb/resources/invoice_line_items.rb +++ b/lib/orb/resources/invoice_line_items.rb @@ -9,7 +9,18 @@ class InvoiceLineItems # This creates a one-off fixed fee invoice line item on an Invoice. This can only # be done for invoices that are in a `draft` status. # - # @overload create(amount:, end_date:, invoice_id:, name:, quantity:, start_date:, request_options: {}) + # The behavior depends on which parameters are provided: + # + # - If `item_id` is provided without `name`: The item is looked up by ID, and the + # item's name is used for the line item. + # - If `name` is provided without `item_id`: An item with the given name is + # searched for in the account. If found, that item is used. If not found, a new + # item is created with that name. The new item's name is used for the line item. + # - If both `item_id` and `name` are provided: The item is looked up by ID for + # association, but the provided `name` is used for the line item (not the item's + # name). + # + # @overload create(amount:, end_date:, invoice_id:, quantity:, start_date:, item_id: nil, name: nil, request_options: {}) # # @param amount [String] The total amount in the invoice's currency to add to the line item. # @@ -17,12 +28,14 @@ class InvoiceLineItems # # @param invoice_id [String] The id of the Invoice to add this line item. # - # @param name [String] The item name associated with this line item. If an item with the same name exis - # # @param quantity [Float] The number of units on the line item # # @param start_date [Date] A date string to specify the line item's start date in the customer's timezone. # + # @param item_id [String, nil] The id of the item to associate with this line item. If provided without `name`, + # + # @param name [String, nil] The name to use for the line item. If `item_id` is not provided, Orb will search + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [Orb::Models::InvoiceLineItemCreateResponse] diff --git a/lib/orb/resources/invoices.rb b/lib/orb/resources/invoices.rb index 23664a8b..92425233 100644 --- a/lib/orb/resources/invoices.rb +++ b/lib/orb/resources/invoices.rb @@ -8,7 +8,7 @@ class Invoices # # This endpoint is used to create a one-off invoice for a customer. # - # @overload create(currency:, invoice_date:, line_items:, customer_id: nil, discount: nil, external_customer_id: nil, memo: nil, metadata: nil, net_terms: nil, will_auto_issue: nil, request_options: {}) + # @overload create(currency:, invoice_date:, line_items:, customer_id: nil, discount: nil, due_date: nil, external_customer_id: nil, memo: nil, metadata: nil, net_terms: nil, will_auto_issue: nil, request_options: {}) # # @param currency [String] An ISO 4217 currency string. Must be the same as the customer's currency if it i # @@ -20,13 +20,15 @@ class Invoices # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::UsageDiscount, Orb::Models::AmountDiscount, nil] An optional discount to attach to the invoice. # + # @param due_date [Date, Time, nil] An optional custom due date for the invoice. If not set, the due date will be ca + # # @param external_customer_id [String, nil] The `external_customer_id` of the `Customer` to create this invoice for. One of # - # @param memo [String, nil] An optional memo to attach to the invoice. + # @param memo [String, nil] An optional memo to attach to the invoice. If no memo is provided, we will attac # # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed # - # @param net_terms [Integer, nil] Determines the difference between the invoice issue date for subscription invoic + # @param net_terms [Integer, nil] The net terms determines the due date of the invoice. Due date is calculated bas # # @param will_auto_issue [Boolean] When true, this invoice will be submitted for issuance upon creation. When false # @@ -50,12 +52,16 @@ def create(params) # `metadata` can be modified regardless of invoice state. `net_terms` and # `due_date` can only be modified if the invoice is in a `draft` state. # - # @overload update(invoice_id, metadata: nil, request_options: {}) + # @overload update(invoice_id, due_date: nil, metadata: nil, net_terms: nil, request_options: {}) # # @param invoice_id [String] # + # @param due_date [Date, Time, nil] An optional custom due date for the invoice. If not set, the due date will be ca + # # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed # + # @param net_terms [Integer, nil] The net terms determines the due date of the invoice. Due date is calculated bas + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [Orb::Models::Invoice] @@ -230,8 +236,8 @@ def issue(invoice_id, params = {}) ) end - # This endpoint allows an invoice's status to be set the `paid` status. This can - # only be done to invoices that are in the `issued` status. + # This endpoint allows an invoice's status to be set to the `paid` status. This + # can only be done to invoices that are in the `issued` or `synced` status. # # @overload mark_paid(invoice_id, payment_received_date:, external_id: nil, notes: nil, request_options: {}) # @@ -279,8 +285,8 @@ def pay(invoice_id, params = {}) ) end - # This endpoint allows an invoice's status to be set the `void` status. This can - # only be done to invoices that are in the `issued` status. + # This endpoint allows an invoice's status to be set to the `void` status. This + # can only be done to invoices that are in the `issued` status. # # If the associated invoice has used the customer balance to change the amount # due, the customer balance operation will be reverted. For example, if the diff --git a/lib/orb/resources/prices.rb b/lib/orb/resources/prices.rb index f3f4b836..597b2324 100644 --- a/lib/orb/resources/prices.rb +++ b/lib/orb/resources/prices.rb @@ -20,7 +20,7 @@ class Prices # See the [Price resource](/product-catalog/price-configuration) for the # specification of different price model configurations possible in this endpoint. # - # @overload create(cadence:, currency:, item_id:, model_type:, name:, unit_config:, package_config:, matrix_config:, matrix_with_allocation_config:, tiered_config:, tiered_bps_config:, bps_config:, bulk_bps_config:, bulk_config:, threshold_total_amount_config:, tiered_package_config:, grouped_tiered_config:, max_group_tiered_package_config:, tiered_with_minimum_config:, package_with_allocation_config:, tiered_package_with_minimum_config:, unit_with_percent_config:, tiered_with_proration_config:, unit_with_proration_config:, grouped_allocation_config:, grouped_with_prorated_minimum_config:, grouped_with_metered_minimum_config:, matrix_with_display_name_config:, bulk_with_proration_config:, grouped_tiered_package_config:, scalable_matrix_with_unit_pricing_config:, scalable_matrix_with_tiered_pricing_config:, cumulative_grouped_bulk_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, request_options: {}) + # @overload create(cadence:, currency:, item_id:, model_type:, name:, unit_config:, tiered_config:, bulk_config:, package_config:, matrix_config:, threshold_total_amount_config:, tiered_package_config:, tiered_with_minimum_config:, grouped_tiered_config:, tiered_package_with_minimum_config:, package_with_allocation_config:, unit_with_percent_config:, matrix_with_allocation_config:, tiered_with_proration_config:, unit_with_proration_config:, grouped_allocation_config:, bulk_with_proration_config:, grouped_with_prorated_minimum_config:, grouped_with_metered_minimum_config:, grouped_with_min_max_thresholds_config:, matrix_with_display_name_config:, grouped_tiered_package_config:, max_group_tiered_package_config:, scalable_matrix_with_unit_pricing_config:, scalable_matrix_with_tiered_pricing_config:, cumulative_grouped_bulk_config:, minimum_config:, percent_config:, event_output_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, conversion_rate_config: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, request_options: {}) # # @param cadence [Symbol, Orb::Models::PriceCreateParams::Cadence] The cadence to bill for this price on. # @@ -28,65 +28,67 @@ class Prices # # @param item_id [String] The id of the item the price will be associated with. # - # @param model_type [Symbol, Orb::Models::PriceCreateParams::ModelType] + # @param model_type [Symbol, Orb::Models::PriceCreateParams::ModelType] The pricing model type # # @param name [String] The name of the price. # - # @param unit_config [Orb::Models::UnitConfig] + # @param unit_config [Orb::Models::UnitConfig] Configuration for unit pricing # - # @param package_config [Orb::Models::PackageConfig] + # @param tiered_config [Orb::Models::TieredConfig] Configuration for tiered pricing # - # @param matrix_config [Orb::Models::MatrixConfig] + # @param bulk_config [Orb::Models::BulkConfig] Configuration for bulk pricing # - # @param matrix_with_allocation_config [Orb::Models::MatrixWithAllocationConfig] + # @param package_config [Orb::Models::PackageConfig] Configuration for package pricing # - # @param tiered_config [Orb::Models::TieredConfig] + # @param matrix_config [Orb::Models::MatrixConfig] Configuration for matrix pricing # - # @param tiered_bps_config [Orb::Models::TieredBPSConfig] + # @param threshold_total_amount_config [Orb::Models::PriceCreateParams::ThresholdTotalAmountConfig] Configuration for threshold_total_amount pricing # - # @param bps_config [Orb::Models::BPSConfig] + # @param tiered_package_config [Orb::Models::PriceCreateParams::TieredPackageConfig] Configuration for tiered_package pricing # - # @param bulk_bps_config [Orb::Models::BulkBPSConfig] + # @param tiered_with_minimum_config [Orb::Models::PriceCreateParams::TieredWithMinimumConfig] Configuration for tiered_with_minimum pricing # - # @param bulk_config [Orb::Models::BulkConfig] + # @param grouped_tiered_config [Orb::Models::PriceCreateParams::GroupedTieredConfig] Configuration for grouped_tiered pricing # - # @param threshold_total_amount_config [Hash{Symbol=>Object}] + # @param tiered_package_with_minimum_config [Orb::Models::PriceCreateParams::TieredPackageWithMinimumConfig] Configuration for tiered_package_with_minimum pricing # - # @param tiered_package_config [Hash{Symbol=>Object}] + # @param package_with_allocation_config [Orb::Models::PriceCreateParams::PackageWithAllocationConfig] Configuration for package_with_allocation pricing # - # @param grouped_tiered_config [Hash{Symbol=>Object}] + # @param unit_with_percent_config [Orb::Models::PriceCreateParams::UnitWithPercentConfig] Configuration for unit_with_percent pricing # - # @param max_group_tiered_package_config [Hash{Symbol=>Object}] + # @param matrix_with_allocation_config [Orb::Models::MatrixWithAllocationConfig] Configuration for matrix_with_allocation pricing # - # @param tiered_with_minimum_config [Hash{Symbol=>Object}] + # @param tiered_with_proration_config [Orb::Models::PriceCreateParams::TieredWithProrationConfig] Configuration for tiered_with_proration pricing # - # @param package_with_allocation_config [Hash{Symbol=>Object}] + # @param unit_with_proration_config [Orb::Models::PriceCreateParams::UnitWithProrationConfig] Configuration for unit_with_proration pricing # - # @param tiered_package_with_minimum_config [Hash{Symbol=>Object}] + # @param grouped_allocation_config [Orb::Models::PriceCreateParams::GroupedAllocationConfig] Configuration for grouped_allocation pricing # - # @param unit_with_percent_config [Hash{Symbol=>Object}] + # @param bulk_with_proration_config [Orb::Models::PriceCreateParams::BulkWithProrationConfig] Configuration for bulk_with_proration pricing # - # @param tiered_with_proration_config [Hash{Symbol=>Object}] + # @param grouped_with_prorated_minimum_config [Orb::Models::PriceCreateParams::GroupedWithProratedMinimumConfig] Configuration for grouped_with_prorated_minimum pricing # - # @param unit_with_proration_config [Hash{Symbol=>Object}] + # @param grouped_with_metered_minimum_config [Orb::Models::PriceCreateParams::GroupedWithMeteredMinimumConfig] Configuration for grouped_with_metered_minimum pricing # - # @param grouped_allocation_config [Hash{Symbol=>Object}] + # @param grouped_with_min_max_thresholds_config [Orb::Models::PriceCreateParams::GroupedWithMinMaxThresholdsConfig] Configuration for grouped_with_min_max_thresholds pricing # - # @param grouped_with_prorated_minimum_config [Hash{Symbol=>Object}] + # @param matrix_with_display_name_config [Orb::Models::PriceCreateParams::MatrixWithDisplayNameConfig] Configuration for matrix_with_display_name pricing # - # @param grouped_with_metered_minimum_config [Hash{Symbol=>Object}] + # @param grouped_tiered_package_config [Orb::Models::PriceCreateParams::GroupedTieredPackageConfig] Configuration for grouped_tiered_package pricing # - # @param matrix_with_display_name_config [Hash{Symbol=>Object}] + # @param max_group_tiered_package_config [Orb::Models::PriceCreateParams::MaxGroupTieredPackageConfig] Configuration for max_group_tiered_package pricing # - # @param bulk_with_proration_config [Hash{Symbol=>Object}] + # @param scalable_matrix_with_unit_pricing_config [Orb::Models::PriceCreateParams::ScalableMatrixWithUnitPricingConfig] Configuration for scalable_matrix_with_unit_pricing pricing # - # @param grouped_tiered_package_config [Hash{Symbol=>Object}] + # @param scalable_matrix_with_tiered_pricing_config [Orb::Models::PriceCreateParams::ScalableMatrixWithTieredPricingConfig] Configuration for scalable_matrix_with_tiered_pricing pricing # - # @param scalable_matrix_with_unit_pricing_config [Hash{Symbol=>Object}] + # @param cumulative_grouped_bulk_config [Orb::Models::PriceCreateParams::CumulativeGroupedBulkConfig] Configuration for cumulative_grouped_bulk pricing # - # @param scalable_matrix_with_tiered_pricing_config [Hash{Symbol=>Object}] + # @param minimum_config [Orb::Models::PriceCreateParams::MinimumConfig] Configuration for minimum pricing # - # @param cumulative_grouped_bulk_config [Hash{Symbol=>Object}] + # @param percent_config [Orb::Models::PriceCreateParams::PercentConfig] Configuration for percent pricing + # + # @param event_output_config [Orb::Models::PriceCreateParams::EventOutputConfig] Configuration for event_output pricing # # @param billable_metric_id [String, nil] The id of the billable metric for the price. Only needed if the price is usage-b # @@ -112,7 +114,7 @@ class Prices # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Orb::Models::Price::Unit, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::Tiered, Orb::Models::Price::TieredBPS, Orb::Models::Price::BPS, Orb::Models::Price::BulkBPS, Orb::Models::Price::Bulk, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::GroupedWithMinMaxThresholds] + # @return [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::Minimum, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput] # # @see Orb::Models::PriceCreateParams def create(params) @@ -135,7 +137,7 @@ def create(params) # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Orb::Models::Price::Unit, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::Tiered, Orb::Models::Price::TieredBPS, Orb::Models::Price::BPS, Orb::Models::Price::BulkBPS, Orb::Models::Price::Bulk, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::GroupedWithMinMaxThresholds] + # @return [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::Minimum, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput] # # @see Orb::Models::PriceUpdateParams def update(price_id, params = {}) @@ -163,7 +165,7 @@ def update(price_id, params = {}) # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Orb::Internal::Page] + # @return [Orb::Internal::Page] # # @see Orb::Models::PriceListParams def list(params = {}) @@ -353,7 +355,7 @@ def evaluate_preview_events(params) # @param price_id [String] # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Orb::Models::Price::Unit, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::Tiered, Orb::Models::Price::TieredBPS, Orb::Models::Price::BPS, Orb::Models::Price::BulkBPS, Orb::Models::Price::Bulk, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::GroupedWithMinMaxThresholds] + # @return [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::Minimum, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput] # # @see Orb::Models::PriceFetchParams def fetch(price_id, params = {}) diff --git a/lib/orb/resources/prices/external_price_id.rb b/lib/orb/resources/prices/external_price_id.rb index 12369843..5cc36cd0 100644 --- a/lib/orb/resources/prices/external_price_id.rb +++ b/lib/orb/resources/prices/external_price_id.rb @@ -19,7 +19,7 @@ class ExternalPriceID # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Orb::Models::Price::Unit, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::Tiered, Orb::Models::Price::TieredBPS, Orb::Models::Price::BPS, Orb::Models::Price::BulkBPS, Orb::Models::Price::Bulk, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::GroupedWithMinMaxThresholds] + # @return [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::Minimum, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput] # # @see Orb::Models::Prices::ExternalPriceIDUpdateParams def update(external_price_id, params = {}) @@ -42,7 +42,7 @@ def update(external_price_id, params = {}) # @param external_price_id [String] # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Orb::Models::Price::Unit, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::Tiered, Orb::Models::Price::TieredBPS, Orb::Models::Price::BPS, Orb::Models::Price::BulkBPS, Orb::Models::Price::Bulk, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::GroupedWithMinMaxThresholds] + # @return [Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::Minimum, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput] # # @see Orb::Models::Prices::ExternalPriceIDFetchParams def fetch(external_price_id, params = {}) diff --git a/lib/orb/resources/subscription_changes.rb b/lib/orb/resources/subscription_changes.rb index 3fa6416a..45d1e756 100644 --- a/lib/orb/resources/subscription_changes.rb +++ b/lib/orb/resources/subscription_changes.rb @@ -30,17 +30,22 @@ def retrieve(subscription_change_id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {Orb::Models::SubscriptionChangeApplyParams} for more details. + # # Apply a subscription change to perform the intended action. If a positive amount # is passed with a request to this endpoint, any eligible invoices that were # created will be issued immediately if they only contain in-advance fees. # - # @overload apply(subscription_change_id, description: nil, previously_collected_amount: nil, request_options: {}) + # @overload apply(subscription_change_id, description: nil, mark_as_paid: nil, previously_collected_amount: nil, request_options: {}) # # @param subscription_change_id [String] # # @param description [String, nil] Description to apply to the balance transaction representing this credit. # - # @param previously_collected_amount [String, nil] Amount already collected to apply to the customer's balance. + # @param mark_as_paid [Boolean, nil] Mark all pending invoices that are payable as paid. If amount is also provided, + # + # @param previously_collected_amount [String, nil] Amount already collected to apply to the customer's balance. If mark_as_paid is # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/orb/resources/subscriptions.rb b/lib/orb/resources/subscriptions.rb index c2783e92..4cbe12e9 100644 --- a/lib/orb/resources/subscriptions.rb +++ b/lib/orb/resources/subscriptions.rb @@ -397,7 +397,7 @@ def update(subscription_id, params = {}) # for multiple customers, use the customer_id[] or external_customer_id[] query # parameters. # - # @overload list(created_at_gt: nil, created_at_gte: nil, created_at_lt: nil, created_at_lte: nil, cursor: nil, customer_id: nil, external_customer_id: nil, limit: nil, status: nil, request_options: {}) + # @overload list(created_at_gt: nil, created_at_gte: nil, created_at_lt: nil, created_at_lte: nil, cursor: nil, customer_id: nil, external_customer_id: nil, external_plan_id: nil, limit: nil, plan_id: nil, status: nil, request_options: {}) # # @param created_at_gt [Time, nil] # @@ -413,8 +413,12 @@ def update(subscription_id, params = {}) # # @param external_customer_id [Array, nil] # + # @param external_plan_id [String, nil] + # # @param limit [Integer] The number of items to fetch. Defaults to 20. # + # @param plan_id [String, nil] + # # @param status [Symbol, Orb::Models::SubscriptionListParams::Status, nil] # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil] @@ -1023,7 +1027,7 @@ def redeem_coupon(subscription_id, params) # This endpoint can be used to change an existing subscription's plan. It returns # the serialized updated subscription object. # - # The body parameter `change_option` determines when the plan change occurrs. Orb + # The body parameter `change_option` determines when the plan change occurs. Orb # supports three options: # # - `end_of_subscription_term`: changes the plan at the end of the existing plan's diff --git a/lib/orb/version.rb b/lib/orb/version.rb index 28305864..89c1fe80 100644 --- a/lib/orb/version.rb +++ b/lib/orb/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Orb - VERSION = "1.11.2" + VERSION = "1.12.0" end diff --git a/rbi/orb/errors.rbi b/rbi/orb/errors.rbi index 45922141..77400cdd 100644 --- a/rbi/orb/errors.rbi +++ b/rbi/orb/errors.rbi @@ -33,6 +33,9 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :status + sig { returns(T.nilable(T::Hash[String, String])) } + attr_accessor :headers + sig { returns(T.nilable(T.anything)) } attr_accessor :body @@ -41,6 +44,7 @@ module Orb params( url: URI::Generic, status: T.nilable(Integer), + headers: T.nilable(T::Hash[String, String]), body: T.nilable(Object), request: NilClass, response: NilClass, @@ -50,6 +54,7 @@ module Orb def self.new( url:, status: nil, + headers: nil, body: nil, request: nil, response: nil, @@ -70,6 +75,7 @@ module Orb params( url: URI::Generic, status: NilClass, + headers: T.nilable(T::Hash[String, String]), body: NilClass, request: NilClass, response: NilClass, @@ -79,6 +85,7 @@ module Orb def self.new( url:, status: nil, + headers: nil, body: nil, request: nil, response: nil, @@ -93,6 +100,7 @@ module Orb params( url: URI::Generic, status: NilClass, + headers: T.nilable(T::Hash[String, String]), body: NilClass, request: NilClass, response: NilClass, @@ -102,6 +110,7 @@ module Orb def self.new( url:, status: nil, + headers: nil, body: nil, request: nil, response: nil, @@ -116,13 +125,22 @@ module Orb params( url: URI::Generic, status: Integer, + headers: T.nilable(T::Hash[String, String]), body: T.nilable(Object), request: NilClass, response: NilClass, message: T.nilable(String) ).returns(T.attached_class) end - def self.for(url:, status:, body:, request:, response:, message: nil) + def self.for( + url:, + status:, + headers:, + body:, + request:, + response:, + message: nil + ) end sig { returns(Integer) } @@ -133,13 +151,22 @@ module Orb params( url: URI::Generic, status: Integer, + headers: T.nilable(T::Hash[String, String]), body: T.nilable(Object), request: NilClass, response: NilClass, message: T.nilable(String) ).returns(T.attached_class) end - def self.new(url:, status:, body:, request:, response:, message: nil) + def self.new( + url:, + status:, + headers:, + body:, + request:, + response:, + message: nil + ) end end diff --git a/rbi/orb/file_part.rbi b/rbi/orb/file_part.rbi index 9f9485dd..f3f79d99 100644 --- a/rbi/orb/file_part.rbi +++ b/rbi/orb/file_part.rbi @@ -27,7 +27,7 @@ module Orb sig do params( content: T.any(Pathname, StringIO, IO, String), - filename: T.nilable(String), + filename: T.nilable(T.any(Pathname, String)), content_type: T.nilable(String) ).returns(T.attached_class) end diff --git a/rbi/orb/internal/transport/base_client.rbi b/rbi/orb/internal/transport/base_client.rbi index 9ed4da5a..31987a5e 100644 --- a/rbi/orb/internal/transport/base_client.rbi +++ b/rbi/orb/internal/transport/base_client.rbi @@ -84,10 +84,9 @@ module Orb # @api private sig do - params( - status: Integer, - headers: T.any(T::Hash[String, String], Net::HTTPHeader) - ).returns(T::Boolean) + params(status: Integer, headers: T::Hash[String, String]).returns( + T::Boolean + ) end def should_retry?(status, headers:) end @@ -97,7 +96,7 @@ module Orb params( request: Orb::Internal::Transport::BaseClient::RequestInput, status: Integer, - response_headers: T.any(T::Hash[String, String], Net::HTTPHeader) + response_headers: T::Hash[String, String] ).returns(Orb::Internal::Transport::BaseClient::RequestInput) end def follow_redirect(request, status:, response_headers:) diff --git a/rbi/orb/internal/type/base_page.rbi b/rbi/orb/internal/type/base_page.rbi index c2901134..63413234 100644 --- a/rbi/orb/internal/type/base_page.rbi +++ b/rbi/orb/internal/type/base_page.rbi @@ -30,7 +30,7 @@ module Orb params( client: Orb::Internal::Transport::BaseClient, req: Orb::Internal::Transport::BaseClient::RequestComponents, - headers: T.any(T::Hash[String, String], Net::HTTPHeader), + headers: T::Hash[String, String], page_data: T.anything ).void end diff --git a/rbi/orb/internal/util.rbi b/rbi/orb/internal/util.rbi index 7820ed36..28a4a75b 100644 --- a/rbi/orb/internal/util.rbi +++ b/rbi/orb/internal/util.rbi @@ -355,7 +355,7 @@ module Orb # Assumes each chunk in stream has `Encoding::BINARY`. sig do params( - headers: T.any(T::Hash[String, String], Net::HTTPHeader), + headers: T::Hash[String, String], stream: T::Enumerable[String], suppress_error: T::Boolean ).returns(T.anything) diff --git a/rbi/orb/models.rbi b/rbi/orb/models.rbi index 0787925b..60e6645f 100644 --- a/rbi/orb/models.rbi +++ b/rbi/orb/models.rbi @@ -55,14 +55,6 @@ module Orb BillingCycleRelativeDate = Orb::Models::BillingCycleRelativeDate - BPSConfig = Orb::Models::BPSConfig - - BPSTier = Orb::Models::BPSTier - - BulkBPSConfig = Orb::Models::BulkBPSConfig - - BulkBPSTier = Orb::Models::BulkBPSTier - BulkConfig = Orb::Models::BulkConfig BulkTier = Orb::Models::BulkTier @@ -262,10 +254,6 @@ module Orb NewDimensionalPriceConfiguration = Orb::Models::NewDimensionalPriceConfiguration - NewFloatingBPSPrice = Orb::Models::NewFloatingBPSPrice - - NewFloatingBulkBPSPrice = Orb::Models::NewFloatingBulkBPSPrice - NewFloatingBulkPrice = Orb::Models::NewFloatingBulkPrice NewFloatingBulkWithProrationPrice = @@ -299,6 +287,9 @@ module Orb NewFloatingMaxGroupTieredPackagePrice = Orb::Models::NewFloatingMaxGroupTieredPackagePrice + NewFloatingMinimumCompositePrice = + Orb::Models::NewFloatingMinimumCompositePrice + NewFloatingPackagePrice = Orb::Models::NewFloatingPackagePrice NewFloatingPackageWithAllocationPrice = @@ -313,8 +304,6 @@ module Orb NewFloatingThresholdTotalAmountPrice = Orb::Models::NewFloatingThresholdTotalAmountPrice - NewFloatingTieredBPSPrice = Orb::Models::NewFloatingTieredBPSPrice - NewFloatingTieredPackagePrice = Orb::Models::NewFloatingTieredPackagePrice NewFloatingTieredPackageWithMinimumPrice = @@ -341,10 +330,6 @@ module Orb NewPercentageDiscount = Orb::Models::NewPercentageDiscount - NewPlanBPSPrice = Orb::Models::NewPlanBPSPrice - - NewPlanBulkBPSPrice = Orb::Models::NewPlanBulkBPSPrice - NewPlanBulkPrice = Orb::Models::NewPlanBulkPrice NewPlanBulkWithProrationPrice = Orb::Models::NewPlanBulkWithProrationPrice @@ -376,6 +361,8 @@ module Orb NewPlanMaxGroupTieredPackagePrice = Orb::Models::NewPlanMaxGroupTieredPackagePrice + NewPlanMinimumCompositePrice = Orb::Models::NewPlanMinimumCompositePrice + NewPlanPackagePrice = Orb::Models::NewPlanPackagePrice NewPlanPackageWithAllocationPrice = @@ -390,8 +377,6 @@ module Orb NewPlanThresholdTotalAmountPrice = Orb::Models::NewPlanThresholdTotalAmountPrice - NewPlanTieredBPSPrice = Orb::Models::NewPlanTieredBPSPrice - NewPlanTieredPackagePrice = Orb::Models::NewPlanTieredPackagePrice NewPlanTieredPackageWithMinimumPrice = @@ -401,8 +386,6 @@ module Orb NewPlanTieredWithMinimumPrice = Orb::Models::NewPlanTieredWithMinimumPrice - NewPlanTierWithProrationPrice = Orb::Models::NewPlanTierWithProrationPrice - NewPlanUnitPrice = Orb::Models::NewPlanUnitPrice NewPlanUnitWithPercentPrice = Orb::Models::NewPlanUnitWithPercentPrice @@ -413,10 +396,6 @@ module Orb NewSphereConfiguration = Orb::Models::NewSphereConfiguration - NewSubscriptionBPSPrice = Orb::Models::NewSubscriptionBPSPrice - - NewSubscriptionBulkBPSPrice = Orb::Models::NewSubscriptionBulkBPSPrice - NewSubscriptionBulkPrice = Orb::Models::NewSubscriptionBulkPrice NewSubscriptionBulkWithProrationPrice = @@ -451,6 +430,9 @@ module Orb NewSubscriptionMaxGroupTieredPackagePrice = Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice + NewSubscriptionMinimumCompositePrice = + Orb::Models::NewSubscriptionMinimumCompositePrice + NewSubscriptionPackagePrice = Orb::Models::NewSubscriptionPackagePrice NewSubscriptionPackageWithAllocationPrice = @@ -465,8 +447,6 @@ module Orb NewSubscriptionThresholdTotalAmountPrice = Orb::Models::NewSubscriptionThresholdTotalAmountPrice - NewSubscriptionTieredBPSPrice = Orb::Models::NewSubscriptionTieredBPSPrice - NewSubscriptionTieredPackagePrice = Orb::Models::NewSubscriptionTieredPackagePrice @@ -478,9 +458,6 @@ module Orb NewSubscriptionTieredWithMinimumPrice = Orb::Models::NewSubscriptionTieredWithMinimumPrice - NewSubscriptionTierWithProrationPrice = - Orb::Models::NewSubscriptionTierWithProrationPrice - NewSubscriptionUnitPrice = Orb::Models::NewSubscriptionUnitPrice NewSubscriptionUnitWithPercentPrice = @@ -624,10 +601,6 @@ module Orb Tier = Orb::Models::Tier - TierConfig = Orb::Models::TierConfig - - TieredBPSConfig = Orb::Models::TieredBPSConfig - TieredConfig = Orb::Models::TieredConfig TieredConversionRateConfig = Orb::Models::TieredConversionRateConfig diff --git a/rbi/orb/models/beta/external_plan_id_create_plan_version_params.rbi b/rbi/orb/models/beta/external_plan_id_create_plan_version_params.rbi index 15768c4b..25a8c3c9 100644 --- a/rbi/orb/models/beta/external_plan_id_create_plan_version_params.rbi +++ b/rbi/orb/models/beta/external_plan_id_create_plan_version_params.rbi @@ -324,39 +324,40 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - # The price to add to the plan + # New plan price request body params. sig do returns( T.nilable( T.any( Orb::NewPlanUnitPrice, - Orb::NewPlanPackagePrice, - Orb::NewPlanMatrixPrice, Orb::NewPlanTieredPrice, - Orb::NewPlanTieredBPSPrice, - Orb::NewPlanBPSPrice, - Orb::NewPlanBulkBPSPrice, Orb::NewPlanBulkPrice, + Orb::NewPlanPackagePrice, + Orb::NewPlanMatrixPrice, Orb::NewPlanThresholdTotalAmountPrice, Orb::NewPlanTieredPackagePrice, Orb::NewPlanTieredWithMinimumPrice, - Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanGroupedTieredPrice, + Orb::NewPlanTieredPackageWithMinimumPrice, Orb::NewPlanPackageWithAllocationPrice, - Orb::NewPlanTierWithProrationPrice, + Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanMatrixWithAllocationPrice, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration, Orb::NewPlanUnitWithProrationPrice, Orb::NewPlanGroupedAllocationPrice, + Orb::NewPlanBulkWithProrationPrice, Orb::NewPlanGroupedWithProratedMinimumPrice, Orb::NewPlanGroupedWithMeteredMinimumPrice, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::NewPlanMatrixWithDisplayNamePrice, - Orb::NewPlanBulkWithProrationPrice, Orb::NewPlanGroupedTieredPackagePrice, Orb::NewPlanMaxGroupTieredPackagePrice, Orb::NewPlanScalableMatrixWithUnitPricingPrice, Orb::NewPlanScalableMatrixWithTieredPricingPrice, Orb::NewPlanCumulativeGroupedBulkPrice, - Orb::NewPlanTieredPackageWithMinimumPrice, - Orb::NewPlanMatrixWithAllocationPrice, - Orb::NewPlanGroupedTieredPrice + Orb::NewPlanMinimumCompositePrice, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput ) ) ) @@ -371,33 +372,34 @@ module Orb T.nilable( T.any( Orb::NewPlanUnitPrice::OrHash, - Orb::NewPlanPackagePrice::OrHash, - Orb::NewPlanMatrixPrice::OrHash, Orb::NewPlanTieredPrice::OrHash, - Orb::NewPlanTieredBPSPrice::OrHash, - Orb::NewPlanBPSPrice::OrHash, - Orb::NewPlanBulkBPSPrice::OrHash, Orb::NewPlanBulkPrice::OrHash, + Orb::NewPlanPackagePrice::OrHash, + Orb::NewPlanMatrixPrice::OrHash, Orb::NewPlanThresholdTotalAmountPrice::OrHash, Orb::NewPlanTieredPackagePrice::OrHash, Orb::NewPlanTieredWithMinimumPrice::OrHash, - Orb::NewPlanUnitWithPercentPrice::OrHash, + Orb::NewPlanGroupedTieredPrice::OrHash, + Orb::NewPlanTieredPackageWithMinimumPrice::OrHash, Orb::NewPlanPackageWithAllocationPrice::OrHash, - Orb::NewPlanTierWithProrationPrice::OrHash, + Orb::NewPlanUnitWithPercentPrice::OrHash, + Orb::NewPlanMatrixWithAllocationPrice::OrHash, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::OrHash, Orb::NewPlanUnitWithProrationPrice::OrHash, Orb::NewPlanGroupedAllocationPrice::OrHash, + Orb::NewPlanBulkWithProrationPrice::OrHash, Orb::NewPlanGroupedWithProratedMinimumPrice::OrHash, Orb::NewPlanGroupedWithMeteredMinimumPrice::OrHash, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::OrHash, Orb::NewPlanMatrixWithDisplayNamePrice::OrHash, - Orb::NewPlanBulkWithProrationPrice::OrHash, Orb::NewPlanGroupedTieredPackagePrice::OrHash, Orb::NewPlanMaxGroupTieredPackagePrice::OrHash, Orb::NewPlanScalableMatrixWithUnitPricingPrice::OrHash, Orb::NewPlanScalableMatrixWithTieredPricingPrice::OrHash, Orb::NewPlanCumulativeGroupedBulkPrice::OrHash, - Orb::NewPlanTieredPackageWithMinimumPrice::OrHash, - Orb::NewPlanMatrixWithAllocationPrice::OrHash, - Orb::NewPlanGroupedTieredPrice::OrHash + Orb::NewPlanMinimumCompositePrice::OrHash, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::OrHash, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::OrHash ) ) ).returns(T.attached_class) @@ -407,7 +409,7 @@ module Orb allocation_price: nil, # The phase to add this price to. plan_phase_order: nil, - # The price to add to the plan + # New plan price request body params. price: nil ) end @@ -421,33 +423,34 @@ module Orb T.nilable( T.any( Orb::NewPlanUnitPrice, - Orb::NewPlanPackagePrice, - Orb::NewPlanMatrixPrice, Orb::NewPlanTieredPrice, - Orb::NewPlanTieredBPSPrice, - Orb::NewPlanBPSPrice, - Orb::NewPlanBulkBPSPrice, Orb::NewPlanBulkPrice, + Orb::NewPlanPackagePrice, + Orb::NewPlanMatrixPrice, Orb::NewPlanThresholdTotalAmountPrice, Orb::NewPlanTieredPackagePrice, Orb::NewPlanTieredWithMinimumPrice, - Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanGroupedTieredPrice, + Orb::NewPlanTieredPackageWithMinimumPrice, Orb::NewPlanPackageWithAllocationPrice, - Orb::NewPlanTierWithProrationPrice, + Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanMatrixWithAllocationPrice, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration, Orb::NewPlanUnitWithProrationPrice, Orb::NewPlanGroupedAllocationPrice, + Orb::NewPlanBulkWithProrationPrice, Orb::NewPlanGroupedWithProratedMinimumPrice, Orb::NewPlanGroupedWithMeteredMinimumPrice, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::NewPlanMatrixWithDisplayNamePrice, - Orb::NewPlanBulkWithProrationPrice, Orb::NewPlanGroupedTieredPackagePrice, Orb::NewPlanMaxGroupTieredPackagePrice, Orb::NewPlanScalableMatrixWithUnitPricingPrice, Orb::NewPlanScalableMatrixWithTieredPricingPrice, Orb::NewPlanCumulativeGroupedBulkPrice, - Orb::NewPlanTieredPackageWithMinimumPrice, - Orb::NewPlanMatrixWithAllocationPrice, - Orb::NewPlanGroupedTieredPrice + Orb::NewPlanMinimumCompositePrice, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput ) ) } @@ -456,7 +459,7 @@ module Orb def to_hash end - # The price to add to the plan + # New plan price request body params. module Price extend Orb::Internal::Type::Union @@ -464,430 +467,3395 @@ module Orb T.type_alias do T.any( Orb::NewPlanUnitPrice, - Orb::NewPlanPackagePrice, - Orb::NewPlanMatrixPrice, Orb::NewPlanTieredPrice, - Orb::NewPlanTieredBPSPrice, - Orb::NewPlanBPSPrice, - Orb::NewPlanBulkBPSPrice, Orb::NewPlanBulkPrice, + Orb::NewPlanPackagePrice, + Orb::NewPlanMatrixPrice, Orb::NewPlanThresholdTotalAmountPrice, Orb::NewPlanTieredPackagePrice, Orb::NewPlanTieredWithMinimumPrice, - Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanGroupedTieredPrice, + Orb::NewPlanTieredPackageWithMinimumPrice, Orb::NewPlanPackageWithAllocationPrice, - Orb::NewPlanTierWithProrationPrice, + Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanMatrixWithAllocationPrice, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration, Orb::NewPlanUnitWithProrationPrice, Orb::NewPlanGroupedAllocationPrice, + Orb::NewPlanBulkWithProrationPrice, Orb::NewPlanGroupedWithProratedMinimumPrice, Orb::NewPlanGroupedWithMeteredMinimumPrice, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::NewPlanMatrixWithDisplayNamePrice, - Orb::NewPlanBulkWithProrationPrice, Orb::NewPlanGroupedTieredPackagePrice, Orb::NewPlanMaxGroupTieredPackagePrice, Orb::NewPlanScalableMatrixWithUnitPricingPrice, Orb::NewPlanScalableMatrixWithTieredPricingPrice, Orb::NewPlanCumulativeGroupedBulkPrice, - Orb::NewPlanTieredPackageWithMinimumPrice, - Orb::NewPlanMatrixWithAllocationPrice, - Orb::NewPlanGroupedTieredPrice + Orb::NewPlanMinimumCompositePrice, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput ) end - sig do - override.returns( - T::Array[ - Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Variants - ] - ) - end - def self.variants - end - end - end + class TieredWithProration < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration, + Orb::Internal::AnyHash + ) + end - class RemoveAdjustment < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Orb::Beta::ExternalPlanIDCreatePlanVersionParams::RemoveAdjustment, - Orb::Internal::AnyHash - ) - end + # The cadence to bill for this price on. + sig do + returns( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence::OrSymbol + ) + end + attr_accessor :cadence - # The id of the adjustment to remove from on the plan. - sig { returns(String) } - attr_accessor :adjustment_id + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id - # The phase to remove this adjustment from. - sig { returns(T.nilable(Integer)) } - attr_accessor :plan_phase_order + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type - sig do - params( - adjustment_id: String, - plan_phase_order: T.nilable(Integer) - ).returns(T.attached_class) - end - def self.new( - # The id of the adjustment to remove from on the plan. - adjustment_id:, - # The phase to remove this adjustment from. - plan_phase_order: nil - ) - end + # The name of the price. + sig { returns(String) } + attr_accessor :name - sig do - override.returns( - { adjustment_id: String, plan_phase_order: T.nilable(Integer) } - ) - end - def to_hash - end - end + # Configuration for tiered_with_proration pricing + sig do + returns( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig + ) + end + attr_reader :tiered_with_proration_config - class RemovePrice < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Orb::Beta::ExternalPlanIDCreatePlanVersionParams::RemovePrice, - Orb::Internal::AnyHash - ) - end + sig do + params( + tiered_with_proration_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::OrHash + ).void + end + attr_writer :tiered_with_proration_config - # The id of the price to remove from the plan. - sig { returns(String) } - attr_accessor :price_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id - # The phase to remove this price from. - sig { returns(T.nilable(Integer)) } - attr_accessor :plan_phase_order + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance - sig do - params( - price_id: String, - plan_phase_order: T.nilable(Integer) - ).returns(T.attached_class) - end - def self.new( - # The id of the price to remove from the plan. - price_id:, - # The phase to remove this price from. - plan_phase_order: nil - ) - end + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration - sig do - override.returns( - { price_id: String, plan_phase_order: T.nilable(Integer) } - ) - end - def to_hash - end - end + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration - class ReplaceAdjustment < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplaceAdjustment, - Orb::Internal::AnyHash - ) - end + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate - # The definition of a new adjustment to create and add to the plan. - sig do - returns( - T.any( - Orb::NewPercentageDiscount, - Orb::NewUsageDiscount, - Orb::NewAmountDiscount, - Orb::NewMinimum, - Orb::NewMaximum - ) - ) - end - attr_accessor :adjustment + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config - # The id of the adjustment on the plan to replace in the plan. - sig { returns(String) } - attr_accessor :replaces_adjustment_id + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency - # The phase to replace this adjustment from. - sig { returns(T.nilable(Integer)) } - attr_accessor :plan_phase_order + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration - sig do - params( - adjustment: - T.any( - Orb::NewPercentageDiscount::OrHash, - Orb::NewUsageDiscount::OrHash, - Orb::NewAmountDiscount::OrHash, - Orb::NewMinimum::OrHash, - Orb::NewMaximum::OrHash - ), - replaces_adjustment_id: String, - plan_phase_order: T.nilable(Integer) - ).returns(T.attached_class) - end - def self.new( - # The definition of a new adjustment to create and add to the plan. - adjustment:, - # The id of the adjustment on the plan to replace in the plan. - replaces_adjustment_id:, - # The phase to replace this adjustment from. - plan_phase_order: nil - ) - end + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration - sig do - override.returns( - { - adjustment: - T.any( - Orb::NewPercentageDiscount, - Orb::NewUsageDiscount, - Orb::NewAmountDiscount, - Orb::NewMinimum, - Orb::NewMaximum - ), - replaces_adjustment_id: String, - plan_phase_order: T.nilable(Integer) - } - ) - end - def to_hash - end + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id - # The definition of a new adjustment to create and add to the plan. - module Adjustment - extend Orb::Internal::Type::Union + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity - Variants = - T.type_alias do - T.any( - Orb::NewPercentageDiscount, - Orb::NewUsageDiscount, - Orb::NewAmountDiscount, - Orb::NewMinimum, - Orb::NewMaximum - ) + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void end + attr_writer :invoicing_cycle_configuration - sig do - override.returns( - T::Array[ - Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplaceAdjustment::Adjustment::Variants - ] - ) - end - def self.variants - end - end - end + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata - class ReplacePrice < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice, - Orb::Internal::AnyHash + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence::OrSymbol, + item_id: String, + name: String, + tiered_with_proration_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for tiered_with_proration pricing + tiered_with_proration_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :tiered_with_proration ) - end + end - # The id of the price on the plan to replace in the plan. - sig { returns(String) } - attr_accessor :replaces_price_id + sig do + override.returns( + { + cadence: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence::OrSymbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_proration_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end - # The allocation price to add to the plan. - sig { returns(T.nilable(Orb::NewAllocationPrice)) } - attr_reader :allocation_price + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig, + Orb::Internal::AnyHash + ) + end + + # Tiers for rating based on total usage quantities into the specified tier with + # proration + sig do + returns( + T::Array[ + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for tiered_with_proration pricing + sig do + params( + tiers: + T::Array[ + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Tiers for rating based on total usage quantities into the specified tier with + # proration + tiers: + ) + end + + sig do + override.returns( + { + tiers: + T::Array[ + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Inclusive tier starting value + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Amount per unit + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tiered with proration tier + sig do + params( + tier_lower_bound: String, + unit_amount: String + ).returns(T.attached_class) + end + def self.new( + # Inclusive tier starting value + tier_lower_bound:, + # Amount per unit + unit_amount: + ) + end + + sig do + override.returns( + { tier_lower_bound: String, unit_amount: String } + ) + end + def to_hash + end + end + end + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + returns( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + ) + end + attr_reader :grouped_with_min_max_thresholds_config + + sig do + params( + grouped_with_min_max_thresholds_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash + ).void + end + attr_writer :grouped_with_min_max_thresholds_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + grouped_with_min_max_thresholds_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # Configuration for grouped_with_min_max_thresholds pricing + grouped_with_min_max_thresholds_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :grouped_with_min_max_thresholds + ) + end + + sig do + override.returns( + { + cadence: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + grouped_with_min_max_thresholds_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before applying thresholds + sig { returns(String) } + attr_accessor :grouping_key + + # The maximum amount to charge each group + sig { returns(String) } + attr_accessor :maximum_charge + + # The minimum amount to charge each group, regardless of usage + sig { returns(String) } + attr_accessor :minimum_charge + + # The base price charged per group + sig { returns(String) } + attr_accessor :per_unit_rate + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + params( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before applying thresholds + grouping_key:, + # The maximum amount to charge each group + maximum_charge:, + # The minimum amount to charge each group, regardless of usage + minimum_charge:, + # The base price charged per group + per_unit_rate: + ) + end + + sig do + override.returns( + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + ) + end + def to_hash + end + end + end + + class Percent < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # Configuration for percent pricing + sig do + returns( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig + ) + end + attr_reader :percent_config + + sig do + params( + percent_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig::OrHash + ).void + end + attr_writer :percent_config + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::Cadence::OrSymbol, + item_id: String, + name: String, + percent_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for percent pricing + percent_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :percent + ) + end + + sig do + override.returns( + { + cadence: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::Cadence::OrSymbol, + item_id: String, + model_type: Symbol, + name: String, + percent_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class PercentConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig, + Orb::Internal::AnyHash + ) + end + + # What percent of the component subtotals to charge + sig { returns(Float) } + attr_accessor :percent + + # Configuration for percent pricing + sig { params(percent: Float).returns(T.attached_class) } + def self.new( + # What percent of the component subtotals to charge + percent: + ) + end + + sig { override.returns({ percent: Float }) } + def to_hash + end + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # Configuration for event_output pricing + sig do + returns( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig + ) + end + attr_reader :event_output_config + + sig do + params( + event_output_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig::OrHash + ).void + end + attr_writer :event_output_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence::OrSymbol, + event_output_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # Configuration for event_output pricing + event_output_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :event_output + ) + end + + sig do + override.returns( + { + cadence: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence::OrSymbol, + event_output_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class EventOutputConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig, + Orb::Internal::AnyHash + ) + end + + # The key in the event data to extract the unit rate from. + sig { returns(String) } + attr_accessor :unit_rating_key + + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + sig { returns(T.nilable(String)) } + attr_accessor :grouping_key + + # Configuration for event_output pricing + sig do + params( + unit_rating_key: String, + grouping_key: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The key in the event data to extract the unit rate from. + unit_rating_key:, + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + grouping_key: nil + ) + end + + sig do + override.returns( + { unit_rating_key: String, grouping_key: T.nilable(String) } + ) + end + def to_hash + end + end + end + + sig do + override.returns( + T::Array[ + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Variants + ] + ) + end + def self.variants + end + end + end + + class RemoveAdjustment < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::RemoveAdjustment, + Orb::Internal::AnyHash + ) + end + + # The id of the adjustment to remove from on the plan. + sig { returns(String) } + attr_accessor :adjustment_id + + # The phase to remove this adjustment from. + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig do + params( + adjustment_id: String, + plan_phase_order: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + # The id of the adjustment to remove from on the plan. + adjustment_id:, + # The phase to remove this adjustment from. + plan_phase_order: nil + ) + end + + sig do + override.returns( + { adjustment_id: String, plan_phase_order: T.nilable(Integer) } + ) + end + def to_hash + end + end + + class RemovePrice < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::RemovePrice, + Orb::Internal::AnyHash + ) + end + + # The id of the price to remove from the plan. + sig { returns(String) } + attr_accessor :price_id + + # The phase to remove this price from. + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig do + params( + price_id: String, + plan_phase_order: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + # The id of the price to remove from the plan. + price_id:, + # The phase to remove this price from. + plan_phase_order: nil + ) + end + + sig do + override.returns( + { price_id: String, plan_phase_order: T.nilable(Integer) } + ) + end + def to_hash + end + end + + class ReplaceAdjustment < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplaceAdjustment, + Orb::Internal::AnyHash + ) + end + + # The definition of a new adjustment to create and add to the plan. + sig do + returns( + T.any( + Orb::NewPercentageDiscount, + Orb::NewUsageDiscount, + Orb::NewAmountDiscount, + Orb::NewMinimum, + Orb::NewMaximum + ) + ) + end + attr_accessor :adjustment + + # The id of the adjustment on the plan to replace in the plan. + sig { returns(String) } + attr_accessor :replaces_adjustment_id + + # The phase to replace this adjustment from. + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig do + params( + adjustment: + T.any( + Orb::NewPercentageDiscount::OrHash, + Orb::NewUsageDiscount::OrHash, + Orb::NewAmountDiscount::OrHash, + Orb::NewMinimum::OrHash, + Orb::NewMaximum::OrHash + ), + replaces_adjustment_id: String, + plan_phase_order: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + # The definition of a new adjustment to create and add to the plan. + adjustment:, + # The id of the adjustment on the plan to replace in the plan. + replaces_adjustment_id:, + # The phase to replace this adjustment from. + plan_phase_order: nil + ) + end + + sig do + override.returns( + { + adjustment: + T.any( + Orb::NewPercentageDiscount, + Orb::NewUsageDiscount, + Orb::NewAmountDiscount, + Orb::NewMinimum, + Orb::NewMaximum + ), + replaces_adjustment_id: String, + plan_phase_order: T.nilable(Integer) + } + ) + end + def to_hash + end + + # The definition of a new adjustment to create and add to the plan. + module Adjustment + extend Orb::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Orb::NewPercentageDiscount, + Orb::NewUsageDiscount, + Orb::NewAmountDiscount, + Orb::NewMinimum, + Orb::NewMaximum + ) + end + + sig do + override.returns( + T::Array[ + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplaceAdjustment::Adjustment::Variants + ] + ) + end + def self.variants + end + end + end + + class ReplacePrice < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice, + Orb::Internal::AnyHash + ) + end + + # The id of the price on the plan to replace in the plan. + sig { returns(String) } + attr_accessor :replaces_price_id + + # The allocation price to add to the plan. + sig { returns(T.nilable(Orb::NewAllocationPrice)) } + attr_reader :allocation_price + + sig do + params( + allocation_price: T.nilable(Orb::NewAllocationPrice::OrHash) + ).void + end + attr_writer :allocation_price + + # The phase to replace this price from. + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + # New plan price request body params. + sig do + returns( + T.nilable( + T.any( + Orb::NewPlanUnitPrice, + Orb::NewPlanTieredPrice, + Orb::NewPlanBulkPrice, + Orb::NewPlanPackagePrice, + Orb::NewPlanMatrixPrice, + Orb::NewPlanThresholdTotalAmountPrice, + Orb::NewPlanTieredPackagePrice, + Orb::NewPlanTieredWithMinimumPrice, + Orb::NewPlanGroupedTieredPrice, + Orb::NewPlanTieredPackageWithMinimumPrice, + Orb::NewPlanPackageWithAllocationPrice, + Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanMatrixWithAllocationPrice, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration, + Orb::NewPlanUnitWithProrationPrice, + Orb::NewPlanGroupedAllocationPrice, + Orb::NewPlanBulkWithProrationPrice, + Orb::NewPlanGroupedWithProratedMinimumPrice, + Orb::NewPlanGroupedWithMeteredMinimumPrice, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, + Orb::NewPlanMatrixWithDisplayNamePrice, + Orb::NewPlanGroupedTieredPackagePrice, + Orb::NewPlanMaxGroupTieredPackagePrice, + Orb::NewPlanScalableMatrixWithUnitPricingPrice, + Orb::NewPlanScalableMatrixWithTieredPricingPrice, + Orb::NewPlanCumulativeGroupedBulkPrice, + Orb::NewPlanMinimumCompositePrice, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput + ) + ) + ) + end + attr_accessor :price + + sig do + params( + replaces_price_id: String, + allocation_price: T.nilable(Orb::NewAllocationPrice::OrHash), + plan_phase_order: T.nilable(Integer), + price: + T.nilable( + T.any( + Orb::NewPlanUnitPrice::OrHash, + Orb::NewPlanTieredPrice::OrHash, + Orb::NewPlanBulkPrice::OrHash, + Orb::NewPlanPackagePrice::OrHash, + Orb::NewPlanMatrixPrice::OrHash, + Orb::NewPlanThresholdTotalAmountPrice::OrHash, + Orb::NewPlanTieredPackagePrice::OrHash, + Orb::NewPlanTieredWithMinimumPrice::OrHash, + Orb::NewPlanGroupedTieredPrice::OrHash, + Orb::NewPlanTieredPackageWithMinimumPrice::OrHash, + Orb::NewPlanPackageWithAllocationPrice::OrHash, + Orb::NewPlanUnitWithPercentPrice::OrHash, + Orb::NewPlanMatrixWithAllocationPrice::OrHash, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::OrHash, + Orb::NewPlanUnitWithProrationPrice::OrHash, + Orb::NewPlanGroupedAllocationPrice::OrHash, + Orb::NewPlanBulkWithProrationPrice::OrHash, + Orb::NewPlanGroupedWithProratedMinimumPrice::OrHash, + Orb::NewPlanGroupedWithMeteredMinimumPrice::OrHash, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::OrHash, + Orb::NewPlanMatrixWithDisplayNamePrice::OrHash, + Orb::NewPlanGroupedTieredPackagePrice::OrHash, + Orb::NewPlanMaxGroupTieredPackagePrice::OrHash, + Orb::NewPlanScalableMatrixWithUnitPricingPrice::OrHash, + Orb::NewPlanScalableMatrixWithTieredPricingPrice::OrHash, + Orb::NewPlanCumulativeGroupedBulkPrice::OrHash, + Orb::NewPlanMinimumCompositePrice::OrHash, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::OrHash, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::OrHash + ) + ) + ).returns(T.attached_class) + end + def self.new( + # The id of the price on the plan to replace in the plan. + replaces_price_id:, + # The allocation price to add to the plan. + allocation_price: nil, + # The phase to replace this price from. + plan_phase_order: nil, + # New plan price request body params. + price: nil + ) + end sig do - params( - allocation_price: T.nilable(Orb::NewAllocationPrice::OrHash) - ).void + override.returns( + { + replaces_price_id: String, + allocation_price: T.nilable(Orb::NewAllocationPrice), + plan_phase_order: T.nilable(Integer), + price: + T.nilable( + T.any( + Orb::NewPlanUnitPrice, + Orb::NewPlanTieredPrice, + Orb::NewPlanBulkPrice, + Orb::NewPlanPackagePrice, + Orb::NewPlanMatrixPrice, + Orb::NewPlanThresholdTotalAmountPrice, + Orb::NewPlanTieredPackagePrice, + Orb::NewPlanTieredWithMinimumPrice, + Orb::NewPlanGroupedTieredPrice, + Orb::NewPlanTieredPackageWithMinimumPrice, + Orb::NewPlanPackageWithAllocationPrice, + Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanMatrixWithAllocationPrice, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration, + Orb::NewPlanUnitWithProrationPrice, + Orb::NewPlanGroupedAllocationPrice, + Orb::NewPlanBulkWithProrationPrice, + Orb::NewPlanGroupedWithProratedMinimumPrice, + Orb::NewPlanGroupedWithMeteredMinimumPrice, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, + Orb::NewPlanMatrixWithDisplayNamePrice, + Orb::NewPlanGroupedTieredPackagePrice, + Orb::NewPlanMaxGroupTieredPackagePrice, + Orb::NewPlanScalableMatrixWithUnitPricingPrice, + Orb::NewPlanScalableMatrixWithTieredPricingPrice, + Orb::NewPlanCumulativeGroupedBulkPrice, + Orb::NewPlanMinimumCompositePrice, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput + ) + ) + } + ) end - attr_writer :allocation_price + def to_hash + end + + # New plan price request body params. + module Price + extend Orb::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Orb::NewPlanUnitPrice, + Orb::NewPlanTieredPrice, + Orb::NewPlanBulkPrice, + Orb::NewPlanPackagePrice, + Orb::NewPlanMatrixPrice, + Orb::NewPlanThresholdTotalAmountPrice, + Orb::NewPlanTieredPackagePrice, + Orb::NewPlanTieredWithMinimumPrice, + Orb::NewPlanGroupedTieredPrice, + Orb::NewPlanTieredPackageWithMinimumPrice, + Orb::NewPlanPackageWithAllocationPrice, + Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanMatrixWithAllocationPrice, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration, + Orb::NewPlanUnitWithProrationPrice, + Orb::NewPlanGroupedAllocationPrice, + Orb::NewPlanBulkWithProrationPrice, + Orb::NewPlanGroupedWithProratedMinimumPrice, + Orb::NewPlanGroupedWithMeteredMinimumPrice, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, + Orb::NewPlanMatrixWithDisplayNamePrice, + Orb::NewPlanGroupedTieredPackagePrice, + Orb::NewPlanMaxGroupTieredPackagePrice, + Orb::NewPlanScalableMatrixWithUnitPricingPrice, + Orb::NewPlanScalableMatrixWithTieredPricingPrice, + Orb::NewPlanCumulativeGroupedBulkPrice, + Orb::NewPlanMinimumCompositePrice, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput + ) + end + + class TieredWithProration < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # Configuration for tiered_with_proration pricing + sig do + returns( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig + ) + end + attr_reader :tiered_with_proration_config + + sig do + params( + tiered_with_proration_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::OrHash + ).void + end + attr_writer :tiered_with_proration_config + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence::OrSymbol, + item_id: String, + name: String, + tiered_with_proration_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for tiered_with_proration pricing + tiered_with_proration_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :tiered_with_proration + ) + end + + sig do + override.returns( + { + cadence: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence::OrSymbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_proration_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig, + Orb::Internal::AnyHash + ) + end + + # Tiers for rating based on total usage quantities into the specified tier with + # proration + sig do + returns( + T::Array[ + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for tiered_with_proration pricing + sig do + params( + tiers: + T::Array[ + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Tiers for rating based on total usage quantities into the specified tier with + # proration + tiers: + ) + end + + sig do + override.returns( + { + tiers: + T::Array[ + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Inclusive tier starting value + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Amount per unit + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tiered with proration tier + sig do + params( + tier_lower_bound: String, + unit_amount: String + ).returns(T.attached_class) + end + def self.new( + # Inclusive tier starting value + tier_lower_bound:, + # Amount per unit + unit_amount: + ) + end + + sig do + override.returns( + { tier_lower_bound: String, unit_amount: String } + ) + end + def to_hash + end + end + end + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + returns( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + ) + end + attr_reader :grouped_with_min_max_thresholds_config + + sig do + params( + grouped_with_min_max_thresholds_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash + ).void + end + attr_writer :grouped_with_min_max_thresholds_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + grouped_with_min_max_thresholds_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # Configuration for grouped_with_min_max_thresholds pricing + grouped_with_min_max_thresholds_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :grouped_with_min_max_thresholds + ) + end + + sig do + override.returns( + { + cadence: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + grouped_with_min_max_thresholds_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before applying thresholds + sig { returns(String) } + attr_accessor :grouping_key + + # The maximum amount to charge each group + sig { returns(String) } + attr_accessor :maximum_charge + + # The minimum amount to charge each group, regardless of usage + sig { returns(String) } + attr_accessor :minimum_charge + + # The base price charged per group + sig { returns(String) } + attr_accessor :per_unit_rate + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + params( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before applying thresholds + grouping_key:, + # The maximum amount to charge each group + maximum_charge:, + # The minimum amount to charge each group, regardless of usage + minimum_charge:, + # The base price charged per group + per_unit_rate: + ) + end + + sig do + override.returns( + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + ) + end + def to_hash + end + end + end + + class Percent < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence::OrSymbol + ) + end + attr_accessor :cadence - # The phase to replace this price from. - sig { returns(T.nilable(Integer)) } - attr_accessor :plan_phase_order + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id - # The price to add to the plan - sig do - returns( - T.nilable( - T.any( - Orb::NewPlanUnitPrice, - Orb::NewPlanPackagePrice, - Orb::NewPlanMatrixPrice, - Orb::NewPlanTieredPrice, - Orb::NewPlanTieredBPSPrice, - Orb::NewPlanBPSPrice, - Orb::NewPlanBulkBPSPrice, - Orb::NewPlanBulkPrice, - Orb::NewPlanThresholdTotalAmountPrice, - Orb::NewPlanTieredPackagePrice, - Orb::NewPlanTieredWithMinimumPrice, - Orb::NewPlanUnitWithPercentPrice, - Orb::NewPlanPackageWithAllocationPrice, - Orb::NewPlanTierWithProrationPrice, - Orb::NewPlanUnitWithProrationPrice, - Orb::NewPlanGroupedAllocationPrice, - Orb::NewPlanGroupedWithProratedMinimumPrice, - Orb::NewPlanGroupedWithMeteredMinimumPrice, - Orb::NewPlanMatrixWithDisplayNamePrice, - Orb::NewPlanBulkWithProrationPrice, - Orb::NewPlanGroupedTieredPackagePrice, - Orb::NewPlanMaxGroupTieredPackagePrice, - Orb::NewPlanScalableMatrixWithUnitPricingPrice, - Orb::NewPlanScalableMatrixWithTieredPricingPrice, - Orb::NewPlanCumulativeGroupedBulkPrice, - Orb::NewPlanTieredPackageWithMinimumPrice, - Orb::NewPlanMatrixWithAllocationPrice, - Orb::NewPlanGroupedTieredPrice + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # Configuration for percent pricing + sig do + returns( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig + ) + end + attr_reader :percent_config + + sig do + params( + percent_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig::OrHash + ).void + end + attr_writer :percent_config + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence::OrSymbol, + item_id: String, + name: String, + percent_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for percent pricing + percent_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :percent ) - ) - end - attr_accessor :price + end - sig do - params( - replaces_price_id: String, - allocation_price: T.nilable(Orb::NewAllocationPrice::OrHash), - plan_phase_order: T.nilable(Integer), - price: - T.nilable( + sig do + override.returns( + { + cadence: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence::OrSymbol, + item_id: String, + model_type: Symbol, + name: String, + percent_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class PercentConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig, + Orb::Internal::AnyHash + ) + end + + # What percent of the component subtotals to charge + sig { returns(Float) } + attr_accessor :percent + + # Configuration for percent pricing + sig { params(percent: Float).returns(T.attached_class) } + def self.new( + # What percent of the component subtotals to charge + percent: + ) + end + + sig { override.returns({ percent: Float }) } + def to_hash + end + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do T.any( - Orb::NewPlanUnitPrice::OrHash, - Orb::NewPlanPackagePrice::OrHash, - Orb::NewPlanMatrixPrice::OrHash, - Orb::NewPlanTieredPrice::OrHash, - Orb::NewPlanTieredBPSPrice::OrHash, - Orb::NewPlanBPSPrice::OrHash, - Orb::NewPlanBulkBPSPrice::OrHash, - Orb::NewPlanBulkPrice::OrHash, - Orb::NewPlanThresholdTotalAmountPrice::OrHash, - Orb::NewPlanTieredPackagePrice::OrHash, - Orb::NewPlanTieredWithMinimumPrice::OrHash, - Orb::NewPlanUnitWithPercentPrice::OrHash, - Orb::NewPlanPackageWithAllocationPrice::OrHash, - Orb::NewPlanTierWithProrationPrice::OrHash, - Orb::NewPlanUnitWithProrationPrice::OrHash, - Orb::NewPlanGroupedAllocationPrice::OrHash, - Orb::NewPlanGroupedWithProratedMinimumPrice::OrHash, - Orb::NewPlanGroupedWithMeteredMinimumPrice::OrHash, - Orb::NewPlanMatrixWithDisplayNamePrice::OrHash, - Orb::NewPlanBulkWithProrationPrice::OrHash, - Orb::NewPlanGroupedTieredPackagePrice::OrHash, - Orb::NewPlanMaxGroupTieredPackagePrice::OrHash, - Orb::NewPlanScalableMatrixWithUnitPricingPrice::OrHash, - Orb::NewPlanScalableMatrixWithTieredPricingPrice::OrHash, - Orb::NewPlanCumulativeGroupedBulkPrice::OrHash, - Orb::NewPlanTieredPackageWithMinimumPrice::OrHash, - Orb::NewPlanMatrixWithAllocationPrice::OrHash, - Orb::NewPlanGroupedTieredPrice::OrHash + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput, + Orb::Internal::AnyHash ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence::OrSymbol ) - ).returns(T.attached_class) - end - def self.new( - # The id of the price on the plan to replace in the plan. - replaces_price_id:, - # The allocation price to add to the plan. - allocation_price: nil, - # The phase to replace this price from. - plan_phase_order: nil, - # The price to add to the plan - price: nil - ) - end + end + attr_accessor :cadence - sig do - override.returns( - { - replaces_price_id: String, - allocation_price: T.nilable(Orb::NewAllocationPrice), - plan_phase_order: T.nilable(Integer), - price: + # Configuration for event_output pricing + sig do + returns( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig + ) + end + attr_reader :event_output_config + + sig do + params( + event_output_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig::OrHash + ).void + end + attr_writer :event_output_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( T.nilable( T.any( - Orb::NewPlanUnitPrice, - Orb::NewPlanPackagePrice, - Orb::NewPlanMatrixPrice, - Orb::NewPlanTieredPrice, - Orb::NewPlanTieredBPSPrice, - Orb::NewPlanBPSPrice, - Orb::NewPlanBulkBPSPrice, - Orb::NewPlanBulkPrice, - Orb::NewPlanThresholdTotalAmountPrice, - Orb::NewPlanTieredPackagePrice, - Orb::NewPlanTieredWithMinimumPrice, - Orb::NewPlanUnitWithPercentPrice, - Orb::NewPlanPackageWithAllocationPrice, - Orb::NewPlanTierWithProrationPrice, - Orb::NewPlanUnitWithProrationPrice, - Orb::NewPlanGroupedAllocationPrice, - Orb::NewPlanGroupedWithProratedMinimumPrice, - Orb::NewPlanGroupedWithMeteredMinimumPrice, - Orb::NewPlanMatrixWithDisplayNamePrice, - Orb::NewPlanBulkWithProrationPrice, - Orb::NewPlanGroupedTieredPackagePrice, - Orb::NewPlanMaxGroupTieredPackagePrice, - Orb::NewPlanScalableMatrixWithUnitPricingPrice, - Orb::NewPlanScalableMatrixWithTieredPricingPrice, - Orb::NewPlanCumulativeGroupedBulkPrice, - Orb::NewPlanTieredPackageWithMinimumPrice, - Orb::NewPlanMatrixWithAllocationPrice, - Orb::NewPlanGroupedTieredPrice + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig ) ) - } - ) - end - def to_hash - end + ) + end + attr_accessor :conversion_rate_config - # The price to add to the plan - module Price - extend Orb::Internal::Type::Union + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency - Variants = - T.type_alias do - T.any( - Orb::NewPlanUnitPrice, - Orb::NewPlanPackagePrice, - Orb::NewPlanMatrixPrice, - Orb::NewPlanTieredPrice, - Orb::NewPlanTieredBPSPrice, - Orb::NewPlanBPSPrice, - Orb::NewPlanBulkBPSPrice, - Orb::NewPlanBulkPrice, - Orb::NewPlanThresholdTotalAmountPrice, - Orb::NewPlanTieredPackagePrice, - Orb::NewPlanTieredWithMinimumPrice, - Orb::NewPlanUnitWithPercentPrice, - Orb::NewPlanPackageWithAllocationPrice, - Orb::NewPlanTierWithProrationPrice, - Orb::NewPlanUnitWithProrationPrice, - Orb::NewPlanGroupedAllocationPrice, - Orb::NewPlanGroupedWithProratedMinimumPrice, - Orb::NewPlanGroupedWithMeteredMinimumPrice, - Orb::NewPlanMatrixWithDisplayNamePrice, - Orb::NewPlanBulkWithProrationPrice, - Orb::NewPlanGroupedTieredPackagePrice, - Orb::NewPlanMaxGroupTieredPackagePrice, - Orb::NewPlanScalableMatrixWithUnitPricingPrice, - Orb::NewPlanScalableMatrixWithTieredPricingPrice, - Orb::NewPlanCumulativeGroupedBulkPrice, - Orb::NewPlanTieredPackageWithMinimumPrice, - Orb::NewPlanMatrixWithAllocationPrice, - Orb::NewPlanGroupedTieredPrice + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence::OrSymbol, + event_output_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # Configuration for event_output pricing + event_output_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :event_output + ) + end + + sig do + override.returns( + { + cadence: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence::OrSymbol, + event_output_config: + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class EventOutputConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig, + Orb::Internal::AnyHash + ) + end + + # The key in the event data to extract the unit rate from. + sig { returns(String) } + attr_accessor :unit_rating_key + + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + sig { returns(T.nilable(String)) } + attr_accessor :grouping_key + + # Configuration for event_output pricing + sig do + params( + unit_rating_key: String, + grouping_key: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The key in the event data to extract the unit rate from. + unit_rating_key:, + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + grouping_key: nil ) + end + + sig do + override.returns( + { unit_rating_key: String, grouping_key: T.nilable(String) } + ) + end + def to_hash + end end + end sig do override.returns( diff --git a/rbi/orb/models/beta_create_plan_version_params.rbi b/rbi/orb/models/beta_create_plan_version_params.rbi index 884982ef..42435c35 100644 --- a/rbi/orb/models/beta_create_plan_version_params.rbi +++ b/rbi/orb/models/beta_create_plan_version_params.rbi @@ -276,39 +276,40 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - # The price to add to the plan + # New plan price request body params. sig do returns( T.nilable( T.any( Orb::NewPlanUnitPrice, - Orb::NewPlanPackagePrice, - Orb::NewPlanMatrixPrice, Orb::NewPlanTieredPrice, - Orb::NewPlanTieredBPSPrice, - Orb::NewPlanBPSPrice, - Orb::NewPlanBulkBPSPrice, Orb::NewPlanBulkPrice, + Orb::NewPlanPackagePrice, + Orb::NewPlanMatrixPrice, Orb::NewPlanThresholdTotalAmountPrice, Orb::NewPlanTieredPackagePrice, Orb::NewPlanTieredWithMinimumPrice, - Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanGroupedTieredPrice, + Orb::NewPlanTieredPackageWithMinimumPrice, Orb::NewPlanPackageWithAllocationPrice, - Orb::NewPlanTierWithProrationPrice, + Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanMatrixWithAllocationPrice, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration, Orb::NewPlanUnitWithProrationPrice, Orb::NewPlanGroupedAllocationPrice, + Orb::NewPlanBulkWithProrationPrice, Orb::NewPlanGroupedWithProratedMinimumPrice, Orb::NewPlanGroupedWithMeteredMinimumPrice, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::NewPlanMatrixWithDisplayNamePrice, - Orb::NewPlanBulkWithProrationPrice, Orb::NewPlanGroupedTieredPackagePrice, Orb::NewPlanMaxGroupTieredPackagePrice, Orb::NewPlanScalableMatrixWithUnitPricingPrice, Orb::NewPlanScalableMatrixWithTieredPricingPrice, Orb::NewPlanCumulativeGroupedBulkPrice, - Orb::NewPlanTieredPackageWithMinimumPrice, - Orb::NewPlanMatrixWithAllocationPrice, - Orb::NewPlanGroupedTieredPrice + Orb::NewPlanMinimumCompositePrice, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput ) ) ) @@ -323,33 +324,34 @@ module Orb T.nilable( T.any( Orb::NewPlanUnitPrice::OrHash, - Orb::NewPlanPackagePrice::OrHash, - Orb::NewPlanMatrixPrice::OrHash, Orb::NewPlanTieredPrice::OrHash, - Orb::NewPlanTieredBPSPrice::OrHash, - Orb::NewPlanBPSPrice::OrHash, - Orb::NewPlanBulkBPSPrice::OrHash, Orb::NewPlanBulkPrice::OrHash, + Orb::NewPlanPackagePrice::OrHash, + Orb::NewPlanMatrixPrice::OrHash, Orb::NewPlanThresholdTotalAmountPrice::OrHash, Orb::NewPlanTieredPackagePrice::OrHash, Orb::NewPlanTieredWithMinimumPrice::OrHash, - Orb::NewPlanUnitWithPercentPrice::OrHash, + Orb::NewPlanGroupedTieredPrice::OrHash, + Orb::NewPlanTieredPackageWithMinimumPrice::OrHash, Orb::NewPlanPackageWithAllocationPrice::OrHash, - Orb::NewPlanTierWithProrationPrice::OrHash, + Orb::NewPlanUnitWithPercentPrice::OrHash, + Orb::NewPlanMatrixWithAllocationPrice::OrHash, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::OrHash, Orb::NewPlanUnitWithProrationPrice::OrHash, Orb::NewPlanGroupedAllocationPrice::OrHash, + Orb::NewPlanBulkWithProrationPrice::OrHash, Orb::NewPlanGroupedWithProratedMinimumPrice::OrHash, Orb::NewPlanGroupedWithMeteredMinimumPrice::OrHash, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::OrHash, Orb::NewPlanMatrixWithDisplayNamePrice::OrHash, - Orb::NewPlanBulkWithProrationPrice::OrHash, Orb::NewPlanGroupedTieredPackagePrice::OrHash, Orb::NewPlanMaxGroupTieredPackagePrice::OrHash, Orb::NewPlanScalableMatrixWithUnitPricingPrice::OrHash, Orb::NewPlanScalableMatrixWithTieredPricingPrice::OrHash, Orb::NewPlanCumulativeGroupedBulkPrice::OrHash, - Orb::NewPlanTieredPackageWithMinimumPrice::OrHash, - Orb::NewPlanMatrixWithAllocationPrice::OrHash, - Orb::NewPlanGroupedTieredPrice::OrHash + Orb::NewPlanMinimumCompositePrice::OrHash, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::OrHash, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::OrHash ) ) ).returns(T.attached_class) @@ -359,7 +361,7 @@ module Orb allocation_price: nil, # The phase to add this price to. plan_phase_order: nil, - # The price to add to the plan + # New plan price request body params. price: nil ) end @@ -373,33 +375,34 @@ module Orb T.nilable( T.any( Orb::NewPlanUnitPrice, - Orb::NewPlanPackagePrice, - Orb::NewPlanMatrixPrice, Orb::NewPlanTieredPrice, - Orb::NewPlanTieredBPSPrice, - Orb::NewPlanBPSPrice, - Orb::NewPlanBulkBPSPrice, Orb::NewPlanBulkPrice, + Orb::NewPlanPackagePrice, + Orb::NewPlanMatrixPrice, Orb::NewPlanThresholdTotalAmountPrice, Orb::NewPlanTieredPackagePrice, Orb::NewPlanTieredWithMinimumPrice, - Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanGroupedTieredPrice, + Orb::NewPlanTieredPackageWithMinimumPrice, Orb::NewPlanPackageWithAllocationPrice, - Orb::NewPlanTierWithProrationPrice, + Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanMatrixWithAllocationPrice, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration, Orb::NewPlanUnitWithProrationPrice, Orb::NewPlanGroupedAllocationPrice, + Orb::NewPlanBulkWithProrationPrice, Orb::NewPlanGroupedWithProratedMinimumPrice, Orb::NewPlanGroupedWithMeteredMinimumPrice, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::NewPlanMatrixWithDisplayNamePrice, - Orb::NewPlanBulkWithProrationPrice, Orb::NewPlanGroupedTieredPackagePrice, Orb::NewPlanMaxGroupTieredPackagePrice, Orb::NewPlanScalableMatrixWithUnitPricingPrice, Orb::NewPlanScalableMatrixWithTieredPricingPrice, Orb::NewPlanCumulativeGroupedBulkPrice, - Orb::NewPlanTieredPackageWithMinimumPrice, - Orb::NewPlanMatrixWithAllocationPrice, - Orb::NewPlanGroupedTieredPrice + Orb::NewPlanMinimumCompositePrice, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput ) ) } @@ -408,7 +411,7 @@ module Orb def to_hash end - # The price to add to the plan + # New plan price request body params. module Price extend Orb::Internal::Type::Union @@ -416,430 +419,3393 @@ module Orb T.type_alias do T.any( Orb::NewPlanUnitPrice, - Orb::NewPlanPackagePrice, - Orb::NewPlanMatrixPrice, Orb::NewPlanTieredPrice, - Orb::NewPlanTieredBPSPrice, - Orb::NewPlanBPSPrice, - Orb::NewPlanBulkBPSPrice, Orb::NewPlanBulkPrice, + Orb::NewPlanPackagePrice, + Orb::NewPlanMatrixPrice, Orb::NewPlanThresholdTotalAmountPrice, Orb::NewPlanTieredPackagePrice, Orb::NewPlanTieredWithMinimumPrice, - Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanGroupedTieredPrice, + Orb::NewPlanTieredPackageWithMinimumPrice, Orb::NewPlanPackageWithAllocationPrice, - Orb::NewPlanTierWithProrationPrice, + Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanMatrixWithAllocationPrice, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration, Orb::NewPlanUnitWithProrationPrice, Orb::NewPlanGroupedAllocationPrice, + Orb::NewPlanBulkWithProrationPrice, Orb::NewPlanGroupedWithProratedMinimumPrice, Orb::NewPlanGroupedWithMeteredMinimumPrice, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::NewPlanMatrixWithDisplayNamePrice, - Orb::NewPlanBulkWithProrationPrice, Orb::NewPlanGroupedTieredPackagePrice, Orb::NewPlanMaxGroupTieredPackagePrice, Orb::NewPlanScalableMatrixWithUnitPricingPrice, Orb::NewPlanScalableMatrixWithTieredPricingPrice, Orb::NewPlanCumulativeGroupedBulkPrice, - Orb::NewPlanTieredPackageWithMinimumPrice, - Orb::NewPlanMatrixWithAllocationPrice, - Orb::NewPlanGroupedTieredPrice + Orb::NewPlanMinimumCompositePrice, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput ) end - sig do - override.returns( - T::Array[ - Orb::BetaCreatePlanVersionParams::AddPrice::Price::Variants - ] - ) - end - def self.variants - end - end - end + class TieredWithProration < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration, + Orb::Internal::AnyHash + ) + end - class RemoveAdjustment < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Orb::BetaCreatePlanVersionParams::RemoveAdjustment, - Orb::Internal::AnyHash - ) - end + # The cadence to bill for this price on. + sig do + returns( + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence::OrSymbol + ) + end + attr_accessor :cadence - # The id of the adjustment to remove from on the plan. - sig { returns(String) } - attr_accessor :adjustment_id + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id - # The phase to remove this adjustment from. - sig { returns(T.nilable(Integer)) } - attr_accessor :plan_phase_order + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type - sig do - params( - adjustment_id: String, - plan_phase_order: T.nilable(Integer) - ).returns(T.attached_class) - end - def self.new( - # The id of the adjustment to remove from on the plan. - adjustment_id:, - # The phase to remove this adjustment from. - plan_phase_order: nil - ) - end + # The name of the price. + sig { returns(String) } + attr_accessor :name - sig do - override.returns( - { adjustment_id: String, plan_phase_order: T.nilable(Integer) } - ) - end - def to_hash - end - end + # Configuration for tiered_with_proration pricing + sig do + returns( + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig + ) + end + attr_reader :tiered_with_proration_config - class RemovePrice < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Orb::BetaCreatePlanVersionParams::RemovePrice, - Orb::Internal::AnyHash - ) - end + sig do + params( + tiered_with_proration_config: + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::OrHash + ).void + end + attr_writer :tiered_with_proration_config - # The id of the price to remove from the plan. - sig { returns(String) } - attr_accessor :price_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id - # The phase to remove this price from. - sig { returns(T.nilable(Integer)) } - attr_accessor :plan_phase_order + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance - sig do - params( - price_id: String, - plan_phase_order: T.nilable(Integer) - ).returns(T.attached_class) - end - def self.new( - # The id of the price to remove from the plan. - price_id:, - # The phase to remove this price from. - plan_phase_order: nil - ) - end + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration - sig do - override.returns( - { price_id: String, plan_phase_order: T.nilable(Integer) } - ) - end - def to_hash - end - end + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration - class ReplaceAdjustment < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Orb::BetaCreatePlanVersionParams::ReplaceAdjustment, - Orb::Internal::AnyHash - ) - end + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate - # The definition of a new adjustment to create and add to the plan. - sig do - returns( - T.any( - Orb::NewPercentageDiscount, - Orb::NewUsageDiscount, - Orb::NewAmountDiscount, - Orb::NewMinimum, - Orb::NewMaximum - ) - ) - end - attr_accessor :adjustment + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config - # The id of the adjustment on the plan to replace in the plan. - sig { returns(String) } - attr_accessor :replaces_adjustment_id + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency - # The phase to replace this adjustment from. - sig { returns(T.nilable(Integer)) } - attr_accessor :plan_phase_order + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration - sig do - params( - adjustment: - T.any( - Orb::NewPercentageDiscount::OrHash, - Orb::NewUsageDiscount::OrHash, - Orb::NewAmountDiscount::OrHash, - Orb::NewMinimum::OrHash, - Orb::NewMaximum::OrHash - ), - replaces_adjustment_id: String, - plan_phase_order: T.nilable(Integer) - ).returns(T.attached_class) - end - def self.new( - # The definition of a new adjustment to create and add to the plan. - adjustment:, - # The id of the adjustment on the plan to replace in the plan. - replaces_adjustment_id:, - # The phase to replace this adjustment from. - plan_phase_order: nil - ) - end + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration - sig do - override.returns( - { - adjustment: - T.any( - Orb::NewPercentageDiscount, - Orb::NewUsageDiscount, - Orb::NewAmountDiscount, - Orb::NewMinimum, - Orb::NewMaximum - ), - replaces_adjustment_id: String, - plan_phase_order: T.nilable(Integer) - } - ) - end - def to_hash - end + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id - # The definition of a new adjustment to create and add to the plan. - module Adjustment - extend Orb::Internal::Type::Union + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity - Variants = - T.type_alias do - T.any( - Orb::NewPercentageDiscount, - Orb::NewUsageDiscount, - Orb::NewAmountDiscount, - Orb::NewMinimum, - Orb::NewMaximum - ) + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void end + attr_writer :invoicing_cycle_configuration - sig do - override.returns( - T::Array[ - Orb::BetaCreatePlanVersionParams::ReplaceAdjustment::Adjustment::Variants - ] - ) - end - def self.variants - end - end - end + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata - class ReplacePrice < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Orb::BetaCreatePlanVersionParams::ReplacePrice, - Orb::Internal::AnyHash + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence::OrSymbol, + item_id: String, + name: String, + tiered_with_proration_config: + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for tiered_with_proration pricing + tiered_with_proration_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :tiered_with_proration ) - end + end - # The id of the price on the plan to replace in the plan. - sig { returns(String) } - attr_accessor :replaces_price_id + sig do + override.returns( + { + cadence: + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence::OrSymbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_proration_config: + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end - # The allocation price to add to the plan. - sig { returns(T.nilable(Orb::NewAllocationPrice)) } - attr_reader :allocation_price + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig, + Orb::Internal::AnyHash + ) + end + + # Tiers for rating based on total usage quantities into the specified tier with + # proration + sig do + returns( + T::Array[ + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for tiered_with_proration pricing + sig do + params( + tiers: + T::Array[ + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Tiers for rating based on total usage quantities into the specified tier with + # proration + tiers: + ) + end + + sig do + override.returns( + { + tiers: + T::Array[ + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Inclusive tier starting value + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Amount per unit + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tiered with proration tier + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Inclusive tier starting value + tier_lower_bound:, + # Amount per unit + unit_amount: + ) + end + + sig do + override.returns( + { tier_lower_bound: String, unit_amount: String } + ) + end + def to_hash + end + end + end + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + returns( + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + ) + end + attr_reader :grouped_with_min_max_thresholds_config + + sig do + params( + grouped_with_min_max_thresholds_config: + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash + ).void + end + attr_writer :grouped_with_min_max_thresholds_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + grouped_with_min_max_thresholds_config: + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # Configuration for grouped_with_min_max_thresholds pricing + grouped_with_min_max_thresholds_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :grouped_with_min_max_thresholds + ) + end + + sig do + override.returns( + { + cadence: + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + grouped_with_min_max_thresholds_config: + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before applying thresholds + sig { returns(String) } + attr_accessor :grouping_key + + # The maximum amount to charge each group + sig { returns(String) } + attr_accessor :maximum_charge + + # The minimum amount to charge each group, regardless of usage + sig { returns(String) } + attr_accessor :minimum_charge + + # The base price charged per group + sig { returns(String) } + attr_accessor :per_unit_rate + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + params( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before applying thresholds + grouping_key:, + # The maximum amount to charge each group + maximum_charge:, + # The minimum amount to charge each group, regardless of usage + minimum_charge:, + # The base price charged per group + per_unit_rate: + ) + end + + sig do + override.returns( + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + ) + end + def to_hash + end + end + end + + class Percent < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # Configuration for percent pricing + sig do + returns( + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig + ) + end + attr_reader :percent_config + + sig do + params( + percent_config: + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig::OrHash + ).void + end + attr_writer :percent_config + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::Cadence::OrSymbol, + item_id: String, + name: String, + percent_config: + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for percent pricing + percent_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :percent + ) + end + + sig do + override.returns( + { + cadence: + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::Cadence::OrSymbol, + item_id: String, + model_type: Symbol, + name: String, + percent_config: + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class PercentConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig, + Orb::Internal::AnyHash + ) + end + + # What percent of the component subtotals to charge + sig { returns(Float) } + attr_accessor :percent + + # Configuration for percent pricing + sig { params(percent: Float).returns(T.attached_class) } + def self.new( + # What percent of the component subtotals to charge + percent: + ) + end + + sig { override.returns({ percent: Float }) } + def to_hash + end + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # Configuration for event_output pricing + sig do + returns( + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig + ) + end + attr_reader :event_output_config + + sig do + params( + event_output_config: + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig::OrHash + ).void + end + attr_writer :event_output_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence::OrSymbol, + event_output_config: + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # Configuration for event_output pricing + event_output_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :event_output + ) + end + + sig do + override.returns( + { + cadence: + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence::OrSymbol, + event_output_config: + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class EventOutputConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig, + Orb::Internal::AnyHash + ) + end + + # The key in the event data to extract the unit rate from. + sig { returns(String) } + attr_accessor :unit_rating_key + + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + sig { returns(T.nilable(String)) } + attr_accessor :grouping_key + + # Configuration for event_output pricing + sig do + params( + unit_rating_key: String, + grouping_key: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The key in the event data to extract the unit rate from. + unit_rating_key:, + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + grouping_key: nil + ) + end + + sig do + override.returns( + { unit_rating_key: String, grouping_key: T.nilable(String) } + ) + end + def to_hash + end + end + end + + sig do + override.returns( + T::Array[ + Orb::BetaCreatePlanVersionParams::AddPrice::Price::Variants + ] + ) + end + def self.variants + end + end + end + + class RemoveAdjustment < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::RemoveAdjustment, + Orb::Internal::AnyHash + ) + end + + # The id of the adjustment to remove from on the plan. + sig { returns(String) } + attr_accessor :adjustment_id + + # The phase to remove this adjustment from. + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig do + params( + adjustment_id: String, + plan_phase_order: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + # The id of the adjustment to remove from on the plan. + adjustment_id:, + # The phase to remove this adjustment from. + plan_phase_order: nil + ) + end + + sig do + override.returns( + { adjustment_id: String, plan_phase_order: T.nilable(Integer) } + ) + end + def to_hash + end + end + + class RemovePrice < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::RemovePrice, + Orb::Internal::AnyHash + ) + end + + # The id of the price to remove from the plan. + sig { returns(String) } + attr_accessor :price_id + + # The phase to remove this price from. + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig do + params( + price_id: String, + plan_phase_order: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + # The id of the price to remove from the plan. + price_id:, + # The phase to remove this price from. + plan_phase_order: nil + ) + end + + sig do + override.returns( + { price_id: String, plan_phase_order: T.nilable(Integer) } + ) + end + def to_hash + end + end + + class ReplaceAdjustment < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::ReplaceAdjustment, + Orb::Internal::AnyHash + ) + end + + # The definition of a new adjustment to create and add to the plan. + sig do + returns( + T.any( + Orb::NewPercentageDiscount, + Orb::NewUsageDiscount, + Orb::NewAmountDiscount, + Orb::NewMinimum, + Orb::NewMaximum + ) + ) + end + attr_accessor :adjustment + + # The id of the adjustment on the plan to replace in the plan. + sig { returns(String) } + attr_accessor :replaces_adjustment_id + + # The phase to replace this adjustment from. + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig do + params( + adjustment: + T.any( + Orb::NewPercentageDiscount::OrHash, + Orb::NewUsageDiscount::OrHash, + Orb::NewAmountDiscount::OrHash, + Orb::NewMinimum::OrHash, + Orb::NewMaximum::OrHash + ), + replaces_adjustment_id: String, + plan_phase_order: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + # The definition of a new adjustment to create and add to the plan. + adjustment:, + # The id of the adjustment on the plan to replace in the plan. + replaces_adjustment_id:, + # The phase to replace this adjustment from. + plan_phase_order: nil + ) + end + + sig do + override.returns( + { + adjustment: + T.any( + Orb::NewPercentageDiscount, + Orb::NewUsageDiscount, + Orb::NewAmountDiscount, + Orb::NewMinimum, + Orb::NewMaximum + ), + replaces_adjustment_id: String, + plan_phase_order: T.nilable(Integer) + } + ) + end + def to_hash + end + + # The definition of a new adjustment to create and add to the plan. + module Adjustment + extend Orb::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Orb::NewPercentageDiscount, + Orb::NewUsageDiscount, + Orb::NewAmountDiscount, + Orb::NewMinimum, + Orb::NewMaximum + ) + end + + sig do + override.returns( + T::Array[ + Orb::BetaCreatePlanVersionParams::ReplaceAdjustment::Adjustment::Variants + ] + ) + end + def self.variants + end + end + end + + class ReplacePrice < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::ReplacePrice, + Orb::Internal::AnyHash + ) + end + + # The id of the price on the plan to replace in the plan. + sig { returns(String) } + attr_accessor :replaces_price_id + + # The allocation price to add to the plan. + sig { returns(T.nilable(Orb::NewAllocationPrice)) } + attr_reader :allocation_price + + sig do + params( + allocation_price: T.nilable(Orb::NewAllocationPrice::OrHash) + ).void + end + attr_writer :allocation_price + + # The phase to replace this price from. + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + # New plan price request body params. + sig do + returns( + T.nilable( + T.any( + Orb::NewPlanUnitPrice, + Orb::NewPlanTieredPrice, + Orb::NewPlanBulkPrice, + Orb::NewPlanPackagePrice, + Orb::NewPlanMatrixPrice, + Orb::NewPlanThresholdTotalAmountPrice, + Orb::NewPlanTieredPackagePrice, + Orb::NewPlanTieredWithMinimumPrice, + Orb::NewPlanGroupedTieredPrice, + Orb::NewPlanTieredPackageWithMinimumPrice, + Orb::NewPlanPackageWithAllocationPrice, + Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanMatrixWithAllocationPrice, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration, + Orb::NewPlanUnitWithProrationPrice, + Orb::NewPlanGroupedAllocationPrice, + Orb::NewPlanBulkWithProrationPrice, + Orb::NewPlanGroupedWithProratedMinimumPrice, + Orb::NewPlanGroupedWithMeteredMinimumPrice, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, + Orb::NewPlanMatrixWithDisplayNamePrice, + Orb::NewPlanGroupedTieredPackagePrice, + Orb::NewPlanMaxGroupTieredPackagePrice, + Orb::NewPlanScalableMatrixWithUnitPricingPrice, + Orb::NewPlanScalableMatrixWithTieredPricingPrice, + Orb::NewPlanCumulativeGroupedBulkPrice, + Orb::NewPlanMinimumCompositePrice, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput + ) + ) + ) + end + attr_accessor :price + + sig do + params( + replaces_price_id: String, + allocation_price: T.nilable(Orb::NewAllocationPrice::OrHash), + plan_phase_order: T.nilable(Integer), + price: + T.nilable( + T.any( + Orb::NewPlanUnitPrice::OrHash, + Orb::NewPlanTieredPrice::OrHash, + Orb::NewPlanBulkPrice::OrHash, + Orb::NewPlanPackagePrice::OrHash, + Orb::NewPlanMatrixPrice::OrHash, + Orb::NewPlanThresholdTotalAmountPrice::OrHash, + Orb::NewPlanTieredPackagePrice::OrHash, + Orb::NewPlanTieredWithMinimumPrice::OrHash, + Orb::NewPlanGroupedTieredPrice::OrHash, + Orb::NewPlanTieredPackageWithMinimumPrice::OrHash, + Orb::NewPlanPackageWithAllocationPrice::OrHash, + Orb::NewPlanUnitWithPercentPrice::OrHash, + Orb::NewPlanMatrixWithAllocationPrice::OrHash, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::OrHash, + Orb::NewPlanUnitWithProrationPrice::OrHash, + Orb::NewPlanGroupedAllocationPrice::OrHash, + Orb::NewPlanBulkWithProrationPrice::OrHash, + Orb::NewPlanGroupedWithProratedMinimumPrice::OrHash, + Orb::NewPlanGroupedWithMeteredMinimumPrice::OrHash, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::OrHash, + Orb::NewPlanMatrixWithDisplayNamePrice::OrHash, + Orb::NewPlanGroupedTieredPackagePrice::OrHash, + Orb::NewPlanMaxGroupTieredPackagePrice::OrHash, + Orb::NewPlanScalableMatrixWithUnitPricingPrice::OrHash, + Orb::NewPlanScalableMatrixWithTieredPricingPrice::OrHash, + Orb::NewPlanCumulativeGroupedBulkPrice::OrHash, + Orb::NewPlanMinimumCompositePrice::OrHash, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::OrHash, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::OrHash + ) + ) + ).returns(T.attached_class) + end + def self.new( + # The id of the price on the plan to replace in the plan. + replaces_price_id:, + # The allocation price to add to the plan. + allocation_price: nil, + # The phase to replace this price from. + plan_phase_order: nil, + # New plan price request body params. + price: nil + ) + end sig do - params( - allocation_price: T.nilable(Orb::NewAllocationPrice::OrHash) - ).void + override.returns( + { + replaces_price_id: String, + allocation_price: T.nilable(Orb::NewAllocationPrice), + plan_phase_order: T.nilable(Integer), + price: + T.nilable( + T.any( + Orb::NewPlanUnitPrice, + Orb::NewPlanTieredPrice, + Orb::NewPlanBulkPrice, + Orb::NewPlanPackagePrice, + Orb::NewPlanMatrixPrice, + Orb::NewPlanThresholdTotalAmountPrice, + Orb::NewPlanTieredPackagePrice, + Orb::NewPlanTieredWithMinimumPrice, + Orb::NewPlanGroupedTieredPrice, + Orb::NewPlanTieredPackageWithMinimumPrice, + Orb::NewPlanPackageWithAllocationPrice, + Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanMatrixWithAllocationPrice, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration, + Orb::NewPlanUnitWithProrationPrice, + Orb::NewPlanGroupedAllocationPrice, + Orb::NewPlanBulkWithProrationPrice, + Orb::NewPlanGroupedWithProratedMinimumPrice, + Orb::NewPlanGroupedWithMeteredMinimumPrice, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, + Orb::NewPlanMatrixWithDisplayNamePrice, + Orb::NewPlanGroupedTieredPackagePrice, + Orb::NewPlanMaxGroupTieredPackagePrice, + Orb::NewPlanScalableMatrixWithUnitPricingPrice, + Orb::NewPlanScalableMatrixWithTieredPricingPrice, + Orb::NewPlanCumulativeGroupedBulkPrice, + Orb::NewPlanMinimumCompositePrice, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput + ) + ) + } + ) end - attr_writer :allocation_price + def to_hash + end + + # New plan price request body params. + module Price + extend Orb::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Orb::NewPlanUnitPrice, + Orb::NewPlanTieredPrice, + Orb::NewPlanBulkPrice, + Orb::NewPlanPackagePrice, + Orb::NewPlanMatrixPrice, + Orb::NewPlanThresholdTotalAmountPrice, + Orb::NewPlanTieredPackagePrice, + Orb::NewPlanTieredWithMinimumPrice, + Orb::NewPlanGroupedTieredPrice, + Orb::NewPlanTieredPackageWithMinimumPrice, + Orb::NewPlanPackageWithAllocationPrice, + Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanMatrixWithAllocationPrice, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration, + Orb::NewPlanUnitWithProrationPrice, + Orb::NewPlanGroupedAllocationPrice, + Orb::NewPlanBulkWithProrationPrice, + Orb::NewPlanGroupedWithProratedMinimumPrice, + Orb::NewPlanGroupedWithMeteredMinimumPrice, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, + Orb::NewPlanMatrixWithDisplayNamePrice, + Orb::NewPlanGroupedTieredPackagePrice, + Orb::NewPlanMaxGroupTieredPackagePrice, + Orb::NewPlanScalableMatrixWithUnitPricingPrice, + Orb::NewPlanScalableMatrixWithTieredPricingPrice, + Orb::NewPlanCumulativeGroupedBulkPrice, + Orb::NewPlanMinimumCompositePrice, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput + ) + end + + class TieredWithProration < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # Configuration for tiered_with_proration pricing + sig do + returns( + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig + ) + end + attr_reader :tiered_with_proration_config + + sig do + params( + tiered_with_proration_config: + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::OrHash + ).void + end + attr_writer :tiered_with_proration_config + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence::OrSymbol, + item_id: String, + name: String, + tiered_with_proration_config: + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for tiered_with_proration pricing + tiered_with_proration_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :tiered_with_proration + ) + end + + sig do + override.returns( + { + cadence: + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence::OrSymbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_proration_config: + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig, + Orb::Internal::AnyHash + ) + end + + # Tiers for rating based on total usage quantities into the specified tier with + # proration + sig do + returns( + T::Array[ + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for tiered_with_proration pricing + sig do + params( + tiers: + T::Array[ + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Tiers for rating based on total usage quantities into the specified tier with + # proration + tiers: + ) + end + + sig do + override.returns( + { + tiers: + T::Array[ + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Inclusive tier starting value + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Amount per unit + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tiered with proration tier + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Inclusive tier starting value + tier_lower_bound:, + # Amount per unit + unit_amount: + ) + end + + sig do + override.returns( + { tier_lower_bound: String, unit_amount: String } + ) + end + def to_hash + end + end + end + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + returns( + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + ) + end + attr_reader :grouped_with_min_max_thresholds_config + + sig do + params( + grouped_with_min_max_thresholds_config: + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash + ).void + end + attr_writer :grouped_with_min_max_thresholds_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + grouped_with_min_max_thresholds_config: + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # Configuration for grouped_with_min_max_thresholds pricing + grouped_with_min_max_thresholds_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :grouped_with_min_max_thresholds + ) + end + + sig do + override.returns( + { + cadence: + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + grouped_with_min_max_thresholds_config: + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before applying thresholds + sig { returns(String) } + attr_accessor :grouping_key + + # The maximum amount to charge each group + sig { returns(String) } + attr_accessor :maximum_charge + + # The minimum amount to charge each group, regardless of usage + sig { returns(String) } + attr_accessor :minimum_charge + + # The base price charged per group + sig { returns(String) } + attr_accessor :per_unit_rate + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + params( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before applying thresholds + grouping_key:, + # The maximum amount to charge each group + maximum_charge:, + # The minimum amount to charge each group, regardless of usage + minimum_charge:, + # The base price charged per group + per_unit_rate: + ) + end + + sig do + override.returns( + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + ) + end + def to_hash + end + end + end + + class Percent < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence::OrSymbol + ) + end + attr_accessor :cadence - # The phase to replace this price from. - sig { returns(T.nilable(Integer)) } - attr_accessor :plan_phase_order + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id - # The price to add to the plan - sig do - returns( - T.nilable( - T.any( - Orb::NewPlanUnitPrice, - Orb::NewPlanPackagePrice, - Orb::NewPlanMatrixPrice, - Orb::NewPlanTieredPrice, - Orb::NewPlanTieredBPSPrice, - Orb::NewPlanBPSPrice, - Orb::NewPlanBulkBPSPrice, - Orb::NewPlanBulkPrice, - Orb::NewPlanThresholdTotalAmountPrice, - Orb::NewPlanTieredPackagePrice, - Orb::NewPlanTieredWithMinimumPrice, - Orb::NewPlanUnitWithPercentPrice, - Orb::NewPlanPackageWithAllocationPrice, - Orb::NewPlanTierWithProrationPrice, - Orb::NewPlanUnitWithProrationPrice, - Orb::NewPlanGroupedAllocationPrice, - Orb::NewPlanGroupedWithProratedMinimumPrice, - Orb::NewPlanGroupedWithMeteredMinimumPrice, - Orb::NewPlanMatrixWithDisplayNamePrice, - Orb::NewPlanBulkWithProrationPrice, - Orb::NewPlanGroupedTieredPackagePrice, - Orb::NewPlanMaxGroupTieredPackagePrice, - Orb::NewPlanScalableMatrixWithUnitPricingPrice, - Orb::NewPlanScalableMatrixWithTieredPricingPrice, - Orb::NewPlanCumulativeGroupedBulkPrice, - Orb::NewPlanTieredPackageWithMinimumPrice, - Orb::NewPlanMatrixWithAllocationPrice, - Orb::NewPlanGroupedTieredPrice + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # Configuration for percent pricing + sig do + returns( + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig + ) + end + attr_reader :percent_config + + sig do + params( + percent_config: + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig::OrHash + ).void + end + attr_writer :percent_config + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence::OrSymbol, + item_id: String, + name: String, + percent_config: + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for percent pricing + percent_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :percent ) - ) - end - attr_accessor :price + end - sig do - params( - replaces_price_id: String, - allocation_price: T.nilable(Orb::NewAllocationPrice::OrHash), - plan_phase_order: T.nilable(Integer), - price: - T.nilable( + sig do + override.returns( + { + cadence: + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence::OrSymbol, + item_id: String, + model_type: Symbol, + name: String, + percent_config: + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class PercentConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig, + Orb::Internal::AnyHash + ) + end + + # What percent of the component subtotals to charge + sig { returns(Float) } + attr_accessor :percent + + # Configuration for percent pricing + sig { params(percent: Float).returns(T.attached_class) } + def self.new( + # What percent of the component subtotals to charge + percent: + ) + end + + sig { override.returns({ percent: Float }) } + def to_hash + end + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do T.any( - Orb::NewPlanUnitPrice::OrHash, - Orb::NewPlanPackagePrice::OrHash, - Orb::NewPlanMatrixPrice::OrHash, - Orb::NewPlanTieredPrice::OrHash, - Orb::NewPlanTieredBPSPrice::OrHash, - Orb::NewPlanBPSPrice::OrHash, - Orb::NewPlanBulkBPSPrice::OrHash, - Orb::NewPlanBulkPrice::OrHash, - Orb::NewPlanThresholdTotalAmountPrice::OrHash, - Orb::NewPlanTieredPackagePrice::OrHash, - Orb::NewPlanTieredWithMinimumPrice::OrHash, - Orb::NewPlanUnitWithPercentPrice::OrHash, - Orb::NewPlanPackageWithAllocationPrice::OrHash, - Orb::NewPlanTierWithProrationPrice::OrHash, - Orb::NewPlanUnitWithProrationPrice::OrHash, - Orb::NewPlanGroupedAllocationPrice::OrHash, - Orb::NewPlanGroupedWithProratedMinimumPrice::OrHash, - Orb::NewPlanGroupedWithMeteredMinimumPrice::OrHash, - Orb::NewPlanMatrixWithDisplayNamePrice::OrHash, - Orb::NewPlanBulkWithProrationPrice::OrHash, - Orb::NewPlanGroupedTieredPackagePrice::OrHash, - Orb::NewPlanMaxGroupTieredPackagePrice::OrHash, - Orb::NewPlanScalableMatrixWithUnitPricingPrice::OrHash, - Orb::NewPlanScalableMatrixWithTieredPricingPrice::OrHash, - Orb::NewPlanCumulativeGroupedBulkPrice::OrHash, - Orb::NewPlanTieredPackageWithMinimumPrice::OrHash, - Orb::NewPlanMatrixWithAllocationPrice::OrHash, - Orb::NewPlanGroupedTieredPrice::OrHash + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput, + Orb::Internal::AnyHash ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence::OrSymbol ) - ).returns(T.attached_class) - end - def self.new( - # The id of the price on the plan to replace in the plan. - replaces_price_id:, - # The allocation price to add to the plan. - allocation_price: nil, - # The phase to replace this price from. - plan_phase_order: nil, - # The price to add to the plan - price: nil - ) - end + end + attr_accessor :cadence - sig do - override.returns( - { - replaces_price_id: String, - allocation_price: T.nilable(Orb::NewAllocationPrice), - plan_phase_order: T.nilable(Integer), - price: + # Configuration for event_output pricing + sig do + returns( + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig + ) + end + attr_reader :event_output_config + + sig do + params( + event_output_config: + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig::OrHash + ).void + end + attr_writer :event_output_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( T.nilable( T.any( - Orb::NewPlanUnitPrice, - Orb::NewPlanPackagePrice, - Orb::NewPlanMatrixPrice, - Orb::NewPlanTieredPrice, - Orb::NewPlanTieredBPSPrice, - Orb::NewPlanBPSPrice, - Orb::NewPlanBulkBPSPrice, - Orb::NewPlanBulkPrice, - Orb::NewPlanThresholdTotalAmountPrice, - Orb::NewPlanTieredPackagePrice, - Orb::NewPlanTieredWithMinimumPrice, - Orb::NewPlanUnitWithPercentPrice, - Orb::NewPlanPackageWithAllocationPrice, - Orb::NewPlanTierWithProrationPrice, - Orb::NewPlanUnitWithProrationPrice, - Orb::NewPlanGroupedAllocationPrice, - Orb::NewPlanGroupedWithProratedMinimumPrice, - Orb::NewPlanGroupedWithMeteredMinimumPrice, - Orb::NewPlanMatrixWithDisplayNamePrice, - Orb::NewPlanBulkWithProrationPrice, - Orb::NewPlanGroupedTieredPackagePrice, - Orb::NewPlanMaxGroupTieredPackagePrice, - Orb::NewPlanScalableMatrixWithUnitPricingPrice, - Orb::NewPlanScalableMatrixWithTieredPricingPrice, - Orb::NewPlanCumulativeGroupedBulkPrice, - Orb::NewPlanTieredPackageWithMinimumPrice, - Orb::NewPlanMatrixWithAllocationPrice, - Orb::NewPlanGroupedTieredPrice + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig ) ) - } - ) - end - def to_hash - end + ) + end + attr_accessor :conversion_rate_config - # The price to add to the plan - module Price - extend Orb::Internal::Type::Union + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency - Variants = - T.type_alias do - T.any( - Orb::NewPlanUnitPrice, - Orb::NewPlanPackagePrice, - Orb::NewPlanMatrixPrice, - Orb::NewPlanTieredPrice, - Orb::NewPlanTieredBPSPrice, - Orb::NewPlanBPSPrice, - Orb::NewPlanBulkBPSPrice, - Orb::NewPlanBulkPrice, - Orb::NewPlanThresholdTotalAmountPrice, - Orb::NewPlanTieredPackagePrice, - Orb::NewPlanTieredWithMinimumPrice, - Orb::NewPlanUnitWithPercentPrice, - Orb::NewPlanPackageWithAllocationPrice, - Orb::NewPlanTierWithProrationPrice, - Orb::NewPlanUnitWithProrationPrice, - Orb::NewPlanGroupedAllocationPrice, - Orb::NewPlanGroupedWithProratedMinimumPrice, - Orb::NewPlanGroupedWithMeteredMinimumPrice, - Orb::NewPlanMatrixWithDisplayNamePrice, - Orb::NewPlanBulkWithProrationPrice, - Orb::NewPlanGroupedTieredPackagePrice, - Orb::NewPlanMaxGroupTieredPackagePrice, - Orb::NewPlanScalableMatrixWithUnitPricingPrice, - Orb::NewPlanScalableMatrixWithTieredPricingPrice, - Orb::NewPlanCumulativeGroupedBulkPrice, - Orb::NewPlanTieredPackageWithMinimumPrice, - Orb::NewPlanMatrixWithAllocationPrice, - Orb::NewPlanGroupedTieredPrice + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence::OrSymbol, + event_output_config: + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # Configuration for event_output pricing + event_output_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :event_output + ) + end + + sig do + override.returns( + { + cadence: + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence::OrSymbol, + event_output_config: + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class EventOutputConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig, + Orb::Internal::AnyHash + ) + end + + # The key in the event data to extract the unit rate from. + sig { returns(String) } + attr_accessor :unit_rating_key + + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + sig { returns(T.nilable(String)) } + attr_accessor :grouping_key + + # Configuration for event_output pricing + sig do + params( + unit_rating_key: String, + grouping_key: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The key in the event data to extract the unit rate from. + unit_rating_key:, + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + grouping_key: nil ) + end + + sig do + override.returns( + { unit_rating_key: String, grouping_key: T.nilable(String) } + ) + end + def to_hash + end end + end sig do override.returns( diff --git a/rbi/orb/models/bps_config.rbi b/rbi/orb/models/bps_config.rbi deleted file mode 100644 index 109aa7b2..00000000 --- a/rbi/orb/models/bps_config.rbi +++ /dev/null @@ -1,36 +0,0 @@ -# typed: strong - -module Orb - module Models - class BPSConfig < Orb::Internal::Type::BaseModel - OrHash = T.type_alias { T.any(Orb::BPSConfig, Orb::Internal::AnyHash) } - - # Basis point take rate per event - sig { returns(Float) } - attr_accessor :bps - - # Optional currency amount maximum to cap spend per event - sig { returns(T.nilable(String)) } - attr_accessor :per_unit_maximum - - sig do - params(bps: Float, per_unit_maximum: T.nilable(String)).returns( - T.attached_class - ) - end - def self.new( - # Basis point take rate per event - bps:, - # Optional currency amount maximum to cap spend per event - per_unit_maximum: nil - ) - end - - sig do - override.returns({ bps: Float, per_unit_maximum: T.nilable(String) }) - end - def to_hash - end - end - end -end diff --git a/rbi/orb/models/bps_tier.rbi b/rbi/orb/models/bps_tier.rbi deleted file mode 100644 index 549accda..00000000 --- a/rbi/orb/models/bps_tier.rbi +++ /dev/null @@ -1,58 +0,0 @@ -# typed: strong - -module Orb - module Models - class BPSTier < Orb::Internal::Type::BaseModel - OrHash = T.type_alias { T.any(Orb::BPSTier, Orb::Internal::AnyHash) } - - # Per-event basis point rate - sig { returns(Float) } - attr_accessor :bps - - # Exclusive tier starting value - sig { returns(String) } - attr_accessor :minimum_amount - - # Inclusive tier ending value - sig { returns(T.nilable(String)) } - attr_accessor :maximum_amount - - # Per unit maximum to charge - sig { returns(T.nilable(String)) } - attr_accessor :per_unit_maximum - - sig do - params( - bps: Float, - minimum_amount: String, - maximum_amount: T.nilable(String), - per_unit_maximum: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Per-event basis point rate - bps:, - # Exclusive tier starting value - minimum_amount:, - # Inclusive tier ending value - maximum_amount: nil, - # Per unit maximum to charge - per_unit_maximum: nil - ) - end - - sig do - override.returns( - { - bps: Float, - minimum_amount: String, - maximum_amount: T.nilable(String), - per_unit_maximum: T.nilable(String) - } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/orb/models/bulk_bps_config.rbi b/rbi/orb/models/bulk_bps_config.rbi deleted file mode 100644 index c5bcf704..00000000 --- a/rbi/orb/models/bulk_bps_config.rbi +++ /dev/null @@ -1,31 +0,0 @@ -# typed: strong - -module Orb - module Models - class BulkBPSConfig < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias { T.any(Orb::BulkBPSConfig, Orb::Internal::AnyHash) } - - # Tiers for a bulk BPS pricing model where all usage is aggregated to a single - # tier based on total volume - sig { returns(T::Array[Orb::BulkBPSTier]) } - attr_accessor :tiers - - sig do - params(tiers: T::Array[Orb::BulkBPSTier::OrHash]).returns( - T.attached_class - ) - end - def self.new( - # Tiers for a bulk BPS pricing model where all usage is aggregated to a single - # tier based on total volume - tiers: - ) - end - - sig { override.returns({ tiers: T::Array[Orb::BulkBPSTier] }) } - def to_hash - end - end - end -end diff --git a/rbi/orb/models/bulk_bps_tier.rbi b/rbi/orb/models/bulk_bps_tier.rbi deleted file mode 100644 index 3501a3a8..00000000 --- a/rbi/orb/models/bulk_bps_tier.rbi +++ /dev/null @@ -1,50 +0,0 @@ -# typed: strong - -module Orb - module Models - class BulkBPSTier < Orb::Internal::Type::BaseModel - OrHash = T.type_alias { T.any(Orb::BulkBPSTier, Orb::Internal::AnyHash) } - - # Basis points to rate on - sig { returns(Float) } - attr_accessor :bps - - # Upper bound for tier - sig { returns(T.nilable(String)) } - attr_accessor :maximum_amount - - # The maximum amount to charge for any one event - sig { returns(T.nilable(String)) } - attr_accessor :per_unit_maximum - - sig do - params( - bps: Float, - maximum_amount: T.nilable(String), - per_unit_maximum: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Basis points to rate on - bps:, - # Upper bound for tier - maximum_amount: nil, - # The maximum amount to charge for any one event - per_unit_maximum: nil - ) - end - - sig do - override.returns( - { - bps: Float, - maximum_amount: T.nilable(String), - per_unit_maximum: T.nilable(String) - } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/orb/models/bulk_config.rbi b/rbi/orb/models/bulk_config.rbi index 383bf67d..de8ecc19 100644 --- a/rbi/orb/models/bulk_config.rbi +++ b/rbi/orb/models/bulk_config.rbi @@ -9,6 +9,7 @@ module Orb sig { returns(T::Array[Orb::BulkTier]) } attr_accessor :tiers + # Configuration for bulk pricing sig do params(tiers: T::Array[Orb::BulkTier::OrHash]).returns(T.attached_class) end diff --git a/rbi/orb/models/bulk_tier.rbi b/rbi/orb/models/bulk_tier.rbi index 8613d3f2..da60f6ee 100644 --- a/rbi/orb/models/bulk_tier.rbi +++ b/rbi/orb/models/bulk_tier.rbi @@ -13,6 +13,7 @@ module Orb sig { returns(T.nilable(Float)) } attr_accessor :maximum_units + # Configuration for a single bulk pricing tier sig do params(unit_amount: String, maximum_units: T.nilable(Float)).returns( T.attached_class diff --git a/rbi/orb/models/changed_subscription_resources.rbi b/rbi/orb/models/changed_subscription_resources.rbi index aedca1e6..76d00793 100644 --- a/rbi/orb/models/changed_subscription_resources.rbi +++ b/rbi/orb/models/changed_subscription_resources.rbi @@ -13,7 +13,9 @@ module Orb attr_accessor :created_credit_notes # The invoices that were created as part of this operation. - sig { returns(T::Array[Orb::Invoice]) } + sig do + returns(T::Array[Orb::ChangedSubscriptionResources::CreatedInvoice]) + end attr_accessor :created_invoices # The credit notes that were voided as part of this operation. @@ -27,7 +29,8 @@ module Orb sig do params( created_credit_notes: T::Array[Orb::CreditNote::OrHash], - created_invoices: T::Array[Orb::Invoice::OrHash], + created_invoices: + T::Array[Orb::ChangedSubscriptionResources::CreatedInvoice::OrHash], voided_credit_notes: T::Array[Orb::CreditNote::OrHash], voided_invoices: T::Array[Orb::Invoice::OrHash] ).returns(T.attached_class) @@ -48,7 +51,8 @@ module Orb override.returns( { created_credit_notes: T::Array[Orb::CreditNote], - created_invoices: T::Array[Orb::Invoice], + created_invoices: + T::Array[Orb::ChangedSubscriptionResources::CreatedInvoice], voided_credit_notes: T::Array[Orb::CreditNote], voided_invoices: T::Array[Orb::Invoice] } @@ -56,6 +60,1739 @@ module Orb end def to_hash end + + class CreatedInvoice < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::ChangedSubscriptionResources::CreatedInvoice, + Orb::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + # This is the final amount required to be charged to the customer and reflects the + # application of the customer balance to the `total` of the invoice. + sig { returns(String) } + attr_accessor :amount_due + + sig do + returns( + Orb::ChangedSubscriptionResources::CreatedInvoice::AutoCollection + ) + end + attr_reader :auto_collection + + sig do + params( + auto_collection: + Orb::ChangedSubscriptionResources::CreatedInvoice::AutoCollection::OrHash + ).void + end + attr_writer :auto_collection + + sig { returns(T.nilable(Orb::Address)) } + attr_reader :billing_address + + sig { params(billing_address: T.nilable(Orb::Address::OrHash)).void } + attr_writer :billing_address + + # The creation time of the resource in Orb. + sig { returns(Time) } + attr_accessor :created_at + + # A list of credit notes associated with the invoice + sig do + returns( + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::CreditNote + ] + ) + end + attr_accessor :credit_notes + + # An ISO 4217 currency string or `credits` + sig { returns(String) } + attr_accessor :currency + + sig { returns(Orb::CustomerMinified) } + attr_reader :customer + + sig { params(customer: Orb::CustomerMinified::OrHash).void } + attr_writer :customer + + sig do + returns( + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction + ] + ) + end + attr_accessor :customer_balance_transactions + + # Tax IDs are commonly required to be displayed on customer invoices, which are + # added to the headers of invoices. + # + # ### Supported Tax ID Countries and Types + # + # | Country | Type | Description | + # | ---------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + # | Albania | `al_tin` | Albania Tax Identification Number | + # | Andorra | `ad_nrt` | Andorran NRT Number | + # | Angola | `ao_tin` | Angola Tax Identification Number | + # | Argentina | `ar_cuit` | Argentinian Tax ID Number | + # | Armenia | `am_tin` | Armenia Tax Identification Number | + # | Aruba | `aw_tin` | Aruba Tax Identification Number | + # | Australia | `au_abn` | Australian Business Number (AU ABN) | + # | Australia | `au_arn` | Australian Taxation Office Reference Number | + # | Austria | `eu_vat` | European VAT Number | + # | Azerbaijan | `az_tin` | Azerbaijan Tax Identification Number | + # | Bahamas | `bs_tin` | Bahamas Tax Identification Number | + # | Bahrain | `bh_vat` | Bahraini VAT Number | + # | Bangladesh | `bd_bin` | Bangladesh Business Identification Number | + # | Barbados | `bb_tin` | Barbados Tax Identification Number | + # | Belarus | `by_tin` | Belarus TIN Number | + # | Belgium | `eu_vat` | European VAT Number | + # | Benin | `bj_ifu` | Benin Tax Identification Number (Identifiant Fiscal Unique) | + # | Bolivia | `bo_tin` | Bolivian Tax ID | + # | Bosnia and Herzegovina | `ba_tin` | Bosnia and Herzegovina Tax Identification Number | + # | Brazil | `br_cnpj` | Brazilian CNPJ Number | + # | Brazil | `br_cpf` | Brazilian CPF Number | + # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + # | Bulgaria | `eu_vat` | European VAT Number | + # | Burkina Faso | `bf_ifu` | Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) | + # | Cambodia | `kh_tin` | Cambodia Tax Identification Number | + # | Cameroon | `cm_niu` | Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) | + # | Canada | `ca_bn` | Canadian BN | + # | Canada | `ca_gst_hst` | Canadian GST/HST Number | + # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + # | Canada | `ca_qst` | Canadian QST Number (Québec) | + # | Cape Verde | `cv_nif` | Cape Verde Tax Identification Number (Número de Identificação Fiscal) | + # | Chile | `cl_tin` | Chilean TIN | + # | China | `cn_tin` | Chinese Tax ID | + # | Colombia | `co_nit` | Colombian NIT Number | + # | Congo-Kinshasa | `cd_nif` | Congo (DR) Tax Identification Number (Número de Identificação Fiscal) | + # | Costa Rica | `cr_tin` | Costa Rican Tax ID | + # | Croatia | `eu_vat` | European VAT Number | + # | Croatia | `hr_oib` | Croatian Personal Identification Number (OIB) | + # | Cyprus | `eu_vat` | European VAT Number | + # | Czech Republic | `eu_vat` | European VAT Number | + # | Denmark | `eu_vat` | European VAT Number | + # | Dominican Republic | `do_rcn` | Dominican RCN Number | + # | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + # | Egypt | `eg_tin` | Egyptian Tax Identification Number | + # | El Salvador | `sv_nit` | El Salvadorian NIT Number | + # | Estonia | `eu_vat` | European VAT Number | + # | Ethiopia | `et_tin` | Ethiopia Tax Identification Number | + # | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + # | Finland | `eu_vat` | European VAT Number | + # | France | `eu_vat` | European VAT Number | + # | Georgia | `ge_vat` | Georgian VAT | + # | Germany | `de_stn` | German Tax Number (Steuernummer) | + # | Germany | `eu_vat` | European VAT Number | + # | Greece | `eu_vat` | European VAT Number | + # | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) | + # | Hong Kong | `hk_br` | Hong Kong BR Number | + # | Hungary | `eu_vat` | European VAT Number | + # | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + # | Iceland | `is_vat` | Icelandic VAT | + # | India | `in_gst` | Indian GST Number | + # | Indonesia | `id_npwp` | Indonesian NPWP Number | + # | Ireland | `eu_vat` | European VAT Number | + # | Israel | `il_vat` | Israel VAT | + # | Italy | `eu_vat` | European VAT Number | + # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + # | Kyrgyzstan | `kg_tin` | Kyrgyzstan Tax Identification Number | + # | Laos | `la_tin` | Laos Tax Identification Number | + # | Latvia | `eu_vat` | European VAT Number | + # | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + # | Liechtenstein | `li_vat` | Liechtenstein VAT Number | + # | Lithuania | `eu_vat` | European VAT Number | + # | Luxembourg | `eu_vat` | European VAT Number | + # | Malaysia | `my_frp` | Malaysian FRP Number | + # | Malaysia | `my_itn` | Malaysian ITN | + # | Malaysia | `my_sst` | Malaysian SST Number | + # | Malta | `eu_vat` | European VAT Number | + # | Mauritania | `mr_nif` | Mauritania Tax Identification Number (Número de Identificação Fiscal) | + # | Mexico | `mx_rfc` | Mexican RFC Number | + # | Moldova | `md_vat` | Moldova VAT Number | + # | Montenegro | `me_pib` | Montenegro PIB Number | + # | Morocco | `ma_vat` | Morocco VAT Number | + # | Nepal | `np_pan` | Nepal PAN Number | + # | Netherlands | `eu_vat` | European VAT Number | + # | New Zealand | `nz_gst` | New Zealand GST Number | + # | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + # | North Macedonia | `mk_vat` | North Macedonia VAT Number | + # | Northern Ireland | `eu_vat` | Northern Ireland VAT Number | + # | Norway | `no_vat` | Norwegian VAT Number | + # | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + # | Oman | `om_vat` | Omani VAT Number | + # | Peru | `pe_ruc` | Peruvian RUC Number | + # | Philippines | `ph_tin` | Philippines Tax Identification Number | + # | Poland | `eu_vat` | European VAT Number | + # | Portugal | `eu_vat` | European VAT Number | + # | Romania | `eu_vat` | European VAT Number | + # | Romania | `ro_tin` | Romanian Tax ID Number | + # | Russia | `ru_inn` | Russian INN | + # | Russia | `ru_kpp` | Russian KPP | + # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + # | Senegal | `sn_ninea` | Senegal NINEA Number | + # | Serbia | `rs_pib` | Serbian PIB Number | + # | Singapore | `sg_gst` | Singaporean GST | + # | Singapore | `sg_uen` | Singaporean UEN | + # | Slovakia | `eu_vat` | European VAT Number | + # | Slovenia | `eu_vat` | European VAT Number | + # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + # | South Africa | `za_vat` | South African VAT Number | + # | South Korea | `kr_brn` | Korean BRN | + # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + # | Spain | `eu_vat` | European VAT Number | + # | Suriname | `sr_fin` | Suriname FIN Number | + # | Sweden | `eu_vat` | European VAT Number | + # | Switzerland | `ch_uid` | Switzerland UID Number | + # | Switzerland | `ch_vat` | Switzerland VAT Number | + # | Taiwan | `tw_vat` | Taiwanese VAT | + # | Tajikistan | `tj_tin` | Tajikistan Tax Identification Number | + # | Tanzania | `tz_vat` | Tanzania VAT Number | + # | Thailand | `th_vat` | Thai VAT | + # | Turkey | `tr_tin` | Turkish Tax Identification Number | + # | Uganda | `ug_tin` | Uganda Tax Identification Number | + # | Ukraine | `ua_vat` | Ukrainian VAT | + # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + # | United Kingdom | `gb_vat` | United Kingdom VAT Number | + # | United States | `us_ein` | United States EIN | + # | Uruguay | `uy_ruc` | Uruguayan RUC Number | + # | Uzbekistan | `uz_tin` | Uzbekistan TIN Number | + # | Uzbekistan | `uz_vat` | Uzbekistan VAT Number | + # | Venezuela | `ve_rif` | Venezuelan RIF Number | + # | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + # | Zambia | `zm_tin` | Zambia Tax Identification Number | + # | Zimbabwe | `zw_tin` | Zimbabwe Tax Identification Number | + sig { returns(T.nilable(Orb::CustomerTaxID)) } + attr_reader :customer_tax_id + + sig do + params(customer_tax_id: T.nilable(Orb::CustomerTaxID::OrHash)).void + end + attr_writer :customer_tax_id + + # This field is deprecated in favor of `discounts`. If a `discounts` list is + # provided, the first discount in the list will be returned. If the list is empty, + # `None` will be returned. + sig { returns(T.anything) } + attr_accessor :discount + + sig { returns(T::Array[Orb::InvoiceLevelDiscount::Variants]) } + attr_accessor :discounts + + # When the invoice payment is due. The due date is null if the invoice is not yet + # finalized. + sig { returns(T.nilable(Time)) } + attr_accessor :due_date + + # If the invoice has a status of `draft`, this will be the time that the invoice + # will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is + # true, the invoice will automatically begin issuing at this time. + sig { returns(T.nilable(Time)) } + attr_accessor :eligible_to_issue_at + + # A URL for the customer-facing invoice portal. This URL expires 30 days after the + # invoice's due date, or 60 days after being re-generated through the UI. + sig { returns(T.nilable(String)) } + attr_accessor :hosted_invoice_url + + # The scheduled date of the invoice + sig { returns(Time) } + attr_accessor :invoice_date + + # Automatically generated invoice number to help track and reconcile invoices. + # Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per + # account or customer. + sig { returns(String) } + attr_accessor :invoice_number + + # The link to download the PDF representation of the `Invoice`. + sig { returns(T.nilable(String)) } + attr_accessor :invoice_pdf + + sig do + returns( + Orb::ChangedSubscriptionResources::CreatedInvoice::InvoiceSource::TaggedSymbol + ) + end + attr_accessor :invoice_source + + # True if the invoice has only in-advance fixed fees and is payable now + sig { returns(T::Boolean) } + attr_accessor :is_payable_now + + # If the invoice failed to issue, this will be the last time it failed to issue + # (even if it is now in a different state.) + sig { returns(T.nilable(Time)) } + attr_accessor :issue_failed_at + + # If the invoice has been issued, this will be the time it transitioned to + # `issued` (even if it is now in a different state.) + sig { returns(T.nilable(Time)) } + attr_accessor :issued_at + + # The breakdown of prices in this invoice. + sig do + returns( + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem + ] + ) + end + attr_accessor :line_items + + sig { returns(T.nilable(Orb::Maximum)) } + attr_reader :maximum + + sig { params(maximum: T.nilable(Orb::Maximum::OrHash)).void } + attr_writer :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + # Free-form text which is available on the invoice PDF and the Orb invoice portal. + sig { returns(T.nilable(String)) } + attr_accessor :memo + + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Minimum)) } + attr_reader :minimum + + sig { params(minimum: T.nilable(Orb::Minimum::OrHash)).void } + attr_writer :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + # If the invoice has a status of `paid`, this gives a timestamp when the invoice + # was paid. + sig { returns(T.nilable(Time)) } + attr_accessor :paid_at + + # A list of payment attempts associated with the invoice + sig do + returns( + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt + ] + ) + end + attr_accessor :payment_attempts + + # If payment was attempted on this invoice but failed, this will be the time of + # the most recent attempt. + sig { returns(T.nilable(Time)) } + attr_accessor :payment_failed_at + + # If payment was attempted on this invoice, this will be the start time of the + # most recent attempt. This field is especially useful for delayed-notification + # payment mechanisms (like bank transfers), where payment can take 3 days or more. + sig { returns(T.nilable(Time)) } + attr_accessor :payment_started_at + + # If the invoice is in draft, this timestamp will reflect when the invoice is + # scheduled to be issued. + sig { returns(T.nilable(Time)) } + attr_accessor :scheduled_issue_at + + sig { returns(T.nilable(Orb::Address)) } + attr_reader :shipping_address + + sig { params(shipping_address: T.nilable(Orb::Address::OrHash)).void } + attr_writer :shipping_address + + sig do + returns( + Orb::ChangedSubscriptionResources::CreatedInvoice::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(T.nilable(Orb::SubscriptionMinified)) } + attr_reader :subscription + + sig do + params( + subscription: T.nilable(Orb::SubscriptionMinified::OrHash) + ).void + end + attr_writer :subscription + + # The total before any discounts and minimums are applied. + sig { returns(String) } + attr_accessor :subtotal + + # If the invoice failed to sync, this will be the last time an external invoicing + # provider sync was attempted. This field will always be `null` for invoices using + # Orb Invoicing. + sig { returns(T.nilable(Time)) } + attr_accessor :sync_failed_at + + # The total after any minimums and discounts have been applied. + sig { returns(String) } + attr_accessor :total + + # If the invoice has a status of `void`, this gives a timestamp when the invoice + # was voided. + sig { returns(T.nilable(Time)) } + attr_accessor :voided_at + + # This is true if the invoice will be automatically issued in the future, and + # false otherwise. + sig { returns(T::Boolean) } + attr_accessor :will_auto_issue + + sig do + params( + id: String, + amount_due: String, + auto_collection: + Orb::ChangedSubscriptionResources::CreatedInvoice::AutoCollection::OrHash, + billing_address: T.nilable(Orb::Address::OrHash), + created_at: Time, + credit_notes: + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::CreditNote::OrHash + ], + currency: String, + customer: Orb::CustomerMinified::OrHash, + customer_balance_transactions: + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::OrHash + ], + customer_tax_id: T.nilable(Orb::CustomerTaxID::OrHash), + discount: T.anything, + discounts: + T::Array[ + T.any( + Orb::PercentageDiscount::OrHash, + Orb::AmountDiscount::OrHash, + Orb::TrialDiscount::OrHash + ) + ], + due_date: T.nilable(Time), + eligible_to_issue_at: T.nilable(Time), + hosted_invoice_url: T.nilable(String), + invoice_date: Time, + invoice_number: String, + invoice_pdf: T.nilable(String), + invoice_source: + Orb::ChangedSubscriptionResources::CreatedInvoice::InvoiceSource::OrSymbol, + is_payable_now: T::Boolean, + issue_failed_at: T.nilable(Time), + issued_at: T.nilable(Time), + line_items: + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem::OrHash + ], + maximum: T.nilable(Orb::Maximum::OrHash), + maximum_amount: T.nilable(String), + memo: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Minimum::OrHash), + minimum_amount: T.nilable(String), + paid_at: T.nilable(Time), + payment_attempts: + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt::OrHash + ], + payment_failed_at: T.nilable(Time), + payment_started_at: T.nilable(Time), + scheduled_issue_at: T.nilable(Time), + shipping_address: T.nilable(Orb::Address::OrHash), + status: + Orb::ChangedSubscriptionResources::CreatedInvoice::Status::OrSymbol, + subscription: T.nilable(Orb::SubscriptionMinified::OrHash), + subtotal: String, + sync_failed_at: T.nilable(Time), + total: String, + voided_at: T.nilable(Time), + will_auto_issue: T::Boolean + ).returns(T.attached_class) + end + def self.new( + id:, + # This is the final amount required to be charged to the customer and reflects the + # application of the customer balance to the `total` of the invoice. + amount_due:, + auto_collection:, + billing_address:, + # The creation time of the resource in Orb. + created_at:, + # A list of credit notes associated with the invoice + credit_notes:, + # An ISO 4217 currency string or `credits` + currency:, + customer:, + customer_balance_transactions:, + # Tax IDs are commonly required to be displayed on customer invoices, which are + # added to the headers of invoices. + # + # ### Supported Tax ID Countries and Types + # + # | Country | Type | Description | + # | ---------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + # | Albania | `al_tin` | Albania Tax Identification Number | + # | Andorra | `ad_nrt` | Andorran NRT Number | + # | Angola | `ao_tin` | Angola Tax Identification Number | + # | Argentina | `ar_cuit` | Argentinian Tax ID Number | + # | Armenia | `am_tin` | Armenia Tax Identification Number | + # | Aruba | `aw_tin` | Aruba Tax Identification Number | + # | Australia | `au_abn` | Australian Business Number (AU ABN) | + # | Australia | `au_arn` | Australian Taxation Office Reference Number | + # | Austria | `eu_vat` | European VAT Number | + # | Azerbaijan | `az_tin` | Azerbaijan Tax Identification Number | + # | Bahamas | `bs_tin` | Bahamas Tax Identification Number | + # | Bahrain | `bh_vat` | Bahraini VAT Number | + # | Bangladesh | `bd_bin` | Bangladesh Business Identification Number | + # | Barbados | `bb_tin` | Barbados Tax Identification Number | + # | Belarus | `by_tin` | Belarus TIN Number | + # | Belgium | `eu_vat` | European VAT Number | + # | Benin | `bj_ifu` | Benin Tax Identification Number (Identifiant Fiscal Unique) | + # | Bolivia | `bo_tin` | Bolivian Tax ID | + # | Bosnia and Herzegovina | `ba_tin` | Bosnia and Herzegovina Tax Identification Number | + # | Brazil | `br_cnpj` | Brazilian CNPJ Number | + # | Brazil | `br_cpf` | Brazilian CPF Number | + # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + # | Bulgaria | `eu_vat` | European VAT Number | + # | Burkina Faso | `bf_ifu` | Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) | + # | Cambodia | `kh_tin` | Cambodia Tax Identification Number | + # | Cameroon | `cm_niu` | Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) | + # | Canada | `ca_bn` | Canadian BN | + # | Canada | `ca_gst_hst` | Canadian GST/HST Number | + # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + # | Canada | `ca_qst` | Canadian QST Number (Québec) | + # | Cape Verde | `cv_nif` | Cape Verde Tax Identification Number (Número de Identificação Fiscal) | + # | Chile | `cl_tin` | Chilean TIN | + # | China | `cn_tin` | Chinese Tax ID | + # | Colombia | `co_nit` | Colombian NIT Number | + # | Congo-Kinshasa | `cd_nif` | Congo (DR) Tax Identification Number (Número de Identificação Fiscal) | + # | Costa Rica | `cr_tin` | Costa Rican Tax ID | + # | Croatia | `eu_vat` | European VAT Number | + # | Croatia | `hr_oib` | Croatian Personal Identification Number (OIB) | + # | Cyprus | `eu_vat` | European VAT Number | + # | Czech Republic | `eu_vat` | European VAT Number | + # | Denmark | `eu_vat` | European VAT Number | + # | Dominican Republic | `do_rcn` | Dominican RCN Number | + # | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + # | Egypt | `eg_tin` | Egyptian Tax Identification Number | + # | El Salvador | `sv_nit` | El Salvadorian NIT Number | + # | Estonia | `eu_vat` | European VAT Number | + # | Ethiopia | `et_tin` | Ethiopia Tax Identification Number | + # | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + # | Finland | `eu_vat` | European VAT Number | + # | France | `eu_vat` | European VAT Number | + # | Georgia | `ge_vat` | Georgian VAT | + # | Germany | `de_stn` | German Tax Number (Steuernummer) | + # | Germany | `eu_vat` | European VAT Number | + # | Greece | `eu_vat` | European VAT Number | + # | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) | + # | Hong Kong | `hk_br` | Hong Kong BR Number | + # | Hungary | `eu_vat` | European VAT Number | + # | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + # | Iceland | `is_vat` | Icelandic VAT | + # | India | `in_gst` | Indian GST Number | + # | Indonesia | `id_npwp` | Indonesian NPWP Number | + # | Ireland | `eu_vat` | European VAT Number | + # | Israel | `il_vat` | Israel VAT | + # | Italy | `eu_vat` | European VAT Number | + # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + # | Kyrgyzstan | `kg_tin` | Kyrgyzstan Tax Identification Number | + # | Laos | `la_tin` | Laos Tax Identification Number | + # | Latvia | `eu_vat` | European VAT Number | + # | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + # | Liechtenstein | `li_vat` | Liechtenstein VAT Number | + # | Lithuania | `eu_vat` | European VAT Number | + # | Luxembourg | `eu_vat` | European VAT Number | + # | Malaysia | `my_frp` | Malaysian FRP Number | + # | Malaysia | `my_itn` | Malaysian ITN | + # | Malaysia | `my_sst` | Malaysian SST Number | + # | Malta | `eu_vat` | European VAT Number | + # | Mauritania | `mr_nif` | Mauritania Tax Identification Number (Número de Identificação Fiscal) | + # | Mexico | `mx_rfc` | Mexican RFC Number | + # | Moldova | `md_vat` | Moldova VAT Number | + # | Montenegro | `me_pib` | Montenegro PIB Number | + # | Morocco | `ma_vat` | Morocco VAT Number | + # | Nepal | `np_pan` | Nepal PAN Number | + # | Netherlands | `eu_vat` | European VAT Number | + # | New Zealand | `nz_gst` | New Zealand GST Number | + # | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + # | North Macedonia | `mk_vat` | North Macedonia VAT Number | + # | Northern Ireland | `eu_vat` | Northern Ireland VAT Number | + # | Norway | `no_vat` | Norwegian VAT Number | + # | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + # | Oman | `om_vat` | Omani VAT Number | + # | Peru | `pe_ruc` | Peruvian RUC Number | + # | Philippines | `ph_tin` | Philippines Tax Identification Number | + # | Poland | `eu_vat` | European VAT Number | + # | Portugal | `eu_vat` | European VAT Number | + # | Romania | `eu_vat` | European VAT Number | + # | Romania | `ro_tin` | Romanian Tax ID Number | + # | Russia | `ru_inn` | Russian INN | + # | Russia | `ru_kpp` | Russian KPP | + # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + # | Senegal | `sn_ninea` | Senegal NINEA Number | + # | Serbia | `rs_pib` | Serbian PIB Number | + # | Singapore | `sg_gst` | Singaporean GST | + # | Singapore | `sg_uen` | Singaporean UEN | + # | Slovakia | `eu_vat` | European VAT Number | + # | Slovenia | `eu_vat` | European VAT Number | + # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + # | South Africa | `za_vat` | South African VAT Number | + # | South Korea | `kr_brn` | Korean BRN | + # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + # | Spain | `eu_vat` | European VAT Number | + # | Suriname | `sr_fin` | Suriname FIN Number | + # | Sweden | `eu_vat` | European VAT Number | + # | Switzerland | `ch_uid` | Switzerland UID Number | + # | Switzerland | `ch_vat` | Switzerland VAT Number | + # | Taiwan | `tw_vat` | Taiwanese VAT | + # | Tajikistan | `tj_tin` | Tajikistan Tax Identification Number | + # | Tanzania | `tz_vat` | Tanzania VAT Number | + # | Thailand | `th_vat` | Thai VAT | + # | Turkey | `tr_tin` | Turkish Tax Identification Number | + # | Uganda | `ug_tin` | Uganda Tax Identification Number | + # | Ukraine | `ua_vat` | Ukrainian VAT | + # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + # | United Kingdom | `gb_vat` | United Kingdom VAT Number | + # | United States | `us_ein` | United States EIN | + # | Uruguay | `uy_ruc` | Uruguayan RUC Number | + # | Uzbekistan | `uz_tin` | Uzbekistan TIN Number | + # | Uzbekistan | `uz_vat` | Uzbekistan VAT Number | + # | Venezuela | `ve_rif` | Venezuelan RIF Number | + # | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + # | Zambia | `zm_tin` | Zambia Tax Identification Number | + # | Zimbabwe | `zw_tin` | Zimbabwe Tax Identification Number | + customer_tax_id:, + # This field is deprecated in favor of `discounts`. If a `discounts` list is + # provided, the first discount in the list will be returned. If the list is empty, + # `None` will be returned. + discount:, + discounts:, + # When the invoice payment is due. The due date is null if the invoice is not yet + # finalized. + due_date:, + # If the invoice has a status of `draft`, this will be the time that the invoice + # will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is + # true, the invoice will automatically begin issuing at this time. + eligible_to_issue_at:, + # A URL for the customer-facing invoice portal. This URL expires 30 days after the + # invoice's due date, or 60 days after being re-generated through the UI. + hosted_invoice_url:, + # The scheduled date of the invoice + invoice_date:, + # Automatically generated invoice number to help track and reconcile invoices. + # Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per + # account or customer. + invoice_number:, + # The link to download the PDF representation of the `Invoice`. + invoice_pdf:, + invoice_source:, + # True if the invoice has only in-advance fixed fees and is payable now + is_payable_now:, + # If the invoice failed to issue, this will be the last time it failed to issue + # (even if it is now in a different state.) + issue_failed_at:, + # If the invoice has been issued, this will be the time it transitioned to + # `issued` (even if it is now in a different state.) + issued_at:, + # The breakdown of prices in this invoice. + line_items:, + maximum:, + maximum_amount:, + # Free-form text which is available on the invoice PDF and the Orb invoice portal. + memo:, + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + metadata:, + minimum:, + minimum_amount:, + # If the invoice has a status of `paid`, this gives a timestamp when the invoice + # was paid. + paid_at:, + # A list of payment attempts associated with the invoice + payment_attempts:, + # If payment was attempted on this invoice but failed, this will be the time of + # the most recent attempt. + payment_failed_at:, + # If payment was attempted on this invoice, this will be the start time of the + # most recent attempt. This field is especially useful for delayed-notification + # payment mechanisms (like bank transfers), where payment can take 3 days or more. + payment_started_at:, + # If the invoice is in draft, this timestamp will reflect when the invoice is + # scheduled to be issued. + scheduled_issue_at:, + shipping_address:, + status:, + subscription:, + # The total before any discounts and minimums are applied. + subtotal:, + # If the invoice failed to sync, this will be the last time an external invoicing + # provider sync was attempted. This field will always be `null` for invoices using + # Orb Invoicing. + sync_failed_at:, + # The total after any minimums and discounts have been applied. + total:, + # If the invoice has a status of `void`, this gives a timestamp when the invoice + # was voided. + voided_at:, + # This is true if the invoice will be automatically issued in the future, and + # false otherwise. + will_auto_issue: + ) + end + + sig do + override.returns( + { + id: String, + amount_due: String, + auto_collection: + Orb::ChangedSubscriptionResources::CreatedInvoice::AutoCollection, + billing_address: T.nilable(Orb::Address), + created_at: Time, + credit_notes: + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::CreditNote + ], + currency: String, + customer: Orb::CustomerMinified, + customer_balance_transactions: + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction + ], + customer_tax_id: T.nilable(Orb::CustomerTaxID), + discount: T.anything, + discounts: T::Array[Orb::InvoiceLevelDiscount::Variants], + due_date: T.nilable(Time), + eligible_to_issue_at: T.nilable(Time), + hosted_invoice_url: T.nilable(String), + invoice_date: Time, + invoice_number: String, + invoice_pdf: T.nilable(String), + invoice_source: + Orb::ChangedSubscriptionResources::CreatedInvoice::InvoiceSource::TaggedSymbol, + is_payable_now: T::Boolean, + issue_failed_at: T.nilable(Time), + issued_at: T.nilable(Time), + line_items: + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem + ], + maximum: T.nilable(Orb::Maximum), + maximum_amount: T.nilable(String), + memo: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Minimum), + minimum_amount: T.nilable(String), + paid_at: T.nilable(Time), + payment_attempts: + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt + ], + payment_failed_at: T.nilable(Time), + payment_started_at: T.nilable(Time), + scheduled_issue_at: T.nilable(Time), + shipping_address: T.nilable(Orb::Address), + status: + Orb::ChangedSubscriptionResources::CreatedInvoice::Status::TaggedSymbol, + subscription: T.nilable(Orb::SubscriptionMinified), + subtotal: String, + sync_failed_at: T.nilable(Time), + total: String, + voided_at: T.nilable(Time), + will_auto_issue: T::Boolean + } + ) + end + def to_hash + end + + class AutoCollection < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::ChangedSubscriptionResources::CreatedInvoice::AutoCollection, + Orb::Internal::AnyHash + ) + end + + # True only if auto-collection is enabled for this invoice. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :enabled + + # If the invoice is scheduled for auto-collection, this field will reflect when + # the next attempt will occur. If dunning has been exhausted, or auto-collection + # is not enabled for this invoice, this field will be `null`. + sig { returns(T.nilable(Time)) } + attr_accessor :next_attempt_at + + # Number of auto-collection payment attempts. + sig { returns(T.nilable(Integer)) } + attr_accessor :num_attempts + + # If Orb has ever attempted payment auto-collection for this invoice, this field + # will reflect when that attempt occurred. In conjunction with `next_attempt_at`, + # this can be used to tell whether the invoice is currently in dunning (that is, + # `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or + # if dunning has been exhausted (`previously_attempted_at` is non-null, but + # `next_attempt_time` is null). + sig { returns(T.nilable(Time)) } + attr_accessor :previously_attempted_at + + sig do + params( + enabled: T.nilable(T::Boolean), + next_attempt_at: T.nilable(Time), + num_attempts: T.nilable(Integer), + previously_attempted_at: T.nilable(Time) + ).returns(T.attached_class) + end + def self.new( + # True only if auto-collection is enabled for this invoice. + enabled:, + # If the invoice is scheduled for auto-collection, this field will reflect when + # the next attempt will occur. If dunning has been exhausted, or auto-collection + # is not enabled for this invoice, this field will be `null`. + next_attempt_at:, + # Number of auto-collection payment attempts. + num_attempts:, + # If Orb has ever attempted payment auto-collection for this invoice, this field + # will reflect when that attempt occurred. In conjunction with `next_attempt_at`, + # this can be used to tell whether the invoice is currently in dunning (that is, + # `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or + # if dunning has been exhausted (`previously_attempted_at` is non-null, but + # `next_attempt_time` is null). + previously_attempted_at: + ) + end + + sig do + override.returns( + { + enabled: T.nilable(T::Boolean), + next_attempt_at: T.nilable(Time), + num_attempts: T.nilable(Integer), + previously_attempted_at: T.nilable(Time) + } + ) + end + def to_hash + end + end + + class CreditNote < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::ChangedSubscriptionResources::CreatedInvoice::CreditNote, + Orb::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :credit_note_number + + # An optional memo supplied on the credit note. + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig { returns(String) } + attr_accessor :reason + + sig { returns(String) } + attr_accessor :total + + sig { returns(String) } + attr_accessor :type + + # If the credit note has a status of `void`, this gives a timestamp when the + # credit note was voided. + sig { returns(T.nilable(Time)) } + attr_accessor :voided_at + + sig do + params( + id: String, + credit_note_number: String, + memo: T.nilable(String), + reason: String, + total: String, + type: String, + voided_at: T.nilable(Time) + ).returns(T.attached_class) + end + def self.new( + id:, + credit_note_number:, + # An optional memo supplied on the credit note. + memo:, + reason:, + total:, + type:, + # If the credit note has a status of `void`, this gives a timestamp when the + # credit note was voided. + voided_at: + ) + end + + sig do + override.returns( + { + id: String, + credit_note_number: String, + memo: T.nilable(String), + reason: String, + total: String, + type: String, + voided_at: T.nilable(Time) + } + ) + end + def to_hash + end + end + + class CustomerBalanceTransaction < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction, + Orb::Internal::AnyHash + ) + end + + # A unique id for this transaction. + sig { returns(String) } + attr_accessor :id + + sig do + returns( + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Action::TaggedSymbol + ) + end + attr_accessor :action + + # The value of the amount changed in the transaction. + sig { returns(String) } + attr_accessor :amount + + # The creation time of this transaction. + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::CreditNoteTiny)) } + attr_reader :credit_note + + sig do + params(credit_note: T.nilable(Orb::CreditNoteTiny::OrHash)).void + end + attr_writer :credit_note + + # An optional description provided for manual customer balance adjustments. + sig { returns(T.nilable(String)) } + attr_accessor :description + + # The new value of the customer's balance prior to the transaction, in the + # customer's currency. + sig { returns(String) } + attr_accessor :ending_balance + + sig { returns(T.nilable(Orb::InvoiceTiny)) } + attr_reader :invoice + + sig { params(invoice: T.nilable(Orb::InvoiceTiny::OrHash)).void } + attr_writer :invoice + + # The original value of the customer's balance prior to the transaction, in the + # customer's currency. + sig { returns(String) } + attr_accessor :starting_balance + + sig do + returns( + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig do + params( + id: String, + action: + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Action::OrSymbol, + amount: String, + created_at: Time, + credit_note: T.nilable(Orb::CreditNoteTiny::OrHash), + description: T.nilable(String), + ending_balance: String, + invoice: T.nilable(Orb::InvoiceTiny::OrHash), + starting_balance: String, + type: + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # A unique id for this transaction. + id:, + action:, + # The value of the amount changed in the transaction. + amount:, + # The creation time of this transaction. + created_at:, + credit_note:, + # An optional description provided for manual customer balance adjustments. + description:, + # The new value of the customer's balance prior to the transaction, in the + # customer's currency. + ending_balance:, + invoice:, + # The original value of the customer's balance prior to the transaction, in the + # customer's currency. + starting_balance:, + type: + ) + end + + sig do + override.returns( + { + id: String, + action: + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Action::TaggedSymbol, + amount: String, + created_at: Time, + credit_note: T.nilable(Orb::CreditNoteTiny), + description: T.nilable(String), + ending_balance: String, + invoice: T.nilable(Orb::InvoiceTiny), + starting_balance: String, + type: + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Action + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPLIED_TO_INVOICE = + T.let( + :applied_to_invoice, + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Action::TaggedSymbol + ) + MANUAL_ADJUSTMENT = + T.let( + :manual_adjustment, + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Action::TaggedSymbol + ) + PRORATED_REFUND = + T.let( + :prorated_refund, + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Action::TaggedSymbol + ) + REVERT_PRORATED_REFUND = + T.let( + :revert_prorated_refund, + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Action::TaggedSymbol + ) + RETURN_FROM_VOIDING = + T.let( + :return_from_voiding, + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Action::TaggedSymbol + ) + CREDIT_NOTE_APPLIED = + T.let( + :credit_note_applied, + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Action::TaggedSymbol + ) + CREDIT_NOTE_VOIDED = + T.let( + :credit_note_voided, + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Action::TaggedSymbol + ) + OVERPAYMENT_REFUND = + T.let( + :overpayment_refund, + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Action::TaggedSymbol + ) + EXTERNAL_PAYMENT = + T.let( + :external_payment, + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Action::TaggedSymbol + ) + SMALL_INVOICE_CARRYOVER = + T.let( + :small_invoice_carryover, + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Type + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCREMENT = + T.let( + :increment, + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Type::TaggedSymbol + ) + DECREMENT = + T.let( + :decrement, + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module InvoiceSource + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::ChangedSubscriptionResources::CreatedInvoice::InvoiceSource + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SUBSCRIPTION = + T.let( + :subscription, + Orb::ChangedSubscriptionResources::CreatedInvoice::InvoiceSource::TaggedSymbol + ) + PARTIAL = + T.let( + :partial, + Orb::ChangedSubscriptionResources::CreatedInvoice::InvoiceSource::TaggedSymbol + ) + ONE_OFF = + T.let( + :one_off, + Orb::ChangedSubscriptionResources::CreatedInvoice::InvoiceSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::InvoiceSource::TaggedSymbol + ] + ) + end + def self.values + end + end + + class LineItem < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem, + Orb::Internal::AnyHash + ) + end + + # A unique ID for this line item. + sig { returns(String) } + attr_accessor :id + + # The line amount after any adjustments and before overage conversion, credits and + # partial invoicing. + sig { returns(String) } + attr_accessor :adjusted_subtotal + + # All adjustments applied to the line item in the order they were applied based on + # invoice calculations (ie. usage discounts -> amount discounts -> percentage + # discounts -> minimums -> maximums). + sig do + returns( + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::Variants + ] + ) + end + attr_accessor :adjustments + + # The final amount for a line item after all adjustments and pre paid credits have + # been applied. + sig { returns(String) } + attr_accessor :amount + + # The number of prepaid credits applied. + sig { returns(String) } + attr_accessor :credits_applied + + # This field is deprecated in favor of `adjustments` + sig { returns(T.nilable(Orb::Discount::Variants)) } + attr_accessor :discount + + # The end date of the range of time applied for this line item's price. + sig { returns(Time) } + attr_accessor :end_date + + # An additional filter that was used to calculate the usage for this line item. + sig { returns(T.nilable(String)) } + attr_accessor :filter + + # [DEPRECATED] For configured prices that are split by a grouping key, this will + # be populated with the key and a value. The `amount` and `subtotal` will be the + # values for this particular grouping. + sig { returns(T.nilable(String)) } + attr_accessor :grouping + + # This field is deprecated in favor of `adjustments`. + sig { returns(T.nilable(Orb::Maximum)) } + attr_reader :maximum + + sig { params(maximum: T.nilable(Orb::Maximum::OrHash)).void } + attr_writer :maximum + + # This field is deprecated in favor of `adjustments`. + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + # This field is deprecated in favor of `adjustments`. + sig { returns(T.nilable(Orb::Minimum)) } + attr_reader :minimum + + sig { params(minimum: T.nilable(Orb::Minimum::OrHash)).void } + attr_writer :minimum + + # This field is deprecated in favor of `adjustments`. + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + # The name of the price associated with this line item. + sig { returns(String) } + attr_accessor :name + + # Any amount applied from a partial invoice + sig { returns(String) } + attr_accessor :partially_invoiced_amount + + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + sig { returns(Orb::Price::Variants) } + attr_accessor :price + + # Either the fixed fee quantity or the usage during the service period. + sig { returns(Float) } + attr_accessor :quantity + + # The start date of the range of time applied for this line item's price. + sig { returns(Time) } + attr_accessor :start_date + + # For complex pricing structures, the line item can be broken down further in + # `sub_line_items`. + sig do + returns( + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem::SubLineItem::Variants + ] + ) + end + attr_accessor :sub_line_items + + # The line amount before any adjustments. + sig { returns(String) } + attr_accessor :subtotal + + # An array of tax rates and their incurred tax amounts. Empty if no tax + # integration is configured. + sig { returns(T::Array[Orb::TaxAmount]) } + attr_accessor :tax_amounts + + # A list of customer ids that were used to calculate the usage for this line item. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :usage_customer_ids + + sig do + params( + id: String, + adjusted_subtotal: String, + adjustments: + T::Array[ + T.any( + Orb::MonetaryUsageDiscountAdjustment::OrHash, + Orb::MonetaryAmountDiscountAdjustment::OrHash, + Orb::MonetaryPercentageDiscountAdjustment::OrHash, + Orb::MonetaryMinimumAdjustment::OrHash, + Orb::MonetaryMaximumAdjustment::OrHash + ) + ], + amount: String, + credits_applied: String, + discount: + T.nilable( + T.any( + Orb::PercentageDiscount::OrHash, + Orb::TrialDiscount::OrHash, + Orb::UsageDiscount::OrHash, + Orb::AmountDiscount::OrHash + ) + ), + end_date: Time, + filter: T.nilable(String), + grouping: T.nilable(String), + maximum: T.nilable(Orb::Maximum::OrHash), + maximum_amount: T.nilable(String), + minimum: T.nilable(Orb::Minimum::OrHash), + minimum_amount: T.nilable(String), + name: String, + partially_invoiced_amount: String, + price: + T.any( + Orb::Price::Unit::OrHash, + Orb::Price::Tiered::OrHash, + Orb::Price::Bulk::OrHash, + Orb::Price::Package::OrHash, + Orb::Price::Matrix::OrHash, + Orb::Price::ThresholdTotalAmount::OrHash, + Orb::Price::TieredPackage::OrHash, + Orb::Price::TieredWithMinimum::OrHash, + Orb::Price::GroupedTiered::OrHash, + Orb::Price::TieredPackageWithMinimum::OrHash, + Orb::Price::PackageWithAllocation::OrHash, + Orb::Price::UnitWithPercent::OrHash, + Orb::Price::MatrixWithAllocation::OrHash, + Orb::Price::TieredWithProration::OrHash, + Orb::Price::UnitWithProration::OrHash, + Orb::Price::GroupedAllocation::OrHash, + Orb::Price::BulkWithProration::OrHash, + Orb::Price::GroupedWithProratedMinimum::OrHash, + Orb::Price::GroupedWithMeteredMinimum::OrHash, + Orb::Price::GroupedWithMinMaxThresholds::OrHash, + Orb::Price::MatrixWithDisplayName::OrHash, + Orb::Price::GroupedTieredPackage::OrHash, + Orb::Price::MaxGroupTieredPackage::OrHash, + Orb::Price::ScalableMatrixWithUnitPricing::OrHash, + Orb::Price::ScalableMatrixWithTieredPricing::OrHash, + Orb::Price::CumulativeGroupedBulk::OrHash, + Orb::Price::Minimum::OrHash, + Orb::Price::Percent::OrHash, + Orb::Price::EventOutput::OrHash + ), + quantity: Float, + start_date: Time, + sub_line_items: + T::Array[ + T.any( + Orb::MatrixSubLineItem::OrHash, + Orb::TierSubLineItem::OrHash, + Orb::OtherSubLineItem::OrHash + ) + ], + subtotal: String, + tax_amounts: T::Array[Orb::TaxAmount::OrHash], + usage_customer_ids: T.nilable(T::Array[String]) + ).returns(T.attached_class) + end + def self.new( + # A unique ID for this line item. + id:, + # The line amount after any adjustments and before overage conversion, credits and + # partial invoicing. + adjusted_subtotal:, + # All adjustments applied to the line item in the order they were applied based on + # invoice calculations (ie. usage discounts -> amount discounts -> percentage + # discounts -> minimums -> maximums). + adjustments:, + # The final amount for a line item after all adjustments and pre paid credits have + # been applied. + amount:, + # The number of prepaid credits applied. + credits_applied:, + # This field is deprecated in favor of `adjustments` + discount:, + # The end date of the range of time applied for this line item's price. + end_date:, + # An additional filter that was used to calculate the usage for this line item. + filter:, + # [DEPRECATED] For configured prices that are split by a grouping key, this will + # be populated with the key and a value. The `amount` and `subtotal` will be the + # values for this particular grouping. + grouping:, + # This field is deprecated in favor of `adjustments`. + maximum:, + # This field is deprecated in favor of `adjustments`. + maximum_amount:, + # This field is deprecated in favor of `adjustments`. + minimum:, + # This field is deprecated in favor of `adjustments`. + minimum_amount:, + # The name of the price associated with this line item. + name:, + # Any amount applied from a partial invoice + partially_invoiced_amount:, + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + price:, + # Either the fixed fee quantity or the usage during the service period. + quantity:, + # The start date of the range of time applied for this line item's price. + start_date:, + # For complex pricing structures, the line item can be broken down further in + # `sub_line_items`. + sub_line_items:, + # The line amount before any adjustments. + subtotal:, + # An array of tax rates and their incurred tax amounts. Empty if no tax + # integration is configured. + tax_amounts:, + # A list of customer ids that were used to calculate the usage for this line item. + usage_customer_ids: + ) + end + + sig do + override.returns( + { + id: String, + adjusted_subtotal: String, + adjustments: + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::Variants + ], + amount: String, + credits_applied: String, + discount: T.nilable(Orb::Discount::Variants), + end_date: Time, + filter: T.nilable(String), + grouping: T.nilable(String), + maximum: T.nilable(Orb::Maximum), + maximum_amount: T.nilable(String), + minimum: T.nilable(Orb::Minimum), + minimum_amount: T.nilable(String), + name: String, + partially_invoiced_amount: String, + price: Orb::Price::Variants, + quantity: Float, + start_date: Time, + sub_line_items: + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem::SubLineItem::Variants + ], + subtotal: String, + tax_amounts: T::Array[Orb::TaxAmount], + usage_customer_ids: T.nilable(T::Array[String]) + } + ) + end + def to_hash + end + + module Adjustment + extend Orb::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Orb::MonetaryUsageDiscountAdjustment, + Orb::MonetaryAmountDiscountAdjustment, + Orb::MonetaryPercentageDiscountAdjustment, + Orb::MonetaryMinimumAdjustment, + Orb::MonetaryMaximumAdjustment + ) + end + + sig do + override.returns( + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem::Adjustment::Variants + ] + ) + end + def self.variants + end + end + + module SubLineItem + extend Orb::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Orb::MatrixSubLineItem, + Orb::TierSubLineItem, + Orb::OtherSubLineItem + ) + end + + sig do + override.returns( + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem::SubLineItem::Variants + ] + ) + end + def self.variants + end + end + end + + class PaymentAttempt < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt, + Orb::Internal::AnyHash + ) + end + + # The ID of the payment attempt. + sig { returns(String) } + attr_accessor :id + + # The amount of the payment attempt. + sig { returns(String) } + attr_accessor :amount + + # The time at which the payment attempt was created. + sig { returns(Time) } + attr_accessor :created_at + + # The payment provider that attempted to collect the payment. + sig do + returns( + T.nilable( + Orb::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt::PaymentProvider::TaggedSymbol + ) + ) + end + attr_accessor :payment_provider + + # The ID of the payment attempt in the payment provider. + sig { returns(T.nilable(String)) } + attr_accessor :payment_provider_id + + # URL to the downloadable PDF version of the receipt. This field will be `null` + # for payment attempts that did not succeed. + sig { returns(T.nilable(String)) } + attr_accessor :receipt_pdf + + # Whether the payment attempt succeeded. + sig { returns(T::Boolean) } + attr_accessor :succeeded + + sig do + params( + id: String, + amount: String, + created_at: Time, + payment_provider: + T.nilable( + Orb::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt::PaymentProvider::OrSymbol + ), + payment_provider_id: T.nilable(String), + receipt_pdf: T.nilable(String), + succeeded: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # The ID of the payment attempt. + id:, + # The amount of the payment attempt. + amount:, + # The time at which the payment attempt was created. + created_at:, + # The payment provider that attempted to collect the payment. + payment_provider:, + # The ID of the payment attempt in the payment provider. + payment_provider_id:, + # URL to the downloadable PDF version of the receipt. This field will be `null` + # for payment attempts that did not succeed. + receipt_pdf:, + # Whether the payment attempt succeeded. + succeeded: + ) + end + + sig do + override.returns( + { + id: String, + amount: String, + created_at: Time, + payment_provider: + T.nilable( + Orb::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt::PaymentProvider::TaggedSymbol + ), + payment_provider_id: T.nilable(String), + receipt_pdf: T.nilable(String), + succeeded: T::Boolean + } + ) + end + def to_hash + end + + # The payment provider that attempted to collect the payment. + module PaymentProvider + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt::PaymentProvider + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + STRIPE = + T.let( + :stripe, + Orb::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt::PaymentProvider::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt::PaymentProvider::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::ChangedSubscriptionResources::CreatedInvoice::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ISSUED = + T.let( + :issued, + Orb::ChangedSubscriptionResources::CreatedInvoice::Status::TaggedSymbol + ) + PAID = + T.let( + :paid, + Orb::ChangedSubscriptionResources::CreatedInvoice::Status::TaggedSymbol + ) + SYNCED = + T.let( + :synced, + Orb::ChangedSubscriptionResources::CreatedInvoice::Status::TaggedSymbol + ) + VOID = + T.let( + :void, + Orb::ChangedSubscriptionResources::CreatedInvoice::Status::TaggedSymbol + ) + DRAFT = + T.let( + :draft, + Orb::ChangedSubscriptionResources::CreatedInvoice::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::ChangedSubscriptionResources::CreatedInvoice::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/orb/models/customer.rbi b/rbi/orb/models/customer.rbi index 5387981f..9432c5a6 100644 --- a/rbi/orb/models/customer.rbi +++ b/rbi/orb/models/customer.rbi @@ -14,6 +14,12 @@ module Orb sig { returns(T::Boolean) } attr_accessor :auto_collection + # Whether invoices for this customer should be automatically issued. If true, + # invoices will be automatically issued. If false, invoices will require manual + # approval. If null, inherits the account-level setting. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_issuance + # The customer's current balance in their currency. sig { returns(String) } attr_accessor :balance @@ -287,6 +293,7 @@ module Orb id: String, additional_emails: T::Array[String], auto_collection: T::Boolean, + auto_issuance: T.nilable(T::Boolean), balance: String, billing_address: T.nilable(Orb::Address::OrHash), created_at: Time, @@ -314,6 +321,10 @@ module Orb id:, additional_emails:, auto_collection:, + # Whether invoices for this customer should be automatically issued. If true, + # invoices will be automatically issued. If false, invoices will require manual + # approval. If null, inherits the account-level setting. + auto_issuance:, # The customer's current balance in their currency. balance:, billing_address:, @@ -507,6 +518,7 @@ module Orb id: String, additional_emails: T::Array[String], auto_collection: T::Boolean, + auto_issuance: T.nilable(T::Boolean), balance: String, billing_address: T.nilable(Orb::Address), created_at: Time, diff --git a/rbi/orb/models/customer_create_params.rbi b/rbi/orb/models/customer_create_params.rbi index a7f996cd..aa11b5ac 100644 --- a/rbi/orb/models/customer_create_params.rbi +++ b/rbi/orb/models/customer_create_params.rbi @@ -33,7 +33,8 @@ module Orb attr_writer :accounting_sync_configuration # Additional email addresses for this customer. If populated, these email - # addresses will be CC'd for customer communications. + # addresses will be CC'd for customer communications. The total number of email + # addresses (including the primary email) cannot exceed 50. sig { returns(T.nilable(T::Array[String])) } attr_accessor :additional_emails @@ -43,6 +44,13 @@ module Orb sig { returns(T.nilable(T::Boolean)) } attr_accessor :auto_collection + # Used to determine if invoices for this customer will be automatically issued. If + # true, invoices will be automatically issued. If false, invoices will require + # manual approval. If `null` is specified, the customer's auto issuance setting + # will be inherited from the account-level setting. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_issuance + sig { returns(T.nilable(Orb::AddressInput)) } attr_reader :billing_address @@ -116,7 +124,8 @@ module Orb T.any( Orb::NewAvalaraTaxConfiguration, Orb::NewTaxJarConfiguration, - Orb::NewSphereConfiguration + Orb::NewSphereConfiguration, + Orb::CustomerCreateParams::TaxConfiguration::Numeral ) ) ) @@ -287,6 +296,7 @@ module Orb T.nilable(Orb::NewAccountingSyncConfiguration::OrHash), additional_emails: T.nilable(T::Array[String]), auto_collection: T.nilable(T::Boolean), + auto_issuance: T.nilable(T::Boolean), billing_address: T.nilable(Orb::AddressInput::OrHash), currency: T.nilable(String), email_delivery: T.nilable(T::Boolean), @@ -304,7 +314,8 @@ module Orb T.any( Orb::NewAvalaraTaxConfiguration::OrHash, Orb::NewTaxJarConfiguration::OrHash, - Orb::NewSphereConfiguration::OrHash + Orb::NewSphereConfiguration::OrHash, + Orb::CustomerCreateParams::TaxConfiguration::Numeral::OrHash ) ), tax_id: T.nilable(Orb::CustomerTaxID::OrHash), @@ -321,12 +332,18 @@ module Orb name:, accounting_sync_configuration: nil, # Additional email addresses for this customer. If populated, these email - # addresses will be CC'd for customer communications. + # addresses will be CC'd for customer communications. The total number of email + # addresses (including the primary email) cannot exceed 50. additional_emails: nil, # Used to determine if invoices for this customer will automatically attempt to # charge a saved payment method, if available. This parameter defaults to `True` # when a payment provider is provided on customer creation. auto_collection: nil, + # Used to determine if invoices for this customer will be automatically issued. If + # true, invoices will be automatically issued. If false, invoices will require + # manual approval. If `null` is specified, the customer's auto issuance setting + # will be inherited from the account-level setting. + auto_issuance: nil, billing_address: nil, # An ISO 4217 currency string used for the customer's invoices and balance. If not # set at creation time, will be set at subscription creation time. @@ -514,6 +531,7 @@ module Orb T.nilable(Orb::NewAccountingSyncConfiguration), additional_emails: T.nilable(T::Array[String]), auto_collection: T.nilable(T::Boolean), + auto_issuance: T.nilable(T::Boolean), billing_address: T.nilable(Orb::AddressInput), currency: T.nilable(String), email_delivery: T.nilable(T::Boolean), @@ -530,7 +548,8 @@ module Orb T.any( Orb::NewAvalaraTaxConfiguration, Orb::NewTaxJarConfiguration, - Orb::NewSphereConfiguration + Orb::NewSphereConfiguration, + Orb::CustomerCreateParams::TaxConfiguration::Numeral ) ), tax_id: T.nilable(Orb::CustomerTaxID), @@ -597,10 +616,41 @@ module Orb T.any( Orb::NewAvalaraTaxConfiguration, Orb::NewTaxJarConfiguration, - Orb::NewSphereConfiguration + Orb::NewSphereConfiguration, + Orb::CustomerCreateParams::TaxConfiguration::Numeral ) end + class Numeral < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::CustomerCreateParams::TaxConfiguration::Numeral, + Orb::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :tax_exempt + + sig { returns(Symbol) } + attr_accessor :tax_provider + + sig do + params(tax_exempt: T::Boolean, tax_provider: Symbol).returns( + T.attached_class + ) + end + def self.new(tax_exempt:, tax_provider: :numeral) + end + + sig do + override.returns({ tax_exempt: T::Boolean, tax_provider: Symbol }) + end + def to_hash + end + end + sig do override.returns( T::Array[Orb::CustomerCreateParams::TaxConfiguration::Variants] diff --git a/rbi/orb/models/customer_update_by_external_id_params.rbi b/rbi/orb/models/customer_update_by_external_id_params.rbi index c909ced2..b5183c42 100644 --- a/rbi/orb/models/customer_update_by_external_id_params.rbi +++ b/rbi/orb/models/customer_update_by_external_id_params.rbi @@ -23,7 +23,8 @@ module Orb attr_writer :accounting_sync_configuration # Additional email addresses for this customer. If populated, these email - # addresses will be CC'd for customer communications. + # addresses will be CC'd for customer communications. The total number of email + # addresses (including the primary email) cannot exceed 50. sig { returns(T.nilable(T::Array[String])) } attr_accessor :additional_emails @@ -33,6 +34,13 @@ module Orb sig { returns(T.nilable(T::Boolean)) } attr_accessor :auto_collection + # Used to determine if invoices for this customer will be automatically issued. If + # true, invoices will be automatically issued. If false, invoices will require + # manual approval.If `null` is specified, the customer's auto issuance setting + # will be inherited from the account-level setting. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_issuance + sig { returns(T.nilable(Orb::AddressInput)) } attr_reader :billing_address @@ -124,7 +132,8 @@ module Orb T.any( Orb::NewAvalaraTaxConfiguration, Orb::NewTaxJarConfiguration, - Orb::NewSphereConfiguration + Orb::NewSphereConfiguration, + Orb::CustomerUpdateByExternalIDParams::TaxConfiguration::Numeral ) ) ) @@ -287,6 +296,7 @@ module Orb T.nilable(Orb::NewAccountingSyncConfiguration::OrHash), additional_emails: T.nilable(T::Array[String]), auto_collection: T.nilable(T::Boolean), + auto_issuance: T.nilable(T::Boolean), billing_address: T.nilable(Orb::AddressInput::OrHash), currency: T.nilable(String), email: T.nilable(String), @@ -308,7 +318,8 @@ module Orb T.any( Orb::NewAvalaraTaxConfiguration::OrHash, Orb::NewTaxJarConfiguration::OrHash, - Orb::NewSphereConfiguration::OrHash + Orb::NewSphereConfiguration::OrHash, + Orb::CustomerUpdateByExternalIDParams::TaxConfiguration::Numeral::OrHash ) ), tax_id: T.nilable(Orb::CustomerTaxID::OrHash), @@ -318,12 +329,18 @@ module Orb def self.new( accounting_sync_configuration: nil, # Additional email addresses for this customer. If populated, these email - # addresses will be CC'd for customer communications. + # addresses will be CC'd for customer communications. The total number of email + # addresses (including the primary email) cannot exceed 50. additional_emails: nil, # Used to determine if invoices for this customer will automatically attempt to # charge a saved payment method, if available. This parameter defaults to `True` # when a payment provider is provided on customer creation. auto_collection: nil, + # Used to determine if invoices for this customer will be automatically issued. If + # true, invoices will be automatically issued. If false, invoices will require + # manual approval.If `null` is specified, the customer's auto issuance setting + # will be inherited from the account-level setting. + auto_issuance: nil, billing_address: nil, # An ISO 4217 currency string used for the customer's invoices and balance. If not # set at creation time, will be set at subscription creation time. @@ -515,6 +532,7 @@ module Orb T.nilable(Orb::NewAccountingSyncConfiguration), additional_emails: T.nilable(T::Array[String]), auto_collection: T.nilable(T::Boolean), + auto_issuance: T.nilable(T::Boolean), billing_address: T.nilable(Orb::AddressInput), currency: T.nilable(String), email: T.nilable(String), @@ -535,7 +553,8 @@ module Orb T.any( Orb::NewAvalaraTaxConfiguration, Orb::NewTaxJarConfiguration, - Orb::NewSphereConfiguration + Orb::NewSphereConfiguration, + Orb::CustomerUpdateByExternalIDParams::TaxConfiguration::Numeral ) ), tax_id: T.nilable(Orb::CustomerTaxID), @@ -610,10 +629,41 @@ module Orb T.any( Orb::NewAvalaraTaxConfiguration, Orb::NewTaxJarConfiguration, - Orb::NewSphereConfiguration + Orb::NewSphereConfiguration, + Orb::CustomerUpdateByExternalIDParams::TaxConfiguration::Numeral ) end + class Numeral < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::CustomerUpdateByExternalIDParams::TaxConfiguration::Numeral, + Orb::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :tax_exempt + + sig { returns(Symbol) } + attr_accessor :tax_provider + + sig do + params(tax_exempt: T::Boolean, tax_provider: Symbol).returns( + T.attached_class + ) + end + def self.new(tax_exempt:, tax_provider: :numeral) + end + + sig do + override.returns({ tax_exempt: T::Boolean, tax_provider: Symbol }) + end + def to_hash + end + end + sig do override.returns( T::Array[ diff --git a/rbi/orb/models/customer_update_params.rbi b/rbi/orb/models/customer_update_params.rbi index eead558d..303b9297 100644 --- a/rbi/orb/models/customer_update_params.rbi +++ b/rbi/orb/models/customer_update_params.rbi @@ -23,7 +23,8 @@ module Orb attr_writer :accounting_sync_configuration # Additional email addresses for this customer. If populated, these email - # addresses will be CC'd for customer communications. + # addresses will be CC'd for customer communications. The total number of email + # addresses (including the primary email) cannot exceed 50. sig { returns(T.nilable(T::Array[String])) } attr_accessor :additional_emails @@ -33,6 +34,13 @@ module Orb sig { returns(T.nilable(T::Boolean)) } attr_accessor :auto_collection + # Used to determine if invoices for this customer will be automatically issued. If + # true, invoices will be automatically issued. If false, invoices will require + # manual approval.If `null` is specified, the customer's auto issuance setting + # will be inherited from the account-level setting. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_issuance + sig { returns(T.nilable(Orb::AddressInput)) } attr_reader :billing_address @@ -120,7 +128,8 @@ module Orb T.any( Orb::NewAvalaraTaxConfiguration, Orb::NewTaxJarConfiguration, - Orb::NewSphereConfiguration + Orb::NewSphereConfiguration, + Orb::CustomerUpdateParams::TaxConfiguration::Numeral ) ) ) @@ -283,6 +292,7 @@ module Orb T.nilable(Orb::NewAccountingSyncConfiguration::OrHash), additional_emails: T.nilable(T::Array[String]), auto_collection: T.nilable(T::Boolean), + auto_issuance: T.nilable(T::Boolean), billing_address: T.nilable(Orb::AddressInput::OrHash), currency: T.nilable(String), email: T.nilable(String), @@ -302,7 +312,8 @@ module Orb T.any( Orb::NewAvalaraTaxConfiguration::OrHash, Orb::NewTaxJarConfiguration::OrHash, - Orb::NewSphereConfiguration::OrHash + Orb::NewSphereConfiguration::OrHash, + Orb::CustomerUpdateParams::TaxConfiguration::Numeral::OrHash ) ), tax_id: T.nilable(Orb::CustomerTaxID::OrHash), @@ -312,12 +323,18 @@ module Orb def self.new( accounting_sync_configuration: nil, # Additional email addresses for this customer. If populated, these email - # addresses will be CC'd for customer communications. + # addresses will be CC'd for customer communications. The total number of email + # addresses (including the primary email) cannot exceed 50. additional_emails: nil, # Used to determine if invoices for this customer will automatically attempt to # charge a saved payment method, if available. This parameter defaults to `True` # when a payment provider is provided on customer creation. auto_collection: nil, + # Used to determine if invoices for this customer will be automatically issued. If + # true, invoices will be automatically issued. If false, invoices will require + # manual approval.If `null` is specified, the customer's auto issuance setting + # will be inherited from the account-level setting. + auto_issuance: nil, billing_address: nil, # An ISO 4217 currency string used for the customer's invoices and balance. If not # set at creation time, will be set at subscription creation time. @@ -509,6 +526,7 @@ module Orb T.nilable(Orb::NewAccountingSyncConfiguration), additional_emails: T.nilable(T::Array[String]), auto_collection: T.nilable(T::Boolean), + auto_issuance: T.nilable(T::Boolean), billing_address: T.nilable(Orb::AddressInput), currency: T.nilable(String), email: T.nilable(String), @@ -527,7 +545,8 @@ module Orb T.any( Orb::NewAvalaraTaxConfiguration, Orb::NewTaxJarConfiguration, - Orb::NewSphereConfiguration + Orb::NewSphereConfiguration, + Orb::CustomerUpdateParams::TaxConfiguration::Numeral ) ), tax_id: T.nilable(Orb::CustomerTaxID), @@ -597,10 +616,41 @@ module Orb T.any( Orb::NewAvalaraTaxConfiguration, Orb::NewTaxJarConfiguration, - Orb::NewSphereConfiguration + Orb::NewSphereConfiguration, + Orb::CustomerUpdateParams::TaxConfiguration::Numeral ) end + class Numeral < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::CustomerUpdateParams::TaxConfiguration::Numeral, + Orb::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :tax_exempt + + sig { returns(Symbol) } + attr_accessor :tax_provider + + sig do + params(tax_exempt: T::Boolean, tax_provider: Symbol).returns( + T.attached_class + ) + end + def self.new(tax_exempt:, tax_provider: :numeral) + end + + sig do + override.returns({ tax_exempt: T::Boolean, tax_provider: Symbol }) + end + def to_hash + end + end + sig do override.returns( T::Array[Orb::CustomerUpdateParams::TaxConfiguration::Variants] diff --git a/rbi/orb/models/customers/balance_transaction_create_response.rbi b/rbi/orb/models/customers/balance_transaction_create_response.rbi index f9b26f55..4f21fcee 100644 --- a/rbi/orb/models/customers/balance_transaction_create_response.rbi +++ b/rbi/orb/models/customers/balance_transaction_create_response.rbi @@ -180,6 +180,11 @@ module Orb :external_payment, Orb::Models::Customers::BalanceTransactionCreateResponse::Action::TaggedSymbol ) + SMALL_INVOICE_CARRYOVER = + T.let( + :small_invoice_carryover, + Orb::Models::Customers::BalanceTransactionCreateResponse::Action::TaggedSymbol + ) sig do override.returns( diff --git a/rbi/orb/models/customers/balance_transaction_list_response.rbi b/rbi/orb/models/customers/balance_transaction_list_response.rbi index 81da95c7..92bfa7ac 100644 --- a/rbi/orb/models/customers/balance_transaction_list_response.rbi +++ b/rbi/orb/models/customers/balance_transaction_list_response.rbi @@ -180,6 +180,11 @@ module Orb :external_payment, Orb::Models::Customers::BalanceTransactionListResponse::Action::TaggedSymbol ) + SMALL_INVOICE_CARRYOVER = + T.let( + :small_invoice_carryover, + Orb::Models::Customers::BalanceTransactionListResponse::Action::TaggedSymbol + ) sig do override.returns( diff --git a/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi b/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi index fdb8e0c7..83001c9d 100644 --- a/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi +++ b/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi @@ -239,12 +239,25 @@ module Orb sig { returns(T::Boolean) } attr_accessor :auto_collection - # The net terms determines the difference between the invoice date and the issue - # date for the invoice. If you intend the invoice to be due on issue, set this - # to 0. + # The net terms determines the due date of the invoice. Due date is calculated + # based on the invoice or issuance date, depending on the account's configured due + # date calculation method. A value of '0' here represents that the invoice is due + # on issue, whereas a value of '30' represents that the customer has 30 days to + # pay the invoice. Do not set this field if you want to set a custom due date. sig { returns(T.nilable(Integer)) } attr_accessor :net_terms + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + sig do + returns( + T.nilable( + Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::CustomDueDate::Variants + ) + ) + end + attr_accessor :custom_due_date + # An ISO 8601 format date that denotes when this invoice should be dated in the # customer's timezone. If not provided, the invoice date will default to the # credit block's effective date. @@ -277,6 +290,10 @@ module Orb params( auto_collection: T::Boolean, net_terms: T.nilable(Integer), + custom_due_date: + T.nilable( + Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::CustomDueDate::Variants + ), invoice_date: T.nilable( Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::InvoiceDate::Variants @@ -289,10 +306,15 @@ module Orb # Whether the credits purchase invoice should auto collect with the customer's # saved payment method. auto_collection:, - # The net terms determines the difference between the invoice date and the issue - # date for the invoice. If you intend the invoice to be due on issue, set this - # to 0. + # The net terms determines the due date of the invoice. Due date is calculated + # based on the invoice or issuance date, depending on the account's configured due + # date calculation method. A value of '0' here represents that the invoice is due + # on issue, whereas a value of '30' represents that the customer has 30 days to + # pay the invoice. Do not set this field if you want to set a custom due date. net_terms:, + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + custom_due_date: nil, # An ISO 8601 format date that denotes when this invoice should be dated in the # customer's timezone. If not provided, the invoice date will default to the # credit block's effective date. @@ -310,6 +332,10 @@ module Orb { auto_collection: T::Boolean, net_terms: T.nilable(Integer), + custom_due_date: + T.nilable( + Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::CustomDueDate::Variants + ), invoice_date: T.nilable( Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::InvoiceDate::Variants @@ -322,6 +348,24 @@ module Orb def to_hash end + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + module CustomDueDate + extend Orb::Internal::Type::Union + + Variants = T.type_alias { T.any(Date, Time) } + + sig do + override.returns( + T::Array[ + Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::CustomDueDate::Variants + ] + ) + end + def self.variants + end + end + # An ISO 8601 format date that denotes when this invoice should be dated in the # customer's timezone. If not provided, the invoice date will default to the # credit block's effective date. diff --git a/rbi/orb/models/customers/credits/ledger_create_entry_params.rbi b/rbi/orb/models/customers/credits/ledger_create_entry_params.rbi index f293dae6..f6c14b4d 100644 --- a/rbi/orb/models/customers/credits/ledger_create_entry_params.rbi +++ b/rbi/orb/models/customers/credits/ledger_create_entry_params.rbi @@ -239,12 +239,25 @@ module Orb sig { returns(T::Boolean) } attr_accessor :auto_collection - # The net terms determines the difference between the invoice date and the issue - # date for the invoice. If you intend the invoice to be due on issue, set this - # to 0. + # The net terms determines the due date of the invoice. Due date is calculated + # based on the invoice or issuance date, depending on the account's configured due + # date calculation method. A value of '0' here represents that the invoice is due + # on issue, whereas a value of '30' represents that the customer has 30 days to + # pay the invoice. Do not set this field if you want to set a custom due date. sig { returns(T.nilable(Integer)) } attr_accessor :net_terms + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + sig do + returns( + T.nilable( + Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::CustomDueDate::Variants + ) + ) + end + attr_accessor :custom_due_date + # An ISO 8601 format date that denotes when this invoice should be dated in the # customer's timezone. If not provided, the invoice date will default to the # credit block's effective date. @@ -277,6 +290,10 @@ module Orb params( auto_collection: T::Boolean, net_terms: T.nilable(Integer), + custom_due_date: + T.nilable( + Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::CustomDueDate::Variants + ), invoice_date: T.nilable( Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::InvoiceDate::Variants @@ -289,10 +306,15 @@ module Orb # Whether the credits purchase invoice should auto collect with the customer's # saved payment method. auto_collection:, - # The net terms determines the difference between the invoice date and the issue - # date for the invoice. If you intend the invoice to be due on issue, set this - # to 0. + # The net terms determines the due date of the invoice. Due date is calculated + # based on the invoice or issuance date, depending on the account's configured due + # date calculation method. A value of '0' here represents that the invoice is due + # on issue, whereas a value of '30' represents that the customer has 30 days to + # pay the invoice. Do not set this field if you want to set a custom due date. net_terms:, + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + custom_due_date: nil, # An ISO 8601 format date that denotes when this invoice should be dated in the # customer's timezone. If not provided, the invoice date will default to the # credit block's effective date. @@ -310,6 +332,10 @@ module Orb { auto_collection: T::Boolean, net_terms: T.nilable(Integer), + custom_due_date: + T.nilable( + Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::CustomDueDate::Variants + ), invoice_date: T.nilable( Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::InvoiceDate::Variants @@ -322,6 +348,24 @@ module Orb def to_hash end + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + module CustomDueDate + extend Orb::Internal::Type::Union + + Variants = T.type_alias { T.any(Date, Time) } + + sig do + override.returns( + T::Array[ + Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::CustomDueDate::Variants + ] + ) + end + def self.variants + end + end + # An ISO 8601 format date that denotes when this invoice should be dated in the # customer's timezone. If not provided, the invoice date will default to the # credit block's effective date. diff --git a/rbi/orb/models/invoice.rbi b/rbi/orb/models/invoice.rbi index d65d788d..eac87c9a 100644 --- a/rbi/orb/models/invoice.rbi +++ b/rbi/orb/models/invoice.rbi @@ -1007,6 +1007,11 @@ module Orb :external_payment, Orb::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol ) + SMALL_INVOICE_CARRYOVER = + T.let( + :small_invoice_carryover, + Orb::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol + ) sig do override.returns( @@ -1172,7 +1177,7 @@ module Orb sig { returns(T::Array[Orb::Invoice::LineItem::SubLineItem::Variants]) } attr_accessor :sub_line_items - # The line amount before before any adjustments. + # The line amount before any adjustments. sig { returns(String) } attr_accessor :subtotal @@ -1222,17 +1227,14 @@ module Orb price: T.any( Orb::Price::Unit::OrHash, - Orb::Price::Package::OrHash, - Orb::Price::Matrix::OrHash, Orb::Price::Tiered::OrHash, - Orb::Price::TieredBPS::OrHash, - Orb::Price::BPS::OrHash, - Orb::Price::BulkBPS::OrHash, Orb::Price::Bulk::OrHash, + Orb::Price::Package::OrHash, + Orb::Price::Matrix::OrHash, Orb::Price::ThresholdTotalAmount::OrHash, Orb::Price::TieredPackage::OrHash, - Orb::Price::GroupedTiered::OrHash, Orb::Price::TieredWithMinimum::OrHash, + Orb::Price::GroupedTiered::OrHash, Orb::Price::TieredPackageWithMinimum::OrHash, Orb::Price::PackageWithAllocation::OrHash, Orb::Price::UnitWithPercent::OrHash, @@ -1240,16 +1242,19 @@ module Orb Orb::Price::TieredWithProration::OrHash, Orb::Price::UnitWithProration::OrHash, Orb::Price::GroupedAllocation::OrHash, + Orb::Price::BulkWithProration::OrHash, Orb::Price::GroupedWithProratedMinimum::OrHash, Orb::Price::GroupedWithMeteredMinimum::OrHash, + Orb::Price::GroupedWithMinMaxThresholds::OrHash, Orb::Price::MatrixWithDisplayName::OrHash, - Orb::Price::BulkWithProration::OrHash, Orb::Price::GroupedTieredPackage::OrHash, Orb::Price::MaxGroupTieredPackage::OrHash, Orb::Price::ScalableMatrixWithUnitPricing::OrHash, Orb::Price::ScalableMatrixWithTieredPricing::OrHash, Orb::Price::CumulativeGroupedBulk::OrHash, - Orb::Price::GroupedWithMinMaxThresholds::OrHash + Orb::Price::Minimum::OrHash, + Orb::Price::Percent::OrHash, + Orb::Price::EventOutput::OrHash ), quantity: Float, start_date: Time, @@ -1321,7 +1326,7 @@ module Orb # For complex pricing structures, the line item can be broken down further in # `sub_line_items`. sub_line_items:, - # The line amount before before any adjustments. + # The line amount before any adjustments. subtotal:, # An array of tax rates and their incurred tax amounts. Empty if no tax # integration is configured. @@ -1441,6 +1446,11 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :payment_provider_id + # URL to the downloadable PDF version of the receipt. This field will be `null` + # for payment attempts that did not succeed. + sig { returns(T.nilable(String)) } + attr_accessor :receipt_pdf + # Whether the payment attempt succeeded. sig { returns(T::Boolean) } attr_accessor :succeeded @@ -1455,6 +1465,7 @@ module Orb Orb::Invoice::PaymentAttempt::PaymentProvider::OrSymbol ), payment_provider_id: T.nilable(String), + receipt_pdf: T.nilable(String), succeeded: T::Boolean ).returns(T.attached_class) end @@ -1469,6 +1480,9 @@ module Orb payment_provider:, # The ID of the payment attempt in the payment provider. payment_provider_id:, + # URL to the downloadable PDF version of the receipt. This field will be `null` + # for payment attempts that did not succeed. + receipt_pdf:, # Whether the payment attempt succeeded. succeeded: ) @@ -1485,6 +1499,7 @@ module Orb Orb::Invoice::PaymentAttempt::PaymentProvider::TaggedSymbol ), payment_provider_id: T.nilable(String), + receipt_pdf: T.nilable(String), succeeded: T::Boolean } ) diff --git a/rbi/orb/models/invoice_create_params.rbi b/rbi/orb/models/invoice_create_params.rbi index 9de3ac5d..dba8e8d7 100644 --- a/rbi/orb/models/invoice_create_params.rbi +++ b/rbi/orb/models/invoice_create_params.rbi @@ -42,12 +42,18 @@ module Orb end attr_accessor :discount + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + sig { returns(T.nilable(Orb::InvoiceCreateParams::DueDate::Variants)) } + attr_accessor :due_date + # The `external_customer_id` of the `Customer` to create this invoice for. One of # `customer_id` and `external_customer_id` are required. sig { returns(T.nilable(String)) } attr_accessor :external_customer_id - # An optional memo to attach to the invoice. + # An optional memo to attach to the invoice. If no memo is provided, we will + # attach the default memo sig { returns(T.nilable(String)) } attr_accessor :memo @@ -57,10 +63,11 @@ module Orb sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } attr_accessor :metadata - # Determines the difference between the invoice issue date for subscription - # invoices as the date that they are due. A value of '0' here represents that the - # invoice is due on issue, whereas a value of 30 represents that the customer has - # 30 days to pay the invoice. + # The net terms determines the due date of the invoice. Due date is calculated + # based on the invoice or issuance date, depending on the account's configured due + # date calculation method. A value of '0' here represents that the invoice is due + # on issue, whereas a value of '30' represents that the customer has 30 days to + # pay the invoice. Do not set this field if you want to set a custom due date. sig { returns(T.nilable(Integer)) } attr_accessor :net_terms @@ -88,6 +95,7 @@ module Orb Orb::AmountDiscount::OrHash ) ), + due_date: T.nilable(Orb::InvoiceCreateParams::DueDate::Variants), external_customer_id: T.nilable(String), memo: T.nilable(String), metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), @@ -109,19 +117,24 @@ module Orb customer_id: nil, # An optional discount to attach to the invoice. discount: nil, + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + due_date: nil, # The `external_customer_id` of the `Customer` to create this invoice for. One of # `customer_id` and `external_customer_id` are required. external_customer_id: nil, - # An optional memo to attach to the invoice. + # An optional memo to attach to the invoice. If no memo is provided, we will + # attach the default memo memo: nil, # User-specified key/value pairs for the resource. Individual keys can be removed # by setting the value to `null`, and the entire metadata mapping can be cleared # by setting `metadata` to `null`. metadata: nil, - # Determines the difference between the invoice issue date for subscription - # invoices as the date that they are due. A value of '0' here represents that the - # invoice is due on issue, whereas a value of 30 represents that the customer has - # 30 days to pay the invoice. + # The net terms determines the due date of the invoice. Due date is calculated + # based on the invoice or issuance date, depending on the account's configured due + # date calculation method. A value of '0' here represents that the invoice is due + # on issue, whereas a value of '30' represents that the customer has 30 days to + # pay the invoice. Do not set this field if you want to set a custom due date. net_terms: nil, # When true, this invoice will be submitted for issuance upon creation. When # false, the resulting invoice will require manual review to issue. Defaulted to @@ -147,6 +160,7 @@ module Orb Orb::AmountDiscount ) ), + due_date: T.nilable(Orb::InvoiceCreateParams::DueDate::Variants), external_customer_id: T.nilable(String), memo: T.nilable(String), metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), @@ -187,6 +201,7 @@ module Orb sig { returns(Date) } attr_accessor :start_date + # Configuration for unit pricing sig { returns(Orb::UnitConfig) } attr_reader :unit_config @@ -215,6 +230,7 @@ module Orb quantity:, # A date string to specify the line item's start date in the customer's timezone. start_date:, + # Configuration for unit pricing unit_config: ) end @@ -262,6 +278,22 @@ module Orb end end end + + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + module DueDate + extend Orb::Internal::Type::Union + + Variants = T.type_alias { T.any(Date, Time) } + + sig do + override.returns( + T::Array[Orb::InvoiceCreateParams::DueDate::Variants] + ) + end + def self.variants + end + end end end end diff --git a/rbi/orb/models/invoice_fetch_upcoming_response.rbi b/rbi/orb/models/invoice_fetch_upcoming_response.rbi index 8f204996..9f7395f8 100644 --- a/rbi/orb/models/invoice_fetch_upcoming_response.rbi +++ b/rbi/orb/models/invoice_fetch_upcoming_response.rbi @@ -1070,6 +1070,11 @@ module Orb :external_payment, Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::Action::TaggedSymbol ) + SMALL_INVOICE_CARRYOVER = + T.let( + :small_invoice_carryover, + Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::Action::TaggedSymbol + ) sig do override.returns( @@ -1275,7 +1280,7 @@ module Orb end attr_accessor :sub_line_items - # The line amount before before any adjustments. + # The line amount before any adjustments. sig { returns(String) } attr_accessor :subtotal @@ -1325,17 +1330,14 @@ module Orb price: T.any( Orb::Price::Unit::OrHash, - Orb::Price::Package::OrHash, - Orb::Price::Matrix::OrHash, Orb::Price::Tiered::OrHash, - Orb::Price::TieredBPS::OrHash, - Orb::Price::BPS::OrHash, - Orb::Price::BulkBPS::OrHash, Orb::Price::Bulk::OrHash, + Orb::Price::Package::OrHash, + Orb::Price::Matrix::OrHash, Orb::Price::ThresholdTotalAmount::OrHash, Orb::Price::TieredPackage::OrHash, - Orb::Price::GroupedTiered::OrHash, Orb::Price::TieredWithMinimum::OrHash, + Orb::Price::GroupedTiered::OrHash, Orb::Price::TieredPackageWithMinimum::OrHash, Orb::Price::PackageWithAllocation::OrHash, Orb::Price::UnitWithPercent::OrHash, @@ -1343,16 +1345,19 @@ module Orb Orb::Price::TieredWithProration::OrHash, Orb::Price::UnitWithProration::OrHash, Orb::Price::GroupedAllocation::OrHash, + Orb::Price::BulkWithProration::OrHash, Orb::Price::GroupedWithProratedMinimum::OrHash, Orb::Price::GroupedWithMeteredMinimum::OrHash, + Orb::Price::GroupedWithMinMaxThresholds::OrHash, Orb::Price::MatrixWithDisplayName::OrHash, - Orb::Price::BulkWithProration::OrHash, Orb::Price::GroupedTieredPackage::OrHash, Orb::Price::MaxGroupTieredPackage::OrHash, Orb::Price::ScalableMatrixWithUnitPricing::OrHash, Orb::Price::ScalableMatrixWithTieredPricing::OrHash, Orb::Price::CumulativeGroupedBulk::OrHash, - Orb::Price::GroupedWithMinMaxThresholds::OrHash + Orb::Price::Minimum::OrHash, + Orb::Price::Percent::OrHash, + Orb::Price::EventOutput::OrHash ), quantity: Float, start_date: Time, @@ -1424,7 +1429,7 @@ module Orb # For complex pricing structures, the line item can be broken down further in # `sub_line_items`. sub_line_items:, - # The line amount before before any adjustments. + # The line amount before any adjustments. subtotal:, # An array of tax rates and their incurred tax amounts. Empty if no tax # integration is configured. @@ -1555,6 +1560,11 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :payment_provider_id + # URL to the downloadable PDF version of the receipt. This field will be `null` + # for payment attempts that did not succeed. + sig { returns(T.nilable(String)) } + attr_accessor :receipt_pdf + # Whether the payment attempt succeeded. sig { returns(T::Boolean) } attr_accessor :succeeded @@ -1569,6 +1579,7 @@ module Orb Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt::PaymentProvider::OrSymbol ), payment_provider_id: T.nilable(String), + receipt_pdf: T.nilable(String), succeeded: T::Boolean ).returns(T.attached_class) end @@ -1583,6 +1594,9 @@ module Orb payment_provider:, # The ID of the payment attempt in the payment provider. payment_provider_id:, + # URL to the downloadable PDF version of the receipt. This field will be `null` + # for payment attempts that did not succeed. + receipt_pdf:, # Whether the payment attempt succeeded. succeeded: ) @@ -1599,6 +1613,7 @@ module Orb Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt::PaymentProvider::TaggedSymbol ), payment_provider_id: T.nilable(String), + receipt_pdf: T.nilable(String), succeeded: T::Boolean } ) diff --git a/rbi/orb/models/invoice_line_item_create_params.rbi b/rbi/orb/models/invoice_line_item_create_params.rbi index d1721127..4a6bc046 100644 --- a/rbi/orb/models/invoice_line_item_create_params.rbi +++ b/rbi/orb/models/invoice_line_item_create_params.rbi @@ -23,11 +23,6 @@ module Orb sig { returns(String) } attr_accessor :invoice_id - # The item name associated with this line item. If an item with the same name - # exists in Orb, that item will be associated with the line item. - sig { returns(String) } - attr_accessor :name - # The number of units on the line item sig { returns(Float) } attr_accessor :quantity @@ -36,14 +31,31 @@ module Orb sig { returns(Date) } attr_accessor :start_date + # The id of the item to associate with this line item. If provided without `name`, + # the item's name will be used for the price/line item. If provided with `name`, + # the item will be associated but `name` will be used for the line item. At least + # one of `name` or `item_id` must be provided. + sig { returns(T.nilable(String)) } + attr_accessor :item_id + + # The name to use for the line item. If `item_id` is not provided, Orb will search + # for an item with this name. If found, that item will be associated with the line + # item. If not found, a new item will be created with this name. If `item_id` is + # provided, this name will be used for the line item, but the item association + # will be based on `item_id`. At least one of `name` or `item_id` must be + # provided. + sig { returns(T.nilable(String)) } + attr_accessor :name + sig do params( amount: String, end_date: Date, invoice_id: String, - name: String, quantity: Float, start_date: Date, + item_id: T.nilable(String), + name: T.nilable(String), request_options: Orb::RequestOptions::OrHash ).returns(T.attached_class) end @@ -54,13 +66,22 @@ module Orb end_date:, # The id of the Invoice to add this line item. invoice_id:, - # The item name associated with this line item. If an item with the same name - # exists in Orb, that item will be associated with the line item. - name:, # The number of units on the line item quantity:, # A date string to specify the line item's start date in the customer's timezone. start_date:, + # The id of the item to associate with this line item. If provided without `name`, + # the item's name will be used for the price/line item. If provided with `name`, + # the item will be associated but `name` will be used for the line item. At least + # one of `name` or `item_id` must be provided. + item_id: nil, + # The name to use for the line item. If `item_id` is not provided, Orb will search + # for an item with this name. If found, that item will be associated with the line + # item. If not found, a new item will be created with this name. If `item_id` is + # provided, this name will be used for the line item, but the item association + # will be based on `item_id`. At least one of `name` or `item_id` must be + # provided. + name: nil, request_options: {} ) end @@ -71,9 +92,10 @@ module Orb amount: String, end_date: Date, invoice_id: String, - name: String, quantity: Float, start_date: Date, + item_id: T.nilable(String), + name: T.nilable(String), request_options: Orb::RequestOptions } ) diff --git a/rbi/orb/models/invoice_line_item_create_response.rbi b/rbi/orb/models/invoice_line_item_create_response.rbi index a73a00fa..2083edea 100644 --- a/rbi/orb/models/invoice_line_item_create_response.rbi +++ b/rbi/orb/models/invoice_line_item_create_response.rbi @@ -121,7 +121,7 @@ module Orb end attr_accessor :sub_line_items - # The line amount before before any adjustments. + # The line amount before any adjustments. sig { returns(String) } attr_accessor :subtotal @@ -171,17 +171,14 @@ module Orb price: T.any( Orb::Price::Unit::OrHash, - Orb::Price::Package::OrHash, - Orb::Price::Matrix::OrHash, Orb::Price::Tiered::OrHash, - Orb::Price::TieredBPS::OrHash, - Orb::Price::BPS::OrHash, - Orb::Price::BulkBPS::OrHash, Orb::Price::Bulk::OrHash, + Orb::Price::Package::OrHash, + Orb::Price::Matrix::OrHash, Orb::Price::ThresholdTotalAmount::OrHash, Orb::Price::TieredPackage::OrHash, - Orb::Price::GroupedTiered::OrHash, Orb::Price::TieredWithMinimum::OrHash, + Orb::Price::GroupedTiered::OrHash, Orb::Price::TieredPackageWithMinimum::OrHash, Orb::Price::PackageWithAllocation::OrHash, Orb::Price::UnitWithPercent::OrHash, @@ -189,16 +186,19 @@ module Orb Orb::Price::TieredWithProration::OrHash, Orb::Price::UnitWithProration::OrHash, Orb::Price::GroupedAllocation::OrHash, + Orb::Price::BulkWithProration::OrHash, Orb::Price::GroupedWithProratedMinimum::OrHash, Orb::Price::GroupedWithMeteredMinimum::OrHash, + Orb::Price::GroupedWithMinMaxThresholds::OrHash, Orb::Price::MatrixWithDisplayName::OrHash, - Orb::Price::BulkWithProration::OrHash, Orb::Price::GroupedTieredPackage::OrHash, Orb::Price::MaxGroupTieredPackage::OrHash, Orb::Price::ScalableMatrixWithUnitPricing::OrHash, Orb::Price::ScalableMatrixWithTieredPricing::OrHash, Orb::Price::CumulativeGroupedBulk::OrHash, - Orb::Price::GroupedWithMinMaxThresholds::OrHash + Orb::Price::Minimum::OrHash, + Orb::Price::Percent::OrHash, + Orb::Price::EventOutput::OrHash ), quantity: Float, start_date: Time, @@ -270,7 +270,7 @@ module Orb # For complex pricing structures, the line item can be broken down further in # `sub_line_items`. sub_line_items:, - # The line amount before before any adjustments. + # The line amount before any adjustments. subtotal:, # An array of tax rates and their incurred tax amounts. Empty if no tax # integration is configured. diff --git a/rbi/orb/models/invoice_update_params.rbi b/rbi/orb/models/invoice_update_params.rbi index b3bd0979..05d0793d 100644 --- a/rbi/orb/models/invoice_update_params.rbi +++ b/rbi/orb/models/invoice_update_params.rbi @@ -9,23 +9,47 @@ module Orb OrHash = T.type_alias { T.any(Orb::InvoiceUpdateParams, Orb::Internal::AnyHash) } + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + sig { returns(T.nilable(Orb::InvoiceUpdateParams::DueDate::Variants)) } + attr_accessor :due_date + # User-specified key/value pairs for the resource. Individual keys can be removed # by setting the value to `null`, and the entire metadata mapping can be cleared # by setting `metadata` to `null`. sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } attr_accessor :metadata + # The net terms determines the due date of the invoice. Due date is calculated + # based on the invoice or issuance date, depending on the account's configured due + # date calculation method. A value of '0' here represents that the invoice is due + # on issue, whereas a value of '30' represents that the customer has 30 days to + # pay the invoice. Do not set this field if you want to set a custom due date. + sig { returns(T.nilable(Integer)) } + attr_accessor :net_terms + sig do params( + due_date: T.nilable(Orb::InvoiceUpdateParams::DueDate::Variants), metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + net_terms: T.nilable(Integer), request_options: Orb::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + due_date: nil, # User-specified key/value pairs for the resource. Individual keys can be removed # by setting the value to `null`, and the entire metadata mapping can be cleared # by setting `metadata` to `null`. metadata: nil, + # The net terms determines the due date of the invoice. Due date is calculated + # based on the invoice or issuance date, depending on the account's configured due + # date calculation method. A value of '0' here represents that the invoice is due + # on issue, whereas a value of '30' represents that the customer has 30 days to + # pay the invoice. Do not set this field if you want to set a custom due date. + net_terms: nil, request_options: {} ) end @@ -33,13 +57,31 @@ module Orb sig do override.returns( { + due_date: T.nilable(Orb::InvoiceUpdateParams::DueDate::Variants), metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + net_terms: T.nilable(Integer), request_options: Orb::RequestOptions } ) end def to_hash end + + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + module DueDate + extend Orb::Internal::Type::Union + + Variants = T.type_alias { T.any(Date, Time) } + + sig do + override.returns( + T::Array[Orb::InvoiceUpdateParams::DueDate::Variants] + ) + end + def self.variants + end + end end end end diff --git a/rbi/orb/models/item.rbi b/rbi/orb/models/item.rbi index f53f97e6..0ca8dca1 100644 --- a/rbi/orb/models/item.rbi +++ b/rbi/orb/models/item.rbi @@ -5,12 +5,16 @@ module Orb class Item < Orb::Internal::Type::BaseModel OrHash = T.type_alias { T.any(Orb::Item, Orb::Internal::AnyHash) } + # The Orb-assigned unique identifier for the item. sig { returns(String) } attr_accessor :id + # The time at which the item was created. sig { returns(Time) } attr_accessor :created_at + # A list of external connections for this item, used to sync with external + # invoicing and tax systems. sig { returns(T::Array[Orb::Item::ExternalConnection]) } attr_accessor :external_connections @@ -21,9 +25,14 @@ module Orb sig { returns(T::Hash[Symbol, String]) } attr_accessor :metadata + # The name of the item. sig { returns(String) } attr_accessor :name + # The time at which the item was archived. If null, the item is not archived. + sig { returns(T.nilable(Time)) } + attr_accessor :archived_at + # The Item resource represents a sellable product or good. Items are associated # with all line items, billable metrics, and prices and are used for defining # external sync behavior for invoices and tax calculation purposes. @@ -33,19 +42,27 @@ module Orb created_at: Time, external_connections: T::Array[Orb::Item::ExternalConnection::OrHash], metadata: T::Hash[Symbol, String], - name: String + name: String, + archived_at: T.nilable(Time) ).returns(T.attached_class) end def self.new( + # The Orb-assigned unique identifier for the item. id:, + # The time at which the item was created. created_at:, + # A list of external connections for this item, used to sync with external + # invoicing and tax systems. external_connections:, # User specified key-value pairs for the resource. If not present, this defaults # to an empty dictionary. Individual keys can be removed by setting the value to # `null`, and the entire metadata mapping can be cleared by setting `metadata` to # `null`. metadata:, - name: + # The name of the item. + name:, + # The time at which the item was archived. If null, the item is not archived. + archived_at: nil ) end @@ -56,7 +73,8 @@ module Orb created_at: Time, external_connections: T::Array[Orb::Item::ExternalConnection], metadata: T::Hash[Symbol, String], - name: String + name: String, + archived_at: T.nilable(Time) } ) end @@ -69,6 +87,7 @@ module Orb T.any(Orb::Item::ExternalConnection, Orb::Internal::AnyHash) end + # The name of the external system this item is connected to. sig do returns( Orb::Item::ExternalConnection::ExternalConnectionName::TaggedSymbol @@ -76,9 +95,12 @@ module Orb end attr_accessor :external_connection_name + # The identifier of this item in the external system. sig { returns(String) } attr_accessor :external_entity_id + # Represents a connection between an Item and an external system for invoicing or + # tax calculation purposes. sig do params( external_connection_name: @@ -86,7 +108,12 @@ module Orb external_entity_id: String ).returns(T.attached_class) end - def self.new(external_connection_name:, external_entity_id:) + def self.new( + # The name of the external system this item is connected to. + external_connection_name:, + # The identifier of this item in the external system. + external_entity_id: + ) end sig do @@ -101,6 +128,7 @@ module Orb def to_hash end + # The name of the external system this item is connected to. module ExternalConnectionName extend Orb::Internal::Type::Enum @@ -148,6 +176,11 @@ module Orb :anrok, Orb::Item::ExternalConnection::ExternalConnectionName::TaggedSymbol ) + NUMERAL = + T.let( + :numeral, + Orb::Item::ExternalConnection::ExternalConnectionName::TaggedSymbol + ) sig do override.returns( diff --git a/rbi/orb/models/item_slim.rbi b/rbi/orb/models/item_slim.rbi index fa0f84ff..af1194c9 100644 --- a/rbi/orb/models/item_slim.rbi +++ b/rbi/orb/models/item_slim.rbi @@ -5,14 +5,23 @@ module Orb class ItemSlim < Orb::Internal::Type::BaseModel OrHash = T.type_alias { T.any(Orb::ItemSlim, Orb::Internal::AnyHash) } + # The Orb-assigned unique identifier for the item. sig { returns(String) } attr_accessor :id + # The name of the item. sig { returns(String) } attr_accessor :name + # A minimal representation of an Item containing only the essential identifying + # information. sig { params(id: String, name: String).returns(T.attached_class) } - def self.new(id:, name:) + def self.new( + # The Orb-assigned unique identifier for the item. + id:, + # The name of the item. + name: + ) end sig { override.returns({ id: String, name: String }) } diff --git a/rbi/orb/models/item_update_params.rbi b/rbi/orb/models/item_update_params.rbi index 0880437d..24227a90 100644 --- a/rbi/orb/models/item_update_params.rbi +++ b/rbi/orb/models/item_update_params.rbi @@ -68,6 +68,7 @@ module Orb ) end + # The name of the external system this item is connected to. sig do returns( Orb::ItemUpdateParams::ExternalConnection::ExternalConnectionName::OrSymbol @@ -75,9 +76,12 @@ module Orb end attr_accessor :external_connection_name + # The identifier of this item in the external system. sig { returns(String) } attr_accessor :external_entity_id + # Represents a connection between an Item and an external system for invoicing or + # tax calculation purposes. sig do params( external_connection_name: @@ -85,7 +89,12 @@ module Orb external_entity_id: String ).returns(T.attached_class) end - def self.new(external_connection_name:, external_entity_id:) + def self.new( + # The name of the external system this item is connected to. + external_connection_name:, + # The identifier of this item in the external system. + external_entity_id: + ) end sig do @@ -100,6 +109,7 @@ module Orb def to_hash end + # The name of the external system this item is connected to. module ExternalConnectionName extend Orb::Internal::Type::Enum @@ -147,6 +157,11 @@ module Orb :anrok, Orb::ItemUpdateParams::ExternalConnection::ExternalConnectionName::TaggedSymbol ) + NUMERAL = + T.let( + :numeral, + Orb::ItemUpdateParams::ExternalConnection::ExternalConnectionName::TaggedSymbol + ) sig do override.returns( diff --git a/rbi/orb/models/matrix_config.rbi b/rbi/orb/models/matrix_config.rbi index 20924566..a753f204 100644 --- a/rbi/orb/models/matrix_config.rbi +++ b/rbi/orb/models/matrix_config.rbi @@ -13,10 +13,11 @@ module Orb sig { returns(T::Array[T.nilable(String)]) } attr_accessor :dimensions - # Matrix values for specified matrix grouping keys + # Matrix values configuration sig { returns(T::Array[Orb::MatrixValue]) } attr_accessor :matrix_values + # Configuration for matrix pricing sig do params( default_unit_amount: String, @@ -29,7 +30,7 @@ module Orb default_unit_amount:, # One or two event property values to evaluate matrix groups by dimensions:, - # Matrix values for specified matrix grouping keys + # Matrix values configuration matrix_values: ) end diff --git a/rbi/orb/models/matrix_sub_line_item.rbi b/rbi/orb/models/matrix_sub_line_item.rbi index c3280331..46624828 100644 --- a/rbi/orb/models/matrix_sub_line_item.rbi +++ b/rbi/orb/models/matrix_sub_line_item.rbi @@ -31,6 +31,10 @@ module Orb sig { returns(Orb::MatrixSubLineItem::Type::TaggedSymbol) } attr_accessor :type + # The scaled quantity for this line item for specific pricing structures + sig { returns(T.nilable(Float)) } + attr_accessor :scaled_quantity + sig do params( amount: String, @@ -38,7 +42,8 @@ module Orb matrix_config: Orb::SubLineItemMatrixConfig::OrHash, name: String, quantity: Float, - type: Orb::MatrixSubLineItem::Type::OrSymbol + type: Orb::MatrixSubLineItem::Type::OrSymbol, + scaled_quantity: T.nilable(Float) ).returns(T.attached_class) end def self.new( @@ -48,7 +53,9 @@ module Orb matrix_config:, name:, quantity:, - type: + type:, + # The scaled quantity for this line item for specific pricing structures + scaled_quantity: nil ) end @@ -60,7 +67,8 @@ module Orb matrix_config: Orb::SubLineItemMatrixConfig, name: String, quantity: Float, - type: Orb::MatrixSubLineItem::Type::TaggedSymbol + type: Orb::MatrixSubLineItem::Type::TaggedSymbol, + scaled_quantity: T.nilable(Float) } ) end diff --git a/rbi/orb/models/matrix_value.rbi b/rbi/orb/models/matrix_value.rbi index eda9e116..e6a61656 100644 --- a/rbi/orb/models/matrix_value.rbi +++ b/rbi/orb/models/matrix_value.rbi @@ -5,9 +5,7 @@ module Orb class MatrixValue < Orb::Internal::Type::BaseModel OrHash = T.type_alias { T.any(Orb::MatrixValue, Orb::Internal::AnyHash) } - # One or two matrix keys to filter usage to this Matrix value by. For example, - # ["region", "tier"] could be used to filter cloud usage by a cloud region and an - # instance tier. + # One or two matrix keys to filter usage to this Matrix value by sig { returns(T::Array[T.nilable(String)]) } attr_accessor :dimension_values @@ -15,6 +13,7 @@ module Orb sig { returns(String) } attr_accessor :unit_amount + # Configuration for a single matrix value sig do params( dimension_values: T::Array[T.nilable(String)], @@ -22,9 +21,7 @@ module Orb ).returns(T.attached_class) end def self.new( - # One or two matrix keys to filter usage to this Matrix value by. For example, - # ["region", "tier"] could be used to filter cloud usage by a cloud region and an - # instance tier. + # One or two matrix keys to filter usage to this Matrix value by dimension_values:, # Unit price for the specified dimension_values unit_amount: diff --git a/rbi/orb/models/matrix_with_allocation_config.rbi b/rbi/orb/models/matrix_with_allocation_config.rbi index 95febd9d..bee3cc6e 100644 --- a/rbi/orb/models/matrix_with_allocation_config.rbi +++ b/rbi/orb/models/matrix_with_allocation_config.rbi @@ -8,8 +8,8 @@ module Orb T.any(Orb::MatrixWithAllocationConfig, Orb::Internal::AnyHash) end - # Allocation to be used to calculate the price - sig { returns(Float) } + # Usage allocation + sig { returns(String) } attr_accessor :allocation # Default per unit rate for any usage not bucketed into a specified matrix_value @@ -20,26 +20,28 @@ module Orb sig { returns(T::Array[T.nilable(String)]) } attr_accessor :dimensions - # Matrix values for specified matrix grouping keys - sig { returns(T::Array[Orb::MatrixValue]) } + # Matrix values configuration + sig { returns(T::Array[Orb::MatrixWithAllocationConfig::MatrixValue]) } attr_accessor :matrix_values + # Configuration for matrix pricing with usage allocation sig do params( - allocation: Float, + allocation: String, default_unit_amount: String, dimensions: T::Array[T.nilable(String)], - matrix_values: T::Array[Orb::MatrixValue::OrHash] + matrix_values: + T::Array[Orb::MatrixWithAllocationConfig::MatrixValue::OrHash] ).returns(T.attached_class) end def self.new( - # Allocation to be used to calculate the price + # Usage allocation allocation:, # Default per unit rate for any usage not bucketed into a specified matrix_value default_unit_amount:, # One or two event property values to evaluate matrix groups by dimensions:, - # Matrix values for specified matrix grouping keys + # Matrix values configuration matrix_values: ) end @@ -47,15 +49,64 @@ module Orb sig do override.returns( { - allocation: Float, + allocation: String, default_unit_amount: String, dimensions: T::Array[T.nilable(String)], - matrix_values: T::Array[Orb::MatrixValue] + matrix_values: + T::Array[Orb::MatrixWithAllocationConfig::MatrixValue] } ) end def to_hash end + + class MatrixValue < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::MatrixWithAllocationConfig::MatrixValue, + Orb::Internal::AnyHash + ) + end + + # One or two matrix keys to filter usage to this Matrix value by. For example, + # ["region", "tier"] could be used to filter cloud usage by a cloud region and an + # instance tier. + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimension_values + + # Unit price for the specified dimension_values + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single matrix value + sig do + params( + dimension_values: T::Array[T.nilable(String)], + unit_amount: String + ).returns(T.attached_class) + end + def self.new( + # One or two matrix keys to filter usage to this Matrix value by. For example, + # ["region", "tier"] could be used to filter cloud usage by a cloud region and an + # instance tier. + dimension_values:, + # Unit price for the specified dimension_values + unit_amount: + ) + end + + sig do + override.returns( + { + dimension_values: T::Array[T.nilable(String)], + unit_amount: String + } + ) + end + def to_hash + end + end end end end diff --git a/rbi/orb/models/monetary_amount_discount_adjustment.rbi b/rbi/orb/models/monetary_amount_discount_adjustment.rbi index af0235f3..2910c311 100644 --- a/rbi/orb/models/monetary_amount_discount_adjustment.rbi +++ b/rbi/orb/models/monetary_amount_discount_adjustment.rbi @@ -35,8 +35,8 @@ module Orb sig { returns(T::Array[Orb::TransformPriceFilter]) } attr_accessor :filters - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. sig { returns(T::Boolean) } attr_accessor :is_invoice_level @@ -75,8 +75,8 @@ module Orb applies_to_price_ids:, # The filters that determine which prices to apply this adjustment to. filters:, - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. is_invoice_level:, # The reason for the adjustment. reason:, diff --git a/rbi/orb/models/monetary_maximum_adjustment.rbi b/rbi/orb/models/monetary_maximum_adjustment.rbi index fb0e6795..06be8e03 100644 --- a/rbi/orb/models/monetary_maximum_adjustment.rbi +++ b/rbi/orb/models/monetary_maximum_adjustment.rbi @@ -28,8 +28,8 @@ module Orb sig { returns(T::Array[Orb::TransformPriceFilter]) } attr_accessor :filters - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. sig { returns(T::Boolean) } attr_accessor :is_invoice_level @@ -70,8 +70,8 @@ module Orb applies_to_price_ids:, # The filters that determine which prices to apply this adjustment to. filters:, - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. is_invoice_level:, # The maximum amount to charge in a given billing period for the prices this # adjustment applies to. diff --git a/rbi/orb/models/monetary_minimum_adjustment.rbi b/rbi/orb/models/monetary_minimum_adjustment.rbi index b339765f..c47ff203 100644 --- a/rbi/orb/models/monetary_minimum_adjustment.rbi +++ b/rbi/orb/models/monetary_minimum_adjustment.rbi @@ -28,8 +28,8 @@ module Orb sig { returns(T::Array[Orb::TransformPriceFilter]) } attr_accessor :filters - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. sig { returns(T::Boolean) } attr_accessor :is_invoice_level @@ -75,8 +75,8 @@ module Orb applies_to_price_ids:, # The filters that determine which prices to apply this adjustment to. filters:, - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. is_invoice_level:, # The item ID that revenue from this minimum will be attributed to. item_id:, diff --git a/rbi/orb/models/monetary_percentage_discount_adjustment.rbi b/rbi/orb/models/monetary_percentage_discount_adjustment.rbi index b5260f87..f1bfcf96 100644 --- a/rbi/orb/models/monetary_percentage_discount_adjustment.rbi +++ b/rbi/orb/models/monetary_percentage_discount_adjustment.rbi @@ -33,8 +33,8 @@ module Orb sig { returns(T::Array[Orb::TransformPriceFilter]) } attr_accessor :filters - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. sig { returns(T::Boolean) } attr_accessor :is_invoice_level @@ -75,8 +75,8 @@ module Orb applies_to_price_ids:, # The filters that determine which prices to apply this adjustment to. filters:, - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. is_invoice_level:, # The percentage (as a value between 0 and 1) by which to discount the price # intervals this adjustment applies to in a given billing period. diff --git a/rbi/orb/models/monetary_usage_discount_adjustment.rbi b/rbi/orb/models/monetary_usage_discount_adjustment.rbi index 6ae5273e..3064d7ae 100644 --- a/rbi/orb/models/monetary_usage_discount_adjustment.rbi +++ b/rbi/orb/models/monetary_usage_discount_adjustment.rbi @@ -30,8 +30,8 @@ module Orb sig { returns(T::Array[Orb::TransformPriceFilter]) } attr_accessor :filters - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. sig { returns(T::Boolean) } attr_accessor :is_invoice_level @@ -72,8 +72,8 @@ module Orb applies_to_price_ids:, # The filters that determine which prices to apply this adjustment to. filters:, - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. is_invoice_level:, # The reason for the adjustment. reason:, diff --git a/rbi/orb/models/new_floating_bps_price.rbi b/rbi/orb/models/new_floating_bps_price.rbi deleted file mode 100644 index fb7f7f7a..00000000 --- a/rbi/orb/models/new_floating_bps_price.rbi +++ /dev/null @@ -1,294 +0,0 @@ -# typed: strong - -module Orb - module Models - class NewFloatingBPSPrice < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias { T.any(Orb::NewFloatingBPSPrice, Orb::Internal::AnyHash) } - - sig { returns(Orb::BPSConfig) } - attr_reader :bps_config - - sig { params(bps_config: Orb::BPSConfig::OrHash).void } - attr_writer :bps_config - - # The cadence to bill for this price on. - sig { returns(Orb::NewFloatingBPSPrice::Cadence::OrSymbol) } - attr_accessor :cadence - - # An ISO 4217 currency string for which this price is billed in. - sig { returns(String) } - attr_accessor :currency - - # The id of the item the price will be associated with. - sig { returns(String) } - attr_accessor :item_id - - sig { returns(Orb::NewFloatingBPSPrice::ModelType::OrSymbol) } - attr_accessor :model_type - - # The name of the price. - sig { returns(String) } - attr_accessor :name - - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - sig { returns(T.nilable(String)) } - attr_accessor :billable_metric_id - - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :billed_in_advance - - # For custom cadence: specifies the duration of the billing period in days or - # months. - sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } - attr_reader :billing_cycle_configuration - - sig do - params( - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash) - ).void - end - attr_writer :billing_cycle_configuration - - # The per unit conversion rate of the price currency to the invoicing currency. - sig { returns(T.nilable(Float)) } - attr_accessor :conversion_rate - - # The configuration for the rate of the price currency to the invoicing currency. - sig do - returns( - T.nilable( - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - ) - ) - end - attr_accessor :conversion_rate_config - - # For dimensional price: specifies a price group and dimension values - sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } - attr_reader :dimensional_price_configuration - - sig do - params( - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) - ).void - end - attr_writer :dimensional_price_configuration - - # An alias for the price. - sig { returns(T.nilable(String)) } - attr_accessor :external_price_id - - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - sig { returns(T.nilable(Float)) } - attr_accessor :fixed_price_quantity - - # The property used to group this price on an invoice - sig { returns(T.nilable(String)) } - attr_accessor :invoice_grouping_key - - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } - attr_reader :invoicing_cycle_configuration - - sig do - params( - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash) - ).void - end - attr_writer :invoicing_cycle_configuration - - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } - attr_accessor :metadata - - sig do - params( - bps_config: Orb::BPSConfig::OrHash, - cadence: Orb::NewFloatingBPSPrice::Cadence::OrSymbol, - currency: String, - item_id: String, - model_type: Orb::NewFloatingBPSPrice::ModelType::OrSymbol, - name: String, - billable_metric_id: T.nilable(String), - billed_in_advance: T.nilable(T::Boolean), - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash), - conversion_rate: T.nilable(Float), - conversion_rate_config: - T.nilable( - T.any( - Orb::UnitConversionRateConfig::OrHash, - Orb::TieredConversionRateConfig::OrHash - ) - ), - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - invoice_grouping_key: T.nilable(String), - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash), - metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) - ).returns(T.attached_class) - end - def self.new( - bps_config:, - # The cadence to bill for this price on. - cadence:, - # An ISO 4217 currency string for which this price is billed in. - currency:, - # The id of the item the price will be associated with. - item_id:, - model_type:, - # The name of the price. - name:, - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - billable_metric_id: nil, - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - billed_in_advance: nil, - # For custom cadence: specifies the duration of the billing period in days or - # months. - billing_cycle_configuration: nil, - # The per unit conversion rate of the price currency to the invoicing currency. - conversion_rate: nil, - # The configuration for the rate of the price currency to the invoicing currency. - conversion_rate_config: nil, - # For dimensional price: specifies a price group and dimension values - dimensional_price_configuration: nil, - # An alias for the price. - external_price_id: nil, - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - fixed_price_quantity: nil, - # The property used to group this price on an invoice - invoice_grouping_key: nil, - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - invoicing_cycle_configuration: nil, - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - metadata: nil - ) - end - - sig do - override.returns( - { - bps_config: Orb::BPSConfig, - cadence: Orb::NewFloatingBPSPrice::Cadence::OrSymbol, - currency: String, - item_id: String, - model_type: Orb::NewFloatingBPSPrice::ModelType::OrSymbol, - name: String, - billable_metric_id: T.nilable(String), - billed_in_advance: T.nilable(T::Boolean), - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration), - conversion_rate: T.nilable(Float), - conversion_rate_config: - T.nilable( - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - ), - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - invoice_grouping_key: T.nilable(String), - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration), - metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) - } - ) - end - def to_hash - end - - # The cadence to bill for this price on. - module Cadence - extend Orb::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::NewFloatingBPSPrice::Cadence) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ANNUAL = T.let(:annual, Orb::NewFloatingBPSPrice::Cadence::TaggedSymbol) - SEMI_ANNUAL = - T.let(:semi_annual, Orb::NewFloatingBPSPrice::Cadence::TaggedSymbol) - MONTHLY = - T.let(:monthly, Orb::NewFloatingBPSPrice::Cadence::TaggedSymbol) - QUARTERLY = - T.let(:quarterly, Orb::NewFloatingBPSPrice::Cadence::TaggedSymbol) - ONE_TIME = - T.let(:one_time, Orb::NewFloatingBPSPrice::Cadence::TaggedSymbol) - CUSTOM = T.let(:custom, Orb::NewFloatingBPSPrice::Cadence::TaggedSymbol) - - sig do - override.returns( - T::Array[Orb::NewFloatingBPSPrice::Cadence::TaggedSymbol] - ) - end - def self.values - end - end - - module ModelType - extend Orb::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::NewFloatingBPSPrice::ModelType) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - BPS = T.let(:bps, Orb::NewFloatingBPSPrice::ModelType::TaggedSymbol) - - sig do - override.returns( - T::Array[Orb::NewFloatingBPSPrice::ModelType::TaggedSymbol] - ) - end - def self.values - end - end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[Orb::NewFloatingBPSPrice::ConversionRateConfig::Variants] - ) - end - def self.variants - end - end - end - end -end diff --git a/rbi/orb/models/new_floating_bulk_bps_price.rbi b/rbi/orb/models/new_floating_bulk_bps_price.rbi deleted file mode 100644 index 3b995868..00000000 --- a/rbi/orb/models/new_floating_bulk_bps_price.rbi +++ /dev/null @@ -1,309 +0,0 @@ -# typed: strong - -module Orb - module Models - class NewFloatingBulkBPSPrice < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(Orb::NewFloatingBulkBPSPrice, Orb::Internal::AnyHash) - end - - sig { returns(Orb::BulkBPSConfig) } - attr_reader :bulk_bps_config - - sig { params(bulk_bps_config: Orb::BulkBPSConfig::OrHash).void } - attr_writer :bulk_bps_config - - # The cadence to bill for this price on. - sig { returns(Orb::NewFloatingBulkBPSPrice::Cadence::OrSymbol) } - attr_accessor :cadence - - # An ISO 4217 currency string for which this price is billed in. - sig { returns(String) } - attr_accessor :currency - - # The id of the item the price will be associated with. - sig { returns(String) } - attr_accessor :item_id - - sig { returns(Orb::NewFloatingBulkBPSPrice::ModelType::OrSymbol) } - attr_accessor :model_type - - # The name of the price. - sig { returns(String) } - attr_accessor :name - - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - sig { returns(T.nilable(String)) } - attr_accessor :billable_metric_id - - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :billed_in_advance - - # For custom cadence: specifies the duration of the billing period in days or - # months. - sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } - attr_reader :billing_cycle_configuration - - sig do - params( - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash) - ).void - end - attr_writer :billing_cycle_configuration - - # The per unit conversion rate of the price currency to the invoicing currency. - sig { returns(T.nilable(Float)) } - attr_accessor :conversion_rate - - # The configuration for the rate of the price currency to the invoicing currency. - sig do - returns( - T.nilable( - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - ) - ) - end - attr_accessor :conversion_rate_config - - # For dimensional price: specifies a price group and dimension values - sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } - attr_reader :dimensional_price_configuration - - sig do - params( - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) - ).void - end - attr_writer :dimensional_price_configuration - - # An alias for the price. - sig { returns(T.nilable(String)) } - attr_accessor :external_price_id - - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - sig { returns(T.nilable(Float)) } - attr_accessor :fixed_price_quantity - - # The property used to group this price on an invoice - sig { returns(T.nilable(String)) } - attr_accessor :invoice_grouping_key - - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } - attr_reader :invoicing_cycle_configuration - - sig do - params( - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash) - ).void - end - attr_writer :invoicing_cycle_configuration - - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } - attr_accessor :metadata - - sig do - params( - bulk_bps_config: Orb::BulkBPSConfig::OrHash, - cadence: Orb::NewFloatingBulkBPSPrice::Cadence::OrSymbol, - currency: String, - item_id: String, - model_type: Orb::NewFloatingBulkBPSPrice::ModelType::OrSymbol, - name: String, - billable_metric_id: T.nilable(String), - billed_in_advance: T.nilable(T::Boolean), - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash), - conversion_rate: T.nilable(Float), - conversion_rate_config: - T.nilable( - T.any( - Orb::UnitConversionRateConfig::OrHash, - Orb::TieredConversionRateConfig::OrHash - ) - ), - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - invoice_grouping_key: T.nilable(String), - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash), - metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) - ).returns(T.attached_class) - end - def self.new( - bulk_bps_config:, - # The cadence to bill for this price on. - cadence:, - # An ISO 4217 currency string for which this price is billed in. - currency:, - # The id of the item the price will be associated with. - item_id:, - model_type:, - # The name of the price. - name:, - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - billable_metric_id: nil, - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - billed_in_advance: nil, - # For custom cadence: specifies the duration of the billing period in days or - # months. - billing_cycle_configuration: nil, - # The per unit conversion rate of the price currency to the invoicing currency. - conversion_rate: nil, - # The configuration for the rate of the price currency to the invoicing currency. - conversion_rate_config: nil, - # For dimensional price: specifies a price group and dimension values - dimensional_price_configuration: nil, - # An alias for the price. - external_price_id: nil, - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - fixed_price_quantity: nil, - # The property used to group this price on an invoice - invoice_grouping_key: nil, - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - invoicing_cycle_configuration: nil, - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - metadata: nil - ) - end - - sig do - override.returns( - { - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::NewFloatingBulkBPSPrice::Cadence::OrSymbol, - currency: String, - item_id: String, - model_type: Orb::NewFloatingBulkBPSPrice::ModelType::OrSymbol, - name: String, - billable_metric_id: T.nilable(String), - billed_in_advance: T.nilable(T::Boolean), - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration), - conversion_rate: T.nilable(Float), - conversion_rate_config: - T.nilable( - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - ), - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - invoice_grouping_key: T.nilable(String), - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration), - metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) - } - ) - end - def to_hash - end - - # The cadence to bill for this price on. - module Cadence - extend Orb::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::NewFloatingBulkBPSPrice::Cadence) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ANNUAL = - T.let(:annual, Orb::NewFloatingBulkBPSPrice::Cadence::TaggedSymbol) - SEMI_ANNUAL = - T.let( - :semi_annual, - Orb::NewFloatingBulkBPSPrice::Cadence::TaggedSymbol - ) - MONTHLY = - T.let(:monthly, Orb::NewFloatingBulkBPSPrice::Cadence::TaggedSymbol) - QUARTERLY = - T.let(:quarterly, Orb::NewFloatingBulkBPSPrice::Cadence::TaggedSymbol) - ONE_TIME = - T.let(:one_time, Orb::NewFloatingBulkBPSPrice::Cadence::TaggedSymbol) - CUSTOM = - T.let(:custom, Orb::NewFloatingBulkBPSPrice::Cadence::TaggedSymbol) - - sig do - override.returns( - T::Array[Orb::NewFloatingBulkBPSPrice::Cadence::TaggedSymbol] - ) - end - def self.values - end - end - - module ModelType - extend Orb::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, Orb::NewFloatingBulkBPSPrice::ModelType) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - BULK_BPS = - T.let( - :bulk_bps, - Orb::NewFloatingBulkBPSPrice::ModelType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[Orb::NewFloatingBulkBPSPrice::ModelType::TaggedSymbol] - ) - end - def self.values - end - end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewFloatingBulkBPSPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end - end - end -end diff --git a/rbi/orb/models/new_floating_bulk_price.rbi b/rbi/orb/models/new_floating_bulk_price.rbi index 2ae85f3e..149d0879 100644 --- a/rbi/orb/models/new_floating_bulk_price.rbi +++ b/rbi/orb/models/new_floating_bulk_price.rbi @@ -8,6 +8,7 @@ module Orb T.any(Orb::NewFloatingBulkPrice, Orb::Internal::AnyHash) end + # Configuration for bulk pricing sig { returns(Orb::BulkConfig) } attr_reader :bulk_config @@ -26,6 +27,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewFloatingBulkPrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -148,6 +150,7 @@ module Orb ).returns(T.attached_class) end def self.new( + # Configuration for bulk pricing bulk_config:, # The cadence to bill for this price on. cadence:, @@ -155,6 +158,7 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -255,6 +259,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -272,27 +277,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[Orb::NewFloatingBulkPrice::ConversionRateConfig::Variants] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_floating_bulk_with_proration_price.rbi b/rbi/orb/models/new_floating_bulk_with_proration_price.rbi index ea9253be..b18c9655 100644 --- a/rbi/orb/models/new_floating_bulk_with_proration_price.rbi +++ b/rbi/orb/models/new_floating_bulk_with_proration_price.rbi @@ -8,8 +8,19 @@ module Orb T.any(Orb::NewFloatingBulkWithProrationPrice, Orb::Internal::AnyHash) end - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :bulk_with_proration_config + # Configuration for bulk_with_proration pricing + sig do + returns(Orb::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig) + end + attr_reader :bulk_with_proration_config + + sig do + params( + bulk_with_proration_config: + Orb::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig::OrHash + ).void + end + attr_writer :bulk_with_proration_config # The cadence to bill for this price on. sig { returns(Orb::NewFloatingBulkWithProrationPrice::Cadence::OrSymbol) } @@ -23,6 +34,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewFloatingBulkWithProrationPrice::ModelType::OrSymbol) end @@ -118,7 +130,8 @@ module Orb sig do params( - bulk_with_proration_config: T::Hash[Symbol, T.anything], + bulk_with_proration_config: + Orb::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig::OrHash, cadence: Orb::NewFloatingBulkWithProrationPrice::Cadence::OrSymbol, currency: String, item_id: String, @@ -148,6 +161,7 @@ module Orb ).returns(T.attached_class) end def self.new( + # Configuration for bulk_with_proration pricing bulk_with_proration_config:, # The cadence to bill for this price on. cadence:, @@ -155,6 +169,7 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -193,7 +208,8 @@ module Orb sig do override.returns( { - bulk_with_proration_config: T::Hash[Symbol, T.anything], + bulk_with_proration_config: + Orb::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig, cadence: Orb::NewFloatingBulkWithProrationPrice::Cadence::OrSymbol, currency: String, item_id: String, @@ -226,6 +242,95 @@ module Orb def to_hash end + class BulkWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig, + Orb::Internal::AnyHash + ) + end + + # Bulk tiers for rating based on total usage volume + sig do + returns( + T::Array[ + Orb::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for bulk_with_proration pricing + sig do + params( + tiers: + T::Array[ + Orb::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Bulk tiers for rating based on total usage volume + tiers: + ) + end + + sig do + override.returns( + { + tiers: + T::Array[ + Orb::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Cost per unit + sig { returns(String) } + attr_accessor :unit_amount + + # The lower bound for this tier + sig { returns(T.nilable(String)) } + attr_accessor :tier_lower_bound + + # Configuration for a single bulk pricing tier with proration + sig do + params( + unit_amount: String, + tier_lower_bound: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Cost per unit + unit_amount:, + # The lower bound for this tier + tier_lower_bound: nil + ) + end + + sig do + override.returns( + { unit_amount: String, tier_lower_bound: T.nilable(String) } + ) + end + def to_hash + end + end + end + # The cadence to bill for this price on. module Cadence extend Orb::Internal::Type::Enum @@ -278,6 +383,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -303,29 +409,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewFloatingBulkWithProrationPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_floating_cumulative_grouped_bulk_price.rbi b/rbi/orb/models/new_floating_cumulative_grouped_bulk_price.rbi index d2fe1800..42928617 100644 --- a/rbi/orb/models/new_floating_cumulative_grouped_bulk_price.rbi +++ b/rbi/orb/models/new_floating_cumulative_grouped_bulk_price.rbi @@ -17,8 +17,21 @@ module Orb end attr_accessor :cadence - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :cumulative_grouped_bulk_config + # Configuration for cumulative_grouped_bulk pricing + sig do + returns( + Orb::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig + ) + end + attr_reader :cumulative_grouped_bulk_config + + sig do + params( + cumulative_grouped_bulk_config: + Orb::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::OrHash + ).void + end + attr_writer :cumulative_grouped_bulk_config # An ISO 4217 currency string for which this price is billed in. sig { returns(String) } @@ -28,6 +41,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewFloatingCumulativeGroupedBulkPrice::ModelType::OrSymbol) end @@ -125,7 +139,8 @@ module Orb params( cadence: Orb::NewFloatingCumulativeGroupedBulkPrice::Cadence::OrSymbol, - cumulative_grouped_bulk_config: T::Hash[Symbol, T.anything], + cumulative_grouped_bulk_config: + Orb::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::OrHash, currency: String, item_id: String, model_type: @@ -156,11 +171,13 @@ module Orb def self.new( # The cadence to bill for this price on. cadence:, + # Configuration for cumulative_grouped_bulk pricing cumulative_grouped_bulk_config:, # An ISO 4217 currency string for which this price is billed in. currency:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -201,7 +218,8 @@ module Orb { cadence: Orb::NewFloatingCumulativeGroupedBulkPrice::Cadence::OrSymbol, - cumulative_grouped_bulk_config: T::Hash[Symbol, T.anything], + cumulative_grouped_bulk_config: + Orb::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig, currency: String, item_id: String, model_type: @@ -285,6 +303,115 @@ module Orb end end + class CumulativeGroupedBulkConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig, + Orb::Internal::AnyHash + ) + end + + # Each tier lower bound must have the same group of values. + sig do + returns( + T::Array[ + Orb::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue + ] + ) + end + attr_accessor :dimension_values + + # Grouping key name + sig { returns(String) } + attr_accessor :group + + # Configuration for cumulative_grouped_bulk pricing + sig do + params( + dimension_values: + T::Array[ + Orb::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue::OrHash + ], + group: String + ).returns(T.attached_class) + end + def self.new( + # Each tier lower bound must have the same group of values. + dimension_values:, + # Grouping key name + group: + ) + end + + sig do + override.returns( + { + dimension_values: + T::Array[ + Orb::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue + ], + group: String + } + ) + end + def to_hash + end + + class DimensionValue < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue, + Orb::Internal::AnyHash + ) + end + + # Grouping key value + sig { returns(String) } + attr_accessor :grouping_key + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Unit amount for this combination + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a dimension value entry + sig do + params( + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + ).returns(T.attached_class) + end + def self.new( + # Grouping key value + grouping_key:, + # Tier lower bound + tier_lower_bound:, + # Unit amount for this combination + unit_amount: + ) + end + + sig do + override.returns( + { + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + } + ) + end + def to_hash + end + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -310,29 +437,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewFloatingCumulativeGroupedBulkPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_floating_grouped_allocation_price.rbi b/rbi/orb/models/new_floating_grouped_allocation_price.rbi index aa9f3427..3f833b40 100644 --- a/rbi/orb/models/new_floating_grouped_allocation_price.rbi +++ b/rbi/orb/models/new_floating_grouped_allocation_price.rbi @@ -16,13 +16,25 @@ module Orb sig { returns(String) } attr_accessor :currency - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_allocation_config + # Configuration for grouped_allocation pricing + sig do + returns(Orb::NewFloatingGroupedAllocationPrice::GroupedAllocationConfig) + end + attr_reader :grouped_allocation_config + + sig do + params( + grouped_allocation_config: + Orb::NewFloatingGroupedAllocationPrice::GroupedAllocationConfig::OrHash + ).void + end + attr_writer :grouped_allocation_config # The id of the item the price will be associated with. sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewFloatingGroupedAllocationPrice::ModelType::OrSymbol) end @@ -120,7 +132,8 @@ module Orb params( cadence: Orb::NewFloatingGroupedAllocationPrice::Cadence::OrSymbol, currency: String, - grouped_allocation_config: T::Hash[Symbol, T.anything], + grouped_allocation_config: + Orb::NewFloatingGroupedAllocationPrice::GroupedAllocationConfig::OrHash, item_id: String, model_type: Orb::NewFloatingGroupedAllocationPrice::ModelType::OrSymbol, @@ -152,9 +165,11 @@ module Orb cadence:, # An ISO 4217 currency string for which this price is billed in. currency:, + # Configuration for grouped_allocation pricing grouped_allocation_config:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -195,7 +210,8 @@ module Orb { cadence: Orb::NewFloatingGroupedAllocationPrice::Cadence::OrSymbol, currency: String, - grouped_allocation_config: T::Hash[Symbol, T.anything], + grouped_allocation_config: + Orb::NewFloatingGroupedAllocationPrice::GroupedAllocationConfig, item_id: String, model_type: Orb::NewFloatingGroupedAllocationPrice::ModelType::OrSymbol, @@ -278,6 +294,59 @@ module Orb end end + class GroupedAllocationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingGroupedAllocationPrice::GroupedAllocationConfig, + Orb::Internal::AnyHash + ) + end + + # Usage allocation per group + sig { returns(String) } + attr_accessor :allocation + + # How to determine the groups that should each be allocated some quantity + sig { returns(String) } + attr_accessor :grouping_key + + # Unit rate for post-allocation + sig { returns(String) } + attr_accessor :overage_unit_rate + + # Configuration for grouped_allocation pricing + sig do + params( + allocation: String, + grouping_key: String, + overage_unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # Usage allocation per group + allocation:, + # How to determine the groups that should each be allocated some quantity + grouping_key:, + # Unit rate for post-allocation + overage_unit_rate: + ) + end + + sig do + override.returns( + { + allocation: String, + grouping_key: String, + overage_unit_rate: String + } + ) + end + def to_hash + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -303,29 +372,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewFloatingGroupedAllocationPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_floating_grouped_tiered_package_price.rbi b/rbi/orb/models/new_floating_grouped_tiered_package_price.rbi index aa4bf8b8..0c3ca717 100644 --- a/rbi/orb/models/new_floating_grouped_tiered_package_price.rbi +++ b/rbi/orb/models/new_floating_grouped_tiered_package_price.rbi @@ -21,13 +21,27 @@ module Orb sig { returns(String) } attr_accessor :currency - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_tiered_package_config + # Configuration for grouped_tiered_package pricing + sig do + returns( + Orb::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig + ) + end + attr_reader :grouped_tiered_package_config + + sig do + params( + grouped_tiered_package_config: + Orb::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig::OrHash + ).void + end + attr_writer :grouped_tiered_package_config # The id of the item the price will be associated with. sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewFloatingGroupedTieredPackagePrice::ModelType::OrSymbol) end @@ -125,7 +139,8 @@ module Orb params( cadence: Orb::NewFloatingGroupedTieredPackagePrice::Cadence::OrSymbol, currency: String, - grouped_tiered_package_config: T::Hash[Symbol, T.anything], + grouped_tiered_package_config: + Orb::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig::OrHash, item_id: String, model_type: Orb::NewFloatingGroupedTieredPackagePrice::ModelType::OrSymbol, @@ -157,9 +172,11 @@ module Orb cadence:, # An ISO 4217 currency string for which this price is billed in. currency:, + # Configuration for grouped_tiered_package pricing grouped_tiered_package_config:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -201,7 +218,8 @@ module Orb cadence: Orb::NewFloatingGroupedTieredPackagePrice::Cadence::OrSymbol, currency: String, - grouped_tiered_package_config: T::Hash[Symbol, T.anything], + grouped_tiered_package_config: + Orb::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig, item_id: String, model_type: Orb::NewFloatingGroupedTieredPackagePrice::ModelType::OrSymbol, @@ -284,6 +302,111 @@ module Orb end end + class GroupedTieredPackageConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before tiering + sig { returns(String) } + attr_accessor :grouping_key + + # Package size + sig { returns(String) } + attr_accessor :package_size + + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + sig do + returns( + T::Array[ + Orb::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for grouped_tiered_package pricing + sig do + params( + grouping_key: String, + package_size: String, + tiers: + T::Array[ + Orb::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before tiering + grouping_key:, + # Package size + package_size:, + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + tiers: + ) + end + + sig do + override.returns( + { + grouping_key: String, + package_size: String, + tiers: + T::Array[ + Orb::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Price per package + sig { returns(String) } + attr_accessor :per_unit + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Configuration for a single tier + sig do + params(per_unit: String, tier_lower_bound: String).returns( + T.attached_class + ) + end + def self.new( + # Price per package + per_unit:, + # Tier lower bound + tier_lower_bound: + ) + end + + sig do + override.returns({ per_unit: String, tier_lower_bound: String }) + end + def to_hash + end + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -309,29 +432,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewFloatingGroupedTieredPackagePrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_floating_grouped_tiered_price.rbi b/rbi/orb/models/new_floating_grouped_tiered_price.rbi index 25c7110e..e07e309d 100644 --- a/rbi/orb/models/new_floating_grouped_tiered_price.rbi +++ b/rbi/orb/models/new_floating_grouped_tiered_price.rbi @@ -16,13 +16,23 @@ module Orb sig { returns(String) } attr_accessor :currency - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_tiered_config + # Configuration for grouped_tiered pricing + sig { returns(Orb::NewFloatingGroupedTieredPrice::GroupedTieredConfig) } + attr_reader :grouped_tiered_config + + sig do + params( + grouped_tiered_config: + Orb::NewFloatingGroupedTieredPrice::GroupedTieredConfig::OrHash + ).void + end + attr_writer :grouped_tiered_config # The id of the item the price will be associated with. sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewFloatingGroupedTieredPrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -118,7 +128,8 @@ module Orb params( cadence: Orb::NewFloatingGroupedTieredPrice::Cadence::OrSymbol, currency: String, - grouped_tiered_config: T::Hash[Symbol, T.anything], + grouped_tiered_config: + Orb::NewFloatingGroupedTieredPrice::GroupedTieredConfig::OrHash, item_id: String, model_type: Orb::NewFloatingGroupedTieredPrice::ModelType::OrSymbol, name: String, @@ -149,9 +160,11 @@ module Orb cadence:, # An ISO 4217 currency string for which this price is billed in. currency:, + # Configuration for grouped_tiered pricing grouped_tiered_config:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -192,7 +205,8 @@ module Orb { cadence: Orb::NewFloatingGroupedTieredPrice::Cadence::OrSymbol, currency: String, - grouped_tiered_config: T::Hash[Symbol, T.anything], + grouped_tiered_config: + Orb::NewFloatingGroupedTieredPrice::GroupedTieredConfig, item_id: String, model_type: Orb::NewFloatingGroupedTieredPrice::ModelType::OrSymbol, name: String, @@ -272,6 +286,103 @@ module Orb end end + class GroupedTieredConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingGroupedTieredPrice::GroupedTieredConfig, + Orb::Internal::AnyHash + ) + end + + # The billable metric property used to group before tiering + sig { returns(String) } + attr_accessor :grouping_key + + # Apply tiered pricing to each segment generated after grouping with the provided + # key + sig do + returns( + T::Array[ + Orb::NewFloatingGroupedTieredPrice::GroupedTieredConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for grouped_tiered pricing + sig do + params( + grouping_key: String, + tiers: + T::Array[ + Orb::NewFloatingGroupedTieredPrice::GroupedTieredConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The billable metric property used to group before tiering + grouping_key:, + # Apply tiered pricing to each segment generated after grouping with the provided + # key + tiers: + ) + end + + sig do + override.returns( + { + grouping_key: String, + tiers: + T::Array[ + Orb::NewFloatingGroupedTieredPrice::GroupedTieredConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingGroupedTieredPrice::GroupedTieredConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tier + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Tier lower bound + tier_lower_bound:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns({ tier_lower_bound: String, unit_amount: String }) + end + def to_hash + end + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -297,29 +408,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewFloatingGroupedTieredPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_floating_grouped_with_metered_minimum_price.rbi b/rbi/orb/models/new_floating_grouped_with_metered_minimum_price.rbi index dce6b426..cc875ddf 100644 --- a/rbi/orb/models/new_floating_grouped_with_metered_minimum_price.rbi +++ b/rbi/orb/models/new_floating_grouped_with_metered_minimum_price.rbi @@ -23,13 +23,27 @@ module Orb sig { returns(String) } attr_accessor :currency - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_with_metered_minimum_config + # Configuration for grouped_with_metered_minimum pricing + sig do + returns( + Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig + ) + end + attr_reader :grouped_with_metered_minimum_config + + sig do + params( + grouped_with_metered_minimum_config: + Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::OrHash + ).void + end + attr_writer :grouped_with_metered_minimum_config # The id of the item the price will be associated with. sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns( Orb::NewFloatingGroupedWithMeteredMinimumPrice::ModelType::OrSymbol @@ -130,7 +144,8 @@ module Orb cadence: Orb::NewFloatingGroupedWithMeteredMinimumPrice::Cadence::OrSymbol, currency: String, - grouped_with_metered_minimum_config: T::Hash[Symbol, T.anything], + grouped_with_metered_minimum_config: + Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::OrHash, item_id: String, model_type: Orb::NewFloatingGroupedWithMeteredMinimumPrice::ModelType::OrSymbol, @@ -162,9 +177,11 @@ module Orb cadence:, # An ISO 4217 currency string for which this price is billed in. currency:, + # Configuration for grouped_with_metered_minimum pricing grouped_with_metered_minimum_config:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -206,7 +223,8 @@ module Orb cadence: Orb::NewFloatingGroupedWithMeteredMinimumPrice::Cadence::OrSymbol, currency: String, - grouped_with_metered_minimum_config: T::Hash[Symbol, T.anything], + grouped_with_metered_minimum_config: + Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig, item_id: String, model_type: Orb::NewFloatingGroupedWithMeteredMinimumPrice::ModelType::OrSymbol, @@ -292,6 +310,187 @@ module Orb end end + class GroupedWithMeteredMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig, + Orb::Internal::AnyHash + ) + end + + # Used to partition the usage into groups. The minimum amount is applied to each + # group. + sig { returns(String) } + attr_accessor :grouping_key + + # The minimum amount to charge per group per unit + sig { returns(String) } + attr_accessor :minimum_unit_amount + + # Used to determine the unit rate + sig { returns(String) } + attr_accessor :pricing_key + + # Scale the unit rates by the scaling factor. + sig do + returns( + T::Array[ + Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor + ] + ) + end + attr_accessor :scaling_factors + + # Used to determine the unit rate scaling factor + sig { returns(String) } + attr_accessor :scaling_key + + # Apply per unit pricing to each pricing value. The minimum amount is applied any + # unmatched usage. + sig do + returns( + T::Array[ + Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount + ] + ) + end + attr_accessor :unit_amounts + + # Configuration for grouped_with_metered_minimum pricing + sig do + params( + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: + T::Array[ + Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor::OrHash + ], + scaling_key: String, + unit_amounts: + T::Array[ + Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Used to partition the usage into groups. The minimum amount is applied to each + # group. + grouping_key:, + # The minimum amount to charge per group per unit + minimum_unit_amount:, + # Used to determine the unit rate + pricing_key:, + # Scale the unit rates by the scaling factor. + scaling_factors:, + # Used to determine the unit rate scaling factor + scaling_key:, + # Apply per unit pricing to each pricing value. The minimum amount is applied any + # unmatched usage. + unit_amounts: + ) + end + + sig do + override.returns( + { + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: + T::Array[ + Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor + ], + scaling_key: String, + unit_amounts: + T::Array[ + Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount + ] + } + ) + end + def to_hash + end + + class ScalingFactor < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor, + Orb::Internal::AnyHash + ) + end + + # Scaling factor + sig { returns(String) } + attr_accessor :scaling_factor + + # Scaling value + sig { returns(String) } + attr_accessor :scaling_value + + # Configuration for a scaling factor + sig do + params(scaling_factor: String, scaling_value: String).returns( + T.attached_class + ) + end + def self.new( + # Scaling factor + scaling_factor:, + # Scaling value + scaling_value: + ) + end + + sig do + override.returns({ scaling_factor: String, scaling_value: String }) + end + def to_hash + end + end + + class UnitAmount < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount, + Orb::Internal::AnyHash + ) + end + + # Pricing value + sig { returns(String) } + attr_accessor :pricing_value + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a unit amount + sig do + params(pricing_value: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Pricing value + pricing_value:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns({ pricing_value: String, unit_amount: String }) + end + def to_hash + end + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -320,29 +519,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewFloatingGroupedWithMeteredMinimumPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_floating_grouped_with_prorated_minimum_price.rbi b/rbi/orb/models/new_floating_grouped_with_prorated_minimum_price.rbi index b361b5e1..f9b77e05 100644 --- a/rbi/orb/models/new_floating_grouped_with_prorated_minimum_price.rbi +++ b/rbi/orb/models/new_floating_grouped_with_prorated_minimum_price.rbi @@ -23,13 +23,27 @@ module Orb sig { returns(String) } attr_accessor :currency - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_with_prorated_minimum_config + # Configuration for grouped_with_prorated_minimum pricing + sig do + returns( + Orb::NewFloatingGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig + ) + end + attr_reader :grouped_with_prorated_minimum_config + + sig do + params( + grouped_with_prorated_minimum_config: + Orb::NewFloatingGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig::OrHash + ).void + end + attr_writer :grouped_with_prorated_minimum_config # The id of the item the price will be associated with. sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns( Orb::NewFloatingGroupedWithProratedMinimumPrice::ModelType::OrSymbol @@ -130,7 +144,8 @@ module Orb cadence: Orb::NewFloatingGroupedWithProratedMinimumPrice::Cadence::OrSymbol, currency: String, - grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + grouped_with_prorated_minimum_config: + Orb::NewFloatingGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig::OrHash, item_id: String, model_type: Orb::NewFloatingGroupedWithProratedMinimumPrice::ModelType::OrSymbol, @@ -162,9 +177,11 @@ module Orb cadence:, # An ISO 4217 currency string for which this price is billed in. currency:, + # Configuration for grouped_with_prorated_minimum pricing grouped_with_prorated_minimum_config:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -206,7 +223,8 @@ module Orb cadence: Orb::NewFloatingGroupedWithProratedMinimumPrice::Cadence::OrSymbol, currency: String, - grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + grouped_with_prorated_minimum_config: + Orb::NewFloatingGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig, item_id: String, model_type: Orb::NewFloatingGroupedWithProratedMinimumPrice::ModelType::OrSymbol, @@ -292,6 +310,55 @@ module Orb end end + class GroupedWithProratedMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig, + Orb::Internal::AnyHash + ) + end + + # How to determine the groups that should each have a minimum + sig { returns(String) } + attr_accessor :grouping_key + + # The minimum amount to charge per group + sig { returns(String) } + attr_accessor :minimum + + # The amount to charge per unit + sig { returns(String) } + attr_accessor :unit_rate + + # Configuration for grouped_with_prorated_minimum pricing + sig do + params( + grouping_key: String, + minimum: String, + unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # How to determine the groups that should each have a minimum + grouping_key:, + # The minimum amount to charge per group + minimum:, + # The amount to charge per unit + unit_rate: + ) + end + + sig do + override.returns( + { grouping_key: String, minimum: String, unit_rate: String } + ) + end + def to_hash + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -320,29 +387,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewFloatingGroupedWithProratedMinimumPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_floating_matrix_price.rbi b/rbi/orb/models/new_floating_matrix_price.rbi index 7d60743a..98d4fafd 100644 --- a/rbi/orb/models/new_floating_matrix_price.rbi +++ b/rbi/orb/models/new_floating_matrix_price.rbi @@ -20,12 +20,14 @@ module Orb sig { returns(String) } attr_accessor :item_id + # Configuration for matrix pricing sig { returns(Orb::MatrixConfig) } attr_reader :matrix_config sig { params(matrix_config: Orb::MatrixConfig::OrHash).void } attr_writer :matrix_config + # The pricing model type sig { returns(Orb::NewFloatingMatrixPrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -154,7 +156,9 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # Configuration for matrix pricing matrix_config:, + # The pricing model type model_type:, # The name of the price. name:, @@ -258,6 +262,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -276,29 +281,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewFloatingMatrixPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_floating_matrix_with_allocation_price.rbi b/rbi/orb/models/new_floating_matrix_with_allocation_price.rbi index 88dbf722..80acccb3 100644 --- a/rbi/orb/models/new_floating_matrix_with_allocation_price.rbi +++ b/rbi/orb/models/new_floating_matrix_with_allocation_price.rbi @@ -25,6 +25,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # Configuration for matrix_with_allocation pricing sig { returns(Orb::MatrixWithAllocationConfig) } attr_reader :matrix_with_allocation_config @@ -35,6 +36,7 @@ module Orb end attr_writer :matrix_with_allocation_config + # The pricing model type sig do returns(Orb::NewFloatingMatrixWithAllocationPrice::ModelType::OrSymbol) end @@ -167,7 +169,9 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # Configuration for matrix_with_allocation pricing matrix_with_allocation_config:, + # The pricing model type model_type:, # The name of the price. name:, @@ -292,6 +296,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -317,29 +322,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewFloatingMatrixWithAllocationPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_floating_matrix_with_display_name_price.rbi b/rbi/orb/models/new_floating_matrix_with_display_name_price.rbi index c43789c1..395118ea 100644 --- a/rbi/orb/models/new_floating_matrix_with_display_name_price.rbi +++ b/rbi/orb/models/new_floating_matrix_with_display_name_price.rbi @@ -25,9 +25,23 @@ module Orb sig { returns(String) } attr_accessor :item_id - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :matrix_with_display_name_config + # Configuration for matrix_with_display_name pricing + sig do + returns( + Orb::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig + ) + end + attr_reader :matrix_with_display_name_config + + sig do + params( + matrix_with_display_name_config: + Orb::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::OrHash + ).void + end + attr_writer :matrix_with_display_name_config + # The pricing model type sig do returns(Orb::NewFloatingMatrixWithDisplayNamePrice::ModelType::OrSymbol) end @@ -127,7 +141,8 @@ module Orb Orb::NewFloatingMatrixWithDisplayNamePrice::Cadence::OrSymbol, currency: String, item_id: String, - matrix_with_display_name_config: T::Hash[Symbol, T.anything], + matrix_with_display_name_config: + Orb::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::OrHash, model_type: Orb::NewFloatingMatrixWithDisplayNamePrice::ModelType::OrSymbol, name: String, @@ -160,7 +175,9 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # Configuration for matrix_with_display_name pricing matrix_with_display_name_config:, + # The pricing model type model_type:, # The name of the price. name:, @@ -203,7 +220,8 @@ module Orb Orb::NewFloatingMatrixWithDisplayNamePrice::Cadence::OrSymbol, currency: String, item_id: String, - matrix_with_display_name_config: T::Hash[Symbol, T.anything], + matrix_with_display_name_config: + Orb::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig, model_type: Orb::NewFloatingMatrixWithDisplayNamePrice::ModelType::OrSymbol, name: String, @@ -285,6 +303,115 @@ module Orb end end + class MatrixWithDisplayNameConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig, + Orb::Internal::AnyHash + ) + end + + # Used to determine the unit rate + sig { returns(String) } + attr_accessor :dimension + + # Apply per unit pricing to each dimension value + sig do + returns( + T::Array[ + Orb::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount + ] + ) + end + attr_accessor :unit_amounts + + # Configuration for matrix_with_display_name pricing + sig do + params( + dimension: String, + unit_amounts: + T::Array[ + Orb::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Used to determine the unit rate + dimension:, + # Apply per unit pricing to each dimension value + unit_amounts: + ) + end + + sig do + override.returns( + { + dimension: String, + unit_amounts: + T::Array[ + Orb::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount + ] + } + ) + end + def to_hash + end + + class UnitAmount < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount, + Orb::Internal::AnyHash + ) + end + + # The dimension value + sig { returns(String) } + attr_accessor :dimension_value + + # Display name for this dimension value + sig { returns(String) } + attr_accessor :display_name + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a unit amount item + sig do + params( + dimension_value: String, + display_name: String, + unit_amount: String + ).returns(T.attached_class) + end + def self.new( + # The dimension value + dimension_value:, + # Display name for this dimension value + display_name:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns( + { + dimension_value: String, + display_name: String, + unit_amount: String + } + ) + end + def to_hash + end + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -310,29 +437,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewFloatingMatrixWithDisplayNamePrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_floating_max_group_tiered_package_price.rbi b/rbi/orb/models/new_floating_max_group_tiered_package_price.rbi index ca741842..556d5994 100644 --- a/rbi/orb/models/new_floating_max_group_tiered_package_price.rbi +++ b/rbi/orb/models/new_floating_max_group_tiered_package_price.rbi @@ -25,9 +25,23 @@ module Orb sig { returns(String) } attr_accessor :item_id - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :max_group_tiered_package_config + # Configuration for max_group_tiered_package pricing + sig do + returns( + Orb::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig + ) + end + attr_reader :max_group_tiered_package_config + + sig do + params( + max_group_tiered_package_config: + Orb::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::OrHash + ).void + end + attr_writer :max_group_tiered_package_config + # The pricing model type sig do returns(Orb::NewFloatingMaxGroupTieredPackagePrice::ModelType::OrSymbol) end @@ -127,7 +141,8 @@ module Orb Orb::NewFloatingMaxGroupTieredPackagePrice::Cadence::OrSymbol, currency: String, item_id: String, - max_group_tiered_package_config: T::Hash[Symbol, T.anything], + max_group_tiered_package_config: + Orb::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::OrHash, model_type: Orb::NewFloatingMaxGroupTieredPackagePrice::ModelType::OrSymbol, name: String, @@ -160,7 +175,9 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # Configuration for max_group_tiered_package pricing max_group_tiered_package_config:, + # The pricing model type model_type:, # The name of the price. name:, @@ -203,7 +220,8 @@ module Orb Orb::NewFloatingMaxGroupTieredPackagePrice::Cadence::OrSymbol, currency: String, item_id: String, - max_group_tiered_package_config: T::Hash[Symbol, T.anything], + max_group_tiered_package_config: + Orb::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig, model_type: Orb::NewFloatingMaxGroupTieredPackagePrice::ModelType::OrSymbol, name: String, @@ -285,6 +303,109 @@ module Orb end end + class MaxGroupTieredPackageConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before tiering the group with the highest value + sig { returns(String) } + attr_accessor :grouping_key + + # Package size + sig { returns(String) } + attr_accessor :package_size + + # Apply tiered pricing to the largest group after grouping with the provided key. + sig do + returns( + T::Array[ + Orb::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for max_group_tiered_package pricing + sig do + params( + grouping_key: String, + package_size: String, + tiers: + T::Array[ + Orb::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before tiering the group with the highest value + grouping_key:, + # Package size + package_size:, + # Apply tiered pricing to the largest group after grouping with the provided key. + tiers: + ) + end + + sig do + override.returns( + { + grouping_key: String, + package_size: String, + tiers: + T::Array[ + Orb::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tier + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Tier lower bound + tier_lower_bound:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns({ tier_lower_bound: String, unit_amount: String }) + end + def to_hash + end + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -310,29 +431,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewFloatingMaxGroupTieredPackagePrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_floating_tiered_bps_price.rbi b/rbi/orb/models/new_floating_minimum_composite_price.rbi similarity index 71% rename from rbi/orb/models/new_floating_tiered_bps_price.rbi rename to rbi/orb/models/new_floating_minimum_composite_price.rbi index fd95f66a..b00766f7 100644 --- a/rbi/orb/models/new_floating_tiered_bps_price.rbi +++ b/rbi/orb/models/new_floating_minimum_composite_price.rbi @@ -2,14 +2,14 @@ module Orb module Models - class NewFloatingTieredBPSPrice < Orb::Internal::Type::BaseModel + class NewFloatingMinimumCompositePrice < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::NewFloatingTieredBPSPrice, Orb::Internal::AnyHash) + T.any(Orb::NewFloatingMinimumCompositePrice, Orb::Internal::AnyHash) end # The cadence to bill for this price on. - sig { returns(Orb::NewFloatingTieredBPSPrice::Cadence::OrSymbol) } + sig { returns(Orb::NewFloatingMinimumCompositePrice::Cadence::OrSymbol) } attr_accessor :cadence # An ISO 4217 currency string for which this price is billed in. @@ -20,19 +20,28 @@ module Orb sig { returns(String) } attr_accessor :item_id - sig { returns(Orb::NewFloatingTieredBPSPrice::ModelType::OrSymbol) } + # Configuration for minimum pricing + sig { returns(Orb::NewFloatingMinimumCompositePrice::MinimumConfig) } + attr_reader :minimum_config + + sig do + params( + minimum_config: + Orb::NewFloatingMinimumCompositePrice::MinimumConfig::OrHash + ).void + end + attr_writer :minimum_config + + # The pricing model type + sig do + returns(Orb::NewFloatingMinimumCompositePrice::ModelType::OrSymbol) + end attr_accessor :model_type # The name of the price. sig { returns(String) } attr_accessor :name - sig { returns(Orb::TieredBPSConfig) } - attr_reader :tiered_bps_config - - sig { params(tiered_bps_config: Orb::TieredBPSConfig::OrHash).void } - attr_writer :tiered_bps_config - # The id of the billable metric for the price. Only needed if the price is # usage-based. sig { returns(T.nilable(String)) } @@ -119,12 +128,14 @@ module Orb sig do params( - cadence: Orb::NewFloatingTieredBPSPrice::Cadence::OrSymbol, + cadence: Orb::NewFloatingMinimumCompositePrice::Cadence::OrSymbol, currency: String, item_id: String, - model_type: Orb::NewFloatingTieredBPSPrice::ModelType::OrSymbol, + minimum_config: + Orb::NewFloatingMinimumCompositePrice::MinimumConfig::OrHash, + model_type: + Orb::NewFloatingMinimumCompositePrice::ModelType::OrSymbol, name: String, - tiered_bps_config: Orb::TieredBPSConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -154,10 +165,12 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # Configuration for minimum pricing + minimum_config:, + # The pricing model type model_type:, # The name of the price. name:, - tiered_bps_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. billable_metric_id: nil, @@ -193,12 +206,14 @@ module Orb sig do override.returns( { - cadence: Orb::NewFloatingTieredBPSPrice::Cadence::OrSymbol, + cadence: Orb::NewFloatingMinimumCompositePrice::Cadence::OrSymbol, currency: String, item_id: String, - model_type: Orb::NewFloatingTieredBPSPrice::ModelType::OrSymbol, + minimum_config: + Orb::NewFloatingMinimumCompositePrice::MinimumConfig, + model_type: + Orb::NewFloatingMinimumCompositePrice::ModelType::OrSymbol, name: String, - tiered_bps_config: Orb::TieredBPSConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -231,85 +246,117 @@ module Orb TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::NewFloatingTieredBPSPrice::Cadence) + T.all(Symbol, Orb::NewFloatingMinimumCompositePrice::Cadence) end OrSymbol = T.type_alias { T.any(Symbol, String) } ANNUAL = - T.let(:annual, Orb::NewFloatingTieredBPSPrice::Cadence::TaggedSymbol) + T.let( + :annual, + Orb::NewFloatingMinimumCompositePrice::Cadence::TaggedSymbol + ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::NewFloatingTieredBPSPrice::Cadence::TaggedSymbol + Orb::NewFloatingMinimumCompositePrice::Cadence::TaggedSymbol ) MONTHLY = - T.let(:monthly, Orb::NewFloatingTieredBPSPrice::Cadence::TaggedSymbol) + T.let( + :monthly, + Orb::NewFloatingMinimumCompositePrice::Cadence::TaggedSymbol + ) QUARTERLY = T.let( :quarterly, - Orb::NewFloatingTieredBPSPrice::Cadence::TaggedSymbol + Orb::NewFloatingMinimumCompositePrice::Cadence::TaggedSymbol ) ONE_TIME = T.let( :one_time, - Orb::NewFloatingTieredBPSPrice::Cadence::TaggedSymbol + Orb::NewFloatingMinimumCompositePrice::Cadence::TaggedSymbol ) CUSTOM = - T.let(:custom, Orb::NewFloatingTieredBPSPrice::Cadence::TaggedSymbol) + T.let( + :custom, + Orb::NewFloatingMinimumCompositePrice::Cadence::TaggedSymbol + ) sig do override.returns( - T::Array[Orb::NewFloatingTieredBPSPrice::Cadence::TaggedSymbol] + T::Array[ + Orb::NewFloatingMinimumCompositePrice::Cadence::TaggedSymbol + ] ) end def self.values end end - module ModelType - extend Orb::Internal::Type::Enum - - TaggedSymbol = + class MinimumConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do - T.all(Symbol, Orb::NewFloatingTieredBPSPrice::ModelType) + T.any( + Orb::NewFloatingMinimumCompositePrice::MinimumConfig, + Orb::Internal::AnyHash + ) end - OrSymbol = T.type_alias { T.any(Symbol, String) } - TIERED_BPS = - T.let( - :tiered_bps, - Orb::NewFloatingTieredBPSPrice::ModelType::TaggedSymbol - ) + # The minimum amount to apply + sig { returns(String) } + attr_accessor :minimum_amount + + # If true, subtotals from this price are prorated based on the service period + sig { returns(T.nilable(T::Boolean)) } + attr_reader :prorated + sig { params(prorated: T::Boolean).void } + attr_writer :prorated + + # Configuration for minimum pricing sig do - override.returns( - T::Array[Orb::NewFloatingTieredBPSPrice::ModelType::TaggedSymbol] + params(minimum_amount: String, prorated: T::Boolean).returns( + T.attached_class ) end - def self.values + def self.new( + # The minimum amount to apply + minimum_amount:, + # If true, subtotals from this price are prorated based on the service period + prorated: nil + ) + end + + sig do + override.returns({ minimum_amount: String, prorated: T::Boolean }) + end + def to_hash end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union + # The pricing model type + module ModelType + extend Orb::Internal::Type::Enum - Variants = + TaggedSymbol = T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) + T.all(Symbol, Orb::NewFloatingMinimumCompositePrice::ModelType) end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MINIMUM = + T.let( + :minimum, + Orb::NewFloatingMinimumCompositePrice::ModelType::TaggedSymbol + ) sig do override.returns( T::Array[ - Orb::NewFloatingTieredBPSPrice::ConversionRateConfig::Variants + Orb::NewFloatingMinimumCompositePrice::ModelType::TaggedSymbol ] ) end - def self.variants + def self.values end end end diff --git a/rbi/orb/models/new_floating_package_price.rbi b/rbi/orb/models/new_floating_package_price.rbi index 6451becd..eea41673 100644 --- a/rbi/orb/models/new_floating_package_price.rbi +++ b/rbi/orb/models/new_floating_package_price.rbi @@ -20,6 +20,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewFloatingPackagePrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -27,6 +28,7 @@ module Orb sig { returns(String) } attr_accessor :name + # Configuration for package pricing sig { returns(Orb::PackageConfig) } attr_reader :package_config @@ -154,9 +156,11 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for package pricing package_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -258,6 +262,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -278,29 +283,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewFloatingPackagePrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_floating_package_with_allocation_price.rbi b/rbi/orb/models/new_floating_package_with_allocation_price.rbi index a5023bda..7b3dc646 100644 --- a/rbi/orb/models/new_floating_package_with_allocation_price.rbi +++ b/rbi/orb/models/new_floating_package_with_allocation_price.rbi @@ -25,6 +25,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewFloatingPackageWithAllocationPrice::ModelType::OrSymbol) end @@ -34,8 +35,21 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :package_with_allocation_config + # Configuration for package_with_allocation pricing + sig do + returns( + Orb::NewFloatingPackageWithAllocationPrice::PackageWithAllocationConfig + ) + end + attr_reader :package_with_allocation_config + + sig do + params( + package_with_allocation_config: + Orb::NewFloatingPackageWithAllocationPrice::PackageWithAllocationConfig::OrHash + ).void + end + attr_writer :package_with_allocation_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -130,7 +144,8 @@ module Orb model_type: Orb::NewFloatingPackageWithAllocationPrice::ModelType::OrSymbol, name: String, - package_with_allocation_config: T::Hash[Symbol, T.anything], + package_with_allocation_config: + Orb::NewFloatingPackageWithAllocationPrice::PackageWithAllocationConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -160,9 +175,11 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for package_with_allocation pricing package_with_allocation_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -206,7 +223,8 @@ module Orb model_type: Orb::NewFloatingPackageWithAllocationPrice::ModelType::OrSymbol, name: String, - package_with_allocation_config: T::Hash[Symbol, T.anything], + package_with_allocation_config: + Orb::NewFloatingPackageWithAllocationPrice::PackageWithAllocationConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -285,6 +303,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -311,26 +330,51 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class PackageWithAllocationConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewFloatingPackageWithAllocationPrice::PackageWithAllocationConfig, + Orb::Internal::AnyHash ) end + # Usage allocation + sig { returns(String) } + attr_accessor :allocation + + # Price per package + sig { returns(String) } + attr_accessor :package_amount + + # Package size + sig { returns(String) } + attr_accessor :package_size + + # Configuration for package_with_allocation pricing + sig do + params( + allocation: String, + package_amount: String, + package_size: String + ).returns(T.attached_class) + end + def self.new( + # Usage allocation + allocation:, + # Price per package + package_amount:, + # Package size + package_size: + ) + end + sig do override.returns( - T::Array[ - Orb::NewFloatingPackageWithAllocationPrice::ConversionRateConfig::Variants - ] + { allocation: String, package_amount: String, package_size: String } ) end - def self.variants + def to_hash end end end diff --git a/rbi/orb/models/new_floating_scalable_matrix_with_tiered_pricing_price.rbi b/rbi/orb/models/new_floating_scalable_matrix_with_tiered_pricing_price.rbi index 0ad40b5f..5758256b 100644 --- a/rbi/orb/models/new_floating_scalable_matrix_with_tiered_pricing_price.rbi +++ b/rbi/orb/models/new_floating_scalable_matrix_with_tiered_pricing_price.rbi @@ -27,6 +27,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns( Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ModelType::OrSymbol @@ -38,8 +39,21 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :scalable_matrix_with_tiered_pricing_config + # Configuration for scalable_matrix_with_tiered_pricing pricing + sig do + returns( + Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig + ) + end + attr_reader :scalable_matrix_with_tiered_pricing_config + + sig do + params( + scalable_matrix_with_tiered_pricing_config: + Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::OrHash + ).void + end + attr_writer :scalable_matrix_with_tiered_pricing_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -135,7 +149,7 @@ module Orb Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ModelType::OrSymbol, name: String, scalable_matrix_with_tiered_pricing_config: - T::Hash[Symbol, T.anything], + Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -165,9 +179,11 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for scalable_matrix_with_tiered_pricing pricing scalable_matrix_with_tiered_pricing_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -212,7 +228,7 @@ module Orb Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ModelType::OrSymbol, name: String, scalable_matrix_with_tiered_pricing_config: - T::Hash[Symbol, T.anything], + Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -294,6 +310,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -323,26 +340,177 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class ScalableMatrixWithTieredPricingConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig, + Orb::Internal::AnyHash ) end + # Used for the scalable matrix first dimension + sig { returns(String) } + attr_accessor :first_dimension + + # Apply a scaling factor to each dimension sig do - override.returns( + returns( + T::Array[ + Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor + ] + ) + end + attr_accessor :matrix_scaling_factors + + # Tier pricing structure + sig do + returns( T::Array[ - Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ConversionRateConfig::Variants + Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier ] ) end - def self.variants + attr_accessor :tiers + + # Used for the scalable matrix second dimension (optional) + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension + + # Configuration for scalable_matrix_with_tiered_pricing pricing + sig do + params( + first_dimension: String, + matrix_scaling_factors: + T::Array[ + Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor::OrHash + ], + tiers: + T::Array[ + Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier::OrHash + ], + second_dimension: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Used for the scalable matrix first dimension + first_dimension:, + # Apply a scaling factor to each dimension + matrix_scaling_factors:, + # Tier pricing structure + tiers:, + # Used for the scalable matrix second dimension (optional) + second_dimension: nil + ) + end + + sig do + override.returns( + { + first_dimension: String, + matrix_scaling_factors: + T::Array[ + Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor + ], + tiers: + T::Array[ + Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier + ], + second_dimension: T.nilable(String) + } + ) + end + def to_hash + end + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor, + Orb::Internal::AnyHash + ) + end + + # First dimension value + sig { returns(String) } + attr_accessor :first_dimension_value + + # Scaling factor + sig { returns(String) } + attr_accessor :scaling_factor + + # Second dimension value (optional) + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension_value + + # Configuration for a single matrix scaling factor + sig do + params( + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # First dimension value + first_dimension_value:, + # Scaling factor + scaling_factor:, + # Second dimension value (optional) + second_dimension_value: nil + ) + end + + sig do + override.returns( + { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tier entry with business logic + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Tier lower bound + tier_lower_bound:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns({ tier_lower_bound: String, unit_amount: String }) + end + def to_hash + end end end end diff --git a/rbi/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rbi b/rbi/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rbi index be0cc128..d0293527 100644 --- a/rbi/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rbi +++ b/rbi/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rbi @@ -27,6 +27,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns( Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ModelType::OrSymbol @@ -38,8 +39,21 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :scalable_matrix_with_unit_pricing_config + # Configuration for scalable_matrix_with_unit_pricing pricing + sig do + returns( + Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig + ) + end + attr_reader :scalable_matrix_with_unit_pricing_config + + sig do + params( + scalable_matrix_with_unit_pricing_config: + Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::OrHash + ).void + end + attr_writer :scalable_matrix_with_unit_pricing_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -134,7 +148,8 @@ module Orb model_type: Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ModelType::OrSymbol, name: String, - scalable_matrix_with_unit_pricing_config: T::Hash[Symbol, T.anything], + scalable_matrix_with_unit_pricing_config: + Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -164,9 +179,11 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for scalable_matrix_with_unit_pricing pricing scalable_matrix_with_unit_pricing_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -211,7 +228,7 @@ module Orb Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ModelType::OrSymbol, name: String, scalable_matrix_with_unit_pricing_config: - T::Hash[Symbol, T.anything], + Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -293,6 +310,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -322,26 +340,135 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class ScalableMatrixWithUnitPricingConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig, + Orb::Internal::AnyHash ) end + # Used to determine the unit rate + sig { returns(String) } + attr_accessor :first_dimension + + # Apply a scaling factor to each dimension sig do - override.returns( + returns( T::Array[ - Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ConversionRateConfig::Variants + Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor ] ) end - def self.variants + attr_accessor :matrix_scaling_factors + + # The final unit price to rate against the output of the matrix + sig { returns(String) } + attr_accessor :unit_price + + # If true, the unit price will be prorated to the billing period + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :prorate + + # Used to determine the unit rate (optional) + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension + + # Configuration for scalable_matrix_with_unit_pricing pricing + sig do + params( + first_dimension: String, + matrix_scaling_factors: + T::Array[ + Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor::OrHash + ], + unit_price: String, + prorate: T.nilable(T::Boolean), + second_dimension: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Used to determine the unit rate + first_dimension:, + # Apply a scaling factor to each dimension + matrix_scaling_factors:, + # The final unit price to rate against the output of the matrix + unit_price:, + # If true, the unit price will be prorated to the billing period + prorate: nil, + # Used to determine the unit rate (optional) + second_dimension: nil + ) + end + + sig do + override.returns( + { + first_dimension: String, + matrix_scaling_factors: + T::Array[ + Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor + ], + unit_price: String, + prorate: T.nilable(T::Boolean), + second_dimension: T.nilable(String) + } + ) + end + def to_hash + end + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor, + Orb::Internal::AnyHash + ) + end + + # First dimension value + sig { returns(String) } + attr_accessor :first_dimension_value + + # Scaling factor + sig { returns(String) } + attr_accessor :scaling_factor + + # Second dimension value (optional) + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension_value + + # Configuration for a single matrix scaling factor + sig do + params( + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # First dimension value + first_dimension_value:, + # Scaling factor + scaling_factor:, + # Second dimension value (optional) + second_dimension_value: nil + ) + end + + sig do + override.returns( + { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: T.nilable(String) + } + ) + end + def to_hash + end end end end diff --git a/rbi/orb/models/new_floating_threshold_total_amount_price.rbi b/rbi/orb/models/new_floating_threshold_total_amount_price.rbi index ea37b05e..254324b1 100644 --- a/rbi/orb/models/new_floating_threshold_total_amount_price.rbi +++ b/rbi/orb/models/new_floating_threshold_total_amount_price.rbi @@ -25,6 +25,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewFloatingThresholdTotalAmountPrice::ModelType::OrSymbol) end @@ -34,8 +35,21 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :threshold_total_amount_config + # Configuration for threshold_total_amount pricing + sig do + returns( + Orb::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig + ) + end + attr_reader :threshold_total_amount_config + + sig do + params( + threshold_total_amount_config: + Orb::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig::OrHash + ).void + end + attr_writer :threshold_total_amount_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -129,7 +143,8 @@ module Orb model_type: Orb::NewFloatingThresholdTotalAmountPrice::ModelType::OrSymbol, name: String, - threshold_total_amount_config: T::Hash[Symbol, T.anything], + threshold_total_amount_config: + Orb::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -159,9 +174,11 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for threshold_total_amount pricing threshold_total_amount_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -205,7 +222,8 @@ module Orb model_type: Orb::NewFloatingThresholdTotalAmountPrice::ModelType::OrSymbol, name: String, - threshold_total_amount_config: T::Hash[Symbol, T.anything], + threshold_total_amount_config: + Orb::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -284,6 +302,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -310,26 +329,97 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class ThresholdTotalAmountConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig, + Orb::Internal::AnyHash ) end + # When the quantity consumed passes a provided threshold, the configured total + # will be charged sig do - override.returns( + returns( T::Array[ - Orb::NewFloatingThresholdTotalAmountPrice::ConversionRateConfig::Variants + Orb::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable ] ) end - def self.variants + attr_accessor :consumption_table + + # If true, the unit price will be prorated to the billing period + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :prorate + + # Configuration for threshold_total_amount pricing + sig do + params( + consumption_table: + T::Array[ + Orb::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable::OrHash + ], + prorate: T.nilable(T::Boolean) + ).returns(T.attached_class) + end + def self.new( + # When the quantity consumed passes a provided threshold, the configured total + # will be charged + consumption_table:, + # If true, the unit price will be prorated to the billing period + prorate: nil + ) + end + + sig do + override.returns( + { + consumption_table: + T::Array[ + Orb::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable + ], + prorate: T.nilable(T::Boolean) + } + ) + end + def to_hash + end + + class ConsumptionTable < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable, + Orb::Internal::AnyHash + ) + end + + # Quantity threshold + sig { returns(String) } + attr_accessor :threshold + + # Total amount for this threshold + sig { returns(String) } + attr_accessor :total_amount + + # Configuration for a single threshold + sig do + params(threshold: String, total_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Quantity threshold + threshold:, + # Total amount for this threshold + total_amount: + ) + end + + sig { override.returns({ threshold: String, total_amount: String }) } + def to_hash + end end end end diff --git a/rbi/orb/models/new_floating_tiered_package_price.rbi b/rbi/orb/models/new_floating_tiered_package_price.rbi index b47ffb26..9dbf7cd2 100644 --- a/rbi/orb/models/new_floating_tiered_package_price.rbi +++ b/rbi/orb/models/new_floating_tiered_package_price.rbi @@ -20,6 +20,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewFloatingTieredPackagePrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -27,8 +28,17 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_package_config + # Configuration for tiered_package pricing + sig { returns(Orb::NewFloatingTieredPackagePrice::TieredPackageConfig) } + attr_reader :tiered_package_config + + sig do + params( + tiered_package_config: + Orb::NewFloatingTieredPackagePrice::TieredPackageConfig::OrHash + ).void + end + attr_writer :tiered_package_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -121,7 +131,8 @@ module Orb item_id: String, model_type: Orb::NewFloatingTieredPackagePrice::ModelType::OrSymbol, name: String, - tiered_package_config: T::Hash[Symbol, T.anything], + tiered_package_config: + Orb::NewFloatingTieredPackagePrice::TieredPackageConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -151,9 +162,11 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for tiered_package pricing tiered_package_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -195,7 +208,8 @@ module Orb item_id: String, model_type: Orb::NewFloatingTieredPackagePrice::ModelType::OrSymbol, name: String, - tiered_package_config: T::Hash[Symbol, T.anything], + tiered_package_config: + Orb::NewFloatingTieredPackagePrice::TieredPackageConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -272,6 +286,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -298,26 +313,103 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class TieredPackageConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewFloatingTieredPackagePrice::TieredPackageConfig, + Orb::Internal::AnyHash ) end + # Package size + sig { returns(String) } + attr_accessor :package_size + + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. The tier bounds are defined based on + # the total quantity rather than the number of packages, so they must be multiples + # of the package size. sig do - override.returns( + returns( T::Array[ - Orb::NewFloatingTieredPackagePrice::ConversionRateConfig::Variants + Orb::NewFloatingTieredPackagePrice::TieredPackageConfig::Tier ] ) end - def self.variants + attr_accessor :tiers + + # Configuration for tiered_package pricing + sig do + params( + package_size: String, + tiers: + T::Array[ + Orb::NewFloatingTieredPackagePrice::TieredPackageConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Package size + package_size:, + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. The tier bounds are defined based on + # the total quantity rather than the number of packages, so they must be multiples + # of the package size. + tiers: + ) + end + + sig do + override.returns( + { + package_size: String, + tiers: + T::Array[ + Orb::NewFloatingTieredPackagePrice::TieredPackageConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingTieredPackagePrice::TieredPackageConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Price per package + sig { returns(String) } + attr_accessor :per_unit + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Configuration for a single tier with business logic + sig do + params(per_unit: String, tier_lower_bound: String).returns( + T.attached_class + ) + end + def self.new( + # Price per package + per_unit:, + # Tier lower bound + tier_lower_bound: + ) + end + + sig do + override.returns({ per_unit: String, tier_lower_bound: String }) + end + def to_hash + end end end end diff --git a/rbi/orb/models/new_floating_tiered_package_with_minimum_price.rbi b/rbi/orb/models/new_floating_tiered_package_with_minimum_price.rbi index 8b4ff4be..7c599a5e 100644 --- a/rbi/orb/models/new_floating_tiered_package_with_minimum_price.rbi +++ b/rbi/orb/models/new_floating_tiered_package_with_minimum_price.rbi @@ -27,6 +27,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns( Orb::NewFloatingTieredPackageWithMinimumPrice::ModelType::OrSymbol @@ -38,8 +39,21 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_package_with_minimum_config + # Configuration for tiered_package_with_minimum pricing + sig do + returns( + Orb::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig + ) + end + attr_reader :tiered_package_with_minimum_config + + sig do + params( + tiered_package_with_minimum_config: + Orb::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::OrHash + ).void + end + attr_writer :tiered_package_with_minimum_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -134,7 +148,8 @@ module Orb model_type: Orb::NewFloatingTieredPackageWithMinimumPrice::ModelType::OrSymbol, name: String, - tiered_package_with_minimum_config: T::Hash[Symbol, T.anything], + tiered_package_with_minimum_config: + Orb::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -164,9 +179,11 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for tiered_package_with_minimum pricing tiered_package_with_minimum_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -210,7 +227,8 @@ module Orb model_type: Orb::NewFloatingTieredPackageWithMinimumPrice::ModelType::OrSymbol, name: String, - tiered_package_with_minimum_config: T::Hash[Symbol, T.anything], + tiered_package_with_minimum_config: + Orb::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -292,6 +310,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -321,26 +340,113 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class TieredPackageWithMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig, + Orb::Internal::AnyHash ) end + # Package size + sig { returns(Float) } + attr_accessor :package_size + + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. sig do - override.returns( + returns( T::Array[ - Orb::NewFloatingTieredPackageWithMinimumPrice::ConversionRateConfig::Variants + Orb::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier ] ) end - def self.variants + attr_accessor :tiers + + # Configuration for tiered_package_with_minimum pricing + sig do + params( + package_size: Float, + tiers: + T::Array[ + Orb::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Package size + package_size:, + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + tiers: + ) + end + + sig do + override.returns( + { + package_size: Float, + tiers: + T::Array[ + Orb::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Minimum amount + sig { returns(String) } + attr_accessor :minimum_amount + + # Price per package + sig { returns(String) } + attr_accessor :per_unit + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Configuration for a single tier + sig do + params( + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + ).returns(T.attached_class) + end + def self.new( + # Minimum amount + minimum_amount:, + # Price per package + per_unit:, + # Tier lower bound + tier_lower_bound: + ) + end + + sig do + override.returns( + { + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + } + ) + end + def to_hash + end end end end diff --git a/rbi/orb/models/new_floating_tiered_price.rbi b/rbi/orb/models/new_floating_tiered_price.rbi index abbd6bef..ebfa9b94 100644 --- a/rbi/orb/models/new_floating_tiered_price.rbi +++ b/rbi/orb/models/new_floating_tiered_price.rbi @@ -20,6 +20,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewFloatingTieredPrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -27,6 +28,7 @@ module Orb sig { returns(String) } attr_accessor :name + # Configuration for tiered pricing sig { returns(Orb::TieredConfig) } attr_reader :tiered_config @@ -154,9 +156,11 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for tiered pricing tiered_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -258,6 +262,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -276,29 +281,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewFloatingTieredPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_floating_tiered_with_minimum_price.rbi b/rbi/orb/models/new_floating_tiered_with_minimum_price.rbi index 21bc9098..f85bc7ee 100644 --- a/rbi/orb/models/new_floating_tiered_with_minimum_price.rbi +++ b/rbi/orb/models/new_floating_tiered_with_minimum_price.rbi @@ -20,6 +20,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewFloatingTieredWithMinimumPrice::ModelType::OrSymbol) end @@ -29,8 +30,19 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_with_minimum_config + # Configuration for tiered_with_minimum pricing + sig do + returns(Orb::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig) + end + attr_reader :tiered_with_minimum_config + + sig do + params( + tiered_with_minimum_config: + Orb::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig::OrHash + ).void + end + attr_writer :tiered_with_minimum_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -124,7 +136,8 @@ module Orb model_type: Orb::NewFloatingTieredWithMinimumPrice::ModelType::OrSymbol, name: String, - tiered_with_minimum_config: T::Hash[Symbol, T.anything], + tiered_with_minimum_config: + Orb::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -154,9 +167,11 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for tiered_with_minimum pricing tiered_with_minimum_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -199,7 +214,8 @@ module Orb model_type: Orb::NewFloatingTieredWithMinimumPrice::ModelType::OrSymbol, name: String, - tiered_with_minimum_config: T::Hash[Symbol, T.anything], + tiered_with_minimum_config: + Orb::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -278,6 +294,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -304,26 +321,127 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class TieredWithMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig, + Orb::Internal::AnyHash ) end + # Tiered pricing with a minimum amount dependent on the volume tier. Tiers are + # defined using exclusive lower bounds. sig do - override.returns( + returns( T::Array[ - Orb::NewFloatingTieredWithMinimumPrice::ConversionRateConfig::Variants + Orb::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig::Tier ] ) end - def self.variants + attr_accessor :tiers + + # If true, tiers with an accrued amount of 0 will not be included in the rating. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :hide_zero_amount_tiers + + sig { params(hide_zero_amount_tiers: T::Boolean).void } + attr_writer :hide_zero_amount_tiers + + # If true, the unit price will be prorated to the billing period + sig { returns(T.nilable(T::Boolean)) } + attr_reader :prorate + + sig { params(prorate: T::Boolean).void } + attr_writer :prorate + + # Configuration for tiered_with_minimum pricing + sig do + params( + tiers: + T::Array[ + Orb::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig::Tier::OrHash + ], + hide_zero_amount_tiers: T::Boolean, + prorate: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # Tiered pricing with a minimum amount dependent on the volume tier. Tiers are + # defined using exclusive lower bounds. + tiers:, + # If true, tiers with an accrued amount of 0 will not be included in the rating. + hide_zero_amount_tiers: nil, + # If true, the unit price will be prorated to the billing period + prorate: nil + ) + end + + sig do + override.returns( + { + tiers: + T::Array[ + Orb::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig::Tier + ], + hide_zero_amount_tiers: T::Boolean, + prorate: T::Boolean + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Minimum amount + sig { returns(String) } + attr_accessor :minimum_amount + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tier + sig do + params( + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + ).returns(T.attached_class) + end + def self.new( + # Minimum amount + minimum_amount:, + # Tier lower bound + tier_lower_bound:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns( + { + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + } + ) + end + def to_hash + end end end end diff --git a/rbi/orb/models/new_floating_tiered_with_proration_price.rbi b/rbi/orb/models/new_floating_tiered_with_proration_price.rbi index 152bd298..8a3fd573 100644 --- a/rbi/orb/models/new_floating_tiered_with_proration_price.rbi +++ b/rbi/orb/models/new_floating_tiered_with_proration_price.rbi @@ -25,6 +25,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewFloatingTieredWithProrationPrice::ModelType::OrSymbol) end @@ -34,8 +35,21 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_with_proration_config + # Configuration for tiered_with_proration pricing + sig do + returns( + Orb::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig + ) + end + attr_reader :tiered_with_proration_config + + sig do + params( + tiered_with_proration_config: + Orb::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig::OrHash + ).void + end + attr_writer :tiered_with_proration_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -129,7 +143,8 @@ module Orb model_type: Orb::NewFloatingTieredWithProrationPrice::ModelType::OrSymbol, name: String, - tiered_with_proration_config: T::Hash[Symbol, T.anything], + tiered_with_proration_config: + Orb::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -159,9 +174,11 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for tiered_with_proration pricing tiered_with_proration_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -205,7 +222,8 @@ module Orb model_type: Orb::NewFloatingTieredWithProrationPrice::ModelType::OrSymbol, name: String, - tiered_with_proration_config: T::Hash[Symbol, T.anything], + tiered_with_proration_config: + Orb::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -284,6 +302,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -310,26 +329,91 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig, + Orb::Internal::AnyHash ) end + # Tiers for rating based on total usage quantities into the specified tier with + # proration sig do - override.returns( + returns( T::Array[ - Orb::NewFloatingTieredWithProrationPrice::ConversionRateConfig::Variants + Orb::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig::Tier ] ) end - def self.variants + attr_accessor :tiers + + # Configuration for tiered_with_proration pricing + sig do + params( + tiers: + T::Array[ + Orb::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Tiers for rating based on total usage quantities into the specified tier with + # proration + tiers: + ) + end + + sig do + override.returns( + { + tiers: + T::Array[ + Orb::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Inclusive tier starting value + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Amount per unit + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tiered with proration tier + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Inclusive tier starting value + tier_lower_bound:, + # Amount per unit + unit_amount: + ) + end + + sig do + override.returns({ tier_lower_bound: String, unit_amount: String }) + end + def to_hash + end end end end diff --git a/rbi/orb/models/new_floating_unit_price.rbi b/rbi/orb/models/new_floating_unit_price.rbi index 73abcb72..30765184 100644 --- a/rbi/orb/models/new_floating_unit_price.rbi +++ b/rbi/orb/models/new_floating_unit_price.rbi @@ -20,6 +20,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewFloatingUnitPrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -27,6 +28,7 @@ module Orb sig { returns(String) } attr_accessor :name + # Configuration for unit pricing sig { returns(Orb::UnitConfig) } attr_reader :unit_config @@ -154,9 +156,11 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for unit pricing unit_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -255,6 +259,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -272,27 +277,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[Orb::NewFloatingUnitPrice::ConversionRateConfig::Variants] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_floating_unit_with_percent_price.rbi b/rbi/orb/models/new_floating_unit_with_percent_price.rbi index 087b5cb9..10225e9c 100644 --- a/rbi/orb/models/new_floating_unit_with_percent_price.rbi +++ b/rbi/orb/models/new_floating_unit_with_percent_price.rbi @@ -20,6 +20,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewFloatingUnitWithPercentPrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -27,8 +28,19 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :unit_with_percent_config + # Configuration for unit_with_percent pricing + sig do + returns(Orb::NewFloatingUnitWithPercentPrice::UnitWithPercentConfig) + end + attr_reader :unit_with_percent_config + + sig do + params( + unit_with_percent_config: + Orb::NewFloatingUnitWithPercentPrice::UnitWithPercentConfig::OrHash + ).void + end + attr_writer :unit_with_percent_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -121,7 +133,8 @@ module Orb item_id: String, model_type: Orb::NewFloatingUnitWithPercentPrice::ModelType::OrSymbol, name: String, - unit_with_percent_config: T::Hash[Symbol, T.anything], + unit_with_percent_config: + Orb::NewFloatingUnitWithPercentPrice::UnitWithPercentConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -151,9 +164,11 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for unit_with_percent pricing unit_with_percent_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -196,7 +211,8 @@ module Orb model_type: Orb::NewFloatingUnitWithPercentPrice::ModelType::OrSymbol, name: String, - unit_with_percent_config: T::Hash[Symbol, T.anything], + unit_with_percent_config: + Orb::NewFloatingUnitWithPercentPrice::UnitWithPercentConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -275,6 +291,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -301,26 +318,37 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class UnitWithPercentConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewFloatingUnitWithPercentPrice::UnitWithPercentConfig, + Orb::Internal::AnyHash ) end + # What percent, out of 100, of the calculated total to charge + sig { returns(String) } + attr_accessor :percent + + # Rate per unit of usage + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for unit_with_percent pricing sig do - override.returns( - T::Array[ - Orb::NewFloatingUnitWithPercentPrice::ConversionRateConfig::Variants - ] - ) + params(percent: String, unit_amount: String).returns(T.attached_class) end - def self.variants + def self.new( + # What percent, out of 100, of the calculated total to charge + percent:, + # Rate per unit of usage + unit_amount: + ) + end + + sig { override.returns({ percent: String, unit_amount: String }) } + def to_hash end end end diff --git a/rbi/orb/models/new_floating_unit_with_proration_price.rbi b/rbi/orb/models/new_floating_unit_with_proration_price.rbi index cc2f8e86..65daa0d7 100644 --- a/rbi/orb/models/new_floating_unit_with_proration_price.rbi +++ b/rbi/orb/models/new_floating_unit_with_proration_price.rbi @@ -20,6 +20,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewFloatingUnitWithProrationPrice::ModelType::OrSymbol) end @@ -29,8 +30,19 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :unit_with_proration_config + # Configuration for unit_with_proration pricing + sig do + returns(Orb::NewFloatingUnitWithProrationPrice::UnitWithProrationConfig) + end + attr_reader :unit_with_proration_config + + sig do + params( + unit_with_proration_config: + Orb::NewFloatingUnitWithProrationPrice::UnitWithProrationConfig::OrHash + ).void + end + attr_writer :unit_with_proration_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -124,7 +136,8 @@ module Orb model_type: Orb::NewFloatingUnitWithProrationPrice::ModelType::OrSymbol, name: String, - unit_with_proration_config: T::Hash[Symbol, T.anything], + unit_with_proration_config: + Orb::NewFloatingUnitWithProrationPrice::UnitWithProrationConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -154,9 +167,11 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for unit_with_proration pricing unit_with_proration_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -199,7 +214,8 @@ module Orb model_type: Orb::NewFloatingUnitWithProrationPrice::ModelType::OrSymbol, name: String, - unit_with_proration_config: T::Hash[Symbol, T.anything], + unit_with_proration_config: + Orb::NewFloatingUnitWithProrationPrice::UnitWithProrationConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -278,6 +294,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -304,26 +321,29 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class UnitWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewFloatingUnitWithProrationPrice::UnitWithProrationConfig, + Orb::Internal::AnyHash ) end - sig do - override.returns( - T::Array[ - Orb::NewFloatingUnitWithProrationPrice::ConversionRateConfig::Variants - ] - ) + # Rate per unit of usage + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for unit_with_proration pricing + sig { params(unit_amount: String).returns(T.attached_class) } + def self.new( + # Rate per unit of usage + unit_amount: + ) end - def self.variants + + sig { override.returns({ unit_amount: String }) } + def to_hash end end end diff --git a/rbi/orb/models/new_plan_bps_price.rbi b/rbi/orb/models/new_plan_bps_price.rbi deleted file mode 100644 index 2b2bc653..00000000 --- a/rbi/orb/models/new_plan_bps_price.rbi +++ /dev/null @@ -1,304 +0,0 @@ -# typed: strong - -module Orb - module Models - class NewPlanBPSPrice < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias { T.any(Orb::NewPlanBPSPrice, Orb::Internal::AnyHash) } - - sig { returns(Orb::BPSConfig) } - attr_reader :bps_config - - sig { params(bps_config: Orb::BPSConfig::OrHash).void } - attr_writer :bps_config - - # The cadence to bill for this price on. - sig { returns(Orb::NewPlanBPSPrice::Cadence::OrSymbol) } - attr_accessor :cadence - - # The id of the item the price will be associated with. - sig { returns(String) } - attr_accessor :item_id - - sig { returns(Orb::NewPlanBPSPrice::ModelType::OrSymbol) } - attr_accessor :model_type - - # The name of the price. - sig { returns(String) } - attr_accessor :name - - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - sig { returns(T.nilable(String)) } - attr_accessor :billable_metric_id - - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :billed_in_advance - - # For custom cadence: specifies the duration of the billing period in days or - # months. - sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } - attr_reader :billing_cycle_configuration - - sig do - params( - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash) - ).void - end - attr_writer :billing_cycle_configuration - - # The per unit conversion rate of the price currency to the invoicing currency. - sig { returns(T.nilable(Float)) } - attr_accessor :conversion_rate - - # The configuration for the rate of the price currency to the invoicing currency. - sig do - returns( - T.nilable( - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - ) - ) - end - attr_accessor :conversion_rate_config - - # An ISO 4217 currency string, or custom pricing unit identifier, in which this - # price is billed. - sig { returns(T.nilable(String)) } - attr_accessor :currency - - # For dimensional price: specifies a price group and dimension values - sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } - attr_reader :dimensional_price_configuration - - sig do - params( - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) - ).void - end - attr_writer :dimensional_price_configuration - - # An alias for the price. - sig { returns(T.nilable(String)) } - attr_accessor :external_price_id - - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - sig { returns(T.nilable(Float)) } - attr_accessor :fixed_price_quantity - - # The property used to group this price on an invoice - sig { returns(T.nilable(String)) } - attr_accessor :invoice_grouping_key - - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } - attr_reader :invoicing_cycle_configuration - - sig do - params( - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash) - ).void - end - attr_writer :invoicing_cycle_configuration - - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } - attr_accessor :metadata - - # A transient ID that can be used to reference this price when adding adjustments - # in the same API call. - sig { returns(T.nilable(String)) } - attr_accessor :reference_id - - sig do - params( - bps_config: Orb::BPSConfig::OrHash, - cadence: Orb::NewPlanBPSPrice::Cadence::OrSymbol, - item_id: String, - model_type: Orb::NewPlanBPSPrice::ModelType::OrSymbol, - name: String, - billable_metric_id: T.nilable(String), - billed_in_advance: T.nilable(T::Boolean), - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash), - conversion_rate: T.nilable(Float), - conversion_rate_config: - T.nilable( - T.any( - Orb::UnitConversionRateConfig::OrHash, - Orb::TieredConversionRateConfig::OrHash - ) - ), - currency: T.nilable(String), - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - invoice_grouping_key: T.nilable(String), - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash), - metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), - reference_id: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - bps_config:, - # The cadence to bill for this price on. - cadence:, - # The id of the item the price will be associated with. - item_id:, - model_type:, - # The name of the price. - name:, - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - billable_metric_id: nil, - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - billed_in_advance: nil, - # For custom cadence: specifies the duration of the billing period in days or - # months. - billing_cycle_configuration: nil, - # The per unit conversion rate of the price currency to the invoicing currency. - conversion_rate: nil, - # The configuration for the rate of the price currency to the invoicing currency. - conversion_rate_config: nil, - # An ISO 4217 currency string, or custom pricing unit identifier, in which this - # price is billed. - currency: nil, - # For dimensional price: specifies a price group and dimension values - dimensional_price_configuration: nil, - # An alias for the price. - external_price_id: nil, - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - fixed_price_quantity: nil, - # The property used to group this price on an invoice - invoice_grouping_key: nil, - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - invoicing_cycle_configuration: nil, - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - metadata: nil, - # A transient ID that can be used to reference this price when adding adjustments - # in the same API call. - reference_id: nil - ) - end - - sig do - override.returns( - { - bps_config: Orb::BPSConfig, - cadence: Orb::NewPlanBPSPrice::Cadence::OrSymbol, - item_id: String, - model_type: Orb::NewPlanBPSPrice::ModelType::OrSymbol, - name: String, - billable_metric_id: T.nilable(String), - billed_in_advance: T.nilable(T::Boolean), - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration), - conversion_rate: T.nilable(Float), - conversion_rate_config: - T.nilable( - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - ), - currency: T.nilable(String), - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - invoice_grouping_key: T.nilable(String), - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration), - metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), - reference_id: T.nilable(String) - } - ) - end - def to_hash - end - - # The cadence to bill for this price on. - module Cadence - extend Orb::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::NewPlanBPSPrice::Cadence) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ANNUAL = T.let(:annual, Orb::NewPlanBPSPrice::Cadence::TaggedSymbol) - SEMI_ANNUAL = - T.let(:semi_annual, Orb::NewPlanBPSPrice::Cadence::TaggedSymbol) - MONTHLY = T.let(:monthly, Orb::NewPlanBPSPrice::Cadence::TaggedSymbol) - QUARTERLY = - T.let(:quarterly, Orb::NewPlanBPSPrice::Cadence::TaggedSymbol) - ONE_TIME = T.let(:one_time, Orb::NewPlanBPSPrice::Cadence::TaggedSymbol) - CUSTOM = T.let(:custom, Orb::NewPlanBPSPrice::Cadence::TaggedSymbol) - - sig do - override.returns( - T::Array[Orb::NewPlanBPSPrice::Cadence::TaggedSymbol] - ) - end - def self.values - end - end - - module ModelType - extend Orb::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::NewPlanBPSPrice::ModelType) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - BPS = T.let(:bps, Orb::NewPlanBPSPrice::ModelType::TaggedSymbol) - - sig do - override.returns( - T::Array[Orb::NewPlanBPSPrice::ModelType::TaggedSymbol] - ) - end - def self.values - end - end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[Orb::NewPlanBPSPrice::ConversionRateConfig::Variants] - ) - end - def self.variants - end - end - end - end -end diff --git a/rbi/orb/models/new_plan_bulk_bps_price.rbi b/rbi/orb/models/new_plan_bulk_bps_price.rbi deleted file mode 100644 index 317416d5..00000000 --- a/rbi/orb/models/new_plan_bulk_bps_price.rbi +++ /dev/null @@ -1,307 +0,0 @@ -# typed: strong - -module Orb - module Models - class NewPlanBulkBPSPrice < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias { T.any(Orb::NewPlanBulkBPSPrice, Orb::Internal::AnyHash) } - - sig { returns(Orb::BulkBPSConfig) } - attr_reader :bulk_bps_config - - sig { params(bulk_bps_config: Orb::BulkBPSConfig::OrHash).void } - attr_writer :bulk_bps_config - - # The cadence to bill for this price on. - sig { returns(Orb::NewPlanBulkBPSPrice::Cadence::OrSymbol) } - attr_accessor :cadence - - # The id of the item the price will be associated with. - sig { returns(String) } - attr_accessor :item_id - - sig { returns(Orb::NewPlanBulkBPSPrice::ModelType::OrSymbol) } - attr_accessor :model_type - - # The name of the price. - sig { returns(String) } - attr_accessor :name - - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - sig { returns(T.nilable(String)) } - attr_accessor :billable_metric_id - - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :billed_in_advance - - # For custom cadence: specifies the duration of the billing period in days or - # months. - sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } - attr_reader :billing_cycle_configuration - - sig do - params( - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash) - ).void - end - attr_writer :billing_cycle_configuration - - # The per unit conversion rate of the price currency to the invoicing currency. - sig { returns(T.nilable(Float)) } - attr_accessor :conversion_rate - - # The configuration for the rate of the price currency to the invoicing currency. - sig do - returns( - T.nilable( - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - ) - ) - end - attr_accessor :conversion_rate_config - - # An ISO 4217 currency string, or custom pricing unit identifier, in which this - # price is billed. - sig { returns(T.nilable(String)) } - attr_accessor :currency - - # For dimensional price: specifies a price group and dimension values - sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } - attr_reader :dimensional_price_configuration - - sig do - params( - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) - ).void - end - attr_writer :dimensional_price_configuration - - # An alias for the price. - sig { returns(T.nilable(String)) } - attr_accessor :external_price_id - - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - sig { returns(T.nilable(Float)) } - attr_accessor :fixed_price_quantity - - # The property used to group this price on an invoice - sig { returns(T.nilable(String)) } - attr_accessor :invoice_grouping_key - - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } - attr_reader :invoicing_cycle_configuration - - sig do - params( - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash) - ).void - end - attr_writer :invoicing_cycle_configuration - - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } - attr_accessor :metadata - - # A transient ID that can be used to reference this price when adding adjustments - # in the same API call. - sig { returns(T.nilable(String)) } - attr_accessor :reference_id - - sig do - params( - bulk_bps_config: Orb::BulkBPSConfig::OrHash, - cadence: Orb::NewPlanBulkBPSPrice::Cadence::OrSymbol, - item_id: String, - model_type: Orb::NewPlanBulkBPSPrice::ModelType::OrSymbol, - name: String, - billable_metric_id: T.nilable(String), - billed_in_advance: T.nilable(T::Boolean), - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash), - conversion_rate: T.nilable(Float), - conversion_rate_config: - T.nilable( - T.any( - Orb::UnitConversionRateConfig::OrHash, - Orb::TieredConversionRateConfig::OrHash - ) - ), - currency: T.nilable(String), - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - invoice_grouping_key: T.nilable(String), - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash), - metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), - reference_id: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - bulk_bps_config:, - # The cadence to bill for this price on. - cadence:, - # The id of the item the price will be associated with. - item_id:, - model_type:, - # The name of the price. - name:, - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - billable_metric_id: nil, - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - billed_in_advance: nil, - # For custom cadence: specifies the duration of the billing period in days or - # months. - billing_cycle_configuration: nil, - # The per unit conversion rate of the price currency to the invoicing currency. - conversion_rate: nil, - # The configuration for the rate of the price currency to the invoicing currency. - conversion_rate_config: nil, - # An ISO 4217 currency string, or custom pricing unit identifier, in which this - # price is billed. - currency: nil, - # For dimensional price: specifies a price group and dimension values - dimensional_price_configuration: nil, - # An alias for the price. - external_price_id: nil, - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - fixed_price_quantity: nil, - # The property used to group this price on an invoice - invoice_grouping_key: nil, - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - invoicing_cycle_configuration: nil, - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - metadata: nil, - # A transient ID that can be used to reference this price when adding adjustments - # in the same API call. - reference_id: nil - ) - end - - sig do - override.returns( - { - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::NewPlanBulkBPSPrice::Cadence::OrSymbol, - item_id: String, - model_type: Orb::NewPlanBulkBPSPrice::ModelType::OrSymbol, - name: String, - billable_metric_id: T.nilable(String), - billed_in_advance: T.nilable(T::Boolean), - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration), - conversion_rate: T.nilable(Float), - conversion_rate_config: - T.nilable( - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - ), - currency: T.nilable(String), - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - invoice_grouping_key: T.nilable(String), - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration), - metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), - reference_id: T.nilable(String) - } - ) - end - def to_hash - end - - # The cadence to bill for this price on. - module Cadence - extend Orb::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::NewPlanBulkBPSPrice::Cadence) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ANNUAL = T.let(:annual, Orb::NewPlanBulkBPSPrice::Cadence::TaggedSymbol) - SEMI_ANNUAL = - T.let(:semi_annual, Orb::NewPlanBulkBPSPrice::Cadence::TaggedSymbol) - MONTHLY = - T.let(:monthly, Orb::NewPlanBulkBPSPrice::Cadence::TaggedSymbol) - QUARTERLY = - T.let(:quarterly, Orb::NewPlanBulkBPSPrice::Cadence::TaggedSymbol) - ONE_TIME = - T.let(:one_time, Orb::NewPlanBulkBPSPrice::Cadence::TaggedSymbol) - CUSTOM = T.let(:custom, Orb::NewPlanBulkBPSPrice::Cadence::TaggedSymbol) - - sig do - override.returns( - T::Array[Orb::NewPlanBulkBPSPrice::Cadence::TaggedSymbol] - ) - end - def self.values - end - end - - module ModelType - extend Orb::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::NewPlanBulkBPSPrice::ModelType) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - BULK_BPS = - T.let(:bulk_bps, Orb::NewPlanBulkBPSPrice::ModelType::TaggedSymbol) - - sig do - override.returns( - T::Array[Orb::NewPlanBulkBPSPrice::ModelType::TaggedSymbol] - ) - end - def self.values - end - end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[Orb::NewPlanBulkBPSPrice::ConversionRateConfig::Variants] - ) - end - def self.variants - end - end - end - end -end diff --git a/rbi/orb/models/new_plan_bulk_price.rbi b/rbi/orb/models/new_plan_bulk_price.rbi index f5288131..ce4ca3d0 100644 --- a/rbi/orb/models/new_plan_bulk_price.rbi +++ b/rbi/orb/models/new_plan_bulk_price.rbi @@ -6,6 +6,7 @@ module Orb OrHash = T.type_alias { T.any(Orb::NewPlanBulkPrice, Orb::Internal::AnyHash) } + # Configuration for bulk pricing sig { returns(Orb::BulkConfig) } attr_reader :bulk_config @@ -20,6 +21,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewPlanBulkPrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -153,11 +155,13 @@ module Orb ).returns(T.attached_class) end def self.new( + # Configuration for bulk pricing bulk_config:, # The cadence to bill for this price on. cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -262,6 +266,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -279,27 +284,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[Orb::NewPlanBulkPrice::ConversionRateConfig::Variants] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_plan_bulk_with_proration_price.rbi b/rbi/orb/models/new_plan_bulk_with_proration_price.rbi index 3336b818..39c69d60 100644 --- a/rbi/orb/models/new_plan_bulk_with_proration_price.rbi +++ b/rbi/orb/models/new_plan_bulk_with_proration_price.rbi @@ -8,8 +8,19 @@ module Orb T.any(Orb::NewPlanBulkWithProrationPrice, Orb::Internal::AnyHash) end - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :bulk_with_proration_config + # Configuration for bulk_with_proration pricing + sig do + returns(Orb::NewPlanBulkWithProrationPrice::BulkWithProrationConfig) + end + attr_reader :bulk_with_proration_config + + sig do + params( + bulk_with_proration_config: + Orb::NewPlanBulkWithProrationPrice::BulkWithProrationConfig::OrHash + ).void + end + attr_writer :bulk_with_proration_config # The cadence to bill for this price on. sig { returns(Orb::NewPlanBulkWithProrationPrice::Cadence::OrSymbol) } @@ -19,6 +30,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewPlanBulkWithProrationPrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -122,7 +134,8 @@ module Orb sig do params( - bulk_with_proration_config: T::Hash[Symbol, T.anything], + bulk_with_proration_config: + Orb::NewPlanBulkWithProrationPrice::BulkWithProrationConfig::OrHash, cadence: Orb::NewPlanBulkWithProrationPrice::Cadence::OrSymbol, item_id: String, model_type: Orb::NewPlanBulkWithProrationPrice::ModelType::OrSymbol, @@ -152,11 +165,13 @@ module Orb ).returns(T.attached_class) end def self.new( + # Configuration for bulk_with_proration pricing bulk_with_proration_config:, # The cadence to bill for this price on. cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -201,7 +216,8 @@ module Orb sig do override.returns( { - bulk_with_proration_config: T::Hash[Symbol, T.anything], + bulk_with_proration_config: + Orb::NewPlanBulkWithProrationPrice::BulkWithProrationConfig, cadence: Orb::NewPlanBulkWithProrationPrice::Cadence::OrSymbol, item_id: String, model_type: Orb::NewPlanBulkWithProrationPrice::ModelType::OrSymbol, @@ -234,6 +250,95 @@ module Orb def to_hash end + class BulkWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanBulkWithProrationPrice::BulkWithProrationConfig, + Orb::Internal::AnyHash + ) + end + + # Bulk tiers for rating based on total usage volume + sig do + returns( + T::Array[ + Orb::NewPlanBulkWithProrationPrice::BulkWithProrationConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for bulk_with_proration pricing + sig do + params( + tiers: + T::Array[ + Orb::NewPlanBulkWithProrationPrice::BulkWithProrationConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Bulk tiers for rating based on total usage volume + tiers: + ) + end + + sig do + override.returns( + { + tiers: + T::Array[ + Orb::NewPlanBulkWithProrationPrice::BulkWithProrationConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanBulkWithProrationPrice::BulkWithProrationConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Cost per unit + sig { returns(String) } + attr_accessor :unit_amount + + # The lower bound for this tier + sig { returns(T.nilable(String)) } + attr_accessor :tier_lower_bound + + # Configuration for a single bulk pricing tier with proration + sig do + params( + unit_amount: String, + tier_lower_bound: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Cost per unit + unit_amount:, + # The lower bound for this tier + tier_lower_bound: nil + ) + end + + sig do + override.returns( + { unit_amount: String, tier_lower_bound: T.nilable(String) } + ) + end + def to_hash + end + end + end + # The cadence to bill for this price on. module Cadence extend Orb::Internal::Type::Enum @@ -284,6 +389,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -309,29 +415,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewPlanBulkWithProrationPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_plan_cumulative_grouped_bulk_price.rbi b/rbi/orb/models/new_plan_cumulative_grouped_bulk_price.rbi index 39b3fc6d..ed2a139c 100644 --- a/rbi/orb/models/new_plan_cumulative_grouped_bulk_price.rbi +++ b/rbi/orb/models/new_plan_cumulative_grouped_bulk_price.rbi @@ -12,13 +12,27 @@ module Orb sig { returns(Orb::NewPlanCumulativeGroupedBulkPrice::Cadence::OrSymbol) } attr_accessor :cadence - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :cumulative_grouped_bulk_config + # Configuration for cumulative_grouped_bulk pricing + sig do + returns( + Orb::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig + ) + end + attr_reader :cumulative_grouped_bulk_config + + sig do + params( + cumulative_grouped_bulk_config: + Orb::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::OrHash + ).void + end + attr_writer :cumulative_grouped_bulk_config # The id of the item the price will be associated with. sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewPlanCumulativeGroupedBulkPrice::ModelType::OrSymbol) end @@ -125,7 +139,8 @@ module Orb sig do params( cadence: Orb::NewPlanCumulativeGroupedBulkPrice::Cadence::OrSymbol, - cumulative_grouped_bulk_config: T::Hash[Symbol, T.anything], + cumulative_grouped_bulk_config: + Orb::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::OrHash, item_id: String, model_type: Orb::NewPlanCumulativeGroupedBulkPrice::ModelType::OrSymbol, @@ -157,9 +172,11 @@ module Orb def self.new( # The cadence to bill for this price on. cadence:, + # Configuration for cumulative_grouped_bulk pricing cumulative_grouped_bulk_config:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -205,7 +222,8 @@ module Orb override.returns( { cadence: Orb::NewPlanCumulativeGroupedBulkPrice::Cadence::OrSymbol, - cumulative_grouped_bulk_config: T::Hash[Symbol, T.anything], + cumulative_grouped_bulk_config: + Orb::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig, item_id: String, model_type: Orb::NewPlanCumulativeGroupedBulkPrice::ModelType::OrSymbol, @@ -290,6 +308,115 @@ module Orb end end + class CumulativeGroupedBulkConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig, + Orb::Internal::AnyHash + ) + end + + # Each tier lower bound must have the same group of values. + sig do + returns( + T::Array[ + Orb::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue + ] + ) + end + attr_accessor :dimension_values + + # Grouping key name + sig { returns(String) } + attr_accessor :group + + # Configuration for cumulative_grouped_bulk pricing + sig do + params( + dimension_values: + T::Array[ + Orb::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue::OrHash + ], + group: String + ).returns(T.attached_class) + end + def self.new( + # Each tier lower bound must have the same group of values. + dimension_values:, + # Grouping key name + group: + ) + end + + sig do + override.returns( + { + dimension_values: + T::Array[ + Orb::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue + ], + group: String + } + ) + end + def to_hash + end + + class DimensionValue < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue, + Orb::Internal::AnyHash + ) + end + + # Grouping key value + sig { returns(String) } + attr_accessor :grouping_key + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Unit amount for this combination + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a dimension value entry + sig do + params( + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + ).returns(T.attached_class) + end + def self.new( + # Grouping key value + grouping_key:, + # Tier lower bound + tier_lower_bound:, + # Unit amount for this combination + unit_amount: + ) + end + + sig do + override.returns( + { + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + } + ) + end + def to_hash + end + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -315,29 +442,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewPlanCumulativeGroupedBulkPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_plan_grouped_allocation_price.rbi b/rbi/orb/models/new_plan_grouped_allocation_price.rbi index 95bb69dc..804488d0 100644 --- a/rbi/orb/models/new_plan_grouped_allocation_price.rbi +++ b/rbi/orb/models/new_plan_grouped_allocation_price.rbi @@ -12,13 +12,25 @@ module Orb sig { returns(Orb::NewPlanGroupedAllocationPrice::Cadence::OrSymbol) } attr_accessor :cadence - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_allocation_config + # Configuration for grouped_allocation pricing + sig do + returns(Orb::NewPlanGroupedAllocationPrice::GroupedAllocationConfig) + end + attr_reader :grouped_allocation_config + + sig do + params( + grouped_allocation_config: + Orb::NewPlanGroupedAllocationPrice::GroupedAllocationConfig::OrHash + ).void + end + attr_writer :grouped_allocation_config # The id of the item the price will be associated with. sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewPlanGroupedAllocationPrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -123,7 +135,8 @@ module Orb sig do params( cadence: Orb::NewPlanGroupedAllocationPrice::Cadence::OrSymbol, - grouped_allocation_config: T::Hash[Symbol, T.anything], + grouped_allocation_config: + Orb::NewPlanGroupedAllocationPrice::GroupedAllocationConfig::OrHash, item_id: String, model_type: Orb::NewPlanGroupedAllocationPrice::ModelType::OrSymbol, name: String, @@ -154,9 +167,11 @@ module Orb def self.new( # The cadence to bill for this price on. cadence:, + # Configuration for grouped_allocation pricing grouped_allocation_config:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -202,7 +217,8 @@ module Orb override.returns( { cadence: Orb::NewPlanGroupedAllocationPrice::Cadence::OrSymbol, - grouped_allocation_config: T::Hash[Symbol, T.anything], + grouped_allocation_config: + Orb::NewPlanGroupedAllocationPrice::GroupedAllocationConfig, item_id: String, model_type: Orb::NewPlanGroupedAllocationPrice::ModelType::OrSymbol, name: String, @@ -284,6 +300,59 @@ module Orb end end + class GroupedAllocationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanGroupedAllocationPrice::GroupedAllocationConfig, + Orb::Internal::AnyHash + ) + end + + # Usage allocation per group + sig { returns(String) } + attr_accessor :allocation + + # How to determine the groups that should each be allocated some quantity + sig { returns(String) } + attr_accessor :grouping_key + + # Unit rate for post-allocation + sig { returns(String) } + attr_accessor :overage_unit_rate + + # Configuration for grouped_allocation pricing + sig do + params( + allocation: String, + grouping_key: String, + overage_unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # Usage allocation per group + allocation:, + # How to determine the groups that should each be allocated some quantity + grouping_key:, + # Unit rate for post-allocation + overage_unit_rate: + ) + end + + sig do + override.returns( + { + allocation: String, + grouping_key: String, + overage_unit_rate: String + } + ) + end + def to_hash + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -309,29 +378,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewPlanGroupedAllocationPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_plan_grouped_tiered_package_price.rbi b/rbi/orb/models/new_plan_grouped_tiered_package_price.rbi index b5629419..a5d3086d 100644 --- a/rbi/orb/models/new_plan_grouped_tiered_package_price.rbi +++ b/rbi/orb/models/new_plan_grouped_tiered_package_price.rbi @@ -12,13 +12,27 @@ module Orb sig { returns(Orb::NewPlanGroupedTieredPackagePrice::Cadence::OrSymbol) } attr_accessor :cadence - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_tiered_package_config + # Configuration for grouped_tiered_package pricing + sig do + returns( + Orb::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig + ) + end + attr_reader :grouped_tiered_package_config + + sig do + params( + grouped_tiered_package_config: + Orb::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig::OrHash + ).void + end + attr_writer :grouped_tiered_package_config # The id of the item the price will be associated with. sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewPlanGroupedTieredPackagePrice::ModelType::OrSymbol) end @@ -125,7 +139,8 @@ module Orb sig do params( cadence: Orb::NewPlanGroupedTieredPackagePrice::Cadence::OrSymbol, - grouped_tiered_package_config: T::Hash[Symbol, T.anything], + grouped_tiered_package_config: + Orb::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig::OrHash, item_id: String, model_type: Orb::NewPlanGroupedTieredPackagePrice::ModelType::OrSymbol, @@ -157,9 +172,11 @@ module Orb def self.new( # The cadence to bill for this price on. cadence:, + # Configuration for grouped_tiered_package pricing grouped_tiered_package_config:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -205,7 +222,8 @@ module Orb override.returns( { cadence: Orb::NewPlanGroupedTieredPackagePrice::Cadence::OrSymbol, - grouped_tiered_package_config: T::Hash[Symbol, T.anything], + grouped_tiered_package_config: + Orb::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig, item_id: String, model_type: Orb::NewPlanGroupedTieredPackagePrice::ModelType::OrSymbol, @@ -290,6 +308,111 @@ module Orb end end + class GroupedTieredPackageConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before tiering + sig { returns(String) } + attr_accessor :grouping_key + + # Package size + sig { returns(String) } + attr_accessor :package_size + + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + sig do + returns( + T::Array[ + Orb::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for grouped_tiered_package pricing + sig do + params( + grouping_key: String, + package_size: String, + tiers: + T::Array[ + Orb::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before tiering + grouping_key:, + # Package size + package_size:, + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + tiers: + ) + end + + sig do + override.returns( + { + grouping_key: String, + package_size: String, + tiers: + T::Array[ + Orb::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Price per package + sig { returns(String) } + attr_accessor :per_unit + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Configuration for a single tier + sig do + params(per_unit: String, tier_lower_bound: String).returns( + T.attached_class + ) + end + def self.new( + # Price per package + per_unit:, + # Tier lower bound + tier_lower_bound: + ) + end + + sig do + override.returns({ per_unit: String, tier_lower_bound: String }) + end + def to_hash + end + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -315,29 +438,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewPlanGroupedTieredPackagePrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_plan_grouped_tiered_price.rbi b/rbi/orb/models/new_plan_grouped_tiered_price.rbi index 839775ee..9a4471e5 100644 --- a/rbi/orb/models/new_plan_grouped_tiered_price.rbi +++ b/rbi/orb/models/new_plan_grouped_tiered_price.rbi @@ -12,13 +12,23 @@ module Orb sig { returns(Orb::NewPlanGroupedTieredPrice::Cadence::OrSymbol) } attr_accessor :cadence - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_tiered_config + # Configuration for grouped_tiered pricing + sig { returns(Orb::NewPlanGroupedTieredPrice::GroupedTieredConfig) } + attr_reader :grouped_tiered_config + + sig do + params( + grouped_tiered_config: + Orb::NewPlanGroupedTieredPrice::GroupedTieredConfig::OrHash + ).void + end + attr_writer :grouped_tiered_config # The id of the item the price will be associated with. sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewPlanGroupedTieredPrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -123,7 +133,8 @@ module Orb sig do params( cadence: Orb::NewPlanGroupedTieredPrice::Cadence::OrSymbol, - grouped_tiered_config: T::Hash[Symbol, T.anything], + grouped_tiered_config: + Orb::NewPlanGroupedTieredPrice::GroupedTieredConfig::OrHash, item_id: String, model_type: Orb::NewPlanGroupedTieredPrice::ModelType::OrSymbol, name: String, @@ -154,9 +165,11 @@ module Orb def self.new( # The cadence to bill for this price on. cadence:, + # Configuration for grouped_tiered pricing grouped_tiered_config:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -202,7 +215,8 @@ module Orb override.returns( { cadence: Orb::NewPlanGroupedTieredPrice::Cadence::OrSymbol, - grouped_tiered_config: T::Hash[Symbol, T.anything], + grouped_tiered_config: + Orb::NewPlanGroupedTieredPrice::GroupedTieredConfig, item_id: String, model_type: Orb::NewPlanGroupedTieredPrice::ModelType::OrSymbol, name: String, @@ -275,6 +289,101 @@ module Orb end end + class GroupedTieredConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanGroupedTieredPrice::GroupedTieredConfig, + Orb::Internal::AnyHash + ) + end + + # The billable metric property used to group before tiering + sig { returns(String) } + attr_accessor :grouping_key + + # Apply tiered pricing to each segment generated after grouping with the provided + # key + sig do + returns( + T::Array[Orb::NewPlanGroupedTieredPrice::GroupedTieredConfig::Tier] + ) + end + attr_accessor :tiers + + # Configuration for grouped_tiered pricing + sig do + params( + grouping_key: String, + tiers: + T::Array[ + Orb::NewPlanGroupedTieredPrice::GroupedTieredConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The billable metric property used to group before tiering + grouping_key:, + # Apply tiered pricing to each segment generated after grouping with the provided + # key + tiers: + ) + end + + sig do + override.returns( + { + grouping_key: String, + tiers: + T::Array[ + Orb::NewPlanGroupedTieredPrice::GroupedTieredConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanGroupedTieredPrice::GroupedTieredConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tier + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Tier lower bound + tier_lower_bound:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns({ tier_lower_bound: String, unit_amount: String }) + end + def to_hash + end + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -298,29 +407,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewPlanGroupedTieredPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_plan_grouped_with_metered_minimum_price.rbi b/rbi/orb/models/new_plan_grouped_with_metered_minimum_price.rbi index 5012c750..c52bf531 100644 --- a/rbi/orb/models/new_plan_grouped_with_metered_minimum_price.rbi +++ b/rbi/orb/models/new_plan_grouped_with_metered_minimum_price.rbi @@ -17,13 +17,27 @@ module Orb end attr_accessor :cadence - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_with_metered_minimum_config + # Configuration for grouped_with_metered_minimum pricing + sig do + returns( + Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig + ) + end + attr_reader :grouped_with_metered_minimum_config + + sig do + params( + grouped_with_metered_minimum_config: + Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::OrHash + ).void + end + attr_writer :grouped_with_metered_minimum_config # The id of the item the price will be associated with. sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewPlanGroupedWithMeteredMinimumPrice::ModelType::OrSymbol) end @@ -131,7 +145,8 @@ module Orb params( cadence: Orb::NewPlanGroupedWithMeteredMinimumPrice::Cadence::OrSymbol, - grouped_with_metered_minimum_config: T::Hash[Symbol, T.anything], + grouped_with_metered_minimum_config: + Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::OrHash, item_id: String, model_type: Orb::NewPlanGroupedWithMeteredMinimumPrice::ModelType::OrSymbol, @@ -163,9 +178,11 @@ module Orb def self.new( # The cadence to bill for this price on. cadence:, + # Configuration for grouped_with_metered_minimum pricing grouped_with_metered_minimum_config:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -212,7 +229,8 @@ module Orb { cadence: Orb::NewPlanGroupedWithMeteredMinimumPrice::Cadence::OrSymbol, - grouped_with_metered_minimum_config: T::Hash[Symbol, T.anything], + grouped_with_metered_minimum_config: + Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig, item_id: String, model_type: Orb::NewPlanGroupedWithMeteredMinimumPrice::ModelType::OrSymbol, @@ -297,52 +315,210 @@ module Orb end end - module ModelType - extend Orb::Internal::Type::Enum - - TaggedSymbol = + class GroupedWithMeteredMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do - T.all(Symbol, Orb::NewPlanGroupedWithMeteredMinimumPrice::ModelType) + T.any( + Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig, + Orb::Internal::AnyHash + ) end - OrSymbol = T.type_alias { T.any(Symbol, String) } - GROUPED_WITH_METERED_MINIMUM = - T.let( - :grouped_with_metered_minimum, - Orb::NewPlanGroupedWithMeteredMinimumPrice::ModelType::TaggedSymbol + # Used to partition the usage into groups. The minimum amount is applied to each + # group. + sig { returns(String) } + attr_accessor :grouping_key + + # The minimum amount to charge per group per unit + sig { returns(String) } + attr_accessor :minimum_unit_amount + + # Used to determine the unit rate + sig { returns(String) } + attr_accessor :pricing_key + + # Scale the unit rates by the scaling factor. + sig do + returns( + T::Array[ + Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor + ] ) + end + attr_accessor :scaling_factors + # Used to determine the unit rate scaling factor + sig { returns(String) } + attr_accessor :scaling_key + + # Apply per unit pricing to each pricing value. The minimum amount is applied any + # unmatched usage. sig do - override.returns( + returns( T::Array[ - Orb::NewPlanGroupedWithMeteredMinimumPrice::ModelType::TaggedSymbol + Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount ] ) end - def self.values + attr_accessor :unit_amounts + + # Configuration for grouped_with_metered_minimum pricing + sig do + params( + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: + T::Array[ + Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor::OrHash + ], + scaling_key: String, + unit_amounts: + T::Array[ + Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Used to partition the usage into groups. The minimum amount is applied to each + # group. + grouping_key:, + # The minimum amount to charge per group per unit + minimum_unit_amount:, + # Used to determine the unit rate + pricing_key:, + # Scale the unit rates by the scaling factor. + scaling_factors:, + # Used to determine the unit rate scaling factor + scaling_key:, + # Apply per unit pricing to each pricing value. The minimum amount is applied any + # unmatched usage. + unit_amounts: + ) + end + + sig do + override.returns( + { + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: + T::Array[ + Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor + ], + scaling_key: String, + unit_amounts: + T::Array[ + Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount + ] + } + ) + end + def to_hash + end + + class ScalingFactor < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor, + Orb::Internal::AnyHash + ) + end + + # Scaling factor + sig { returns(String) } + attr_accessor :scaling_factor + + # Scaling value + sig { returns(String) } + attr_accessor :scaling_value + + # Configuration for a scaling factor + sig do + params(scaling_factor: String, scaling_value: String).returns( + T.attached_class + ) + end + def self.new( + # Scaling factor + scaling_factor:, + # Scaling value + scaling_value: + ) + end + + sig do + override.returns({ scaling_factor: String, scaling_value: String }) + end + def to_hash + end + end + + class UnitAmount < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount, + Orb::Internal::AnyHash + ) + end + + # Pricing value + sig { returns(String) } + attr_accessor :pricing_value + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a unit amount + sig do + params(pricing_value: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Pricing value + pricing_value:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns({ pricing_value: String, unit_amount: String }) + end + def to_hash + end end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union + # The pricing model type + module ModelType + extend Orb::Internal::Type::Enum - Variants = + TaggedSymbol = T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) + T.all(Symbol, Orb::NewPlanGroupedWithMeteredMinimumPrice::ModelType) end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GROUPED_WITH_METERED_MINIMUM = + T.let( + :grouped_with_metered_minimum, + Orb::NewPlanGroupedWithMeteredMinimumPrice::ModelType::TaggedSymbol + ) sig do override.returns( T::Array[ - Orb::NewPlanGroupedWithMeteredMinimumPrice::ConversionRateConfig::Variants + Orb::NewPlanGroupedWithMeteredMinimumPrice::ModelType::TaggedSymbol ] ) end - def self.variants + def self.values end end end diff --git a/rbi/orb/models/new_plan_grouped_with_prorated_minimum_price.rbi b/rbi/orb/models/new_plan_grouped_with_prorated_minimum_price.rbi index 1cc4e82a..88717fe3 100644 --- a/rbi/orb/models/new_plan_grouped_with_prorated_minimum_price.rbi +++ b/rbi/orb/models/new_plan_grouped_with_prorated_minimum_price.rbi @@ -17,13 +17,27 @@ module Orb end attr_accessor :cadence - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_with_prorated_minimum_config + # Configuration for grouped_with_prorated_minimum pricing + sig do + returns( + Orb::NewPlanGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig + ) + end + attr_reader :grouped_with_prorated_minimum_config + + sig do + params( + grouped_with_prorated_minimum_config: + Orb::NewPlanGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig::OrHash + ).void + end + attr_writer :grouped_with_prorated_minimum_config # The id of the item the price will be associated with. sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns( Orb::NewPlanGroupedWithProratedMinimumPrice::ModelType::OrSymbol @@ -133,7 +147,8 @@ module Orb params( cadence: Orb::NewPlanGroupedWithProratedMinimumPrice::Cadence::OrSymbol, - grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + grouped_with_prorated_minimum_config: + Orb::NewPlanGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig::OrHash, item_id: String, model_type: Orb::NewPlanGroupedWithProratedMinimumPrice::ModelType::OrSymbol, @@ -165,9 +180,11 @@ module Orb def self.new( # The cadence to bill for this price on. cadence:, + # Configuration for grouped_with_prorated_minimum pricing grouped_with_prorated_minimum_config:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -214,7 +231,8 @@ module Orb { cadence: Orb::NewPlanGroupedWithProratedMinimumPrice::Cadence::OrSymbol, - grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + grouped_with_prorated_minimum_config: + Orb::NewPlanGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig, item_id: String, model_type: Orb::NewPlanGroupedWithProratedMinimumPrice::ModelType::OrSymbol, @@ -299,6 +317,55 @@ module Orb end end + class GroupedWithProratedMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig, + Orb::Internal::AnyHash + ) + end + + # How to determine the groups that should each have a minimum + sig { returns(String) } + attr_accessor :grouping_key + + # The minimum amount to charge per group + sig { returns(String) } + attr_accessor :minimum + + # The amount to charge per unit + sig { returns(String) } + attr_accessor :unit_rate + + # Configuration for grouped_with_prorated_minimum pricing + sig do + params( + grouping_key: String, + minimum: String, + unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # How to determine the groups that should each have a minimum + grouping_key:, + # The minimum amount to charge per group + minimum:, + # The amount to charge per unit + unit_rate: + ) + end + + sig do + override.returns( + { grouping_key: String, minimum: String, unit_rate: String } + ) + end + def to_hash + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -327,29 +394,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewPlanGroupedWithProratedMinimumPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_plan_matrix_price.rbi b/rbi/orb/models/new_plan_matrix_price.rbi index 1d1fdaad..dd96975d 100644 --- a/rbi/orb/models/new_plan_matrix_price.rbi +++ b/rbi/orb/models/new_plan_matrix_price.rbi @@ -14,12 +14,14 @@ module Orb sig { returns(String) } attr_accessor :item_id + # Configuration for matrix pricing sig { returns(Orb::MatrixConfig) } attr_reader :matrix_config sig { params(matrix_config: Orb::MatrixConfig::OrHash).void } attr_writer :matrix_config + # The pricing model type sig { returns(Orb::NewPlanMatrixPrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -157,7 +159,9 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # Configuration for matrix pricing matrix_config:, + # The pricing model type model_type:, # The name of the price. name:, @@ -263,6 +267,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -281,27 +286,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[Orb::NewPlanMatrixPrice::ConversionRateConfig::Variants] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_plan_matrix_with_allocation_price.rbi b/rbi/orb/models/new_plan_matrix_with_allocation_price.rbi index d04ddad5..bddade05 100644 --- a/rbi/orb/models/new_plan_matrix_with_allocation_price.rbi +++ b/rbi/orb/models/new_plan_matrix_with_allocation_price.rbi @@ -16,6 +16,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # Configuration for matrix_with_allocation pricing sig { returns(Orb::MatrixWithAllocationConfig) } attr_reader :matrix_with_allocation_config @@ -26,6 +27,7 @@ module Orb end attr_writer :matrix_with_allocation_config + # The pricing model type sig do returns(Orb::NewPlanMatrixWithAllocationPrice::ModelType::OrSymbol) end @@ -167,7 +169,9 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # Configuration for matrix_with_allocation pricing matrix_with_allocation_config:, + # The pricing model type model_type:, # The name of the price. name:, @@ -298,6 +302,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -323,29 +328,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewPlanMatrixWithAllocationPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_plan_matrix_with_display_name_price.rbi b/rbi/orb/models/new_plan_matrix_with_display_name_price.rbi index 4c28b34f..4e32bad9 100644 --- a/rbi/orb/models/new_plan_matrix_with_display_name_price.rbi +++ b/rbi/orb/models/new_plan_matrix_with_display_name_price.rbi @@ -16,9 +16,23 @@ module Orb sig { returns(String) } attr_accessor :item_id - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :matrix_with_display_name_config + # Configuration for matrix_with_display_name pricing + sig do + returns( + Orb::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig + ) + end + attr_reader :matrix_with_display_name_config + + sig do + params( + matrix_with_display_name_config: + Orb::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::OrHash + ).void + end + attr_writer :matrix_with_display_name_config + # The pricing model type sig do returns(Orb::NewPlanMatrixWithDisplayNamePrice::ModelType::OrSymbol) end @@ -126,7 +140,8 @@ module Orb params( cadence: Orb::NewPlanMatrixWithDisplayNamePrice::Cadence::OrSymbol, item_id: String, - matrix_with_display_name_config: T::Hash[Symbol, T.anything], + matrix_with_display_name_config: + Orb::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::OrHash, model_type: Orb::NewPlanMatrixWithDisplayNamePrice::ModelType::OrSymbol, name: String, @@ -159,7 +174,9 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # Configuration for matrix_with_display_name pricing matrix_with_display_name_config:, + # The pricing model type model_type:, # The name of the price. name:, @@ -206,7 +223,8 @@ module Orb { cadence: Orb::NewPlanMatrixWithDisplayNamePrice::Cadence::OrSymbol, item_id: String, - matrix_with_display_name_config: T::Hash[Symbol, T.anything], + matrix_with_display_name_config: + Orb::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig, model_type: Orb::NewPlanMatrixWithDisplayNamePrice::ModelType::OrSymbol, name: String, @@ -290,6 +308,115 @@ module Orb end end + class MatrixWithDisplayNameConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig, + Orb::Internal::AnyHash + ) + end + + # Used to determine the unit rate + sig { returns(String) } + attr_accessor :dimension + + # Apply per unit pricing to each dimension value + sig do + returns( + T::Array[ + Orb::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount + ] + ) + end + attr_accessor :unit_amounts + + # Configuration for matrix_with_display_name pricing + sig do + params( + dimension: String, + unit_amounts: + T::Array[ + Orb::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Used to determine the unit rate + dimension:, + # Apply per unit pricing to each dimension value + unit_amounts: + ) + end + + sig do + override.returns( + { + dimension: String, + unit_amounts: + T::Array[ + Orb::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount + ] + } + ) + end + def to_hash + end + + class UnitAmount < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount, + Orb::Internal::AnyHash + ) + end + + # The dimension value + sig { returns(String) } + attr_accessor :dimension_value + + # Display name for this dimension value + sig { returns(String) } + attr_accessor :display_name + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a unit amount item + sig do + params( + dimension_value: String, + display_name: String, + unit_amount: String + ).returns(T.attached_class) + end + def self.new( + # The dimension value + dimension_value:, + # Display name for this dimension value + display_name:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns( + { + dimension_value: String, + display_name: String, + unit_amount: String + } + ) + end + def to_hash + end + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -315,29 +442,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewPlanMatrixWithDisplayNamePrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_plan_max_group_tiered_package_price.rbi b/rbi/orb/models/new_plan_max_group_tiered_package_price.rbi index fd39fcd3..29ce8716 100644 --- a/rbi/orb/models/new_plan_max_group_tiered_package_price.rbi +++ b/rbi/orb/models/new_plan_max_group_tiered_package_price.rbi @@ -16,9 +16,23 @@ module Orb sig { returns(String) } attr_accessor :item_id - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :max_group_tiered_package_config + # Configuration for max_group_tiered_package pricing + sig do + returns( + Orb::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig + ) + end + attr_reader :max_group_tiered_package_config + + sig do + params( + max_group_tiered_package_config: + Orb::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::OrHash + ).void + end + attr_writer :max_group_tiered_package_config + # The pricing model type sig do returns(Orb::NewPlanMaxGroupTieredPackagePrice::ModelType::OrSymbol) end @@ -126,7 +140,8 @@ module Orb params( cadence: Orb::NewPlanMaxGroupTieredPackagePrice::Cadence::OrSymbol, item_id: String, - max_group_tiered_package_config: T::Hash[Symbol, T.anything], + max_group_tiered_package_config: + Orb::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::OrHash, model_type: Orb::NewPlanMaxGroupTieredPackagePrice::ModelType::OrSymbol, name: String, @@ -159,7 +174,9 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # Configuration for max_group_tiered_package pricing max_group_tiered_package_config:, + # The pricing model type model_type:, # The name of the price. name:, @@ -206,7 +223,8 @@ module Orb { cadence: Orb::NewPlanMaxGroupTieredPackagePrice::Cadence::OrSymbol, item_id: String, - max_group_tiered_package_config: T::Hash[Symbol, T.anything], + max_group_tiered_package_config: + Orb::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig, model_type: Orb::NewPlanMaxGroupTieredPackagePrice::ModelType::OrSymbol, name: String, @@ -290,6 +308,109 @@ module Orb end end + class MaxGroupTieredPackageConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before tiering the group with the highest value + sig { returns(String) } + attr_accessor :grouping_key + + # Package size + sig { returns(String) } + attr_accessor :package_size + + # Apply tiered pricing to the largest group after grouping with the provided key. + sig do + returns( + T::Array[ + Orb::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for max_group_tiered_package pricing + sig do + params( + grouping_key: String, + package_size: String, + tiers: + T::Array[ + Orb::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before tiering the group with the highest value + grouping_key:, + # Package size + package_size:, + # Apply tiered pricing to the largest group after grouping with the provided key. + tiers: + ) + end + + sig do + override.returns( + { + grouping_key: String, + package_size: String, + tiers: + T::Array[ + Orb::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tier + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Tier lower bound + tier_lower_bound:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns({ tier_lower_bound: String, unit_amount: String }) + end + def to_hash + end + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -315,29 +436,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewPlanMaxGroupTieredPackagePrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_subscription_tier_with_proration_price.rbi b/rbi/orb/models/new_plan_minimum_composite_price.rbi similarity index 75% rename from rbi/orb/models/new_subscription_tier_with_proration_price.rbi rename to rbi/orb/models/new_plan_minimum_composite_price.rbi index a8d10acb..884d363a 100644 --- a/rbi/orb/models/new_subscription_tier_with_proration_price.rbi +++ b/rbi/orb/models/new_plan_minimum_composite_price.rbi @@ -2,37 +2,40 @@ module Orb module Models - class NewSubscriptionTierWithProrationPrice < Orb::Internal::Type::BaseModel + class NewPlanMinimumCompositePrice < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any( - Orb::NewSubscriptionTierWithProrationPrice, - Orb::Internal::AnyHash - ) + T.any(Orb::NewPlanMinimumCompositePrice, Orb::Internal::AnyHash) end # The cadence to bill for this price on. - sig do - returns(Orb::NewSubscriptionTierWithProrationPrice::Cadence::OrSymbol) - end + sig { returns(Orb::NewPlanMinimumCompositePrice::Cadence::OrSymbol) } attr_accessor :cadence # The id of the item the price will be associated with. sig { returns(String) } attr_accessor :item_id + # Configuration for minimum pricing + sig { returns(Orb::NewPlanMinimumCompositePrice::MinimumConfig) } + attr_reader :minimum_config + sig do - returns(Orb::NewSubscriptionTierWithProrationPrice::ModelType::OrSymbol) + params( + minimum_config: + Orb::NewPlanMinimumCompositePrice::MinimumConfig::OrHash + ).void end + attr_writer :minimum_config + + # The pricing model type + sig { returns(Orb::NewPlanMinimumCompositePrice::ModelType::OrSymbol) } attr_accessor :model_type # The name of the price. sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_with_proration_config - # The id of the billable metric for the price. Only needed if the price is # usage-based. sig { returns(T.nilable(String)) } @@ -129,13 +132,12 @@ module Orb sig do params( - cadence: - Orb::NewSubscriptionTierWithProrationPrice::Cadence::OrSymbol, + cadence: Orb::NewPlanMinimumCompositePrice::Cadence::OrSymbol, item_id: String, - model_type: - Orb::NewSubscriptionTierWithProrationPrice::ModelType::OrSymbol, + minimum_config: + Orb::NewPlanMinimumCompositePrice::MinimumConfig::OrHash, + model_type: Orb::NewPlanMinimumCompositePrice::ModelType::OrSymbol, name: String, - tiered_with_proration_config: T::Hash[Symbol, T.anything], billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -165,10 +167,12 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # Configuration for minimum pricing + minimum_config:, + # The pricing model type model_type:, # The name of the price. name:, - tiered_with_proration_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. billable_metric_id: nil, @@ -210,13 +214,11 @@ module Orb sig do override.returns( { - cadence: - Orb::NewSubscriptionTierWithProrationPrice::Cadence::OrSymbol, + cadence: Orb::NewPlanMinimumCompositePrice::Cadence::OrSymbol, item_id: String, - model_type: - Orb::NewSubscriptionTierWithProrationPrice::ModelType::OrSymbol, + minimum_config: Orb::NewPlanMinimumCompositePrice::MinimumConfig, + model_type: Orb::NewPlanMinimumCompositePrice::ModelType::OrSymbol, name: String, - tiered_with_proration_config: T::Hash[Symbol, T.anything], billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -251,98 +253,113 @@ module Orb TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::NewSubscriptionTierWithProrationPrice::Cadence) + T.all(Symbol, Orb::NewPlanMinimumCompositePrice::Cadence) end OrSymbol = T.type_alias { T.any(Symbol, String) } ANNUAL = T.let( :annual, - Orb::NewSubscriptionTierWithProrationPrice::Cadence::TaggedSymbol + Orb::NewPlanMinimumCompositePrice::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::NewSubscriptionTierWithProrationPrice::Cadence::TaggedSymbol + Orb::NewPlanMinimumCompositePrice::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::NewSubscriptionTierWithProrationPrice::Cadence::TaggedSymbol + Orb::NewPlanMinimumCompositePrice::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::NewSubscriptionTierWithProrationPrice::Cadence::TaggedSymbol + Orb::NewPlanMinimumCompositePrice::Cadence::TaggedSymbol ) ONE_TIME = T.let( :one_time, - Orb::NewSubscriptionTierWithProrationPrice::Cadence::TaggedSymbol + Orb::NewPlanMinimumCompositePrice::Cadence::TaggedSymbol ) CUSTOM = T.let( :custom, - Orb::NewSubscriptionTierWithProrationPrice::Cadence::TaggedSymbol + Orb::NewPlanMinimumCompositePrice::Cadence::TaggedSymbol ) sig do override.returns( - T::Array[ - Orb::NewSubscriptionTierWithProrationPrice::Cadence::TaggedSymbol - ] + T::Array[Orb::NewPlanMinimumCompositePrice::Cadence::TaggedSymbol] ) end def self.values end end - module ModelType - extend Orb::Internal::Type::Enum - - TaggedSymbol = + class MinimumConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do - T.all(Symbol, Orb::NewSubscriptionTierWithProrationPrice::ModelType) + T.any( + Orb::NewPlanMinimumCompositePrice::MinimumConfig, + Orb::Internal::AnyHash + ) end - OrSymbol = T.type_alias { T.any(Symbol, String) } - TIERED_WITH_PRORATION = - T.let( - :tiered_with_proration, - Orb::NewSubscriptionTierWithProrationPrice::ModelType::TaggedSymbol - ) + # The minimum amount to apply + sig { returns(String) } + attr_accessor :minimum_amount + + # If true, subtotals from this price are prorated based on the service period + sig { returns(T.nilable(T::Boolean)) } + attr_reader :prorated + sig { params(prorated: T::Boolean).void } + attr_writer :prorated + + # Configuration for minimum pricing sig do - override.returns( - T::Array[ - Orb::NewSubscriptionTierWithProrationPrice::ModelType::TaggedSymbol - ] + params(minimum_amount: String, prorated: T::Boolean).returns( + T.attached_class ) end - def self.values + def self.new( + # The minimum amount to apply + minimum_amount:, + # If true, subtotals from this price are prorated based on the service period + prorated: nil + ) + end + + sig do + override.returns({ minimum_amount: String, prorated: T::Boolean }) + end + def to_hash end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union + # The pricing model type + module ModelType + extend Orb::Internal::Type::Enum - Variants = + TaggedSymbol = T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) + T.all(Symbol, Orb::NewPlanMinimumCompositePrice::ModelType) end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MINIMUM = + T.let( + :minimum, + Orb::NewPlanMinimumCompositePrice::ModelType::TaggedSymbol + ) sig do override.returns( - T::Array[ - Orb::NewSubscriptionTierWithProrationPrice::ConversionRateConfig::Variants - ] + T::Array[Orb::NewPlanMinimumCompositePrice::ModelType::TaggedSymbol] ) end - def self.variants + def self.values end end end diff --git a/rbi/orb/models/new_plan_package_price.rbi b/rbi/orb/models/new_plan_package_price.rbi index 000e79af..56c9afc8 100644 --- a/rbi/orb/models/new_plan_package_price.rbi +++ b/rbi/orb/models/new_plan_package_price.rbi @@ -14,6 +14,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewPlanPackagePrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -21,6 +22,7 @@ module Orb sig { returns(String) } attr_accessor :name + # Configuration for package pricing sig { returns(Orb::PackageConfig) } attr_reader :package_config @@ -157,9 +159,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for package pricing package_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -263,6 +267,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -281,27 +286,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[Orb::NewPlanPackagePrice::ConversionRateConfig::Variants] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_plan_package_with_allocation_price.rbi b/rbi/orb/models/new_plan_package_with_allocation_price.rbi index 65973845..3a2bbfd5 100644 --- a/rbi/orb/models/new_plan_package_with_allocation_price.rbi +++ b/rbi/orb/models/new_plan_package_with_allocation_price.rbi @@ -16,6 +16,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewPlanPackageWithAllocationPrice::ModelType::OrSymbol) end @@ -25,8 +26,21 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :package_with_allocation_config + # Configuration for package_with_allocation pricing + sig do + returns( + Orb::NewPlanPackageWithAllocationPrice::PackageWithAllocationConfig + ) + end + attr_reader :package_with_allocation_config + + sig do + params( + package_with_allocation_config: + Orb::NewPlanPackageWithAllocationPrice::PackageWithAllocationConfig::OrHash + ).void + end + attr_writer :package_with_allocation_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -129,7 +143,8 @@ module Orb model_type: Orb::NewPlanPackageWithAllocationPrice::ModelType::OrSymbol, name: String, - package_with_allocation_config: T::Hash[Symbol, T.anything], + package_with_allocation_config: + Orb::NewPlanPackageWithAllocationPrice::PackageWithAllocationConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -159,9 +174,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for package_with_allocation pricing package_with_allocation_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -209,7 +226,8 @@ module Orb model_type: Orb::NewPlanPackageWithAllocationPrice::ModelType::OrSymbol, name: String, - package_with_allocation_config: T::Hash[Symbol, T.anything], + package_with_allocation_config: + Orb::NewPlanPackageWithAllocationPrice::PackageWithAllocationConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -290,6 +308,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -316,26 +335,51 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class PackageWithAllocationConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewPlanPackageWithAllocationPrice::PackageWithAllocationConfig, + Orb::Internal::AnyHash ) end + # Usage allocation + sig { returns(String) } + attr_accessor :allocation + + # Price per package + sig { returns(String) } + attr_accessor :package_amount + + # Package size + sig { returns(String) } + attr_accessor :package_size + + # Configuration for package_with_allocation pricing + sig do + params( + allocation: String, + package_amount: String, + package_size: String + ).returns(T.attached_class) + end + def self.new( + # Usage allocation + allocation:, + # Price per package + package_amount:, + # Package size + package_size: + ) + end + sig do override.returns( - T::Array[ - Orb::NewPlanPackageWithAllocationPrice::ConversionRateConfig::Variants - ] + { allocation: String, package_amount: String, package_size: String } ) end - def self.variants + def to_hash end end end diff --git a/rbi/orb/models/new_plan_scalable_matrix_with_tiered_pricing_price.rbi b/rbi/orb/models/new_plan_scalable_matrix_with_tiered_pricing_price.rbi index c599c34d..11c617eb 100644 --- a/rbi/orb/models/new_plan_scalable_matrix_with_tiered_pricing_price.rbi +++ b/rbi/orb/models/new_plan_scalable_matrix_with_tiered_pricing_price.rbi @@ -23,6 +23,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns( Orb::NewPlanScalableMatrixWithTieredPricingPrice::ModelType::OrSymbol @@ -34,8 +35,21 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :scalable_matrix_with_tiered_pricing_config + # Configuration for scalable_matrix_with_tiered_pricing pricing + sig do + returns( + Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig + ) + end + attr_reader :scalable_matrix_with_tiered_pricing_config + + sig do + params( + scalable_matrix_with_tiered_pricing_config: + Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::OrHash + ).void + end + attr_writer :scalable_matrix_with_tiered_pricing_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -140,7 +154,7 @@ module Orb Orb::NewPlanScalableMatrixWithTieredPricingPrice::ModelType::OrSymbol, name: String, scalable_matrix_with_tiered_pricing_config: - T::Hash[Symbol, T.anything], + Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -170,9 +184,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for scalable_matrix_with_tiered_pricing pricing scalable_matrix_with_tiered_pricing_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -222,7 +238,7 @@ module Orb Orb::NewPlanScalableMatrixWithTieredPricingPrice::ModelType::OrSymbol, name: String, scalable_matrix_with_tiered_pricing_config: - T::Hash[Symbol, T.anything], + Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -306,6 +322,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -335,26 +352,177 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class ScalableMatrixWithTieredPricingConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig, + Orb::Internal::AnyHash ) end + # Used for the scalable matrix first dimension + sig { returns(String) } + attr_accessor :first_dimension + + # Apply a scaling factor to each dimension sig do - override.returns( + returns( + T::Array[ + Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor + ] + ) + end + attr_accessor :matrix_scaling_factors + + # Tier pricing structure + sig do + returns( T::Array[ - Orb::NewPlanScalableMatrixWithTieredPricingPrice::ConversionRateConfig::Variants + Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier ] ) end - def self.variants + attr_accessor :tiers + + # Used for the scalable matrix second dimension (optional) + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension + + # Configuration for scalable_matrix_with_tiered_pricing pricing + sig do + params( + first_dimension: String, + matrix_scaling_factors: + T::Array[ + Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor::OrHash + ], + tiers: + T::Array[ + Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier::OrHash + ], + second_dimension: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Used for the scalable matrix first dimension + first_dimension:, + # Apply a scaling factor to each dimension + matrix_scaling_factors:, + # Tier pricing structure + tiers:, + # Used for the scalable matrix second dimension (optional) + second_dimension: nil + ) + end + + sig do + override.returns( + { + first_dimension: String, + matrix_scaling_factors: + T::Array[ + Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor + ], + tiers: + T::Array[ + Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier + ], + second_dimension: T.nilable(String) + } + ) + end + def to_hash + end + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor, + Orb::Internal::AnyHash + ) + end + + # First dimension value + sig { returns(String) } + attr_accessor :first_dimension_value + + # Scaling factor + sig { returns(String) } + attr_accessor :scaling_factor + + # Second dimension value (optional) + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension_value + + # Configuration for a single matrix scaling factor + sig do + params( + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # First dimension value + first_dimension_value:, + # Scaling factor + scaling_factor:, + # Second dimension value (optional) + second_dimension_value: nil + ) + end + + sig do + override.returns( + { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tier entry with business logic + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Tier lower bound + tier_lower_bound:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns({ tier_lower_bound: String, unit_amount: String }) + end + def to_hash + end end end end diff --git a/rbi/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rbi b/rbi/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rbi index 05db751a..f5449ee5 100644 --- a/rbi/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rbi +++ b/rbi/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rbi @@ -23,6 +23,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns( Orb::NewPlanScalableMatrixWithUnitPricingPrice::ModelType::OrSymbol @@ -34,8 +35,21 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :scalable_matrix_with_unit_pricing_config + # Configuration for scalable_matrix_with_unit_pricing pricing + sig do + returns( + Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig + ) + end + attr_reader :scalable_matrix_with_unit_pricing_config + + sig do + params( + scalable_matrix_with_unit_pricing_config: + Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::OrHash + ).void + end + attr_writer :scalable_matrix_with_unit_pricing_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -139,7 +153,8 @@ module Orb model_type: Orb::NewPlanScalableMatrixWithUnitPricingPrice::ModelType::OrSymbol, name: String, - scalable_matrix_with_unit_pricing_config: T::Hash[Symbol, T.anything], + scalable_matrix_with_unit_pricing_config: + Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -169,9 +184,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for scalable_matrix_with_unit_pricing pricing scalable_matrix_with_unit_pricing_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -221,7 +238,7 @@ module Orb Orb::NewPlanScalableMatrixWithUnitPricingPrice::ModelType::OrSymbol, name: String, scalable_matrix_with_unit_pricing_config: - T::Hash[Symbol, T.anything], + Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -305,6 +322,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -334,26 +352,135 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class ScalableMatrixWithUnitPricingConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig, + Orb::Internal::AnyHash ) end + # Used to determine the unit rate + sig { returns(String) } + attr_accessor :first_dimension + + # Apply a scaling factor to each dimension sig do - override.returns( + returns( T::Array[ - Orb::NewPlanScalableMatrixWithUnitPricingPrice::ConversionRateConfig::Variants + Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor ] ) end - def self.variants + attr_accessor :matrix_scaling_factors + + # The final unit price to rate against the output of the matrix + sig { returns(String) } + attr_accessor :unit_price + + # If true, the unit price will be prorated to the billing period + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :prorate + + # Used to determine the unit rate (optional) + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension + + # Configuration for scalable_matrix_with_unit_pricing pricing + sig do + params( + first_dimension: String, + matrix_scaling_factors: + T::Array[ + Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor::OrHash + ], + unit_price: String, + prorate: T.nilable(T::Boolean), + second_dimension: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Used to determine the unit rate + first_dimension:, + # Apply a scaling factor to each dimension + matrix_scaling_factors:, + # The final unit price to rate against the output of the matrix + unit_price:, + # If true, the unit price will be prorated to the billing period + prorate: nil, + # Used to determine the unit rate (optional) + second_dimension: nil + ) + end + + sig do + override.returns( + { + first_dimension: String, + matrix_scaling_factors: + T::Array[ + Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor + ], + unit_price: String, + prorate: T.nilable(T::Boolean), + second_dimension: T.nilable(String) + } + ) + end + def to_hash + end + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor, + Orb::Internal::AnyHash + ) + end + + # First dimension value + sig { returns(String) } + attr_accessor :first_dimension_value + + # Scaling factor + sig { returns(String) } + attr_accessor :scaling_factor + + # Second dimension value (optional) + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension_value + + # Configuration for a single matrix scaling factor + sig do + params( + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # First dimension value + first_dimension_value:, + # Scaling factor + scaling_factor:, + # Second dimension value (optional) + second_dimension_value: nil + ) + end + + sig do + override.returns( + { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: T.nilable(String) + } + ) + end + def to_hash + end end end end diff --git a/rbi/orb/models/new_plan_threshold_total_amount_price.rbi b/rbi/orb/models/new_plan_threshold_total_amount_price.rbi index 7d02e8ac..e35a4133 100644 --- a/rbi/orb/models/new_plan_threshold_total_amount_price.rbi +++ b/rbi/orb/models/new_plan_threshold_total_amount_price.rbi @@ -16,6 +16,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewPlanThresholdTotalAmountPrice::ModelType::OrSymbol) end @@ -25,8 +26,21 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :threshold_total_amount_config + # Configuration for threshold_total_amount pricing + sig do + returns( + Orb::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig + ) + end + attr_reader :threshold_total_amount_config + + sig do + params( + threshold_total_amount_config: + Orb::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig::OrHash + ).void + end + attr_writer :threshold_total_amount_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -129,7 +143,8 @@ module Orb model_type: Orb::NewPlanThresholdTotalAmountPrice::ModelType::OrSymbol, name: String, - threshold_total_amount_config: T::Hash[Symbol, T.anything], + threshold_total_amount_config: + Orb::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -159,9 +174,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for threshold_total_amount pricing threshold_total_amount_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -209,7 +226,8 @@ module Orb model_type: Orb::NewPlanThresholdTotalAmountPrice::ModelType::OrSymbol, name: String, - threshold_total_amount_config: T::Hash[Symbol, T.anything], + threshold_total_amount_config: + Orb::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -290,6 +308,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -316,26 +335,97 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class ThresholdTotalAmountConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig, + Orb::Internal::AnyHash ) end + # When the quantity consumed passes a provided threshold, the configured total + # will be charged sig do - override.returns( + returns( T::Array[ - Orb::NewPlanThresholdTotalAmountPrice::ConversionRateConfig::Variants + Orb::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable ] ) end - def self.variants + attr_accessor :consumption_table + + # If true, the unit price will be prorated to the billing period + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :prorate + + # Configuration for threshold_total_amount pricing + sig do + params( + consumption_table: + T::Array[ + Orb::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable::OrHash + ], + prorate: T.nilable(T::Boolean) + ).returns(T.attached_class) + end + def self.new( + # When the quantity consumed passes a provided threshold, the configured total + # will be charged + consumption_table:, + # If true, the unit price will be prorated to the billing period + prorate: nil + ) + end + + sig do + override.returns( + { + consumption_table: + T::Array[ + Orb::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable + ], + prorate: T.nilable(T::Boolean) + } + ) + end + def to_hash + end + + class ConsumptionTable < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable, + Orb::Internal::AnyHash + ) + end + + # Quantity threshold + sig { returns(String) } + attr_accessor :threshold + + # Total amount for this threshold + sig { returns(String) } + attr_accessor :total_amount + + # Configuration for a single threshold + sig do + params(threshold: String, total_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Quantity threshold + threshold:, + # Total amount for this threshold + total_amount: + ) + end + + sig { override.returns({ threshold: String, total_amount: String }) } + def to_hash + end end end end diff --git a/rbi/orb/models/new_plan_tier_with_proration_price.rbi b/rbi/orb/models/new_plan_tier_with_proration_price.rbi deleted file mode 100644 index 65e71bcf..00000000 --- a/rbi/orb/models/new_plan_tier_with_proration_price.rbi +++ /dev/null @@ -1,337 +0,0 @@ -# typed: strong - -module Orb - module Models - class NewPlanTierWithProrationPrice < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(Orb::NewPlanTierWithProrationPrice, Orb::Internal::AnyHash) - end - - # The cadence to bill for this price on. - sig { returns(Orb::NewPlanTierWithProrationPrice::Cadence::OrSymbol) } - attr_accessor :cadence - - # The id of the item the price will be associated with. - sig { returns(String) } - attr_accessor :item_id - - sig { returns(Orb::NewPlanTierWithProrationPrice::ModelType::OrSymbol) } - attr_accessor :model_type - - # The name of the price. - sig { returns(String) } - attr_accessor :name - - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_with_proration_config - - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - sig { returns(T.nilable(String)) } - attr_accessor :billable_metric_id - - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :billed_in_advance - - # For custom cadence: specifies the duration of the billing period in days or - # months. - sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } - attr_reader :billing_cycle_configuration - - sig do - params( - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash) - ).void - end - attr_writer :billing_cycle_configuration - - # The per unit conversion rate of the price currency to the invoicing currency. - sig { returns(T.nilable(Float)) } - attr_accessor :conversion_rate - - # The configuration for the rate of the price currency to the invoicing currency. - sig do - returns( - T.nilable( - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - ) - ) - end - attr_accessor :conversion_rate_config - - # An ISO 4217 currency string, or custom pricing unit identifier, in which this - # price is billed. - sig { returns(T.nilable(String)) } - attr_accessor :currency - - # For dimensional price: specifies a price group and dimension values - sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } - attr_reader :dimensional_price_configuration - - sig do - params( - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) - ).void - end - attr_writer :dimensional_price_configuration - - # An alias for the price. - sig { returns(T.nilable(String)) } - attr_accessor :external_price_id - - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - sig { returns(T.nilable(Float)) } - attr_accessor :fixed_price_quantity - - # The property used to group this price on an invoice - sig { returns(T.nilable(String)) } - attr_accessor :invoice_grouping_key - - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } - attr_reader :invoicing_cycle_configuration - - sig do - params( - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash) - ).void - end - attr_writer :invoicing_cycle_configuration - - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } - attr_accessor :metadata - - # A transient ID that can be used to reference this price when adding adjustments - # in the same API call. - sig { returns(T.nilable(String)) } - attr_accessor :reference_id - - sig do - params( - cadence: Orb::NewPlanTierWithProrationPrice::Cadence::OrSymbol, - item_id: String, - model_type: Orb::NewPlanTierWithProrationPrice::ModelType::OrSymbol, - name: String, - tiered_with_proration_config: T::Hash[Symbol, T.anything], - billable_metric_id: T.nilable(String), - billed_in_advance: T.nilable(T::Boolean), - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash), - conversion_rate: T.nilable(Float), - conversion_rate_config: - T.nilable( - T.any( - Orb::UnitConversionRateConfig::OrHash, - Orb::TieredConversionRateConfig::OrHash - ) - ), - currency: T.nilable(String), - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - invoice_grouping_key: T.nilable(String), - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash), - metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), - reference_id: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # The cadence to bill for this price on. - cadence:, - # The id of the item the price will be associated with. - item_id:, - model_type:, - # The name of the price. - name:, - tiered_with_proration_config:, - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - billable_metric_id: nil, - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - billed_in_advance: nil, - # For custom cadence: specifies the duration of the billing period in days or - # months. - billing_cycle_configuration: nil, - # The per unit conversion rate of the price currency to the invoicing currency. - conversion_rate: nil, - # The configuration for the rate of the price currency to the invoicing currency. - conversion_rate_config: nil, - # An ISO 4217 currency string, or custom pricing unit identifier, in which this - # price is billed. - currency: nil, - # For dimensional price: specifies a price group and dimension values - dimensional_price_configuration: nil, - # An alias for the price. - external_price_id: nil, - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - fixed_price_quantity: nil, - # The property used to group this price on an invoice - invoice_grouping_key: nil, - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - invoicing_cycle_configuration: nil, - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - metadata: nil, - # A transient ID that can be used to reference this price when adding adjustments - # in the same API call. - reference_id: nil - ) - end - - sig do - override.returns( - { - cadence: Orb::NewPlanTierWithProrationPrice::Cadence::OrSymbol, - item_id: String, - model_type: Orb::NewPlanTierWithProrationPrice::ModelType::OrSymbol, - name: String, - tiered_with_proration_config: T::Hash[Symbol, T.anything], - billable_metric_id: T.nilable(String), - billed_in_advance: T.nilable(T::Boolean), - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration), - conversion_rate: T.nilable(Float), - conversion_rate_config: - T.nilable( - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - ), - currency: T.nilable(String), - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - invoice_grouping_key: T.nilable(String), - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration), - metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), - reference_id: T.nilable(String) - } - ) - end - def to_hash - end - - # The cadence to bill for this price on. - module Cadence - extend Orb::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, Orb::NewPlanTierWithProrationPrice::Cadence) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ANNUAL = - T.let( - :annual, - Orb::NewPlanTierWithProrationPrice::Cadence::TaggedSymbol - ) - SEMI_ANNUAL = - T.let( - :semi_annual, - Orb::NewPlanTierWithProrationPrice::Cadence::TaggedSymbol - ) - MONTHLY = - T.let( - :monthly, - Orb::NewPlanTierWithProrationPrice::Cadence::TaggedSymbol - ) - QUARTERLY = - T.let( - :quarterly, - Orb::NewPlanTierWithProrationPrice::Cadence::TaggedSymbol - ) - ONE_TIME = - T.let( - :one_time, - Orb::NewPlanTierWithProrationPrice::Cadence::TaggedSymbol - ) - CUSTOM = - T.let( - :custom, - Orb::NewPlanTierWithProrationPrice::Cadence::TaggedSymbol - ) - - sig do - override.returns( - T::Array[Orb::NewPlanTierWithProrationPrice::Cadence::TaggedSymbol] - ) - end - def self.values - end - end - - module ModelType - extend Orb::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, Orb::NewPlanTierWithProrationPrice::ModelType) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TIERED_WITH_PRORATION = - T.let( - :tiered_with_proration, - Orb::NewPlanTierWithProrationPrice::ModelType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - Orb::NewPlanTierWithProrationPrice::ModelType::TaggedSymbol - ] - ) - end - def self.values - end - end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewPlanTierWithProrationPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end - end - end -end diff --git a/rbi/orb/models/new_plan_tiered_bps_price.rbi b/rbi/orb/models/new_plan_tiered_bps_price.rbi deleted file mode 100644 index 87fa287e..00000000 --- a/rbi/orb/models/new_plan_tiered_bps_price.rbi +++ /dev/null @@ -1,314 +0,0 @@ -# typed: strong - -module Orb - module Models - class NewPlanTieredBPSPrice < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(Orb::NewPlanTieredBPSPrice, Orb::Internal::AnyHash) - end - - # The cadence to bill for this price on. - sig { returns(Orb::NewPlanTieredBPSPrice::Cadence::OrSymbol) } - attr_accessor :cadence - - # The id of the item the price will be associated with. - sig { returns(String) } - attr_accessor :item_id - - sig { returns(Orb::NewPlanTieredBPSPrice::ModelType::OrSymbol) } - attr_accessor :model_type - - # The name of the price. - sig { returns(String) } - attr_accessor :name - - sig { returns(Orb::TieredBPSConfig) } - attr_reader :tiered_bps_config - - sig { params(tiered_bps_config: Orb::TieredBPSConfig::OrHash).void } - attr_writer :tiered_bps_config - - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - sig { returns(T.nilable(String)) } - attr_accessor :billable_metric_id - - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :billed_in_advance - - # For custom cadence: specifies the duration of the billing period in days or - # months. - sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } - attr_reader :billing_cycle_configuration - - sig do - params( - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash) - ).void - end - attr_writer :billing_cycle_configuration - - # The per unit conversion rate of the price currency to the invoicing currency. - sig { returns(T.nilable(Float)) } - attr_accessor :conversion_rate - - # The configuration for the rate of the price currency to the invoicing currency. - sig do - returns( - T.nilable( - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - ) - ) - end - attr_accessor :conversion_rate_config - - # An ISO 4217 currency string, or custom pricing unit identifier, in which this - # price is billed. - sig { returns(T.nilable(String)) } - attr_accessor :currency - - # For dimensional price: specifies a price group and dimension values - sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } - attr_reader :dimensional_price_configuration - - sig do - params( - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) - ).void - end - attr_writer :dimensional_price_configuration - - # An alias for the price. - sig { returns(T.nilable(String)) } - attr_accessor :external_price_id - - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - sig { returns(T.nilable(Float)) } - attr_accessor :fixed_price_quantity - - # The property used to group this price on an invoice - sig { returns(T.nilable(String)) } - attr_accessor :invoice_grouping_key - - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } - attr_reader :invoicing_cycle_configuration - - sig do - params( - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash) - ).void - end - attr_writer :invoicing_cycle_configuration - - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } - attr_accessor :metadata - - # A transient ID that can be used to reference this price when adding adjustments - # in the same API call. - sig { returns(T.nilable(String)) } - attr_accessor :reference_id - - sig do - params( - cadence: Orb::NewPlanTieredBPSPrice::Cadence::OrSymbol, - item_id: String, - model_type: Orb::NewPlanTieredBPSPrice::ModelType::OrSymbol, - name: String, - tiered_bps_config: Orb::TieredBPSConfig::OrHash, - billable_metric_id: T.nilable(String), - billed_in_advance: T.nilable(T::Boolean), - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash), - conversion_rate: T.nilable(Float), - conversion_rate_config: - T.nilable( - T.any( - Orb::UnitConversionRateConfig::OrHash, - Orb::TieredConversionRateConfig::OrHash - ) - ), - currency: T.nilable(String), - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - invoice_grouping_key: T.nilable(String), - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash), - metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), - reference_id: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # The cadence to bill for this price on. - cadence:, - # The id of the item the price will be associated with. - item_id:, - model_type:, - # The name of the price. - name:, - tiered_bps_config:, - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - billable_metric_id: nil, - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - billed_in_advance: nil, - # For custom cadence: specifies the duration of the billing period in days or - # months. - billing_cycle_configuration: nil, - # The per unit conversion rate of the price currency to the invoicing currency. - conversion_rate: nil, - # The configuration for the rate of the price currency to the invoicing currency. - conversion_rate_config: nil, - # An ISO 4217 currency string, or custom pricing unit identifier, in which this - # price is billed. - currency: nil, - # For dimensional price: specifies a price group and dimension values - dimensional_price_configuration: nil, - # An alias for the price. - external_price_id: nil, - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - fixed_price_quantity: nil, - # The property used to group this price on an invoice - invoice_grouping_key: nil, - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - invoicing_cycle_configuration: nil, - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - metadata: nil, - # A transient ID that can be used to reference this price when adding adjustments - # in the same API call. - reference_id: nil - ) - end - - sig do - override.returns( - { - cadence: Orb::NewPlanTieredBPSPrice::Cadence::OrSymbol, - item_id: String, - model_type: Orb::NewPlanTieredBPSPrice::ModelType::OrSymbol, - name: String, - tiered_bps_config: Orb::TieredBPSConfig, - billable_metric_id: T.nilable(String), - billed_in_advance: T.nilable(T::Boolean), - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration), - conversion_rate: T.nilable(Float), - conversion_rate_config: - T.nilable( - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - ), - currency: T.nilable(String), - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - invoice_grouping_key: T.nilable(String), - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration), - metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), - reference_id: T.nilable(String) - } - ) - end - def to_hash - end - - # The cadence to bill for this price on. - module Cadence - extend Orb::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::NewPlanTieredBPSPrice::Cadence) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ANNUAL = - T.let(:annual, Orb::NewPlanTieredBPSPrice::Cadence::TaggedSymbol) - SEMI_ANNUAL = - T.let(:semi_annual, Orb::NewPlanTieredBPSPrice::Cadence::TaggedSymbol) - MONTHLY = - T.let(:monthly, Orb::NewPlanTieredBPSPrice::Cadence::TaggedSymbol) - QUARTERLY = - T.let(:quarterly, Orb::NewPlanTieredBPSPrice::Cadence::TaggedSymbol) - ONE_TIME = - T.let(:one_time, Orb::NewPlanTieredBPSPrice::Cadence::TaggedSymbol) - CUSTOM = - T.let(:custom, Orb::NewPlanTieredBPSPrice::Cadence::TaggedSymbol) - - sig do - override.returns( - T::Array[Orb::NewPlanTieredBPSPrice::Cadence::TaggedSymbol] - ) - end - def self.values - end - end - - module ModelType - extend Orb::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::NewPlanTieredBPSPrice::ModelType) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TIERED_BPS = - T.let( - :tiered_bps, - Orb::NewPlanTieredBPSPrice::ModelType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[Orb::NewPlanTieredBPSPrice::ModelType::TaggedSymbol] - ) - end - def self.values - end - end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[Orb::NewPlanTieredBPSPrice::ConversionRateConfig::Variants] - ) - end - def self.variants - end - end - end - end -end diff --git a/rbi/orb/models/new_plan_tiered_package_price.rbi b/rbi/orb/models/new_plan_tiered_package_price.rbi index f62b57ff..950c52d2 100644 --- a/rbi/orb/models/new_plan_tiered_package_price.rbi +++ b/rbi/orb/models/new_plan_tiered_package_price.rbi @@ -16,6 +16,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewPlanTieredPackagePrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -23,8 +24,17 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_package_config + # Configuration for tiered_package pricing + sig { returns(Orb::NewPlanTieredPackagePrice::TieredPackageConfig) } + attr_reader :tiered_package_config + + sig do + params( + tiered_package_config: + Orb::NewPlanTieredPackagePrice::TieredPackageConfig::OrHash + ).void + end + attr_writer :tiered_package_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -126,7 +136,8 @@ module Orb item_id: String, model_type: Orb::NewPlanTieredPackagePrice::ModelType::OrSymbol, name: String, - tiered_package_config: T::Hash[Symbol, T.anything], + tiered_package_config: + Orb::NewPlanTieredPackagePrice::TieredPackageConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -156,9 +167,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for tiered_package pricing tiered_package_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -205,7 +218,8 @@ module Orb item_id: String, model_type: Orb::NewPlanTieredPackagePrice::ModelType::OrSymbol, name: String, - tiered_package_config: T::Hash[Symbol, T.anything], + tiered_package_config: + Orb::NewPlanTieredPackagePrice::TieredPackageConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -275,6 +289,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -299,26 +314,101 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class TieredPackageConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewPlanTieredPackagePrice::TieredPackageConfig, + Orb::Internal::AnyHash ) end + # Package size + sig { returns(String) } + attr_accessor :package_size + + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. The tier bounds are defined based on + # the total quantity rather than the number of packages, so they must be multiples + # of the package size. + sig do + returns( + T::Array[Orb::NewPlanTieredPackagePrice::TieredPackageConfig::Tier] + ) + end + attr_accessor :tiers + + # Configuration for tiered_package pricing + sig do + params( + package_size: String, + tiers: + T::Array[ + Orb::NewPlanTieredPackagePrice::TieredPackageConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Package size + package_size:, + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. The tier bounds are defined based on + # the total quantity rather than the number of packages, so they must be multiples + # of the package size. + tiers: + ) + end + sig do override.returns( - T::Array[ - Orb::NewPlanTieredPackagePrice::ConversionRateConfig::Variants - ] + { + package_size: String, + tiers: + T::Array[ + Orb::NewPlanTieredPackagePrice::TieredPackageConfig::Tier + ] + } ) end - def self.variants + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanTieredPackagePrice::TieredPackageConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Price per package + sig { returns(String) } + attr_accessor :per_unit + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Configuration for a single tier with business logic + sig do + params(per_unit: String, tier_lower_bound: String).returns( + T.attached_class + ) + end + def self.new( + # Price per package + per_unit:, + # Tier lower bound + tier_lower_bound: + ) + end + + sig do + override.returns({ per_unit: String, tier_lower_bound: String }) + end + def to_hash + end end end end diff --git a/rbi/orb/models/new_plan_tiered_package_with_minimum_price.rbi b/rbi/orb/models/new_plan_tiered_package_with_minimum_price.rbi index 7ddc3800..6a676023 100644 --- a/rbi/orb/models/new_plan_tiered_package_with_minimum_price.rbi +++ b/rbi/orb/models/new_plan_tiered_package_with_minimum_price.rbi @@ -21,6 +21,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewPlanTieredPackageWithMinimumPrice::ModelType::OrSymbol) end @@ -30,8 +31,21 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_package_with_minimum_config + # Configuration for tiered_package_with_minimum pricing + sig do + returns( + Orb::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig + ) + end + attr_reader :tiered_package_with_minimum_config + + sig do + params( + tiered_package_with_minimum_config: + Orb::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::OrHash + ).void + end + attr_writer :tiered_package_with_minimum_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -134,7 +148,8 @@ module Orb model_type: Orb::NewPlanTieredPackageWithMinimumPrice::ModelType::OrSymbol, name: String, - tiered_package_with_minimum_config: T::Hash[Symbol, T.anything], + tiered_package_with_minimum_config: + Orb::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -164,9 +179,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for tiered_package_with_minimum pricing tiered_package_with_minimum_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -215,7 +232,8 @@ module Orb model_type: Orb::NewPlanTieredPackageWithMinimumPrice::ModelType::OrSymbol, name: String, - tiered_package_with_minimum_config: T::Hash[Symbol, T.anything], + tiered_package_with_minimum_config: + Orb::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -296,6 +314,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -322,26 +341,113 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class TieredPackageWithMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig, + Orb::Internal::AnyHash ) end + # Package size + sig { returns(Float) } + attr_accessor :package_size + + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. sig do - override.returns( + returns( T::Array[ - Orb::NewPlanTieredPackageWithMinimumPrice::ConversionRateConfig::Variants + Orb::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier ] ) end - def self.variants + attr_accessor :tiers + + # Configuration for tiered_package_with_minimum pricing + sig do + params( + package_size: Float, + tiers: + T::Array[ + Orb::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Package size + package_size:, + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + tiers: + ) + end + + sig do + override.returns( + { + package_size: Float, + tiers: + T::Array[ + Orb::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Minimum amount + sig { returns(String) } + attr_accessor :minimum_amount + + # Price per package + sig { returns(String) } + attr_accessor :per_unit + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Configuration for a single tier + sig do + params( + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + ).returns(T.attached_class) + end + def self.new( + # Minimum amount + minimum_amount:, + # Price per package + per_unit:, + # Tier lower bound + tier_lower_bound: + ) + end + + sig do + override.returns( + { + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + } + ) + end + def to_hash + end end end end diff --git a/rbi/orb/models/new_plan_tiered_price.rbi b/rbi/orb/models/new_plan_tiered_price.rbi index 6cdfb4c5..20ea748f 100644 --- a/rbi/orb/models/new_plan_tiered_price.rbi +++ b/rbi/orb/models/new_plan_tiered_price.rbi @@ -14,6 +14,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewPlanTieredPrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -21,6 +22,7 @@ module Orb sig { returns(String) } attr_accessor :name + # Configuration for tiered pricing sig { returns(Orb::TieredConfig) } attr_reader :tiered_config @@ -157,9 +159,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for tiered pricing tiered_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -263,6 +267,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -281,27 +286,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[Orb::NewPlanTieredPrice::ConversionRateConfig::Variants] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_plan_tiered_with_minimum_price.rbi b/rbi/orb/models/new_plan_tiered_with_minimum_price.rbi index 1cc539cc..960b55db 100644 --- a/rbi/orb/models/new_plan_tiered_with_minimum_price.rbi +++ b/rbi/orb/models/new_plan_tiered_with_minimum_price.rbi @@ -16,6 +16,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewPlanTieredWithMinimumPrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -23,8 +24,19 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_with_minimum_config + # Configuration for tiered_with_minimum pricing + sig do + returns(Orb::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig) + end + attr_reader :tiered_with_minimum_config + + sig do + params( + tiered_with_minimum_config: + Orb::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig::OrHash + ).void + end + attr_writer :tiered_with_minimum_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -126,7 +138,8 @@ module Orb item_id: String, model_type: Orb::NewPlanTieredWithMinimumPrice::ModelType::OrSymbol, name: String, - tiered_with_minimum_config: T::Hash[Symbol, T.anything], + tiered_with_minimum_config: + Orb::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -156,9 +169,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for tiered_with_minimum pricing tiered_with_minimum_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -205,7 +220,8 @@ module Orb item_id: String, model_type: Orb::NewPlanTieredWithMinimumPrice::ModelType::OrSymbol, name: String, - tiered_with_minimum_config: T::Hash[Symbol, T.anything], + tiered_with_minimum_config: + Orb::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -284,6 +300,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -310,26 +327,127 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class TieredWithMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig, + Orb::Internal::AnyHash ) end + # Tiered pricing with a minimum amount dependent on the volume tier. Tiers are + # defined using exclusive lower bounds. sig do - override.returns( + returns( T::Array[ - Orb::NewPlanTieredWithMinimumPrice::ConversionRateConfig::Variants + Orb::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig::Tier ] ) end - def self.variants + attr_accessor :tiers + + # If true, tiers with an accrued amount of 0 will not be included in the rating. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :hide_zero_amount_tiers + + sig { params(hide_zero_amount_tiers: T::Boolean).void } + attr_writer :hide_zero_amount_tiers + + # If true, the unit price will be prorated to the billing period + sig { returns(T.nilable(T::Boolean)) } + attr_reader :prorate + + sig { params(prorate: T::Boolean).void } + attr_writer :prorate + + # Configuration for tiered_with_minimum pricing + sig do + params( + tiers: + T::Array[ + Orb::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig::Tier::OrHash + ], + hide_zero_amount_tiers: T::Boolean, + prorate: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # Tiered pricing with a minimum amount dependent on the volume tier. Tiers are + # defined using exclusive lower bounds. + tiers:, + # If true, tiers with an accrued amount of 0 will not be included in the rating. + hide_zero_amount_tiers: nil, + # If true, the unit price will be prorated to the billing period + prorate: nil + ) + end + + sig do + override.returns( + { + tiers: + T::Array[ + Orb::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig::Tier + ], + hide_zero_amount_tiers: T::Boolean, + prorate: T::Boolean + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Minimum amount + sig { returns(String) } + attr_accessor :minimum_amount + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tier + sig do + params( + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + ).returns(T.attached_class) + end + def self.new( + # Minimum amount + minimum_amount:, + # Tier lower bound + tier_lower_bound:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns( + { + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + } + ) + end + def to_hash + end end end end diff --git a/rbi/orb/models/new_plan_unit_price.rbi b/rbi/orb/models/new_plan_unit_price.rbi index 08113f80..77cb026b 100644 --- a/rbi/orb/models/new_plan_unit_price.rbi +++ b/rbi/orb/models/new_plan_unit_price.rbi @@ -14,6 +14,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewPlanUnitPrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -21,6 +22,7 @@ module Orb sig { returns(String) } attr_accessor :name + # Configuration for unit pricing sig { returns(Orb::UnitConfig) } attr_reader :unit_config @@ -157,9 +159,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for unit pricing unit_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -262,6 +266,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -279,27 +284,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[Orb::NewPlanUnitPrice::ConversionRateConfig::Variants] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_plan_unit_with_percent_price.rbi b/rbi/orb/models/new_plan_unit_with_percent_price.rbi index 45676b55..6cac6210 100644 --- a/rbi/orb/models/new_plan_unit_with_percent_price.rbi +++ b/rbi/orb/models/new_plan_unit_with_percent_price.rbi @@ -16,6 +16,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewPlanUnitWithPercentPrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -23,8 +24,17 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :unit_with_percent_config + # Configuration for unit_with_percent pricing + sig { returns(Orb::NewPlanUnitWithPercentPrice::UnitWithPercentConfig) } + attr_reader :unit_with_percent_config + + sig do + params( + unit_with_percent_config: + Orb::NewPlanUnitWithPercentPrice::UnitWithPercentConfig::OrHash + ).void + end + attr_writer :unit_with_percent_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -126,7 +136,8 @@ module Orb item_id: String, model_type: Orb::NewPlanUnitWithPercentPrice::ModelType::OrSymbol, name: String, - unit_with_percent_config: T::Hash[Symbol, T.anything], + unit_with_percent_config: + Orb::NewPlanUnitWithPercentPrice::UnitWithPercentConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -156,9 +167,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for unit_with_percent pricing unit_with_percent_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -205,7 +218,8 @@ module Orb item_id: String, model_type: Orb::NewPlanUnitWithPercentPrice::ModelType::OrSymbol, name: String, - unit_with_percent_config: T::Hash[Symbol, T.anything], + unit_with_percent_config: + Orb::NewPlanUnitWithPercentPrice::UnitWithPercentConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -284,6 +298,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -308,26 +323,37 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class UnitWithPercentConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewPlanUnitWithPercentPrice::UnitWithPercentConfig, + Orb::Internal::AnyHash ) end + # What percent, out of 100, of the calculated total to charge + sig { returns(String) } + attr_accessor :percent + + # Rate per unit of usage + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for unit_with_percent pricing sig do - override.returns( - T::Array[ - Orb::NewPlanUnitWithPercentPrice::ConversionRateConfig::Variants - ] - ) + params(percent: String, unit_amount: String).returns(T.attached_class) + end + def self.new( + # What percent, out of 100, of the calculated total to charge + percent:, + # Rate per unit of usage + unit_amount: + ) end - def self.variants + + sig { override.returns({ percent: String, unit_amount: String }) } + def to_hash end end end diff --git a/rbi/orb/models/new_plan_unit_with_proration_price.rbi b/rbi/orb/models/new_plan_unit_with_proration_price.rbi index dd4be0cd..410a8977 100644 --- a/rbi/orb/models/new_plan_unit_with_proration_price.rbi +++ b/rbi/orb/models/new_plan_unit_with_proration_price.rbi @@ -16,6 +16,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewPlanUnitWithProrationPrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -23,8 +24,19 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :unit_with_proration_config + # Configuration for unit_with_proration pricing + sig do + returns(Orb::NewPlanUnitWithProrationPrice::UnitWithProrationConfig) + end + attr_reader :unit_with_proration_config + + sig do + params( + unit_with_proration_config: + Orb::NewPlanUnitWithProrationPrice::UnitWithProrationConfig::OrHash + ).void + end + attr_writer :unit_with_proration_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -126,7 +138,8 @@ module Orb item_id: String, model_type: Orb::NewPlanUnitWithProrationPrice::ModelType::OrSymbol, name: String, - unit_with_proration_config: T::Hash[Symbol, T.anything], + unit_with_proration_config: + Orb::NewPlanUnitWithProrationPrice::UnitWithProrationConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -156,9 +169,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for unit_with_proration pricing unit_with_proration_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -205,7 +220,8 @@ module Orb item_id: String, model_type: Orb::NewPlanUnitWithProrationPrice::ModelType::OrSymbol, name: String, - unit_with_proration_config: T::Hash[Symbol, T.anything], + unit_with_proration_config: + Orb::NewPlanUnitWithProrationPrice::UnitWithProrationConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -284,6 +300,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -310,26 +327,29 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class UnitWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewPlanUnitWithProrationPrice::UnitWithProrationConfig, + Orb::Internal::AnyHash ) end - sig do - override.returns( - T::Array[ - Orb::NewPlanUnitWithProrationPrice::ConversionRateConfig::Variants - ] - ) + # Rate per unit of usage + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for unit_with_proration pricing + sig { params(unit_amount: String).returns(T.attached_class) } + def self.new( + # Rate per unit of usage + unit_amount: + ) end - def self.variants + + sig { override.returns({ unit_amount: String }) } + def to_hash end end end diff --git a/rbi/orb/models/new_subscription_bps_price.rbi b/rbi/orb/models/new_subscription_bps_price.rbi deleted file mode 100644 index 6e50631b..00000000 --- a/rbi/orb/models/new_subscription_bps_price.rbi +++ /dev/null @@ -1,317 +0,0 @@ -# typed: strong - -module Orb - module Models - class NewSubscriptionBPSPrice < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(Orb::NewSubscriptionBPSPrice, Orb::Internal::AnyHash) - end - - sig { returns(Orb::BPSConfig) } - attr_reader :bps_config - - sig { params(bps_config: Orb::BPSConfig::OrHash).void } - attr_writer :bps_config - - # The cadence to bill for this price on. - sig { returns(Orb::NewSubscriptionBPSPrice::Cadence::OrSymbol) } - attr_accessor :cadence - - # The id of the item the price will be associated with. - sig { returns(String) } - attr_accessor :item_id - - sig { returns(Orb::NewSubscriptionBPSPrice::ModelType::OrSymbol) } - attr_accessor :model_type - - # The name of the price. - sig { returns(String) } - attr_accessor :name - - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - sig { returns(T.nilable(String)) } - attr_accessor :billable_metric_id - - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :billed_in_advance - - # For custom cadence: specifies the duration of the billing period in days or - # months. - sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } - attr_reader :billing_cycle_configuration - - sig do - params( - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash) - ).void - end - attr_writer :billing_cycle_configuration - - # The per unit conversion rate of the price currency to the invoicing currency. - sig { returns(T.nilable(Float)) } - attr_accessor :conversion_rate - - # The configuration for the rate of the price currency to the invoicing currency. - sig do - returns( - T.nilable( - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - ) - ) - end - attr_accessor :conversion_rate_config - - # An ISO 4217 currency string, or custom pricing unit identifier, in which this - # price is billed. - sig { returns(T.nilable(String)) } - attr_accessor :currency - - # For dimensional price: specifies a price group and dimension values - sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } - attr_reader :dimensional_price_configuration - - sig do - params( - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) - ).void - end - attr_writer :dimensional_price_configuration - - # An alias for the price. - sig { returns(T.nilable(String)) } - attr_accessor :external_price_id - - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - sig { returns(T.nilable(Float)) } - attr_accessor :fixed_price_quantity - - # The property used to group this price on an invoice - sig { returns(T.nilable(String)) } - attr_accessor :invoice_grouping_key - - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } - attr_reader :invoicing_cycle_configuration - - sig do - params( - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash) - ).void - end - attr_writer :invoicing_cycle_configuration - - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } - attr_accessor :metadata - - # A transient ID that can be used to reference this price when adding adjustments - # in the same API call. - sig { returns(T.nilable(String)) } - attr_accessor :reference_id - - sig do - params( - bps_config: Orb::BPSConfig::OrHash, - cadence: Orb::NewSubscriptionBPSPrice::Cadence::OrSymbol, - item_id: String, - model_type: Orb::NewSubscriptionBPSPrice::ModelType::OrSymbol, - name: String, - billable_metric_id: T.nilable(String), - billed_in_advance: T.nilable(T::Boolean), - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash), - conversion_rate: T.nilable(Float), - conversion_rate_config: - T.nilable( - T.any( - Orb::UnitConversionRateConfig::OrHash, - Orb::TieredConversionRateConfig::OrHash - ) - ), - currency: T.nilable(String), - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - invoice_grouping_key: T.nilable(String), - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash), - metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), - reference_id: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - bps_config:, - # The cadence to bill for this price on. - cadence:, - # The id of the item the price will be associated with. - item_id:, - model_type:, - # The name of the price. - name:, - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - billable_metric_id: nil, - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - billed_in_advance: nil, - # For custom cadence: specifies the duration of the billing period in days or - # months. - billing_cycle_configuration: nil, - # The per unit conversion rate of the price currency to the invoicing currency. - conversion_rate: nil, - # The configuration for the rate of the price currency to the invoicing currency. - conversion_rate_config: nil, - # An ISO 4217 currency string, or custom pricing unit identifier, in which this - # price is billed. - currency: nil, - # For dimensional price: specifies a price group and dimension values - dimensional_price_configuration: nil, - # An alias for the price. - external_price_id: nil, - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - fixed_price_quantity: nil, - # The property used to group this price on an invoice - invoice_grouping_key: nil, - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - invoicing_cycle_configuration: nil, - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - metadata: nil, - # A transient ID that can be used to reference this price when adding adjustments - # in the same API call. - reference_id: nil - ) - end - - sig do - override.returns( - { - bps_config: Orb::BPSConfig, - cadence: Orb::NewSubscriptionBPSPrice::Cadence::OrSymbol, - item_id: String, - model_type: Orb::NewSubscriptionBPSPrice::ModelType::OrSymbol, - name: String, - billable_metric_id: T.nilable(String), - billed_in_advance: T.nilable(T::Boolean), - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration), - conversion_rate: T.nilable(Float), - conversion_rate_config: - T.nilable( - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - ), - currency: T.nilable(String), - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - invoice_grouping_key: T.nilable(String), - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration), - metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), - reference_id: T.nilable(String) - } - ) - end - def to_hash - end - - # The cadence to bill for this price on. - module Cadence - extend Orb::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::NewSubscriptionBPSPrice::Cadence) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ANNUAL = - T.let(:annual, Orb::NewSubscriptionBPSPrice::Cadence::TaggedSymbol) - SEMI_ANNUAL = - T.let( - :semi_annual, - Orb::NewSubscriptionBPSPrice::Cadence::TaggedSymbol - ) - MONTHLY = - T.let(:monthly, Orb::NewSubscriptionBPSPrice::Cadence::TaggedSymbol) - QUARTERLY = - T.let(:quarterly, Orb::NewSubscriptionBPSPrice::Cadence::TaggedSymbol) - ONE_TIME = - T.let(:one_time, Orb::NewSubscriptionBPSPrice::Cadence::TaggedSymbol) - CUSTOM = - T.let(:custom, Orb::NewSubscriptionBPSPrice::Cadence::TaggedSymbol) - - sig do - override.returns( - T::Array[Orb::NewSubscriptionBPSPrice::Cadence::TaggedSymbol] - ) - end - def self.values - end - end - - module ModelType - extend Orb::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, Orb::NewSubscriptionBPSPrice::ModelType) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - BPS = T.let(:bps, Orb::NewSubscriptionBPSPrice::ModelType::TaggedSymbol) - - sig do - override.returns( - T::Array[Orb::NewSubscriptionBPSPrice::ModelType::TaggedSymbol] - ) - end - def self.values - end - end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewSubscriptionBPSPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end - end - end -end diff --git a/rbi/orb/models/new_subscription_bulk_bps_price.rbi b/rbi/orb/models/new_subscription_bulk_bps_price.rbi deleted file mode 100644 index 16a670ae..00000000 --- a/rbi/orb/models/new_subscription_bulk_bps_price.rbi +++ /dev/null @@ -1,338 +0,0 @@ -# typed: strong - -module Orb - module Models - class NewSubscriptionBulkBPSPrice < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(Orb::NewSubscriptionBulkBPSPrice, Orb::Internal::AnyHash) - end - - sig { returns(Orb::BulkBPSConfig) } - attr_reader :bulk_bps_config - - sig { params(bulk_bps_config: Orb::BulkBPSConfig::OrHash).void } - attr_writer :bulk_bps_config - - # The cadence to bill for this price on. - sig { returns(Orb::NewSubscriptionBulkBPSPrice::Cadence::OrSymbol) } - attr_accessor :cadence - - # The id of the item the price will be associated with. - sig { returns(String) } - attr_accessor :item_id - - sig { returns(Orb::NewSubscriptionBulkBPSPrice::ModelType::OrSymbol) } - attr_accessor :model_type - - # The name of the price. - sig { returns(String) } - attr_accessor :name - - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - sig { returns(T.nilable(String)) } - attr_accessor :billable_metric_id - - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :billed_in_advance - - # For custom cadence: specifies the duration of the billing period in days or - # months. - sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } - attr_reader :billing_cycle_configuration - - sig do - params( - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash) - ).void - end - attr_writer :billing_cycle_configuration - - # The per unit conversion rate of the price currency to the invoicing currency. - sig { returns(T.nilable(Float)) } - attr_accessor :conversion_rate - - # The configuration for the rate of the price currency to the invoicing currency. - sig do - returns( - T.nilable( - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - ) - ) - end - attr_accessor :conversion_rate_config - - # An ISO 4217 currency string, or custom pricing unit identifier, in which this - # price is billed. - sig { returns(T.nilable(String)) } - attr_accessor :currency - - # For dimensional price: specifies a price group and dimension values - sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } - attr_reader :dimensional_price_configuration - - sig do - params( - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) - ).void - end - attr_writer :dimensional_price_configuration - - # An alias for the price. - sig { returns(T.nilable(String)) } - attr_accessor :external_price_id - - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - sig { returns(T.nilable(Float)) } - attr_accessor :fixed_price_quantity - - # The property used to group this price on an invoice - sig { returns(T.nilable(String)) } - attr_accessor :invoice_grouping_key - - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } - attr_reader :invoicing_cycle_configuration - - sig do - params( - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash) - ).void - end - attr_writer :invoicing_cycle_configuration - - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } - attr_accessor :metadata - - # A transient ID that can be used to reference this price when adding adjustments - # in the same API call. - sig { returns(T.nilable(String)) } - attr_accessor :reference_id - - sig do - params( - bulk_bps_config: Orb::BulkBPSConfig::OrHash, - cadence: Orb::NewSubscriptionBulkBPSPrice::Cadence::OrSymbol, - item_id: String, - model_type: Orb::NewSubscriptionBulkBPSPrice::ModelType::OrSymbol, - name: String, - billable_metric_id: T.nilable(String), - billed_in_advance: T.nilable(T::Boolean), - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash), - conversion_rate: T.nilable(Float), - conversion_rate_config: - T.nilable( - T.any( - Orb::UnitConversionRateConfig::OrHash, - Orb::TieredConversionRateConfig::OrHash - ) - ), - currency: T.nilable(String), - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - invoice_grouping_key: T.nilable(String), - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration::OrHash), - metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), - reference_id: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - bulk_bps_config:, - # The cadence to bill for this price on. - cadence:, - # The id of the item the price will be associated with. - item_id:, - model_type:, - # The name of the price. - name:, - # The id of the billable metric for the price. Only needed if the price is - # usage-based. - billable_metric_id: nil, - # If the Price represents a fixed cost, the price will be billed in-advance if - # this is true, and in-arrears if this is false. - billed_in_advance: nil, - # For custom cadence: specifies the duration of the billing period in days or - # months. - billing_cycle_configuration: nil, - # The per unit conversion rate of the price currency to the invoicing currency. - conversion_rate: nil, - # The configuration for the rate of the price currency to the invoicing currency. - conversion_rate_config: nil, - # An ISO 4217 currency string, or custom pricing unit identifier, in which this - # price is billed. - currency: nil, - # For dimensional price: specifies a price group and dimension values - dimensional_price_configuration: nil, - # An alias for the price. - external_price_id: nil, - # If the Price represents a fixed cost, this represents the quantity of units - # applied. - fixed_price_quantity: nil, - # The property used to group this price on an invoice - invoice_grouping_key: nil, - # Within each billing cycle, specifies the cadence at which invoices are produced. - # If unspecified, a single invoice is produced per billing cycle. - invoicing_cycle_configuration: nil, - # User-specified key/value pairs for the resource. Individual keys can be removed - # by setting the value to `null`, and the entire metadata mapping can be cleared - # by setting `metadata` to `null`. - metadata: nil, - # A transient ID that can be used to reference this price when adding adjustments - # in the same API call. - reference_id: nil - ) - end - - sig do - override.returns( - { - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::NewSubscriptionBulkBPSPrice::Cadence::OrSymbol, - item_id: String, - model_type: Orb::NewSubscriptionBulkBPSPrice::ModelType::OrSymbol, - name: String, - billable_metric_id: T.nilable(String), - billed_in_advance: T.nilable(T::Boolean), - billing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration), - conversion_rate: T.nilable(Float), - conversion_rate_config: - T.nilable( - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - ), - currency: T.nilable(String), - dimensional_price_configuration: - T.nilable(Orb::NewDimensionalPriceConfiguration), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - invoice_grouping_key: T.nilable(String), - invoicing_cycle_configuration: - T.nilable(Orb::NewBillingCycleConfiguration), - metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), - reference_id: T.nilable(String) - } - ) - end - def to_hash - end - - # The cadence to bill for this price on. - module Cadence - extend Orb::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, Orb::NewSubscriptionBulkBPSPrice::Cadence) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ANNUAL = - T.let( - :annual, - Orb::NewSubscriptionBulkBPSPrice::Cadence::TaggedSymbol - ) - SEMI_ANNUAL = - T.let( - :semi_annual, - Orb::NewSubscriptionBulkBPSPrice::Cadence::TaggedSymbol - ) - MONTHLY = - T.let( - :monthly, - Orb::NewSubscriptionBulkBPSPrice::Cadence::TaggedSymbol - ) - QUARTERLY = - T.let( - :quarterly, - Orb::NewSubscriptionBulkBPSPrice::Cadence::TaggedSymbol - ) - ONE_TIME = - T.let( - :one_time, - Orb::NewSubscriptionBulkBPSPrice::Cadence::TaggedSymbol - ) - CUSTOM = - T.let( - :custom, - Orb::NewSubscriptionBulkBPSPrice::Cadence::TaggedSymbol - ) - - sig do - override.returns( - T::Array[Orb::NewSubscriptionBulkBPSPrice::Cadence::TaggedSymbol] - ) - end - def self.values - end - end - - module ModelType - extend Orb::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, Orb::NewSubscriptionBulkBPSPrice::ModelType) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - BULK_BPS = - T.let( - :bulk_bps, - Orb::NewSubscriptionBulkBPSPrice::ModelType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[Orb::NewSubscriptionBulkBPSPrice::ModelType::TaggedSymbol] - ) - end - def self.values - end - end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewSubscriptionBulkBPSPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end - end - end -end diff --git a/rbi/orb/models/new_subscription_bulk_price.rbi b/rbi/orb/models/new_subscription_bulk_price.rbi index 7b6e6127..43ef13c0 100644 --- a/rbi/orb/models/new_subscription_bulk_price.rbi +++ b/rbi/orb/models/new_subscription_bulk_price.rbi @@ -8,6 +8,7 @@ module Orb T.any(Orb::NewSubscriptionBulkPrice, Orb::Internal::AnyHash) end + # Configuration for bulk pricing sig { returns(Orb::BulkConfig) } attr_reader :bulk_config @@ -22,6 +23,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewSubscriptionBulkPrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -155,11 +157,13 @@ module Orb ).returns(T.attached_class) end def self.new( + # Configuration for bulk pricing bulk_config:, # The cadence to bill for this price on. cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -273,6 +277,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -293,29 +298,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewSubscriptionBulkPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_subscription_bulk_with_proration_price.rbi b/rbi/orb/models/new_subscription_bulk_with_proration_price.rbi index 87b80c83..7967bbbe 100644 --- a/rbi/orb/models/new_subscription_bulk_with_proration_price.rbi +++ b/rbi/orb/models/new_subscription_bulk_with_proration_price.rbi @@ -11,8 +11,21 @@ module Orb ) end - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :bulk_with_proration_config + # Configuration for bulk_with_proration pricing + sig do + returns( + Orb::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig + ) + end + attr_reader :bulk_with_proration_config + + sig do + params( + bulk_with_proration_config: + Orb::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig::OrHash + ).void + end + attr_writer :bulk_with_proration_config # The cadence to bill for this price on. sig do @@ -24,6 +37,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewSubscriptionBulkWithProrationPrice::ModelType::OrSymbol) end @@ -129,7 +143,8 @@ module Orb sig do params( - bulk_with_proration_config: T::Hash[Symbol, T.anything], + bulk_with_proration_config: + Orb::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig::OrHash, cadence: Orb::NewSubscriptionBulkWithProrationPrice::Cadence::OrSymbol, item_id: String, @@ -161,11 +176,13 @@ module Orb ).returns(T.attached_class) end def self.new( + # Configuration for bulk_with_proration pricing bulk_with_proration_config:, # The cadence to bill for this price on. cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -210,7 +227,8 @@ module Orb sig do override.returns( { - bulk_with_proration_config: T::Hash[Symbol, T.anything], + bulk_with_proration_config: + Orb::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig, cadence: Orb::NewSubscriptionBulkWithProrationPrice::Cadence::OrSymbol, item_id: String, @@ -245,6 +263,95 @@ module Orb def to_hash end + class BulkWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig, + Orb::Internal::AnyHash + ) + end + + # Bulk tiers for rating based on total usage volume + sig do + returns( + T::Array[ + Orb::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for bulk_with_proration pricing + sig do + params( + tiers: + T::Array[ + Orb::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Bulk tiers for rating based on total usage volume + tiers: + ) + end + + sig do + override.returns( + { + tiers: + T::Array[ + Orb::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Cost per unit + sig { returns(String) } + attr_accessor :unit_amount + + # The lower bound for this tier + sig { returns(T.nilable(String)) } + attr_accessor :tier_lower_bound + + # Configuration for a single bulk pricing tier with proration + sig do + params( + unit_amount: String, + tier_lower_bound: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Cost per unit + unit_amount:, + # The lower bound for this tier + tier_lower_bound: nil + ) + end + + sig do + override.returns( + { unit_amount: String, tier_lower_bound: T.nilable(String) } + ) + end + def to_hash + end + end + end + # The cadence to bill for this price on. module Cadence extend Orb::Internal::Type::Enum @@ -297,6 +404,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -322,29 +430,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewSubscriptionBulkWithProrationPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_subscription_cumulative_grouped_bulk_price.rbi b/rbi/orb/models/new_subscription_cumulative_grouped_bulk_price.rbi index 4521b228..ad28ff8b 100644 --- a/rbi/orb/models/new_subscription_cumulative_grouped_bulk_price.rbi +++ b/rbi/orb/models/new_subscription_cumulative_grouped_bulk_price.rbi @@ -19,13 +19,27 @@ module Orb end attr_accessor :cadence - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :cumulative_grouped_bulk_config + # Configuration for cumulative_grouped_bulk pricing + sig do + returns( + Orb::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig + ) + end + attr_reader :cumulative_grouped_bulk_config + + sig do + params( + cumulative_grouped_bulk_config: + Orb::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::OrHash + ).void + end + attr_writer :cumulative_grouped_bulk_config # The id of the item the price will be associated with. sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns( Orb::NewSubscriptionCumulativeGroupedBulkPrice::ModelType::OrSymbol @@ -135,7 +149,8 @@ module Orb params( cadence: Orb::NewSubscriptionCumulativeGroupedBulkPrice::Cadence::OrSymbol, - cumulative_grouped_bulk_config: T::Hash[Symbol, T.anything], + cumulative_grouped_bulk_config: + Orb::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::OrHash, item_id: String, model_type: Orb::NewSubscriptionCumulativeGroupedBulkPrice::ModelType::OrSymbol, @@ -167,9 +182,11 @@ module Orb def self.new( # The cadence to bill for this price on. cadence:, + # Configuration for cumulative_grouped_bulk pricing cumulative_grouped_bulk_config:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -216,7 +233,8 @@ module Orb { cadence: Orb::NewSubscriptionCumulativeGroupedBulkPrice::Cadence::OrSymbol, - cumulative_grouped_bulk_config: T::Hash[Symbol, T.anything], + cumulative_grouped_bulk_config: + Orb::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig, item_id: String, model_type: Orb::NewSubscriptionCumulativeGroupedBulkPrice::ModelType::OrSymbol, @@ -304,6 +322,115 @@ module Orb end end + class CumulativeGroupedBulkConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig, + Orb::Internal::AnyHash + ) + end + + # Each tier lower bound must have the same group of values. + sig do + returns( + T::Array[ + Orb::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue + ] + ) + end + attr_accessor :dimension_values + + # Grouping key name + sig { returns(String) } + attr_accessor :group + + # Configuration for cumulative_grouped_bulk pricing + sig do + params( + dimension_values: + T::Array[ + Orb::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue::OrHash + ], + group: String + ).returns(T.attached_class) + end + def self.new( + # Each tier lower bound must have the same group of values. + dimension_values:, + # Grouping key name + group: + ) + end + + sig do + override.returns( + { + dimension_values: + T::Array[ + Orb::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue + ], + group: String + } + ) + end + def to_hash + end + + class DimensionValue < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue, + Orb::Internal::AnyHash + ) + end + + # Grouping key value + sig { returns(String) } + attr_accessor :grouping_key + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Unit amount for this combination + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a dimension value entry + sig do + params( + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + ).returns(T.attached_class) + end + def self.new( + # Grouping key value + grouping_key:, + # Tier lower bound + tier_lower_bound:, + # Unit amount for this combination + unit_amount: + ) + end + + sig do + override.returns( + { + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + } + ) + end + def to_hash + end + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -332,29 +459,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewSubscriptionCumulativeGroupedBulkPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_subscription_grouped_allocation_price.rbi b/rbi/orb/models/new_subscription_grouped_allocation_price.rbi index c828abb5..8ced1803 100644 --- a/rbi/orb/models/new_subscription_grouped_allocation_price.rbi +++ b/rbi/orb/models/new_subscription_grouped_allocation_price.rbi @@ -17,13 +17,27 @@ module Orb end attr_accessor :cadence - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_allocation_config + # Configuration for grouped_allocation pricing + sig do + returns( + Orb::NewSubscriptionGroupedAllocationPrice::GroupedAllocationConfig + ) + end + attr_reader :grouped_allocation_config + + sig do + params( + grouped_allocation_config: + Orb::NewSubscriptionGroupedAllocationPrice::GroupedAllocationConfig::OrHash + ).void + end + attr_writer :grouped_allocation_config # The id of the item the price will be associated with. sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewSubscriptionGroupedAllocationPrice::ModelType::OrSymbol) end @@ -131,7 +145,8 @@ module Orb params( cadence: Orb::NewSubscriptionGroupedAllocationPrice::Cadence::OrSymbol, - grouped_allocation_config: T::Hash[Symbol, T.anything], + grouped_allocation_config: + Orb::NewSubscriptionGroupedAllocationPrice::GroupedAllocationConfig::OrHash, item_id: String, model_type: Orb::NewSubscriptionGroupedAllocationPrice::ModelType::OrSymbol, @@ -163,9 +178,11 @@ module Orb def self.new( # The cadence to bill for this price on. cadence:, + # Configuration for grouped_allocation pricing grouped_allocation_config:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -212,7 +229,8 @@ module Orb { cadence: Orb::NewSubscriptionGroupedAllocationPrice::Cadence::OrSymbol, - grouped_allocation_config: T::Hash[Symbol, T.anything], + grouped_allocation_config: + Orb::NewSubscriptionGroupedAllocationPrice::GroupedAllocationConfig, item_id: String, model_type: Orb::NewSubscriptionGroupedAllocationPrice::ModelType::OrSymbol, @@ -297,6 +315,59 @@ module Orb end end + class GroupedAllocationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionGroupedAllocationPrice::GroupedAllocationConfig, + Orb::Internal::AnyHash + ) + end + + # Usage allocation per group + sig { returns(String) } + attr_accessor :allocation + + # How to determine the groups that should each be allocated some quantity + sig { returns(String) } + attr_accessor :grouping_key + + # Unit rate for post-allocation + sig { returns(String) } + attr_accessor :overage_unit_rate + + # Configuration for grouped_allocation pricing + sig do + params( + allocation: String, + grouping_key: String, + overage_unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # Usage allocation per group + allocation:, + # How to determine the groups that should each be allocated some quantity + grouping_key:, + # Unit rate for post-allocation + overage_unit_rate: + ) + end + + sig do + override.returns( + { + allocation: String, + grouping_key: String, + overage_unit_rate: String + } + ) + end + def to_hash + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -322,29 +393,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewSubscriptionGroupedAllocationPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_subscription_grouped_tiered_package_price.rbi b/rbi/orb/models/new_subscription_grouped_tiered_package_price.rbi index 9ca4cb17..c9e3d55a 100644 --- a/rbi/orb/models/new_subscription_grouped_tiered_package_price.rbi +++ b/rbi/orb/models/new_subscription_grouped_tiered_package_price.rbi @@ -19,13 +19,27 @@ module Orb end attr_accessor :cadence - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_tiered_package_config + # Configuration for grouped_tiered_package pricing + sig do + returns( + Orb::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig + ) + end + attr_reader :grouped_tiered_package_config + + sig do + params( + grouped_tiered_package_config: + Orb::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig::OrHash + ).void + end + attr_writer :grouped_tiered_package_config # The id of the item the price will be associated with. sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns( Orb::NewSubscriptionGroupedTieredPackagePrice::ModelType::OrSymbol @@ -135,7 +149,8 @@ module Orb params( cadence: Orb::NewSubscriptionGroupedTieredPackagePrice::Cadence::OrSymbol, - grouped_tiered_package_config: T::Hash[Symbol, T.anything], + grouped_tiered_package_config: + Orb::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig::OrHash, item_id: String, model_type: Orb::NewSubscriptionGroupedTieredPackagePrice::ModelType::OrSymbol, @@ -167,9 +182,11 @@ module Orb def self.new( # The cadence to bill for this price on. cadence:, + # Configuration for grouped_tiered_package pricing grouped_tiered_package_config:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -216,7 +233,8 @@ module Orb { cadence: Orb::NewSubscriptionGroupedTieredPackagePrice::Cadence::OrSymbol, - grouped_tiered_package_config: T::Hash[Symbol, T.anything], + grouped_tiered_package_config: + Orb::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig, item_id: String, model_type: Orb::NewSubscriptionGroupedTieredPackagePrice::ModelType::OrSymbol, @@ -304,6 +322,111 @@ module Orb end end + class GroupedTieredPackageConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before tiering + sig { returns(String) } + attr_accessor :grouping_key + + # Package size + sig { returns(String) } + attr_accessor :package_size + + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + sig do + returns( + T::Array[ + Orb::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for grouped_tiered_package pricing + sig do + params( + grouping_key: String, + package_size: String, + tiers: + T::Array[ + Orb::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before tiering + grouping_key:, + # Package size + package_size:, + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + tiers: + ) + end + + sig do + override.returns( + { + grouping_key: String, + package_size: String, + tiers: + T::Array[ + Orb::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Price per package + sig { returns(String) } + attr_accessor :per_unit + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Configuration for a single tier + sig do + params(per_unit: String, tier_lower_bound: String).returns( + T.attached_class + ) + end + def self.new( + # Price per package + per_unit:, + # Tier lower bound + tier_lower_bound: + ) + end + + sig do + override.returns({ per_unit: String, tier_lower_bound: String }) + end + def to_hash + end + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -332,29 +455,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewSubscriptionGroupedTieredPackagePrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_subscription_grouped_tiered_price.rbi b/rbi/orb/models/new_subscription_grouped_tiered_price.rbi index 873413a6..61337fcc 100644 --- a/rbi/orb/models/new_subscription_grouped_tiered_price.rbi +++ b/rbi/orb/models/new_subscription_grouped_tiered_price.rbi @@ -12,13 +12,25 @@ module Orb sig { returns(Orb::NewSubscriptionGroupedTieredPrice::Cadence::OrSymbol) } attr_accessor :cadence - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_tiered_config + # Configuration for grouped_tiered pricing + sig do + returns(Orb::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig) + end + attr_reader :grouped_tiered_config + + sig do + params( + grouped_tiered_config: + Orb::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig::OrHash + ).void + end + attr_writer :grouped_tiered_config # The id of the item the price will be associated with. sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewSubscriptionGroupedTieredPrice::ModelType::OrSymbol) end @@ -125,7 +137,8 @@ module Orb sig do params( cadence: Orb::NewSubscriptionGroupedTieredPrice::Cadence::OrSymbol, - grouped_tiered_config: T::Hash[Symbol, T.anything], + grouped_tiered_config: + Orb::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig::OrHash, item_id: String, model_type: Orb::NewSubscriptionGroupedTieredPrice::ModelType::OrSymbol, @@ -157,9 +170,11 @@ module Orb def self.new( # The cadence to bill for this price on. cadence:, + # Configuration for grouped_tiered pricing grouped_tiered_config:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -205,7 +220,8 @@ module Orb override.returns( { cadence: Orb::NewSubscriptionGroupedTieredPrice::Cadence::OrSymbol, - grouped_tiered_config: T::Hash[Symbol, T.anything], + grouped_tiered_config: + Orb::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig, item_id: String, model_type: Orb::NewSubscriptionGroupedTieredPrice::ModelType::OrSymbol, @@ -290,6 +306,103 @@ module Orb end end + class GroupedTieredConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig, + Orb::Internal::AnyHash + ) + end + + # The billable metric property used to group before tiering + sig { returns(String) } + attr_accessor :grouping_key + + # Apply tiered pricing to each segment generated after grouping with the provided + # key + sig do + returns( + T::Array[ + Orb::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for grouped_tiered pricing + sig do + params( + grouping_key: String, + tiers: + T::Array[ + Orb::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The billable metric property used to group before tiering + grouping_key:, + # Apply tiered pricing to each segment generated after grouping with the provided + # key + tiers: + ) + end + + sig do + override.returns( + { + grouping_key: String, + tiers: + T::Array[ + Orb::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tier + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Tier lower bound + tier_lower_bound:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns({ tier_lower_bound: String, unit_amount: String }) + end + def to_hash + end + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -315,29 +428,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewSubscriptionGroupedTieredPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_subscription_grouped_with_metered_minimum_price.rbi b/rbi/orb/models/new_subscription_grouped_with_metered_minimum_price.rbi index 26b7036a..12fdf0c8 100644 --- a/rbi/orb/models/new_subscription_grouped_with_metered_minimum_price.rbi +++ b/rbi/orb/models/new_subscription_grouped_with_metered_minimum_price.rbi @@ -19,13 +19,27 @@ module Orb end attr_accessor :cadence - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_with_metered_minimum_config + # Configuration for grouped_with_metered_minimum pricing + sig do + returns( + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig + ) + end + attr_reader :grouped_with_metered_minimum_config + + sig do + params( + grouped_with_metered_minimum_config: + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::OrHash + ).void + end + attr_writer :grouped_with_metered_minimum_config # The id of the item the price will be associated with. sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns( Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::ModelType::OrSymbol @@ -135,7 +149,8 @@ module Orb params( cadence: Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::Cadence::OrSymbol, - grouped_with_metered_minimum_config: T::Hash[Symbol, T.anything], + grouped_with_metered_minimum_config: + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::OrHash, item_id: String, model_type: Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::ModelType::OrSymbol, @@ -167,9 +182,11 @@ module Orb def self.new( # The cadence to bill for this price on. cadence:, + # Configuration for grouped_with_metered_minimum pricing grouped_with_metered_minimum_config:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -216,7 +233,8 @@ module Orb { cadence: Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::Cadence::OrSymbol, - grouped_with_metered_minimum_config: T::Hash[Symbol, T.anything], + grouped_with_metered_minimum_config: + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig, item_id: String, model_type: Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::ModelType::OrSymbol, @@ -304,6 +322,187 @@ module Orb end end + class GroupedWithMeteredMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig, + Orb::Internal::AnyHash + ) + end + + # Used to partition the usage into groups. The minimum amount is applied to each + # group. + sig { returns(String) } + attr_accessor :grouping_key + + # The minimum amount to charge per group per unit + sig { returns(String) } + attr_accessor :minimum_unit_amount + + # Used to determine the unit rate + sig { returns(String) } + attr_accessor :pricing_key + + # Scale the unit rates by the scaling factor. + sig do + returns( + T::Array[ + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor + ] + ) + end + attr_accessor :scaling_factors + + # Used to determine the unit rate scaling factor + sig { returns(String) } + attr_accessor :scaling_key + + # Apply per unit pricing to each pricing value. The minimum amount is applied any + # unmatched usage. + sig do + returns( + T::Array[ + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount + ] + ) + end + attr_accessor :unit_amounts + + # Configuration for grouped_with_metered_minimum pricing + sig do + params( + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: + T::Array[ + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor::OrHash + ], + scaling_key: String, + unit_amounts: + T::Array[ + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Used to partition the usage into groups. The minimum amount is applied to each + # group. + grouping_key:, + # The minimum amount to charge per group per unit + minimum_unit_amount:, + # Used to determine the unit rate + pricing_key:, + # Scale the unit rates by the scaling factor. + scaling_factors:, + # Used to determine the unit rate scaling factor + scaling_key:, + # Apply per unit pricing to each pricing value. The minimum amount is applied any + # unmatched usage. + unit_amounts: + ) + end + + sig do + override.returns( + { + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: + T::Array[ + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor + ], + scaling_key: String, + unit_amounts: + T::Array[ + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount + ] + } + ) + end + def to_hash + end + + class ScalingFactor < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor, + Orb::Internal::AnyHash + ) + end + + # Scaling factor + sig { returns(String) } + attr_accessor :scaling_factor + + # Scaling value + sig { returns(String) } + attr_accessor :scaling_value + + # Configuration for a scaling factor + sig do + params(scaling_factor: String, scaling_value: String).returns( + T.attached_class + ) + end + def self.new( + # Scaling factor + scaling_factor:, + # Scaling value + scaling_value: + ) + end + + sig do + override.returns({ scaling_factor: String, scaling_value: String }) + end + def to_hash + end + end + + class UnitAmount < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount, + Orb::Internal::AnyHash + ) + end + + # Pricing value + sig { returns(String) } + attr_accessor :pricing_value + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a unit amount + sig do + params(pricing_value: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Pricing value + pricing_value:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns({ pricing_value: String, unit_amount: String }) + end + def to_hash + end + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -332,29 +531,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_subscription_grouped_with_prorated_minimum_price.rbi b/rbi/orb/models/new_subscription_grouped_with_prorated_minimum_price.rbi index d12d4016..c273a36e 100644 --- a/rbi/orb/models/new_subscription_grouped_with_prorated_minimum_price.rbi +++ b/rbi/orb/models/new_subscription_grouped_with_prorated_minimum_price.rbi @@ -19,13 +19,27 @@ module Orb end attr_accessor :cadence - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_with_prorated_minimum_config + # Configuration for grouped_with_prorated_minimum pricing + sig do + returns( + Orb::NewSubscriptionGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig + ) + end + attr_reader :grouped_with_prorated_minimum_config + + sig do + params( + grouped_with_prorated_minimum_config: + Orb::NewSubscriptionGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig::OrHash + ).void + end + attr_writer :grouped_with_prorated_minimum_config # The id of the item the price will be associated with. sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns( Orb::NewSubscriptionGroupedWithProratedMinimumPrice::ModelType::OrSymbol @@ -135,7 +149,8 @@ module Orb params( cadence: Orb::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence::OrSymbol, - grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + grouped_with_prorated_minimum_config: + Orb::NewSubscriptionGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig::OrHash, item_id: String, model_type: Orb::NewSubscriptionGroupedWithProratedMinimumPrice::ModelType::OrSymbol, @@ -167,9 +182,11 @@ module Orb def self.new( # The cadence to bill for this price on. cadence:, + # Configuration for grouped_with_prorated_minimum pricing grouped_with_prorated_minimum_config:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, @@ -216,7 +233,8 @@ module Orb { cadence: Orb::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence::OrSymbol, - grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + grouped_with_prorated_minimum_config: + Orb::NewSubscriptionGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig, item_id: String, model_type: Orb::NewSubscriptionGroupedWithProratedMinimumPrice::ModelType::OrSymbol, @@ -304,6 +322,55 @@ module Orb end end + class GroupedWithProratedMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig, + Orb::Internal::AnyHash + ) + end + + # How to determine the groups that should each have a minimum + sig { returns(String) } + attr_accessor :grouping_key + + # The minimum amount to charge per group + sig { returns(String) } + attr_accessor :minimum + + # The amount to charge per unit + sig { returns(String) } + attr_accessor :unit_rate + + # Configuration for grouped_with_prorated_minimum pricing + sig do + params( + grouping_key: String, + minimum: String, + unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # How to determine the groups that should each have a minimum + grouping_key:, + # The minimum amount to charge per group + minimum:, + # The amount to charge per unit + unit_rate: + ) + end + + sig do + override.returns( + { grouping_key: String, minimum: String, unit_rate: String } + ) + end + def to_hash + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -332,29 +399,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewSubscriptionGroupedWithProratedMinimumPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_subscription_matrix_price.rbi b/rbi/orb/models/new_subscription_matrix_price.rbi index df62c081..a6a760ca 100644 --- a/rbi/orb/models/new_subscription_matrix_price.rbi +++ b/rbi/orb/models/new_subscription_matrix_price.rbi @@ -16,12 +16,14 @@ module Orb sig { returns(String) } attr_accessor :item_id + # Configuration for matrix pricing sig { returns(Orb::MatrixConfig) } attr_reader :matrix_config sig { params(matrix_config: Orb::MatrixConfig::OrHash).void } attr_writer :matrix_config + # The pricing model type sig { returns(Orb::NewSubscriptionMatrixPrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -159,7 +161,9 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # Configuration for matrix pricing matrix_config:, + # The pricing model type model_type:, # The name of the price. name:, @@ -281,6 +285,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -304,29 +309,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewSubscriptionMatrixPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_subscription_matrix_with_allocation_price.rbi b/rbi/orb/models/new_subscription_matrix_with_allocation_price.rbi index 49b7939a..c38bcbb4 100644 --- a/rbi/orb/models/new_subscription_matrix_with_allocation_price.rbi +++ b/rbi/orb/models/new_subscription_matrix_with_allocation_price.rbi @@ -23,6 +23,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # Configuration for matrix_with_allocation pricing sig { returns(Orb::MatrixWithAllocationConfig) } attr_reader :matrix_with_allocation_config @@ -33,6 +34,7 @@ module Orb end attr_writer :matrix_with_allocation_config + # The pricing model type sig do returns( Orb::NewSubscriptionMatrixWithAllocationPrice::ModelType::OrSymbol @@ -177,7 +179,9 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # Configuration for matrix_with_allocation pricing matrix_with_allocation_config:, + # The pricing model type model_type:, # The name of the price. name:, @@ -312,6 +316,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -340,29 +345,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewSubscriptionMatrixWithAllocationPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_subscription_matrix_with_display_name_price.rbi b/rbi/orb/models/new_subscription_matrix_with_display_name_price.rbi index 5d979b18..e58021c3 100644 --- a/rbi/orb/models/new_subscription_matrix_with_display_name_price.rbi +++ b/rbi/orb/models/new_subscription_matrix_with_display_name_price.rbi @@ -23,9 +23,23 @@ module Orb sig { returns(String) } attr_accessor :item_id - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :matrix_with_display_name_config + # Configuration for matrix_with_display_name pricing + sig do + returns( + Orb::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig + ) + end + attr_reader :matrix_with_display_name_config + + sig do + params( + matrix_with_display_name_config: + Orb::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::OrHash + ).void + end + attr_writer :matrix_with_display_name_config + # The pricing model type sig do returns( Orb::NewSubscriptionMatrixWithDisplayNamePrice::ModelType::OrSymbol @@ -136,7 +150,8 @@ module Orb cadence: Orb::NewSubscriptionMatrixWithDisplayNamePrice::Cadence::OrSymbol, item_id: String, - matrix_with_display_name_config: T::Hash[Symbol, T.anything], + matrix_with_display_name_config: + Orb::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::OrHash, model_type: Orb::NewSubscriptionMatrixWithDisplayNamePrice::ModelType::OrSymbol, name: String, @@ -169,7 +184,9 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # Configuration for matrix_with_display_name pricing matrix_with_display_name_config:, + # The pricing model type model_type:, # The name of the price. name:, @@ -217,7 +234,8 @@ module Orb cadence: Orb::NewSubscriptionMatrixWithDisplayNamePrice::Cadence::OrSymbol, item_id: String, - matrix_with_display_name_config: T::Hash[Symbol, T.anything], + matrix_with_display_name_config: + Orb::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig, model_type: Orb::NewSubscriptionMatrixWithDisplayNamePrice::ModelType::OrSymbol, name: String, @@ -304,6 +322,115 @@ module Orb end end + class MatrixWithDisplayNameConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig, + Orb::Internal::AnyHash + ) + end + + # Used to determine the unit rate + sig { returns(String) } + attr_accessor :dimension + + # Apply per unit pricing to each dimension value + sig do + returns( + T::Array[ + Orb::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount + ] + ) + end + attr_accessor :unit_amounts + + # Configuration for matrix_with_display_name pricing + sig do + params( + dimension: String, + unit_amounts: + T::Array[ + Orb::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Used to determine the unit rate + dimension:, + # Apply per unit pricing to each dimension value + unit_amounts: + ) + end + + sig do + override.returns( + { + dimension: String, + unit_amounts: + T::Array[ + Orb::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount + ] + } + ) + end + def to_hash + end + + class UnitAmount < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount, + Orb::Internal::AnyHash + ) + end + + # The dimension value + sig { returns(String) } + attr_accessor :dimension_value + + # Display name for this dimension value + sig { returns(String) } + attr_accessor :display_name + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a unit amount item + sig do + params( + dimension_value: String, + display_name: String, + unit_amount: String + ).returns(T.attached_class) + end + def self.new( + # The dimension value + dimension_value:, + # Display name for this dimension value + display_name:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns( + { + dimension_value: String, + display_name: String, + unit_amount: String + } + ) + end + def to_hash + end + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -332,29 +459,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewSubscriptionMatrixWithDisplayNamePrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_subscription_max_group_tiered_package_price.rbi b/rbi/orb/models/new_subscription_max_group_tiered_package_price.rbi index 90e21ddd..e29a8e7e 100644 --- a/rbi/orb/models/new_subscription_max_group_tiered_package_price.rbi +++ b/rbi/orb/models/new_subscription_max_group_tiered_package_price.rbi @@ -23,9 +23,23 @@ module Orb sig { returns(String) } attr_accessor :item_id - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :max_group_tiered_package_config + # Configuration for max_group_tiered_package pricing + sig do + returns( + Orb::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig + ) + end + attr_reader :max_group_tiered_package_config + + sig do + params( + max_group_tiered_package_config: + Orb::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::OrHash + ).void + end + attr_writer :max_group_tiered_package_config + # The pricing model type sig do returns( Orb::NewSubscriptionMaxGroupTieredPackagePrice::ModelType::OrSymbol @@ -136,7 +150,8 @@ module Orb cadence: Orb::NewSubscriptionMaxGroupTieredPackagePrice::Cadence::OrSymbol, item_id: String, - max_group_tiered_package_config: T::Hash[Symbol, T.anything], + max_group_tiered_package_config: + Orb::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::OrHash, model_type: Orb::NewSubscriptionMaxGroupTieredPackagePrice::ModelType::OrSymbol, name: String, @@ -169,7 +184,9 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # Configuration for max_group_tiered_package pricing max_group_tiered_package_config:, + # The pricing model type model_type:, # The name of the price. name:, @@ -217,7 +234,8 @@ module Orb cadence: Orb::NewSubscriptionMaxGroupTieredPackagePrice::Cadence::OrSymbol, item_id: String, - max_group_tiered_package_config: T::Hash[Symbol, T.anything], + max_group_tiered_package_config: + Orb::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig, model_type: Orb::NewSubscriptionMaxGroupTieredPackagePrice::ModelType::OrSymbol, name: String, @@ -304,6 +322,109 @@ module Orb end end + class MaxGroupTieredPackageConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before tiering the group with the highest value + sig { returns(String) } + attr_accessor :grouping_key + + # Package size + sig { returns(String) } + attr_accessor :package_size + + # Apply tiered pricing to the largest group after grouping with the provided key. + sig do + returns( + T::Array[ + Orb::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for max_group_tiered_package pricing + sig do + params( + grouping_key: String, + package_size: String, + tiers: + T::Array[ + Orb::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before tiering the group with the highest value + grouping_key:, + # Package size + package_size:, + # Apply tiered pricing to the largest group after grouping with the provided key. + tiers: + ) + end + + sig do + override.returns( + { + grouping_key: String, + package_size: String, + tiers: + T::Array[ + Orb::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tier + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Tier lower bound + tier_lower_bound:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns({ tier_lower_bound: String, unit_amount: String }) + end + def to_hash + end + end + end + + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -332,29 +453,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewSubscriptionMaxGroupTieredPackagePrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_subscription_tiered_bps_price.rbi b/rbi/orb/models/new_subscription_minimum_composite_price.rbi similarity index 73% rename from rbi/orb/models/new_subscription_tiered_bps_price.rbi rename to rbi/orb/models/new_subscription_minimum_composite_price.rbi index 59bfe215..cfc58bab 100644 --- a/rbi/orb/models/new_subscription_tiered_bps_price.rbi +++ b/rbi/orb/models/new_subscription_minimum_composite_price.rbi @@ -2,33 +2,47 @@ module Orb module Models - class NewSubscriptionTieredBPSPrice < Orb::Internal::Type::BaseModel + class NewSubscriptionMinimumCompositePrice < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::NewSubscriptionTieredBPSPrice, Orb::Internal::AnyHash) + T.any( + Orb::NewSubscriptionMinimumCompositePrice, + Orb::Internal::AnyHash + ) end # The cadence to bill for this price on. - sig { returns(Orb::NewSubscriptionTieredBPSPrice::Cadence::OrSymbol) } + sig do + returns(Orb::NewSubscriptionMinimumCompositePrice::Cadence::OrSymbol) + end attr_accessor :cadence # The id of the item the price will be associated with. sig { returns(String) } attr_accessor :item_id - sig { returns(Orb::NewSubscriptionTieredBPSPrice::ModelType::OrSymbol) } + # Configuration for minimum pricing + sig { returns(Orb::NewSubscriptionMinimumCompositePrice::MinimumConfig) } + attr_reader :minimum_config + + sig do + params( + minimum_config: + Orb::NewSubscriptionMinimumCompositePrice::MinimumConfig::OrHash + ).void + end + attr_writer :minimum_config + + # The pricing model type + sig do + returns(Orb::NewSubscriptionMinimumCompositePrice::ModelType::OrSymbol) + end attr_accessor :model_type # The name of the price. sig { returns(String) } attr_accessor :name - sig { returns(Orb::TieredBPSConfig) } - attr_reader :tiered_bps_config - - sig { params(tiered_bps_config: Orb::TieredBPSConfig::OrHash).void } - attr_writer :tiered_bps_config - # The id of the billable metric for the price. Only needed if the price is # usage-based. sig { returns(T.nilable(String)) } @@ -125,11 +139,13 @@ module Orb sig do params( - cadence: Orb::NewSubscriptionTieredBPSPrice::Cadence::OrSymbol, + cadence: Orb::NewSubscriptionMinimumCompositePrice::Cadence::OrSymbol, item_id: String, - model_type: Orb::NewSubscriptionTieredBPSPrice::ModelType::OrSymbol, + minimum_config: + Orb::NewSubscriptionMinimumCompositePrice::MinimumConfig::OrHash, + model_type: + Orb::NewSubscriptionMinimumCompositePrice::ModelType::OrSymbol, name: String, - tiered_bps_config: Orb::TieredBPSConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -159,10 +175,12 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # Configuration for minimum pricing + minimum_config:, + # The pricing model type model_type:, # The name of the price. name:, - tiered_bps_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. billable_metric_id: nil, @@ -204,11 +222,14 @@ module Orb sig do override.returns( { - cadence: Orb::NewSubscriptionTieredBPSPrice::Cadence::OrSymbol, + cadence: + Orb::NewSubscriptionMinimumCompositePrice::Cadence::OrSymbol, item_id: String, - model_type: Orb::NewSubscriptionTieredBPSPrice::ModelType::OrSymbol, + minimum_config: + Orb::NewSubscriptionMinimumCompositePrice::MinimumConfig, + model_type: + Orb::NewSubscriptionMinimumCompositePrice::ModelType::OrSymbol, name: String, - tiered_bps_config: Orb::TieredBPSConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -243,96 +264,117 @@ module Orb TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::NewSubscriptionTieredBPSPrice::Cadence) + T.all(Symbol, Orb::NewSubscriptionMinimumCompositePrice::Cadence) end OrSymbol = T.type_alias { T.any(Symbol, String) } ANNUAL = T.let( :annual, - Orb::NewSubscriptionTieredBPSPrice::Cadence::TaggedSymbol + Orb::NewSubscriptionMinimumCompositePrice::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::NewSubscriptionTieredBPSPrice::Cadence::TaggedSymbol + Orb::NewSubscriptionMinimumCompositePrice::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::NewSubscriptionTieredBPSPrice::Cadence::TaggedSymbol + Orb::NewSubscriptionMinimumCompositePrice::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::NewSubscriptionTieredBPSPrice::Cadence::TaggedSymbol + Orb::NewSubscriptionMinimumCompositePrice::Cadence::TaggedSymbol ) ONE_TIME = T.let( :one_time, - Orb::NewSubscriptionTieredBPSPrice::Cadence::TaggedSymbol + Orb::NewSubscriptionMinimumCompositePrice::Cadence::TaggedSymbol ) CUSTOM = T.let( :custom, - Orb::NewSubscriptionTieredBPSPrice::Cadence::TaggedSymbol + Orb::NewSubscriptionMinimumCompositePrice::Cadence::TaggedSymbol ) sig do override.returns( - T::Array[Orb::NewSubscriptionTieredBPSPrice::Cadence::TaggedSymbol] + T::Array[ + Orb::NewSubscriptionMinimumCompositePrice::Cadence::TaggedSymbol + ] ) end def self.values end end - module ModelType - extend Orb::Internal::Type::Enum - - TaggedSymbol = + class MinimumConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do - T.all(Symbol, Orb::NewSubscriptionTieredBPSPrice::ModelType) + T.any( + Orb::NewSubscriptionMinimumCompositePrice::MinimumConfig, + Orb::Internal::AnyHash + ) end - OrSymbol = T.type_alias { T.any(Symbol, String) } - TIERED_BPS = - T.let( - :tiered_bps, - Orb::NewSubscriptionTieredBPSPrice::ModelType::TaggedSymbol - ) + # The minimum amount to apply + sig { returns(String) } + attr_accessor :minimum_amount + # If true, subtotals from this price are prorated based on the service period + sig { returns(T.nilable(T::Boolean)) } + attr_reader :prorated + + sig { params(prorated: T::Boolean).void } + attr_writer :prorated + + # Configuration for minimum pricing sig do - override.returns( - T::Array[ - Orb::NewSubscriptionTieredBPSPrice::ModelType::TaggedSymbol - ] + params(minimum_amount: String, prorated: T::Boolean).returns( + T.attached_class ) end - def self.values + def self.new( + # The minimum amount to apply + minimum_amount:, + # If true, subtotals from this price are prorated based on the service period + prorated: nil + ) + end + + sig do + override.returns({ minimum_amount: String, prorated: T::Boolean }) + end + def to_hash end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union + # The pricing model type + module ModelType + extend Orb::Internal::Type::Enum - Variants = + TaggedSymbol = T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) + T.all(Symbol, Orb::NewSubscriptionMinimumCompositePrice::ModelType) end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MINIMUM = + T.let( + :minimum, + Orb::NewSubscriptionMinimumCompositePrice::ModelType::TaggedSymbol + ) sig do override.returns( T::Array[ - Orb::NewSubscriptionTieredBPSPrice::ConversionRateConfig::Variants + Orb::NewSubscriptionMinimumCompositePrice::ModelType::TaggedSymbol ] ) end - def self.variants + def self.values end end end diff --git a/rbi/orb/models/new_subscription_package_price.rbi b/rbi/orb/models/new_subscription_package_price.rbi index 703713ca..bff8498a 100644 --- a/rbi/orb/models/new_subscription_package_price.rbi +++ b/rbi/orb/models/new_subscription_package_price.rbi @@ -16,6 +16,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewSubscriptionPackagePrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -23,6 +24,7 @@ module Orb sig { returns(String) } attr_accessor :name + # Configuration for package pricing sig { returns(Orb::PackageConfig) } attr_reader :package_config @@ -159,9 +161,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for package pricing package_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -287,6 +291,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -310,29 +315,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewSubscriptionPackagePrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_subscription_package_with_allocation_price.rbi b/rbi/orb/models/new_subscription_package_with_allocation_price.rbi index 8800d1ed..b45cbbeb 100644 --- a/rbi/orb/models/new_subscription_package_with_allocation_price.rbi +++ b/rbi/orb/models/new_subscription_package_with_allocation_price.rbi @@ -23,6 +23,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns( Orb::NewSubscriptionPackageWithAllocationPrice::ModelType::OrSymbol @@ -34,8 +35,21 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :package_with_allocation_config + # Configuration for package_with_allocation pricing + sig do + returns( + Orb::NewSubscriptionPackageWithAllocationPrice::PackageWithAllocationConfig + ) + end + attr_reader :package_with_allocation_config + + sig do + params( + package_with_allocation_config: + Orb::NewSubscriptionPackageWithAllocationPrice::PackageWithAllocationConfig::OrHash + ).void + end + attr_writer :package_with_allocation_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -139,7 +153,8 @@ module Orb model_type: Orb::NewSubscriptionPackageWithAllocationPrice::ModelType::OrSymbol, name: String, - package_with_allocation_config: T::Hash[Symbol, T.anything], + package_with_allocation_config: + Orb::NewSubscriptionPackageWithAllocationPrice::PackageWithAllocationConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -169,9 +184,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for package_with_allocation pricing package_with_allocation_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -220,7 +237,8 @@ module Orb model_type: Orb::NewSubscriptionPackageWithAllocationPrice::ModelType::OrSymbol, name: String, - package_with_allocation_config: T::Hash[Symbol, T.anything], + package_with_allocation_config: + Orb::NewSubscriptionPackageWithAllocationPrice::PackageWithAllocationConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -304,6 +322,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -333,26 +352,51 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class PackageWithAllocationConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewSubscriptionPackageWithAllocationPrice::PackageWithAllocationConfig, + Orb::Internal::AnyHash ) end + # Usage allocation + sig { returns(String) } + attr_accessor :allocation + + # Price per package + sig { returns(String) } + attr_accessor :package_amount + + # Package size + sig { returns(String) } + attr_accessor :package_size + + # Configuration for package_with_allocation pricing + sig do + params( + allocation: String, + package_amount: String, + package_size: String + ).returns(T.attached_class) + end + def self.new( + # Usage allocation + allocation:, + # Price per package + package_amount:, + # Package size + package_size: + ) + end + sig do override.returns( - T::Array[ - Orb::NewSubscriptionPackageWithAllocationPrice::ConversionRateConfig::Variants - ] + { allocation: String, package_amount: String, package_size: String } ) end - def self.variants + def to_hash end end end diff --git a/rbi/orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rbi b/rbi/orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rbi index e35d47fd..b61ee8b1 100644 --- a/rbi/orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rbi +++ b/rbi/orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rbi @@ -23,6 +23,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns( Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ModelType::OrSymbol @@ -34,8 +35,21 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :scalable_matrix_with_tiered_pricing_config + # Configuration for scalable_matrix_with_tiered_pricing pricing + sig do + returns( + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig + ) + end + attr_reader :scalable_matrix_with_tiered_pricing_config + + sig do + params( + scalable_matrix_with_tiered_pricing_config: + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::OrHash + ).void + end + attr_writer :scalable_matrix_with_tiered_pricing_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -140,7 +154,7 @@ module Orb Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ModelType::OrSymbol, name: String, scalable_matrix_with_tiered_pricing_config: - T::Hash[Symbol, T.anything], + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -170,9 +184,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for scalable_matrix_with_tiered_pricing pricing scalable_matrix_with_tiered_pricing_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -222,7 +238,7 @@ module Orb Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ModelType::OrSymbol, name: String, scalable_matrix_with_tiered_pricing_config: - T::Hash[Symbol, T.anything], + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -306,6 +322,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -335,26 +352,177 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class ScalableMatrixWithTieredPricingConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig, + Orb::Internal::AnyHash ) end + # Used for the scalable matrix first dimension + sig { returns(String) } + attr_accessor :first_dimension + + # Apply a scaling factor to each dimension sig do - override.returns( + returns( + T::Array[ + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor + ] + ) + end + attr_accessor :matrix_scaling_factors + + # Tier pricing structure + sig do + returns( T::Array[ - Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ConversionRateConfig::Variants + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier ] ) end - def self.variants + attr_accessor :tiers + + # Used for the scalable matrix second dimension (optional) + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension + + # Configuration for scalable_matrix_with_tiered_pricing pricing + sig do + params( + first_dimension: String, + matrix_scaling_factors: + T::Array[ + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor::OrHash + ], + tiers: + T::Array[ + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier::OrHash + ], + second_dimension: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Used for the scalable matrix first dimension + first_dimension:, + # Apply a scaling factor to each dimension + matrix_scaling_factors:, + # Tier pricing structure + tiers:, + # Used for the scalable matrix second dimension (optional) + second_dimension: nil + ) + end + + sig do + override.returns( + { + first_dimension: String, + matrix_scaling_factors: + T::Array[ + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor + ], + tiers: + T::Array[ + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier + ], + second_dimension: T.nilable(String) + } + ) + end + def to_hash + end + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor, + Orb::Internal::AnyHash + ) + end + + # First dimension value + sig { returns(String) } + attr_accessor :first_dimension_value + + # Scaling factor + sig { returns(String) } + attr_accessor :scaling_factor + + # Second dimension value (optional) + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension_value + + # Configuration for a single matrix scaling factor + sig do + params( + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # First dimension value + first_dimension_value:, + # Scaling factor + scaling_factor:, + # Second dimension value (optional) + second_dimension_value: nil + ) + end + + sig do + override.returns( + { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tier entry with business logic + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Tier lower bound + tier_lower_bound:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns({ tier_lower_bound: String, unit_amount: String }) + end + def to_hash + end end end end diff --git a/rbi/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rbi b/rbi/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rbi index 41ed14eb..a266d4c2 100644 --- a/rbi/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rbi +++ b/rbi/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rbi @@ -23,6 +23,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns( Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ModelType::OrSymbol @@ -34,8 +35,21 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :scalable_matrix_with_unit_pricing_config + # Configuration for scalable_matrix_with_unit_pricing pricing + sig do + returns( + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig + ) + end + attr_reader :scalable_matrix_with_unit_pricing_config + + sig do + params( + scalable_matrix_with_unit_pricing_config: + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::OrHash + ).void + end + attr_writer :scalable_matrix_with_unit_pricing_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -139,7 +153,8 @@ module Orb model_type: Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ModelType::OrSymbol, name: String, - scalable_matrix_with_unit_pricing_config: T::Hash[Symbol, T.anything], + scalable_matrix_with_unit_pricing_config: + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -169,9 +184,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for scalable_matrix_with_unit_pricing pricing scalable_matrix_with_unit_pricing_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -221,7 +238,7 @@ module Orb Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ModelType::OrSymbol, name: String, scalable_matrix_with_unit_pricing_config: - T::Hash[Symbol, T.anything], + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -305,6 +322,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -334,26 +352,135 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class ScalableMatrixWithUnitPricingConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig, + Orb::Internal::AnyHash ) end + # Used to determine the unit rate + sig { returns(String) } + attr_accessor :first_dimension + + # Apply a scaling factor to each dimension sig do - override.returns( + returns( T::Array[ - Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ConversionRateConfig::Variants + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor ] ) end - def self.variants + attr_accessor :matrix_scaling_factors + + # The final unit price to rate against the output of the matrix + sig { returns(String) } + attr_accessor :unit_price + + # If true, the unit price will be prorated to the billing period + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :prorate + + # Used to determine the unit rate (optional) + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension + + # Configuration for scalable_matrix_with_unit_pricing pricing + sig do + params( + first_dimension: String, + matrix_scaling_factors: + T::Array[ + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor::OrHash + ], + unit_price: String, + prorate: T.nilable(T::Boolean), + second_dimension: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Used to determine the unit rate + first_dimension:, + # Apply a scaling factor to each dimension + matrix_scaling_factors:, + # The final unit price to rate against the output of the matrix + unit_price:, + # If true, the unit price will be prorated to the billing period + prorate: nil, + # Used to determine the unit rate (optional) + second_dimension: nil + ) + end + + sig do + override.returns( + { + first_dimension: String, + matrix_scaling_factors: + T::Array[ + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor + ], + unit_price: String, + prorate: T.nilable(T::Boolean), + second_dimension: T.nilable(String) + } + ) + end + def to_hash + end + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor, + Orb::Internal::AnyHash + ) + end + + # First dimension value + sig { returns(String) } + attr_accessor :first_dimension_value + + # Scaling factor + sig { returns(String) } + attr_accessor :scaling_factor + + # Second dimension value (optional) + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension_value + + # Configuration for a single matrix scaling factor + sig do + params( + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # First dimension value + first_dimension_value:, + # Scaling factor + scaling_factor:, + # Second dimension value (optional) + second_dimension_value: nil + ) + end + + sig do + override.returns( + { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: T.nilable(String) + } + ) + end + def to_hash + end end end end diff --git a/rbi/orb/models/new_subscription_threshold_total_amount_price.rbi b/rbi/orb/models/new_subscription_threshold_total_amount_price.rbi index a71b914d..ffb1b5b2 100644 --- a/rbi/orb/models/new_subscription_threshold_total_amount_price.rbi +++ b/rbi/orb/models/new_subscription_threshold_total_amount_price.rbi @@ -23,6 +23,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns( Orb::NewSubscriptionThresholdTotalAmountPrice::ModelType::OrSymbol @@ -34,8 +35,21 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :threshold_total_amount_config + # Configuration for threshold_total_amount pricing + sig do + returns( + Orb::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig + ) + end + attr_reader :threshold_total_amount_config + + sig do + params( + threshold_total_amount_config: + Orb::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig::OrHash + ).void + end + attr_writer :threshold_total_amount_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -139,7 +153,8 @@ module Orb model_type: Orb::NewSubscriptionThresholdTotalAmountPrice::ModelType::OrSymbol, name: String, - threshold_total_amount_config: T::Hash[Symbol, T.anything], + threshold_total_amount_config: + Orb::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -169,9 +184,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for threshold_total_amount pricing threshold_total_amount_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -220,7 +237,8 @@ module Orb model_type: Orb::NewSubscriptionThresholdTotalAmountPrice::ModelType::OrSymbol, name: String, - threshold_total_amount_config: T::Hash[Symbol, T.anything], + threshold_total_amount_config: + Orb::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -304,6 +322,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -333,26 +352,97 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class ThresholdTotalAmountConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig, + Orb::Internal::AnyHash ) end + # When the quantity consumed passes a provided threshold, the configured total + # will be charged sig do - override.returns( + returns( T::Array[ - Orb::NewSubscriptionThresholdTotalAmountPrice::ConversionRateConfig::Variants + Orb::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable ] ) end - def self.variants + attr_accessor :consumption_table + + # If true, the unit price will be prorated to the billing period + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :prorate + + # Configuration for threshold_total_amount pricing + sig do + params( + consumption_table: + T::Array[ + Orb::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable::OrHash + ], + prorate: T.nilable(T::Boolean) + ).returns(T.attached_class) + end + def self.new( + # When the quantity consumed passes a provided threshold, the configured total + # will be charged + consumption_table:, + # If true, the unit price will be prorated to the billing period + prorate: nil + ) + end + + sig do + override.returns( + { + consumption_table: + T::Array[ + Orb::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable + ], + prorate: T.nilable(T::Boolean) + } + ) + end + def to_hash + end + + class ConsumptionTable < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable, + Orb::Internal::AnyHash + ) + end + + # Quantity threshold + sig { returns(String) } + attr_accessor :threshold + + # Total amount for this threshold + sig { returns(String) } + attr_accessor :total_amount + + # Configuration for a single threshold + sig do + params(threshold: String, total_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Quantity threshold + threshold:, + # Total amount for this threshold + total_amount: + ) + end + + sig { override.returns({ threshold: String, total_amount: String }) } + def to_hash + end end end end diff --git a/rbi/orb/models/new_subscription_tiered_package_price.rbi b/rbi/orb/models/new_subscription_tiered_package_price.rbi index 299557ec..e5184ae5 100644 --- a/rbi/orb/models/new_subscription_tiered_package_price.rbi +++ b/rbi/orb/models/new_subscription_tiered_package_price.rbi @@ -16,6 +16,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewSubscriptionTieredPackagePrice::ModelType::OrSymbol) end @@ -25,8 +26,19 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_package_config + # Configuration for tiered_package pricing + sig do + returns(Orb::NewSubscriptionTieredPackagePrice::TieredPackageConfig) + end + attr_reader :tiered_package_config + + sig do + params( + tiered_package_config: + Orb::NewSubscriptionTieredPackagePrice::TieredPackageConfig::OrHash + ).void + end + attr_writer :tiered_package_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -129,7 +141,8 @@ module Orb model_type: Orb::NewSubscriptionTieredPackagePrice::ModelType::OrSymbol, name: String, - tiered_package_config: T::Hash[Symbol, T.anything], + tiered_package_config: + Orb::NewSubscriptionTieredPackagePrice::TieredPackageConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -159,9 +172,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for tiered_package pricing tiered_package_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -209,7 +224,8 @@ module Orb model_type: Orb::NewSubscriptionTieredPackagePrice::ModelType::OrSymbol, name: String, - tiered_package_config: T::Hash[Symbol, T.anything], + tiered_package_config: + Orb::NewSubscriptionTieredPackagePrice::TieredPackageConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -290,6 +306,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -316,26 +333,103 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class TieredPackageConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewSubscriptionTieredPackagePrice::TieredPackageConfig, + Orb::Internal::AnyHash ) end + # Package size + sig { returns(String) } + attr_accessor :package_size + + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. The tier bounds are defined based on + # the total quantity rather than the number of packages, so they must be multiples + # of the package size. sig do - override.returns( + returns( T::Array[ - Orb::NewSubscriptionTieredPackagePrice::ConversionRateConfig::Variants + Orb::NewSubscriptionTieredPackagePrice::TieredPackageConfig::Tier ] ) end - def self.variants + attr_accessor :tiers + + # Configuration for tiered_package pricing + sig do + params( + package_size: String, + tiers: + T::Array[ + Orb::NewSubscriptionTieredPackagePrice::TieredPackageConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Package size + package_size:, + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. The tier bounds are defined based on + # the total quantity rather than the number of packages, so they must be multiples + # of the package size. + tiers: + ) + end + + sig do + override.returns( + { + package_size: String, + tiers: + T::Array[ + Orb::NewSubscriptionTieredPackagePrice::TieredPackageConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionTieredPackagePrice::TieredPackageConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Price per package + sig { returns(String) } + attr_accessor :per_unit + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Configuration for a single tier with business logic + sig do + params(per_unit: String, tier_lower_bound: String).returns( + T.attached_class + ) + end + def self.new( + # Price per package + per_unit:, + # Tier lower bound + tier_lower_bound: + ) + end + + sig do + override.returns({ per_unit: String, tier_lower_bound: String }) + end + def to_hash + end end end end diff --git a/rbi/orb/models/new_subscription_tiered_package_with_minimum_price.rbi b/rbi/orb/models/new_subscription_tiered_package_with_minimum_price.rbi index 3fedd954..beb1c529 100644 --- a/rbi/orb/models/new_subscription_tiered_package_with_minimum_price.rbi +++ b/rbi/orb/models/new_subscription_tiered_package_with_minimum_price.rbi @@ -23,6 +23,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns( Orb::NewSubscriptionTieredPackageWithMinimumPrice::ModelType::OrSymbol @@ -34,8 +35,21 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_package_with_minimum_config + # Configuration for tiered_package_with_minimum pricing + sig do + returns( + Orb::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig + ) + end + attr_reader :tiered_package_with_minimum_config + + sig do + params( + tiered_package_with_minimum_config: + Orb::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::OrHash + ).void + end + attr_writer :tiered_package_with_minimum_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -139,7 +153,8 @@ module Orb model_type: Orb::NewSubscriptionTieredPackageWithMinimumPrice::ModelType::OrSymbol, name: String, - tiered_package_with_minimum_config: T::Hash[Symbol, T.anything], + tiered_package_with_minimum_config: + Orb::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -169,9 +184,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for tiered_package_with_minimum pricing tiered_package_with_minimum_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -220,7 +237,8 @@ module Orb model_type: Orb::NewSubscriptionTieredPackageWithMinimumPrice::ModelType::OrSymbol, name: String, - tiered_package_with_minimum_config: T::Hash[Symbol, T.anything], + tiered_package_with_minimum_config: + Orb::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -304,6 +322,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -333,26 +352,113 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class TieredPackageWithMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig, + Orb::Internal::AnyHash ) end + # Package size + sig { returns(Float) } + attr_accessor :package_size + + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. sig do - override.returns( + returns( T::Array[ - Orb::NewSubscriptionTieredPackageWithMinimumPrice::ConversionRateConfig::Variants + Orb::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier ] ) end - def self.variants + attr_accessor :tiers + + # Configuration for tiered_package_with_minimum pricing + sig do + params( + package_size: Float, + tiers: + T::Array[ + Orb::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Package size + package_size:, + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + tiers: + ) + end + + sig do + override.returns( + { + package_size: Float, + tiers: + T::Array[ + Orb::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Minimum amount + sig { returns(String) } + attr_accessor :minimum_amount + + # Price per package + sig { returns(String) } + attr_accessor :per_unit + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Configuration for a single tier + sig do + params( + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + ).returns(T.attached_class) + end + def self.new( + # Minimum amount + minimum_amount:, + # Price per package + per_unit:, + # Tier lower bound + tier_lower_bound: + ) + end + + sig do + override.returns( + { + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + } + ) + end + def to_hash + end end end end diff --git a/rbi/orb/models/new_subscription_tiered_price.rbi b/rbi/orb/models/new_subscription_tiered_price.rbi index 52d258ca..0d9da3f2 100644 --- a/rbi/orb/models/new_subscription_tiered_price.rbi +++ b/rbi/orb/models/new_subscription_tiered_price.rbi @@ -16,6 +16,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewSubscriptionTieredPrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -23,6 +24,7 @@ module Orb sig { returns(String) } attr_accessor :name + # Configuration for tiered pricing sig { returns(Orb::TieredConfig) } attr_reader :tiered_config @@ -159,9 +161,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for tiered pricing tiered_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -281,6 +285,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -304,29 +309,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewSubscriptionTieredPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_subscription_tiered_with_minimum_price.rbi b/rbi/orb/models/new_subscription_tiered_with_minimum_price.rbi index 3e75de3e..8da6e51d 100644 --- a/rbi/orb/models/new_subscription_tiered_with_minimum_price.rbi +++ b/rbi/orb/models/new_subscription_tiered_with_minimum_price.rbi @@ -21,6 +21,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewSubscriptionTieredWithMinimumPrice::ModelType::OrSymbol) end @@ -30,8 +31,21 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_with_minimum_config + # Configuration for tiered_with_minimum pricing + sig do + returns( + Orb::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig + ) + end + attr_reader :tiered_with_minimum_config + + sig do + params( + tiered_with_minimum_config: + Orb::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig::OrHash + ).void + end + attr_writer :tiered_with_minimum_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -135,7 +149,8 @@ module Orb model_type: Orb::NewSubscriptionTieredWithMinimumPrice::ModelType::OrSymbol, name: String, - tiered_with_minimum_config: T::Hash[Symbol, T.anything], + tiered_with_minimum_config: + Orb::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -165,9 +180,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for tiered_with_minimum pricing tiered_with_minimum_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -216,7 +233,8 @@ module Orb model_type: Orb::NewSubscriptionTieredWithMinimumPrice::ModelType::OrSymbol, name: String, - tiered_with_minimum_config: T::Hash[Symbol, T.anything], + tiered_with_minimum_config: + Orb::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -297,6 +315,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -323,26 +342,127 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class TieredWithMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig, + Orb::Internal::AnyHash ) end + # Tiered pricing with a minimum amount dependent on the volume tier. Tiers are + # defined using exclusive lower bounds. sig do - override.returns( + returns( T::Array[ - Orb::NewSubscriptionTieredWithMinimumPrice::ConversionRateConfig::Variants + Orb::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig::Tier ] ) end - def self.variants + attr_accessor :tiers + + # If true, tiers with an accrued amount of 0 will not be included in the rating. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :hide_zero_amount_tiers + + sig { params(hide_zero_amount_tiers: T::Boolean).void } + attr_writer :hide_zero_amount_tiers + + # If true, the unit price will be prorated to the billing period + sig { returns(T.nilable(T::Boolean)) } + attr_reader :prorate + + sig { params(prorate: T::Boolean).void } + attr_writer :prorate + + # Configuration for tiered_with_minimum pricing + sig do + params( + tiers: + T::Array[ + Orb::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig::Tier::OrHash + ], + hide_zero_amount_tiers: T::Boolean, + prorate: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # Tiered pricing with a minimum amount dependent on the volume tier. Tiers are + # defined using exclusive lower bounds. + tiers:, + # If true, tiers with an accrued amount of 0 will not be included in the rating. + hide_zero_amount_tiers: nil, + # If true, the unit price will be prorated to the billing period + prorate: nil + ) + end + + sig do + override.returns( + { + tiers: + T::Array[ + Orb::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig::Tier + ], + hide_zero_amount_tiers: T::Boolean, + prorate: T::Boolean + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Minimum amount + sig { returns(String) } + attr_accessor :minimum_amount + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tier + sig do + params( + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + ).returns(T.attached_class) + end + def self.new( + # Minimum amount + minimum_amount:, + # Tier lower bound + tier_lower_bound:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns( + { + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + } + ) + end + def to_hash + end end end end diff --git a/rbi/orb/models/new_subscription_unit_price.rbi b/rbi/orb/models/new_subscription_unit_price.rbi index 3b72bdde..805949cd 100644 --- a/rbi/orb/models/new_subscription_unit_price.rbi +++ b/rbi/orb/models/new_subscription_unit_price.rbi @@ -16,6 +16,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::NewSubscriptionUnitPrice::ModelType::OrSymbol) } attr_accessor :model_type @@ -23,6 +24,7 @@ module Orb sig { returns(String) } attr_accessor :name + # Configuration for unit pricing sig { returns(Orb::UnitConfig) } attr_reader :unit_config @@ -159,9 +161,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for unit pricing unit_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -273,6 +277,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -293,29 +298,6 @@ module Orb def self.values end end - - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::NewSubscriptionUnitPrice::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end end end end diff --git a/rbi/orb/models/new_subscription_unit_with_percent_price.rbi b/rbi/orb/models/new_subscription_unit_with_percent_price.rbi index b7d415e7..709110ed 100644 --- a/rbi/orb/models/new_subscription_unit_with_percent_price.rbi +++ b/rbi/orb/models/new_subscription_unit_with_percent_price.rbi @@ -21,6 +21,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewSubscriptionUnitWithPercentPrice::ModelType::OrSymbol) end @@ -30,8 +31,19 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :unit_with_percent_config + # Configuration for unit_with_percent pricing + sig do + returns(Orb::NewSubscriptionUnitWithPercentPrice::UnitWithPercentConfig) + end + attr_reader :unit_with_percent_config + + sig do + params( + unit_with_percent_config: + Orb::NewSubscriptionUnitWithPercentPrice::UnitWithPercentConfig::OrHash + ).void + end + attr_writer :unit_with_percent_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -134,7 +146,8 @@ module Orb model_type: Orb::NewSubscriptionUnitWithPercentPrice::ModelType::OrSymbol, name: String, - unit_with_percent_config: T::Hash[Symbol, T.anything], + unit_with_percent_config: + Orb::NewSubscriptionUnitWithPercentPrice::UnitWithPercentConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -164,9 +177,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for unit_with_percent pricing unit_with_percent_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -215,7 +230,8 @@ module Orb model_type: Orb::NewSubscriptionUnitWithPercentPrice::ModelType::OrSymbol, name: String, - unit_with_percent_config: T::Hash[Symbol, T.anything], + unit_with_percent_config: + Orb::NewSubscriptionUnitWithPercentPrice::UnitWithPercentConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -296,6 +312,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -322,26 +339,37 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class UnitWithPercentConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewSubscriptionUnitWithPercentPrice::UnitWithPercentConfig, + Orb::Internal::AnyHash ) end + # What percent, out of 100, of the calculated total to charge + sig { returns(String) } + attr_accessor :percent + + # Rate per unit of usage + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for unit_with_percent pricing sig do - override.returns( - T::Array[ - Orb::NewSubscriptionUnitWithPercentPrice::ConversionRateConfig::Variants - ] - ) + params(percent: String, unit_amount: String).returns(T.attached_class) end - def self.variants + def self.new( + # What percent, out of 100, of the calculated total to charge + percent:, + # Rate per unit of usage + unit_amount: + ) + end + + sig { override.returns({ percent: String, unit_amount: String }) } + def to_hash end end end diff --git a/rbi/orb/models/new_subscription_unit_with_proration_price.rbi b/rbi/orb/models/new_subscription_unit_with_proration_price.rbi index fe8775e2..4f898523 100644 --- a/rbi/orb/models/new_subscription_unit_with_proration_price.rbi +++ b/rbi/orb/models/new_subscription_unit_with_proration_price.rbi @@ -21,6 +21,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig do returns(Orb::NewSubscriptionUnitWithProrationPrice::ModelType::OrSymbol) end @@ -30,8 +31,21 @@ module Orb sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :unit_with_proration_config + # Configuration for unit_with_proration pricing + sig do + returns( + Orb::NewSubscriptionUnitWithProrationPrice::UnitWithProrationConfig + ) + end + attr_reader :unit_with_proration_config + + sig do + params( + unit_with_proration_config: + Orb::NewSubscriptionUnitWithProrationPrice::UnitWithProrationConfig::OrHash + ).void + end + attr_writer :unit_with_proration_config # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -135,7 +149,8 @@ module Orb model_type: Orb::NewSubscriptionUnitWithProrationPrice::ModelType::OrSymbol, name: String, - unit_with_proration_config: T::Hash[Symbol, T.anything], + unit_with_proration_config: + Orb::NewSubscriptionUnitWithProrationPrice::UnitWithProrationConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -165,9 +180,11 @@ module Orb cadence:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for unit_with_proration pricing unit_with_proration_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. @@ -216,7 +233,8 @@ module Orb model_type: Orb::NewSubscriptionUnitWithProrationPrice::ModelType::OrSymbol, name: String, - unit_with_proration_config: T::Hash[Symbol, T.anything], + unit_with_proration_config: + Orb::NewSubscriptionUnitWithProrationPrice::UnitWithProrationConfig, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -297,6 +315,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -323,26 +342,29 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class UnitWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::NewSubscriptionUnitWithProrationPrice::UnitWithProrationConfig, + Orb::Internal::AnyHash ) end - sig do - override.returns( - T::Array[ - Orb::NewSubscriptionUnitWithProrationPrice::ConversionRateConfig::Variants - ] - ) + # Rate per unit of usage + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for unit_with_proration pricing + sig { params(unit_amount: String).returns(T.attached_class) } + def self.new( + # Rate per unit of usage + unit_amount: + ) end - def self.variants + + sig { override.returns({ unit_amount: String }) } + def to_hash end end end diff --git a/rbi/orb/models/package_config.rbi b/rbi/orb/models/package_config.rbi index 2bcb528f..f4f15c74 100644 --- a/rbi/orb/models/package_config.rbi +++ b/rbi/orb/models/package_config.rbi @@ -15,6 +15,7 @@ module Orb sig { returns(Integer) } attr_accessor :package_size + # Configuration for package pricing sig do params(package_amount: String, package_size: Integer).returns( T.attached_class diff --git a/rbi/orb/models/per_price_cost.rbi b/rbi/orb/models/per_price_cost.rbi index 03b378d7..20bb011c 100644 --- a/rbi/orb/models/per_price_cost.rbi +++ b/rbi/orb/models/per_price_cost.rbi @@ -30,17 +30,14 @@ module Orb price: T.any( Orb::Price::Unit::OrHash, - Orb::Price::Package::OrHash, - Orb::Price::Matrix::OrHash, Orb::Price::Tiered::OrHash, - Orb::Price::TieredBPS::OrHash, - Orb::Price::BPS::OrHash, - Orb::Price::BulkBPS::OrHash, Orb::Price::Bulk::OrHash, + Orb::Price::Package::OrHash, + Orb::Price::Matrix::OrHash, Orb::Price::ThresholdTotalAmount::OrHash, Orb::Price::TieredPackage::OrHash, - Orb::Price::GroupedTiered::OrHash, Orb::Price::TieredWithMinimum::OrHash, + Orb::Price::GroupedTiered::OrHash, Orb::Price::TieredPackageWithMinimum::OrHash, Orb::Price::PackageWithAllocation::OrHash, Orb::Price::UnitWithPercent::OrHash, @@ -48,16 +45,19 @@ module Orb Orb::Price::TieredWithProration::OrHash, Orb::Price::UnitWithProration::OrHash, Orb::Price::GroupedAllocation::OrHash, + Orb::Price::BulkWithProration::OrHash, Orb::Price::GroupedWithProratedMinimum::OrHash, Orb::Price::GroupedWithMeteredMinimum::OrHash, + Orb::Price::GroupedWithMinMaxThresholds::OrHash, Orb::Price::MatrixWithDisplayName::OrHash, - Orb::Price::BulkWithProration::OrHash, Orb::Price::GroupedTieredPackage::OrHash, Orb::Price::MaxGroupTieredPackage::OrHash, Orb::Price::ScalableMatrixWithUnitPricing::OrHash, Orb::Price::ScalableMatrixWithTieredPricing::OrHash, Orb::Price::CumulativeGroupedBulk::OrHash, - Orb::Price::GroupedWithMinMaxThresholds::OrHash + Orb::Price::Minimum::OrHash, + Orb::Price::Percent::OrHash, + Orb::Price::EventOutput::OrHash ), price_id: String, subtotal: String, diff --git a/rbi/orb/models/plan.rbi b/rbi/orb/models/plan.rbi index 813e07cf..94619e24 100644 --- a/rbi/orb/models/plan.rbi +++ b/rbi/orb/models/plan.rbi @@ -162,17 +162,14 @@ module Orb T::Array[ T.any( Orb::Price::Unit::OrHash, - Orb::Price::Package::OrHash, - Orb::Price::Matrix::OrHash, Orb::Price::Tiered::OrHash, - Orb::Price::TieredBPS::OrHash, - Orb::Price::BPS::OrHash, - Orb::Price::BulkBPS::OrHash, Orb::Price::Bulk::OrHash, + Orb::Price::Package::OrHash, + Orb::Price::Matrix::OrHash, Orb::Price::ThresholdTotalAmount::OrHash, Orb::Price::TieredPackage::OrHash, - Orb::Price::GroupedTiered::OrHash, Orb::Price::TieredWithMinimum::OrHash, + Orb::Price::GroupedTiered::OrHash, Orb::Price::TieredPackageWithMinimum::OrHash, Orb::Price::PackageWithAllocation::OrHash, Orb::Price::UnitWithPercent::OrHash, @@ -180,16 +177,19 @@ module Orb Orb::Price::TieredWithProration::OrHash, Orb::Price::UnitWithProration::OrHash, Orb::Price::GroupedAllocation::OrHash, + Orb::Price::BulkWithProration::OrHash, Orb::Price::GroupedWithProratedMinimum::OrHash, Orb::Price::GroupedWithMeteredMinimum::OrHash, + Orb::Price::GroupedWithMinMaxThresholds::OrHash, Orb::Price::MatrixWithDisplayName::OrHash, - Orb::Price::BulkWithProration::OrHash, Orb::Price::GroupedTieredPackage::OrHash, Orb::Price::MaxGroupTieredPackage::OrHash, Orb::Price::ScalableMatrixWithUnitPricing::OrHash, Orb::Price::ScalableMatrixWithTieredPricing::OrHash, Orb::Price::CumulativeGroupedBulk::OrHash, - Orb::Price::GroupedWithMinMaxThresholds::OrHash + Orb::Price::Minimum::OrHash, + Orb::Price::Percent::OrHash, + Orb::Price::EventOutput::OrHash ) ], product: Orb::Plan::Product::OrHash, diff --git a/rbi/orb/models/plan_create_params.rbi b/rbi/orb/models/plan_create_params.rbi index 41bc20f7..288c1a1e 100644 --- a/rbi/orb/models/plan_create_params.rbi +++ b/rbi/orb/models/plan_create_params.rbi @@ -149,39 +149,40 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - # The price to add to the plan + # New plan price request body params. sig do returns( T.nilable( T.any( Orb::NewPlanUnitPrice, - Orb::NewPlanPackagePrice, - Orb::NewPlanMatrixPrice, Orb::NewPlanTieredPrice, - Orb::NewPlanTieredBPSPrice, - Orb::NewPlanBPSPrice, - Orb::NewPlanBulkBPSPrice, Orb::NewPlanBulkPrice, + Orb::NewPlanPackagePrice, + Orb::NewPlanMatrixPrice, Orb::NewPlanThresholdTotalAmountPrice, Orb::NewPlanTieredPackagePrice, Orb::NewPlanTieredWithMinimumPrice, - Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanGroupedTieredPrice, + Orb::NewPlanTieredPackageWithMinimumPrice, Orb::NewPlanPackageWithAllocationPrice, - Orb::NewPlanTierWithProrationPrice, + Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanMatrixWithAllocationPrice, + Orb::PlanCreateParams::Price::Price::TieredWithProration, Orb::NewPlanUnitWithProrationPrice, Orb::NewPlanGroupedAllocationPrice, + Orb::NewPlanBulkWithProrationPrice, Orb::NewPlanGroupedWithProratedMinimumPrice, Orb::NewPlanGroupedWithMeteredMinimumPrice, + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds, Orb::NewPlanMatrixWithDisplayNamePrice, - Orb::NewPlanBulkWithProrationPrice, Orb::NewPlanGroupedTieredPackagePrice, Orb::NewPlanMaxGroupTieredPackagePrice, Orb::NewPlanScalableMatrixWithUnitPricingPrice, Orb::NewPlanScalableMatrixWithTieredPricingPrice, Orb::NewPlanCumulativeGroupedBulkPrice, - Orb::NewPlanTieredPackageWithMinimumPrice, - Orb::NewPlanMatrixWithAllocationPrice, - Orb::NewPlanGroupedTieredPrice + Orb::NewPlanMinimumCompositePrice, + Orb::PlanCreateParams::Price::Price::Percent, + Orb::PlanCreateParams::Price::Price::EventOutput ) ) ) @@ -196,33 +197,34 @@ module Orb T.nilable( T.any( Orb::NewPlanUnitPrice::OrHash, - Orb::NewPlanPackagePrice::OrHash, - Orb::NewPlanMatrixPrice::OrHash, Orb::NewPlanTieredPrice::OrHash, - Orb::NewPlanTieredBPSPrice::OrHash, - Orb::NewPlanBPSPrice::OrHash, - Orb::NewPlanBulkBPSPrice::OrHash, Orb::NewPlanBulkPrice::OrHash, + Orb::NewPlanPackagePrice::OrHash, + Orb::NewPlanMatrixPrice::OrHash, Orb::NewPlanThresholdTotalAmountPrice::OrHash, Orb::NewPlanTieredPackagePrice::OrHash, Orb::NewPlanTieredWithMinimumPrice::OrHash, - Orb::NewPlanUnitWithPercentPrice::OrHash, + Orb::NewPlanGroupedTieredPrice::OrHash, + Orb::NewPlanTieredPackageWithMinimumPrice::OrHash, Orb::NewPlanPackageWithAllocationPrice::OrHash, - Orb::NewPlanTierWithProrationPrice::OrHash, + Orb::NewPlanUnitWithPercentPrice::OrHash, + Orb::NewPlanMatrixWithAllocationPrice::OrHash, + Orb::PlanCreateParams::Price::Price::TieredWithProration::OrHash, Orb::NewPlanUnitWithProrationPrice::OrHash, Orb::NewPlanGroupedAllocationPrice::OrHash, + Orb::NewPlanBulkWithProrationPrice::OrHash, Orb::NewPlanGroupedWithProratedMinimumPrice::OrHash, Orb::NewPlanGroupedWithMeteredMinimumPrice::OrHash, + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::OrHash, Orb::NewPlanMatrixWithDisplayNamePrice::OrHash, - Orb::NewPlanBulkWithProrationPrice::OrHash, Orb::NewPlanGroupedTieredPackagePrice::OrHash, Orb::NewPlanMaxGroupTieredPackagePrice::OrHash, Orb::NewPlanScalableMatrixWithUnitPricingPrice::OrHash, Orb::NewPlanScalableMatrixWithTieredPricingPrice::OrHash, Orb::NewPlanCumulativeGroupedBulkPrice::OrHash, - Orb::NewPlanTieredPackageWithMinimumPrice::OrHash, - Orb::NewPlanMatrixWithAllocationPrice::OrHash, - Orb::NewPlanGroupedTieredPrice::OrHash + Orb::NewPlanMinimumCompositePrice::OrHash, + Orb::PlanCreateParams::Price::Price::Percent::OrHash, + Orb::PlanCreateParams::Price::Price::EventOutput::OrHash ) ) ).returns(T.attached_class) @@ -232,7 +234,7 @@ module Orb allocation_price: nil, # The phase to add this price to. plan_phase_order: nil, - # The price to add to the plan + # New plan price request body params. price: nil ) end @@ -246,33 +248,34 @@ module Orb T.nilable( T.any( Orb::NewPlanUnitPrice, - Orb::NewPlanPackagePrice, - Orb::NewPlanMatrixPrice, Orb::NewPlanTieredPrice, - Orb::NewPlanTieredBPSPrice, - Orb::NewPlanBPSPrice, - Orb::NewPlanBulkBPSPrice, Orb::NewPlanBulkPrice, + Orb::NewPlanPackagePrice, + Orb::NewPlanMatrixPrice, Orb::NewPlanThresholdTotalAmountPrice, Orb::NewPlanTieredPackagePrice, Orb::NewPlanTieredWithMinimumPrice, - Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanGroupedTieredPrice, + Orb::NewPlanTieredPackageWithMinimumPrice, Orb::NewPlanPackageWithAllocationPrice, - Orb::NewPlanTierWithProrationPrice, + Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanMatrixWithAllocationPrice, + Orb::PlanCreateParams::Price::Price::TieredWithProration, Orb::NewPlanUnitWithProrationPrice, Orb::NewPlanGroupedAllocationPrice, + Orb::NewPlanBulkWithProrationPrice, Orb::NewPlanGroupedWithProratedMinimumPrice, Orb::NewPlanGroupedWithMeteredMinimumPrice, + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds, Orb::NewPlanMatrixWithDisplayNamePrice, - Orb::NewPlanBulkWithProrationPrice, Orb::NewPlanGroupedTieredPackagePrice, Orb::NewPlanMaxGroupTieredPackagePrice, Orb::NewPlanScalableMatrixWithUnitPricingPrice, Orb::NewPlanScalableMatrixWithTieredPricingPrice, Orb::NewPlanCumulativeGroupedBulkPrice, - Orb::NewPlanTieredPackageWithMinimumPrice, - Orb::NewPlanMatrixWithAllocationPrice, - Orb::NewPlanGroupedTieredPrice + Orb::NewPlanMinimumCompositePrice, + Orb::PlanCreateParams::Price::Price::Percent, + Orb::PlanCreateParams::Price::Price::EventOutput ) ) } @@ -281,7 +284,7 @@ module Orb def to_hash end - # The price to add to the plan + # New plan price request body params. module Price extend Orb::Internal::Type::Union @@ -289,35 +292,1515 @@ module Orb T.type_alias do T.any( Orb::NewPlanUnitPrice, - Orb::NewPlanPackagePrice, - Orb::NewPlanMatrixPrice, Orb::NewPlanTieredPrice, - Orb::NewPlanTieredBPSPrice, - Orb::NewPlanBPSPrice, - Orb::NewPlanBulkBPSPrice, Orb::NewPlanBulkPrice, + Orb::NewPlanPackagePrice, + Orb::NewPlanMatrixPrice, Orb::NewPlanThresholdTotalAmountPrice, Orb::NewPlanTieredPackagePrice, Orb::NewPlanTieredWithMinimumPrice, - Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanGroupedTieredPrice, + Orb::NewPlanTieredPackageWithMinimumPrice, Orb::NewPlanPackageWithAllocationPrice, - Orb::NewPlanTierWithProrationPrice, + Orb::NewPlanUnitWithPercentPrice, + Orb::NewPlanMatrixWithAllocationPrice, + Orb::PlanCreateParams::Price::Price::TieredWithProration, Orb::NewPlanUnitWithProrationPrice, Orb::NewPlanGroupedAllocationPrice, + Orb::NewPlanBulkWithProrationPrice, Orb::NewPlanGroupedWithProratedMinimumPrice, Orb::NewPlanGroupedWithMeteredMinimumPrice, + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds, Orb::NewPlanMatrixWithDisplayNamePrice, - Orb::NewPlanBulkWithProrationPrice, Orb::NewPlanGroupedTieredPackagePrice, Orb::NewPlanMaxGroupTieredPackagePrice, Orb::NewPlanScalableMatrixWithUnitPricingPrice, Orb::NewPlanScalableMatrixWithTieredPricingPrice, Orb::NewPlanCumulativeGroupedBulkPrice, - Orb::NewPlanTieredPackageWithMinimumPrice, - Orb::NewPlanMatrixWithAllocationPrice, - Orb::NewPlanGroupedTieredPrice + Orb::NewPlanMinimumCompositePrice, + Orb::PlanCreateParams::Price::Price::Percent, + Orb::PlanCreateParams::Price::Price::EventOutput + ) + end + + class TieredWithProration < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PlanCreateParams::Price::Price::TieredWithProration, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::PlanCreateParams::Price::Price::TieredWithProration::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # Configuration for tiered_with_proration pricing + sig do + returns( + Orb::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig + ) + end + attr_reader :tiered_with_proration_config + + sig do + params( + tiered_with_proration_config: + Orb::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig::OrHash + ).void + end + attr_writer :tiered_with_proration_config + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::PlanCreateParams::Price::Price::TieredWithProration::Cadence::OrSymbol, + item_id: String, + name: String, + tiered_with_proration_config: + Orb::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for tiered_with_proration pricing + tiered_with_proration_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :tiered_with_proration + ) + end + + sig do + override.returns( + { + cadence: + Orb::PlanCreateParams::Price::Price::TieredWithProration::Cadence::OrSymbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_proration_config: + Orb::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::PlanCreateParams::Price::Price::TieredWithProration::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::PlanCreateParams::Price::Price::TieredWithProration::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::PlanCreateParams::Price::Price::TieredWithProration::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::PlanCreateParams::Price::Price::TieredWithProration::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::PlanCreateParams::Price::Price::TieredWithProration::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::PlanCreateParams::Price::Price::TieredWithProration::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::PlanCreateParams::Price::Price::TieredWithProration::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::PlanCreateParams::Price::Price::TieredWithProration::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig, + Orb::Internal::AnyHash + ) + end + + # Tiers for rating based on total usage quantities into the specified tier with + # proration + sig do + returns( + T::Array[ + Orb::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for tiered_with_proration pricing + sig do + params( + tiers: + T::Array[ + Orb::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Tiers for rating based on total usage quantities into the specified tier with + # proration + tiers: + ) + end + + sig do + override.returns( + { + tiers: + T::Array[ + Orb::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Inclusive tier starting value + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Amount per unit + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tiered with proration tier + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Inclusive tier starting value + tier_lower_bound:, + # Amount per unit + unit_amount: + ) + end + + sig do + override.returns( + { tier_lower_bound: String, unit_amount: String } + ) + end + def to_hash + end + end + end + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + returns( + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + ) + end + attr_reader :grouped_with_min_max_thresholds_config + + sig do + params( + grouped_with_min_max_thresholds_config: + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash + ).void + end + attr_writer :grouped_with_min_max_thresholds_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + grouped_with_min_max_thresholds_config: + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # Configuration for grouped_with_min_max_thresholds pricing + grouped_with_min_max_thresholds_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :grouped_with_min_max_thresholds + ) + end + + sig do + override.returns( + { + cadence: + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + grouped_with_min_max_thresholds_config: + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before applying thresholds + sig { returns(String) } + attr_accessor :grouping_key + + # The maximum amount to charge each group + sig { returns(String) } + attr_accessor :maximum_charge + + # The minimum amount to charge each group, regardless of usage + sig { returns(String) } + attr_accessor :minimum_charge + + # The base price charged per group + sig { returns(String) } + attr_accessor :per_unit_rate + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + params( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before applying thresholds + grouping_key:, + # The maximum amount to charge each group + maximum_charge:, + # The minimum amount to charge each group, regardless of usage + minimum_charge:, + # The base price charged per group + per_unit_rate: + ) + end + + sig do + override.returns( + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + ) + end + def to_hash + end + end + end + + class Percent < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PlanCreateParams::Price::Price::Percent, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::PlanCreateParams::Price::Price::Percent::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # Configuration for percent pricing + sig do + returns( + Orb::PlanCreateParams::Price::Price::Percent::PercentConfig + ) + end + attr_reader :percent_config + + sig do + params( + percent_config: + Orb::PlanCreateParams::Price::Price::Percent::PercentConfig::OrHash + ).void + end + attr_writer :percent_config + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::PlanCreateParams::Price::Price::Percent::Cadence::OrSymbol, + item_id: String, + name: String, + percent_config: + Orb::PlanCreateParams::Price::Price::Percent::PercentConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for percent pricing + percent_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :percent + ) + end + + sig do + override.returns( + { + cadence: + Orb::PlanCreateParams::Price::Price::Percent::Cadence::OrSymbol, + item_id: String, + model_type: Symbol, + name: String, + percent_config: + Orb::PlanCreateParams::Price::Price::Percent::PercentConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::PlanCreateParams::Price::Price::Percent::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::PlanCreateParams::Price::Price::Percent::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::PlanCreateParams::Price::Price::Percent::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::PlanCreateParams::Price::Price::Percent::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::PlanCreateParams::Price::Price::Percent::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::PlanCreateParams::Price::Price::Percent::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::PlanCreateParams::Price::Price::Percent::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::PlanCreateParams::Price::Price::Percent::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class PercentConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PlanCreateParams::Price::Price::Percent::PercentConfig, + Orb::Internal::AnyHash + ) + end + + # What percent of the component subtotals to charge + sig { returns(Float) } + attr_accessor :percent + + # Configuration for percent pricing + sig { params(percent: Float).returns(T.attached_class) } + def self.new( + # What percent of the component subtotals to charge + percent: ) + end + + sig { override.returns({ percent: Float }) } + def to_hash + end end + end + + class EventOutput < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PlanCreateParams::Price::Price::EventOutput, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::PlanCreateParams::Price::Price::EventOutput::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # Configuration for event_output pricing + sig do + returns( + Orb::PlanCreateParams::Price::Price::EventOutput::EventOutputConfig + ) + end + attr_reader :event_output_config + + sig do + params( + event_output_config: + Orb::PlanCreateParams::Price::Price::EventOutput::EventOutputConfig::OrHash + ).void + end + attr_writer :event_output_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::PlanCreateParams::Price::Price::EventOutput::Cadence::OrSymbol, + event_output_config: + Orb::PlanCreateParams::Price::Price::EventOutput::EventOutputConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # Configuration for event_output pricing + event_output_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :event_output + ) + end + + sig do + override.returns( + { + cadence: + Orb::PlanCreateParams::Price::Price::EventOutput::Cadence::OrSymbol, + event_output_config: + Orb::PlanCreateParams::Price::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::PlanCreateParams::Price::Price::EventOutput::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::PlanCreateParams::Price::Price::EventOutput::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::PlanCreateParams::Price::Price::EventOutput::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::PlanCreateParams::Price::Price::EventOutput::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::PlanCreateParams::Price::Price::EventOutput::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::PlanCreateParams::Price::Price::EventOutput::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::PlanCreateParams::Price::Price::EventOutput::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::PlanCreateParams::Price::Price::EventOutput::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class EventOutputConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PlanCreateParams::Price::Price::EventOutput::EventOutputConfig, + Orb::Internal::AnyHash + ) + end + + # The key in the event data to extract the unit rate from. + sig { returns(String) } + attr_accessor :unit_rating_key + + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + sig { returns(T.nilable(String)) } + attr_accessor :grouping_key + + # Configuration for event_output pricing + sig do + params( + unit_rating_key: String, + grouping_key: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The key in the event data to extract the unit rate from. + unit_rating_key:, + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + grouping_key: nil + ) + end + + sig do + override.returns( + { unit_rating_key: String, grouping_key: T.nilable(String) } + ) + end + def to_hash + end + end + end sig do override.returns( diff --git a/rbi/orb/models/plan_phase_amount_discount_adjustment.rbi b/rbi/orb/models/plan_phase_amount_discount_adjustment.rbi index aec1b182..8d8b89eb 100644 --- a/rbi/orb/models/plan_phase_amount_discount_adjustment.rbi +++ b/rbi/orb/models/plan_phase_amount_discount_adjustment.rbi @@ -31,8 +31,8 @@ module Orb sig { returns(T::Array[Orb::TransformPriceFilter]) } attr_accessor :filters - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. sig { returns(T::Boolean) } attr_accessor :is_invoice_level @@ -73,8 +73,8 @@ module Orb applies_to_price_ids:, # The filters that determine which prices to apply this adjustment to. filters:, - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. is_invoice_level:, # The plan phase in which this adjustment is active. plan_phase_order:, diff --git a/rbi/orb/models/plan_phase_maximum_adjustment.rbi b/rbi/orb/models/plan_phase_maximum_adjustment.rbi index b52c8ea2..6afeaea2 100644 --- a/rbi/orb/models/plan_phase_maximum_adjustment.rbi +++ b/rbi/orb/models/plan_phase_maximum_adjustment.rbi @@ -24,8 +24,8 @@ module Orb sig { returns(T::Array[Orb::TransformPriceFilter]) } attr_accessor :filters - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. sig { returns(T::Boolean) } attr_accessor :is_invoice_level @@ -68,8 +68,8 @@ module Orb applies_to_price_ids:, # The filters that determine which prices to apply this adjustment to. filters:, - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. is_invoice_level:, # The maximum amount to charge in a given billing period for the prices this # adjustment applies to. diff --git a/rbi/orb/models/plan_phase_minimum_adjustment.rbi b/rbi/orb/models/plan_phase_minimum_adjustment.rbi index b47b8ee3..05aec852 100644 --- a/rbi/orb/models/plan_phase_minimum_adjustment.rbi +++ b/rbi/orb/models/plan_phase_minimum_adjustment.rbi @@ -24,8 +24,8 @@ module Orb sig { returns(T::Array[Orb::TransformPriceFilter]) } attr_accessor :filters - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. sig { returns(T::Boolean) } attr_accessor :is_invoice_level @@ -73,8 +73,8 @@ module Orb applies_to_price_ids:, # The filters that determine which prices to apply this adjustment to. filters:, - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. is_invoice_level:, # The item ID that revenue from this minimum will be attributed to. item_id:, diff --git a/rbi/orb/models/plan_phase_percentage_discount_adjustment.rbi b/rbi/orb/models/plan_phase_percentage_discount_adjustment.rbi index fb768d57..5a330bbc 100644 --- a/rbi/orb/models/plan_phase_percentage_discount_adjustment.rbi +++ b/rbi/orb/models/plan_phase_percentage_discount_adjustment.rbi @@ -29,8 +29,8 @@ module Orb sig { returns(T::Array[Orb::TransformPriceFilter]) } attr_accessor :filters - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. sig { returns(T::Boolean) } attr_accessor :is_invoice_level @@ -73,8 +73,8 @@ module Orb applies_to_price_ids:, # The filters that determine which prices to apply this adjustment to. filters:, - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. is_invoice_level:, # The percentage (as a value between 0 and 1) by which to discount the price # intervals this adjustment applies to in a given billing period. diff --git a/rbi/orb/models/plan_phase_usage_discount_adjustment.rbi b/rbi/orb/models/plan_phase_usage_discount_adjustment.rbi index 55e320a9..a6a44369 100644 --- a/rbi/orb/models/plan_phase_usage_discount_adjustment.rbi +++ b/rbi/orb/models/plan_phase_usage_discount_adjustment.rbi @@ -26,8 +26,8 @@ module Orb sig { returns(T::Array[Orb::TransformPriceFilter]) } attr_accessor :filters - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. sig { returns(T::Boolean) } attr_accessor :is_invoice_level @@ -70,8 +70,8 @@ module Orb applies_to_price_ids:, # The filters that determine which prices to apply this adjustment to. filters:, - # True for adjustments that apply to an entire invocice, false for adjustments - # that apply to only one price. + # True for adjustments that apply to an entire invoice, false for adjustments that + # apply to only one price. is_invoice_level:, # The plan phase in which this adjustment is active. plan_phase_order:, diff --git a/rbi/orb/models/plan_version.rbi b/rbi/orb/models/plan_version.rbi index 20ef976e..f726ec98 100644 --- a/rbi/orb/models/plan_version.rbi +++ b/rbi/orb/models/plan_version.rbi @@ -44,17 +44,14 @@ module Orb T::Array[ T.any( Orb::Price::Unit::OrHash, - Orb::Price::Package::OrHash, - Orb::Price::Matrix::OrHash, Orb::Price::Tiered::OrHash, - Orb::Price::TieredBPS::OrHash, - Orb::Price::BPS::OrHash, - Orb::Price::BulkBPS::OrHash, Orb::Price::Bulk::OrHash, + Orb::Price::Package::OrHash, + Orb::Price::Matrix::OrHash, Orb::Price::ThresholdTotalAmount::OrHash, Orb::Price::TieredPackage::OrHash, - Orb::Price::GroupedTiered::OrHash, Orb::Price::TieredWithMinimum::OrHash, + Orb::Price::GroupedTiered::OrHash, Orb::Price::TieredPackageWithMinimum::OrHash, Orb::Price::PackageWithAllocation::OrHash, Orb::Price::UnitWithPercent::OrHash, @@ -62,16 +59,19 @@ module Orb Orb::Price::TieredWithProration::OrHash, Orb::Price::UnitWithProration::OrHash, Orb::Price::GroupedAllocation::OrHash, + Orb::Price::BulkWithProration::OrHash, Orb::Price::GroupedWithProratedMinimum::OrHash, Orb::Price::GroupedWithMeteredMinimum::OrHash, + Orb::Price::GroupedWithMinMaxThresholds::OrHash, Orb::Price::MatrixWithDisplayName::OrHash, - Orb::Price::BulkWithProration::OrHash, Orb::Price::GroupedTieredPackage::OrHash, Orb::Price::MaxGroupTieredPackage::OrHash, Orb::Price::ScalableMatrixWithUnitPricing::OrHash, Orb::Price::ScalableMatrixWithTieredPricing::OrHash, Orb::Price::CumulativeGroupedBulk::OrHash, - Orb::Price::GroupedWithMinMaxThresholds::OrHash + Orb::Price::Minimum::OrHash, + Orb::Price::Percent::OrHash, + Orb::Price::EventOutput::OrHash ) ], version: Integer diff --git a/rbi/orb/models/price.rbi b/rbi/orb/models/price.rbi index 6fc9e6b1..3ed6d79c 100644 --- a/rbi/orb/models/price.rbi +++ b/rbi/orb/models/price.rbi @@ -19,17 +19,14 @@ module Orb T.type_alias do T.any( Orb::Price::Unit, - Orb::Price::Package, - Orb::Price::Matrix, Orb::Price::Tiered, - Orb::Price::TieredBPS, - Orb::Price::BPS, - Orb::Price::BulkBPS, Orb::Price::Bulk, + Orb::Price::Package, + Orb::Price::Matrix, Orb::Price::ThresholdTotalAmount, Orb::Price::TieredPackage, - Orb::Price::GroupedTiered, Orb::Price::TieredWithMinimum, + Orb::Price::GroupedTiered, Orb::Price::TieredPackageWithMinimum, Orb::Price::PackageWithAllocation, Orb::Price::UnitWithPercent, @@ -37,16 +34,19 @@ module Orb Orb::Price::TieredWithProration, Orb::Price::UnitWithProration, Orb::Price::GroupedAllocation, + Orb::Price::BulkWithProration, Orb::Price::GroupedWithProratedMinimum, Orb::Price::GroupedWithMeteredMinimum, + Orb::Price::GroupedWithMinMaxThresholds, Orb::Price::MatrixWithDisplayName, - Orb::Price::BulkWithProration, Orb::Price::GroupedTieredPackage, Orb::Price::MaxGroupTieredPackage, Orb::Price::ScalableMatrixWithUnitPricing, Orb::Price::ScalableMatrixWithTieredPricing, Orb::Price::CumulativeGroupedBulk, - Orb::Price::GroupedWithMinMaxThresholds + Orb::Price::Minimum, + Orb::Price::Percent, + Orb::Price::EventOutput ) end @@ -77,9 +77,15 @@ module Orb end attr_writer :billing_cycle_configuration + sig { returns(Orb::Price::Unit::BillingMode::TaggedSymbol) } + attr_accessor :billing_mode + sig { returns(Orb::Price::Unit::Cadence::TaggedSymbol) } attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate @@ -122,6 +128,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -153,6 +161,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -170,6 +179,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :replaces_price_id + # Configuration for unit pricing sig { returns(Orb::UnitConfig) } attr_reader :unit_config @@ -192,7 +202,10 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, + billing_mode: Orb::Price::Unit::BillingMode::OrSymbol, cadence: Orb::Price::Unit::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -237,7 +250,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -247,6 +262,8 @@ module Orb external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -263,8 +280,10 @@ module Orb # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, + # Configuration for unit pricing unit_config:, dimensional_price_configuration: nil, + # The pricing model type model_type: :unit ) end @@ -275,7 +294,10 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::Unit::BillingMode::TaggedSymbol, cadence: Orb::Price::Unit::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable(Orb::Price::Unit::ConversionRateConfig::Variants), @@ -307,6 +329,27 @@ module Orb def to_hash end + module BillingMode + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Orb::Price::Unit::BillingMode) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_ADVANCE = + T.let(:in_advance, Orb::Price::Unit::BillingMode::TaggedSymbol) + IN_ARREAR = + T.let(:in_arrear, Orb::Price::Unit::BillingMode::TaggedSymbol) + + sig do + override.returns( + T::Array[Orb::Price::Unit::BillingMode::TaggedSymbol] + ) + end + def self.values + end + end + module Cadence extend Orb::Internal::Type::Enum @@ -329,26 +372,6 @@ module Orb end end - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[Orb::Price::Unit::ConversionRateConfig::Variants] - ) - end - def self.variants - end - end - module PriceType extend Orb::Internal::Type::Enum @@ -360,6 +383,8 @@ module Orb T.let(:usage_price, Orb::Price::Unit::PriceType::TaggedSymbol) FIXED_PRICE = T.let(:fixed_price, Orb::Price::Unit::PriceType::TaggedSymbol) + COMPOSITE_PRICE = + T.let(:composite_price, Orb::Price::Unit::PriceType::TaggedSymbol) sig do override.returns( @@ -371,9 +396,9 @@ module Orb end end - class Package < Orb::Internal::Type::BaseModel + class Tiered < Orb::Internal::Type::BaseModel OrHash = - T.type_alias { T.any(Orb::Price::Package, Orb::Internal::AnyHash) } + T.type_alias { T.any(Orb::Price::Tiered, Orb::Internal::AnyHash) } sig { returns(String) } attr_accessor :id @@ -398,16 +423,20 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::Price::Package::Cadence::TaggedSymbol) } + sig { returns(Orb::Price::Tiered::BillingMode::TaggedSymbol) } + attr_accessor :billing_mode + + sig { returns(Orb::Price::Tiered::Cadence::TaggedSymbol) } attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do - returns( - T.nilable(Orb::Price::Package::ConversionRateConfig::Variants) - ) + returns(T.nilable(Orb::Price::Tiered::ConversionRateConfig::Variants)) end attr_accessor :conversion_rate_config @@ -445,6 +474,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -476,22 +507,17 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type sig { returns(String) } attr_accessor :name - sig { returns(Orb::PackageConfig) } - attr_reader :package_config - - sig { params(package_config: Orb::PackageConfig::OrHash).void } - attr_writer :package_config - sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig { returns(Orb::Price::Package::PriceType::TaggedSymbol) } + sig { returns(Orb::Price::Tiered::PriceType::TaggedSymbol) } attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -499,6 +525,13 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :replaces_price_id + # Configuration for tiered pricing + sig { returns(Orb::TieredConfig) } + attr_reader :tiered_config + + sig { params(tiered_config: Orb::TieredConfig::OrHash).void } + attr_writer :tiered_config + sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) } attr_reader :dimensional_price_configuration @@ -515,7 +548,10 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::Package::Cadence::OrSymbol, + billing_mode: Orb::Price::Tiered::BillingMode::OrSymbol, + cadence: Orb::Price::Tiered::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -547,10 +583,10 @@ module Orb minimum: T.nilable(Orb::Minimum::OrHash), minimum_amount: T.nilable(String), name: String, - package_config: Orb::PackageConfig::OrHash, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::Package::PriceType::OrSymbol, + price_type: Orb::Price::Tiered::PriceType::OrSymbol, replaces_price_id: T.nilable(String), + tiered_config: Orb::TieredConfig::OrHash, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -560,7 +596,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -570,6 +608,8 @@ module Orb external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -581,14 +621,16 @@ module Orb minimum:, minimum_amount:, name:, - package_config:, plan_phase_order:, price_type:, # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, + # Configuration for tiered pricing + tiered_config:, dimensional_price_configuration: nil, - model_type: :package + # The pricing model type + model_type: :tiered ) end @@ -598,10 +640,13 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::Package::Cadence::TaggedSymbol, + billing_mode: Orb::Price::Tiered::BillingMode::TaggedSymbol, + cadence: Orb::Price::Tiered::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: - T.nilable(Orb::Price::Package::ConversionRateConfig::Variants), + T.nilable(Orb::Price::Tiered::ConversionRateConfig::Variants), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), currency: String, @@ -618,10 +663,10 @@ module Orb minimum_amount: T.nilable(String), model_type: Symbol, name: String, - package_config: Orb::PackageConfig, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::Package::PriceType::TaggedSymbol, + price_type: Orb::Price::Tiered::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), + tiered_config: Orb::TieredConfig, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -630,49 +675,49 @@ module Orb def to_hash end - module Cadence + module BillingMode extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::Price::Package::Cadence) } + T.type_alias { T.all(Symbol, Orb::Price::Tiered::BillingMode) } OrSymbol = T.type_alias { T.any(Symbol, String) } - ONE_TIME = - T.let(:one_time, Orb::Price::Package::Cadence::TaggedSymbol) - MONTHLY = T.let(:monthly, Orb::Price::Package::Cadence::TaggedSymbol) - QUARTERLY = - T.let(:quarterly, Orb::Price::Package::Cadence::TaggedSymbol) - SEMI_ANNUAL = - T.let(:semi_annual, Orb::Price::Package::Cadence::TaggedSymbol) - ANNUAL = T.let(:annual, Orb::Price::Package::Cadence::TaggedSymbol) - CUSTOM = T.let(:custom, Orb::Price::Package::Cadence::TaggedSymbol) + IN_ADVANCE = + T.let(:in_advance, Orb::Price::Tiered::BillingMode::TaggedSymbol) + IN_ARREAR = + T.let(:in_arrear, Orb::Price::Tiered::BillingMode::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::Package::Cadence::TaggedSymbol] + T::Array[Orb::Price::Tiered::BillingMode::TaggedSymbol] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union + module Cadence + extend Orb::Internal::Type::Enum - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end + TaggedSymbol = + T.type_alias { T.all(Symbol, Orb::Price::Tiered::Cadence) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ONE_TIME = T.let(:one_time, Orb::Price::Tiered::Cadence::TaggedSymbol) + MONTHLY = T.let(:monthly, Orb::Price::Tiered::Cadence::TaggedSymbol) + QUARTERLY = + T.let(:quarterly, Orb::Price::Tiered::Cadence::TaggedSymbol) + SEMI_ANNUAL = + T.let(:semi_annual, Orb::Price::Tiered::Cadence::TaggedSymbol) + ANNUAL = T.let(:annual, Orb::Price::Tiered::Cadence::TaggedSymbol) + CUSTOM = T.let(:custom, Orb::Price::Tiered::Cadence::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::Package::ConversionRateConfig::Variants] + T::Array[Orb::Price::Tiered::Cadence::TaggedSymbol] ) end - def self.variants + def self.values end end @@ -680,17 +725,19 @@ module Orb extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::Price::Package::PriceType) } + T.type_alias { T.all(Symbol, Orb::Price::Tiered::PriceType) } OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = - T.let(:usage_price, Orb::Price::Package::PriceType::TaggedSymbol) + T.let(:usage_price, Orb::Price::Tiered::PriceType::TaggedSymbol) FIXED_PRICE = - T.let(:fixed_price, Orb::Price::Package::PriceType::TaggedSymbol) + T.let(:fixed_price, Orb::Price::Tiered::PriceType::TaggedSymbol) + COMPOSITE_PRICE = + T.let(:composite_price, Orb::Price::Tiered::PriceType::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::Package::PriceType::TaggedSymbol] + T::Array[Orb::Price::Tiered::PriceType::TaggedSymbol] ) end def self.values @@ -698,9 +745,9 @@ module Orb end end - class Matrix < Orb::Internal::Type::BaseModel + class Bulk < Orb::Internal::Type::BaseModel OrHash = - T.type_alias { T.any(Orb::Price::Matrix, Orb::Internal::AnyHash) } + T.type_alias { T.any(Orb::Price::Bulk, Orb::Internal::AnyHash) } sig { returns(String) } attr_accessor :id @@ -725,14 +772,27 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::Price::Matrix::Cadence::TaggedSymbol) } + sig { returns(Orb::Price::Bulk::BillingMode::TaggedSymbol) } + attr_accessor :billing_mode + + # Configuration for bulk pricing + sig { returns(Orb::BulkConfig) } + attr_reader :bulk_config + + sig { params(bulk_config: Orb::BulkConfig::OrHash).void } + attr_writer :bulk_config + + sig { returns(Orb::Price::Bulk::Cadence::TaggedSymbol) } attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do - returns(T.nilable(Orb::Price::Matrix::ConversionRateConfig::Variants)) + returns(T.nilable(Orb::Price::Bulk::ConversionRateConfig::Variants)) end attr_accessor :conversion_rate_config @@ -770,18 +830,14 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item sig { params(item: Orb::ItemSlim::OrHash).void } attr_writer :item - sig { returns(Orb::MatrixConfig) } - attr_reader :matrix_config - - sig { params(matrix_config: Orb::MatrixConfig::OrHash).void } - attr_writer :matrix_config - sig { returns(T.nilable(Orb::Maximum)) } attr_reader :maximum @@ -807,6 +863,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -816,7 +873,7 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig { returns(Orb::Price::Matrix::PriceType::TaggedSymbol) } + sig { returns(Orb::Price::Bulk::PriceType::TaggedSymbol) } attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -840,7 +897,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::Matrix::Cadence::OrSymbol, + billing_mode: Orb::Price::Bulk::BillingMode::OrSymbol, + bulk_config: Orb::BulkConfig::OrHash, + cadence: Orb::Price::Bulk::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -866,7 +927,6 @@ module Orb invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration::OrHash), item: Orb::ItemSlim::OrHash, - matrix_config: Orb::MatrixConfig::OrHash, maximum: T.nilable(Orb::Maximum::OrHash), maximum_amount: T.nilable(String), metadata: T::Hash[Symbol, String], @@ -874,7 +934,7 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::Matrix::PriceType::OrSymbol, + price_type: Orb::Price::Bulk::PriceType::OrSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), @@ -885,7 +945,11 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, + # Configuration for bulk pricing + bulk_config:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -895,8 +959,9 @@ module Orb external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, - matrix_config:, maximum:, maximum_amount:, # User specified key-value pairs for the resource. If not present, this defaults @@ -913,7 +978,8 @@ module Orb # price in plan version migrations. replaces_price_id:, dimensional_price_configuration: nil, - model_type: :matrix + # The pricing model type + model_type: :bulk ) end @@ -923,10 +989,14 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::Matrix::Cadence::TaggedSymbol, + billing_mode: Orb::Price::Bulk::BillingMode::TaggedSymbol, + bulk_config: Orb::BulkConfig, + cadence: Orb::Price::Bulk::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: - T.nilable(Orb::Price::Matrix::ConversionRateConfig::Variants), + T.nilable(Orb::Price::Bulk::ConversionRateConfig::Variants), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), currency: String, @@ -936,7 +1006,6 @@ module Orb invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, - matrix_config: Orb::MatrixConfig, maximum: T.nilable(Orb::Maximum), maximum_amount: T.nilable(String), metadata: T::Hash[Symbol, String], @@ -945,7 +1014,7 @@ module Orb model_type: Symbol, name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::Matrix::PriceType::TaggedSymbol, + price_type: Orb::Price::Bulk::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) @@ -955,48 +1024,46 @@ module Orb def to_hash end - module Cadence + module BillingMode extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::Price::Matrix::Cadence) } + T.type_alias { T.all(Symbol, Orb::Price::Bulk::BillingMode) } OrSymbol = T.type_alias { T.any(Symbol, String) } - ONE_TIME = T.let(:one_time, Orb::Price::Matrix::Cadence::TaggedSymbol) - MONTHLY = T.let(:monthly, Orb::Price::Matrix::Cadence::TaggedSymbol) - QUARTERLY = - T.let(:quarterly, Orb::Price::Matrix::Cadence::TaggedSymbol) - SEMI_ANNUAL = - T.let(:semi_annual, Orb::Price::Matrix::Cadence::TaggedSymbol) - ANNUAL = T.let(:annual, Orb::Price::Matrix::Cadence::TaggedSymbol) - CUSTOM = T.let(:custom, Orb::Price::Matrix::Cadence::TaggedSymbol) + IN_ADVANCE = + T.let(:in_advance, Orb::Price::Bulk::BillingMode::TaggedSymbol) + IN_ARREAR = + T.let(:in_arrear, Orb::Price::Bulk::BillingMode::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::Matrix::Cadence::TaggedSymbol] + T::Array[Orb::Price::Bulk::BillingMode::TaggedSymbol] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Orb::Price::Bulk::Cadence) } + OrSymbol = T.type_alias { T.any(Symbol, String) } - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end + ONE_TIME = T.let(:one_time, Orb::Price::Bulk::Cadence::TaggedSymbol) + MONTHLY = T.let(:monthly, Orb::Price::Bulk::Cadence::TaggedSymbol) + QUARTERLY = T.let(:quarterly, Orb::Price::Bulk::Cadence::TaggedSymbol) + SEMI_ANNUAL = + T.let(:semi_annual, Orb::Price::Bulk::Cadence::TaggedSymbol) + ANNUAL = T.let(:annual, Orb::Price::Bulk::Cadence::TaggedSymbol) + CUSTOM = T.let(:custom, Orb::Price::Bulk::Cadence::TaggedSymbol) sig do - override.returns( - T::Array[Orb::Price::Matrix::ConversionRateConfig::Variants] - ) + override.returns(T::Array[Orb::Price::Bulk::Cadence::TaggedSymbol]) end - def self.variants + def self.values end end @@ -1004,17 +1071,19 @@ module Orb extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::Price::Matrix::PriceType) } + T.type_alias { T.all(Symbol, Orb::Price::Bulk::PriceType) } OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = - T.let(:usage_price, Orb::Price::Matrix::PriceType::TaggedSymbol) + T.let(:usage_price, Orb::Price::Bulk::PriceType::TaggedSymbol) FIXED_PRICE = - T.let(:fixed_price, Orb::Price::Matrix::PriceType::TaggedSymbol) + T.let(:fixed_price, Orb::Price::Bulk::PriceType::TaggedSymbol) + COMPOSITE_PRICE = + T.let(:composite_price, Orb::Price::Bulk::PriceType::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::Matrix::PriceType::TaggedSymbol] + T::Array[Orb::Price::Bulk::PriceType::TaggedSymbol] ) end def self.values @@ -1022,9 +1091,9 @@ module Orb end end - class Tiered < Orb::Internal::Type::BaseModel + class Package < Orb::Internal::Type::BaseModel OrHash = - T.type_alias { T.any(Orb::Price::Tiered, Orb::Internal::AnyHash) } + T.type_alias { T.any(Orb::Price::Package, Orb::Internal::AnyHash) } sig { returns(String) } attr_accessor :id @@ -1049,14 +1118,22 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::Price::Tiered::Cadence::TaggedSymbol) } + sig { returns(Orb::Price::Package::BillingMode::TaggedSymbol) } + attr_accessor :billing_mode + + sig { returns(Orb::Price::Package::Cadence::TaggedSymbol) } attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do - returns(T.nilable(Orb::Price::Tiered::ConversionRateConfig::Variants)) + returns( + T.nilable(Orb::Price::Package::ConversionRateConfig::Variants) + ) end attr_accessor :conversion_rate_config @@ -1094,6 +1171,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -1125,16 +1204,24 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type sig { returns(String) } attr_accessor :name + # Configuration for package pricing + sig { returns(Orb::PackageConfig) } + attr_reader :package_config + + sig { params(package_config: Orb::PackageConfig::OrHash).void } + attr_writer :package_config + sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig { returns(Orb::Price::Tiered::PriceType::TaggedSymbol) } + sig { returns(Orb::Price::Package::PriceType::TaggedSymbol) } attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -1142,12 +1229,6 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :replaces_price_id - sig { returns(Orb::TieredConfig) } - attr_reader :tiered_config - - sig { params(tiered_config: Orb::TieredConfig::OrHash).void } - attr_writer :tiered_config - sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) } attr_reader :dimensional_price_configuration @@ -1164,7 +1245,10 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::Tiered::Cadence::OrSymbol, + billing_mode: Orb::Price::Package::BillingMode::OrSymbol, + cadence: Orb::Price::Package::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -1196,10 +1280,10 @@ module Orb minimum: T.nilable(Orb::Minimum::OrHash), minimum_amount: T.nilable(String), name: String, + package_config: Orb::PackageConfig::OrHash, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::Tiered::PriceType::OrSymbol, + price_type: Orb::Price::Package::PriceType::OrSymbol, replaces_price_id: T.nilable(String), - tiered_config: Orb::TieredConfig::OrHash, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -1209,7 +1293,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -1219,6 +1305,8 @@ module Orb external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -1230,14 +1318,16 @@ module Orb minimum:, minimum_amount:, name:, + # Configuration for package pricing + package_config:, plan_phase_order:, price_type:, # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, - tiered_config:, dimensional_price_configuration: nil, - model_type: :tiered + # The pricing model type + model_type: :package ) end @@ -1247,10 +1337,13 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::Tiered::Cadence::TaggedSymbol, + billing_mode: Orb::Price::Package::BillingMode::TaggedSymbol, + cadence: Orb::Price::Package::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: - T.nilable(Orb::Price::Tiered::ConversionRateConfig::Variants), + T.nilable(Orb::Price::Package::ConversionRateConfig::Variants), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), currency: String, @@ -1267,10 +1360,10 @@ module Orb minimum_amount: T.nilable(String), model_type: Symbol, name: String, + package_config: Orb::PackageConfig, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::Tiered::PriceType::TaggedSymbol, + price_type: Orb::Price::Package::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), - tiered_config: Orb::TieredConfig, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -1279,48 +1372,50 @@ module Orb def to_hash end - module Cadence + module BillingMode extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::Price::Tiered::Cadence) } + T.type_alias { T.all(Symbol, Orb::Price::Package::BillingMode) } OrSymbol = T.type_alias { T.any(Symbol, String) } - ONE_TIME = T.let(:one_time, Orb::Price::Tiered::Cadence::TaggedSymbol) - MONTHLY = T.let(:monthly, Orb::Price::Tiered::Cadence::TaggedSymbol) - QUARTERLY = - T.let(:quarterly, Orb::Price::Tiered::Cadence::TaggedSymbol) - SEMI_ANNUAL = - T.let(:semi_annual, Orb::Price::Tiered::Cadence::TaggedSymbol) - ANNUAL = T.let(:annual, Orb::Price::Tiered::Cadence::TaggedSymbol) - CUSTOM = T.let(:custom, Orb::Price::Tiered::Cadence::TaggedSymbol) + IN_ADVANCE = + T.let(:in_advance, Orb::Price::Package::BillingMode::TaggedSymbol) + IN_ARREAR = + T.let(:in_arrear, Orb::Price::Package::BillingMode::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::Tiered::Cadence::TaggedSymbol] + T::Array[Orb::Price::Package::BillingMode::TaggedSymbol] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union + module Cadence + extend Orb::Internal::Type::Enum - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end + TaggedSymbol = + T.type_alias { T.all(Symbol, Orb::Price::Package::Cadence) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ONE_TIME = + T.let(:one_time, Orb::Price::Package::Cadence::TaggedSymbol) + MONTHLY = T.let(:monthly, Orb::Price::Package::Cadence::TaggedSymbol) + QUARTERLY = + T.let(:quarterly, Orb::Price::Package::Cadence::TaggedSymbol) + SEMI_ANNUAL = + T.let(:semi_annual, Orb::Price::Package::Cadence::TaggedSymbol) + ANNUAL = T.let(:annual, Orb::Price::Package::Cadence::TaggedSymbol) + CUSTOM = T.let(:custom, Orb::Price::Package::Cadence::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::Tiered::ConversionRateConfig::Variants] + T::Array[Orb::Price::Package::Cadence::TaggedSymbol] ) end - def self.variants + def self.values end end @@ -1328,17 +1423,22 @@ module Orb extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::Price::Tiered::PriceType) } + T.type_alias { T.all(Symbol, Orb::Price::Package::PriceType) } OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = - T.let(:usage_price, Orb::Price::Tiered::PriceType::TaggedSymbol) + T.let(:usage_price, Orb::Price::Package::PriceType::TaggedSymbol) FIXED_PRICE = - T.let(:fixed_price, Orb::Price::Tiered::PriceType::TaggedSymbol) + T.let(:fixed_price, Orb::Price::Package::PriceType::TaggedSymbol) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::Package::PriceType::TaggedSymbol + ) sig do override.returns( - T::Array[Orb::Price::Tiered::PriceType::TaggedSymbol] + T::Array[Orb::Price::Package::PriceType::TaggedSymbol] ) end def self.values @@ -1346,9 +1446,9 @@ module Orb end end - class TieredBPS < Orb::Internal::Type::BaseModel + class Matrix < Orb::Internal::Type::BaseModel OrHash = - T.type_alias { T.any(Orb::Price::TieredBPS, Orb::Internal::AnyHash) } + T.type_alias { T.any(Orb::Price::Matrix, Orb::Internal::AnyHash) } sig { returns(String) } attr_accessor :id @@ -1373,16 +1473,20 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::Price::TieredBPS::Cadence::TaggedSymbol) } + sig { returns(Orb::Price::Matrix::BillingMode::TaggedSymbol) } + attr_accessor :billing_mode + + sig { returns(Orb::Price::Matrix::Cadence::TaggedSymbol) } attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do - returns( - T.nilable(Orb::Price::TieredBPS::ConversionRateConfig::Variants) - ) + returns(T.nilable(Orb::Price::Matrix::ConversionRateConfig::Variants)) end attr_accessor :conversion_rate_config @@ -1420,12 +1524,21 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item sig { params(item: Orb::ItemSlim::OrHash).void } attr_writer :item + # Configuration for matrix pricing + sig { returns(Orb::MatrixConfig) } + attr_reader :matrix_config + + sig { params(matrix_config: Orb::MatrixConfig::OrHash).void } + attr_writer :matrix_config + sig { returns(T.nilable(Orb::Maximum)) } attr_reader :maximum @@ -1451,6 +1564,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -1460,7 +1574,7 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig { returns(Orb::Price::TieredBPS::PriceType::TaggedSymbol) } + sig { returns(Orb::Price::Matrix::PriceType::TaggedSymbol) } attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -1468,12 +1582,6 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :replaces_price_id - sig { returns(Orb::TieredBPSConfig) } - attr_reader :tiered_bps_config - - sig { params(tiered_bps_config: Orb::TieredBPSConfig::OrHash).void } - attr_writer :tiered_bps_config - sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) } attr_reader :dimensional_price_configuration @@ -1490,7 +1598,10 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::TieredBPS::Cadence::OrSymbol, + billing_mode: Orb::Price::Matrix::BillingMode::OrSymbol, + cadence: Orb::Price::Matrix::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -1516,6 +1627,7 @@ module Orb invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration::OrHash), item: Orb::ItemSlim::OrHash, + matrix_config: Orb::MatrixConfig::OrHash, maximum: T.nilable(Orb::Maximum::OrHash), maximum_amount: T.nilable(String), metadata: T::Hash[Symbol, String], @@ -1523,9 +1635,8 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::TieredBPS::PriceType::OrSymbol, + price_type: Orb::Price::Matrix::PriceType::OrSymbol, replaces_price_id: T.nilable(String), - tiered_bps_config: Orb::TieredBPSConfig::OrHash, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -1535,7 +1646,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -1545,7 +1658,11 @@ module Orb external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, + # Configuration for matrix pricing + matrix_config:, maximum:, maximum_amount:, # User specified key-value pairs for the resource. If not present, this defaults @@ -1561,9 +1678,9 @@ module Orb # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, - tiered_bps_config:, dimensional_price_configuration: nil, - model_type: :tiered_bps + # The pricing model type + model_type: :matrix ) end @@ -1573,12 +1690,13 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::TieredBPS::Cadence::TaggedSymbol, + billing_mode: Orb::Price::Matrix::BillingMode::TaggedSymbol, + cadence: Orb::Price::Matrix::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: - T.nilable( - Orb::Price::TieredBPS::ConversionRateConfig::Variants - ), + T.nilable(Orb::Price::Matrix::ConversionRateConfig::Variants), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), currency: String, @@ -1588,6 +1706,7 @@ module Orb invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, + matrix_config: Orb::MatrixConfig, maximum: T.nilable(Orb::Maximum), maximum_amount: T.nilable(String), metadata: T::Hash[Symbol, String], @@ -1596,9 +1715,8 @@ module Orb model_type: Symbol, name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::TieredBPS::PriceType::TaggedSymbol, + price_type: Orb::Price::Matrix::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), - tiered_bps_config: Orb::TieredBPSConfig, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -1607,50 +1725,49 @@ module Orb def to_hash end - module Cadence + module BillingMode extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::Price::TieredBPS::Cadence) } + T.type_alias { T.all(Symbol, Orb::Price::Matrix::BillingMode) } OrSymbol = T.type_alias { T.any(Symbol, String) } - ONE_TIME = - T.let(:one_time, Orb::Price::TieredBPS::Cadence::TaggedSymbol) - MONTHLY = - T.let(:monthly, Orb::Price::TieredBPS::Cadence::TaggedSymbol) - QUARTERLY = - T.let(:quarterly, Orb::Price::TieredBPS::Cadence::TaggedSymbol) - SEMI_ANNUAL = - T.let(:semi_annual, Orb::Price::TieredBPS::Cadence::TaggedSymbol) - ANNUAL = T.let(:annual, Orb::Price::TieredBPS::Cadence::TaggedSymbol) - CUSTOM = T.let(:custom, Orb::Price::TieredBPS::Cadence::TaggedSymbol) + IN_ADVANCE = + T.let(:in_advance, Orb::Price::Matrix::BillingMode::TaggedSymbol) + IN_ARREAR = + T.let(:in_arrear, Orb::Price::Matrix::BillingMode::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::TieredBPS::Cadence::TaggedSymbol] + T::Array[Orb::Price::Matrix::BillingMode::TaggedSymbol] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union + module Cadence + extend Orb::Internal::Type::Enum - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end + TaggedSymbol = + T.type_alias { T.all(Symbol, Orb::Price::Matrix::Cadence) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ONE_TIME = T.let(:one_time, Orb::Price::Matrix::Cadence::TaggedSymbol) + MONTHLY = T.let(:monthly, Orb::Price::Matrix::Cadence::TaggedSymbol) + QUARTERLY = + T.let(:quarterly, Orb::Price::Matrix::Cadence::TaggedSymbol) + SEMI_ANNUAL = + T.let(:semi_annual, Orb::Price::Matrix::Cadence::TaggedSymbol) + ANNUAL = T.let(:annual, Orb::Price::Matrix::Cadence::TaggedSymbol) + CUSTOM = T.let(:custom, Orb::Price::Matrix::Cadence::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::TieredBPS::ConversionRateConfig::Variants] + T::Array[Orb::Price::Matrix::Cadence::TaggedSymbol] ) end - def self.variants + def self.values end end @@ -1658,17 +1775,19 @@ module Orb extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::Price::TieredBPS::PriceType) } + T.type_alias { T.all(Symbol, Orb::Price::Matrix::PriceType) } OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = - T.let(:usage_price, Orb::Price::TieredBPS::PriceType::TaggedSymbol) + T.let(:usage_price, Orb::Price::Matrix::PriceType::TaggedSymbol) FIXED_PRICE = - T.let(:fixed_price, Orb::Price::TieredBPS::PriceType::TaggedSymbol) + T.let(:fixed_price, Orb::Price::Matrix::PriceType::TaggedSymbol) + COMPOSITE_PRICE = + T.let(:composite_price, Orb::Price::Matrix::PriceType::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::TieredBPS::PriceType::TaggedSymbol] + T::Array[Orb::Price::Matrix::PriceType::TaggedSymbol] ) end def self.values @@ -1676,8 +1795,11 @@ module Orb end end - class BPS < Orb::Internal::Type::BaseModel - OrHash = T.type_alias { T.any(Orb::Price::BPS, Orb::Internal::AnyHash) } + class ThresholdTotalAmount < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Orb::Price::ThresholdTotalAmount, Orb::Internal::AnyHash) + end sig { returns(String) } attr_accessor :id @@ -1702,20 +1824,26 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::BPSConfig) } - attr_reader :bps_config - - sig { params(bps_config: Orb::BPSConfig::OrHash).void } - attr_writer :bps_config + sig do + returns(Orb::Price::ThresholdTotalAmount::BillingMode::TaggedSymbol) + end + attr_accessor :billing_mode - sig { returns(Orb::Price::BPS::Cadence::TaggedSymbol) } + sig { returns(Orb::Price::ThresholdTotalAmount::Cadence::TaggedSymbol) } attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do - returns(T.nilable(Orb::Price::BPS::ConversionRateConfig::Variants)) + returns( + T.nilable( + Orb::Price::ThresholdTotalAmount::ConversionRateConfig::Variants + ) + ) end attr_accessor :conversion_rate_config @@ -1753,6 +1881,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -1784,6 +1914,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -1793,7 +1924,9 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig { returns(Orb::Price::BPS::PriceType::TaggedSymbol) } + sig do + returns(Orb::Price::ThresholdTotalAmount::PriceType::TaggedSymbol) + end attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -1801,6 +1934,20 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :replaces_price_id + # Configuration for threshold_total_amount pricing + sig do + returns(Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig) + end + attr_reader :threshold_total_amount_config + + sig do + params( + threshold_total_amount_config: + Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig::OrHash + ).void + end + attr_writer :threshold_total_amount_config + sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) } attr_reader :dimensional_price_configuration @@ -1817,8 +1964,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - bps_config: Orb::BPSConfig::OrHash, - cadence: Orb::Price::BPS::Cadence::OrSymbol, + billing_mode: + Orb::Price::ThresholdTotalAmount::BillingMode::OrSymbol, + cadence: Orb::Price::ThresholdTotalAmount::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -1851,8 +2001,10 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::BPS::PriceType::OrSymbol, + price_type: Orb::Price::ThresholdTotalAmount::PriceType::OrSymbol, replaces_price_id: T.nilable(String), + threshold_total_amount_config: + Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig::OrHash, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -1862,8 +2014,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, - bps_config:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -1873,6 +2026,8 @@ module Orb external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -1889,8 +2044,11 @@ module Orb # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, + # Configuration for threshold_total_amount pricing + threshold_total_amount_config:, dimensional_price_configuration: nil, - model_type: :bps + # The pricing model type + model_type: :threshold_total_amount ) end @@ -1900,11 +2058,16 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - bps_config: Orb::BPSConfig, - cadence: Orb::Price::BPS::Cadence::TaggedSymbol, + billing_mode: + Orb::Price::ThresholdTotalAmount::BillingMode::TaggedSymbol, + cadence: Orb::Price::ThresholdTotalAmount::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: - T.nilable(Orb::Price::BPS::ConversionRateConfig::Variants), + T.nilable( + Orb::Price::ThresholdTotalAmount::ConversionRateConfig::Variants + ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), currency: String, @@ -1922,8 +2085,11 @@ module Orb model_type: Symbol, name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::BPS::PriceType::TaggedSymbol, + price_type: + Orb::Price::ThresholdTotalAmount::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), + threshold_total_amount_config: + Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -1932,45 +2098,83 @@ module Orb def to_hash end - module Cadence + module BillingMode extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::Price::BPS::Cadence) } + T.type_alias do + T.all(Symbol, Orb::Price::ThresholdTotalAmount::BillingMode) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - ONE_TIME = T.let(:one_time, Orb::Price::BPS::Cadence::TaggedSymbol) - MONTHLY = T.let(:monthly, Orb::Price::BPS::Cadence::TaggedSymbol) - QUARTERLY = T.let(:quarterly, Orb::Price::BPS::Cadence::TaggedSymbol) - SEMI_ANNUAL = - T.let(:semi_annual, Orb::Price::BPS::Cadence::TaggedSymbol) - ANNUAL = T.let(:annual, Orb::Price::BPS::Cadence::TaggedSymbol) - CUSTOM = T.let(:custom, Orb::Price::BPS::Cadence::TaggedSymbol) + IN_ADVANCE = + T.let( + :in_advance, + Orb::Price::ThresholdTotalAmount::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::ThresholdTotalAmount::BillingMode::TaggedSymbol + ) sig do - override.returns(T::Array[Orb::Price::BPS::Cadence::TaggedSymbol]) + override.returns( + T::Array[ + Orb::Price::ThresholdTotalAmount::BillingMode::TaggedSymbol + ] + ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union + module Cadence + extend Orb::Internal::Type::Enum - Variants = + TaggedSymbol = T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) + T.all(Symbol, Orb::Price::ThresholdTotalAmount::Cadence) end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ONE_TIME = + T.let( + :one_time, + Orb::Price::ThresholdTotalAmount::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::Price::ThresholdTotalAmount::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::Price::ThresholdTotalAmount::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::Price::ThresholdTotalAmount::Cadence::TaggedSymbol + ) + ANNUAL = + T.let( + :annual, + Orb::Price::ThresholdTotalAmount::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::Price::ThresholdTotalAmount::Cadence::TaggedSymbol + ) sig do override.returns( - T::Array[Orb::Price::BPS::ConversionRateConfig::Variants] + T::Array[Orb::Price::ThresholdTotalAmount::Cadence::TaggedSymbol] ) end - def self.variants + def self.values end end @@ -1978,25 +2182,140 @@ module Orb extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::Price::BPS::PriceType) } + T.type_alias do + T.all(Symbol, Orb::Price::ThresholdTotalAmount::PriceType) + end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = - T.let(:usage_price, Orb::Price::BPS::PriceType::TaggedSymbol) + T.let( + :usage_price, + Orb::Price::ThresholdTotalAmount::PriceType::TaggedSymbol + ) FIXED_PRICE = - T.let(:fixed_price, Orb::Price::BPS::PriceType::TaggedSymbol) + T.let( + :fixed_price, + Orb::Price::ThresholdTotalAmount::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::ThresholdTotalAmount::PriceType::TaggedSymbol + ) sig do - override.returns(T::Array[Orb::Price::BPS::PriceType::TaggedSymbol]) + override.returns( + T::Array[ + Orb::Price::ThresholdTotalAmount::PriceType::TaggedSymbol + ] + ) end def self.values end end + + class ThresholdTotalAmountConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig, + Orb::Internal::AnyHash + ) + end + + # When the quantity consumed passes a provided threshold, the configured total + # will be charged + sig do + returns( + T::Array[ + Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig::ConsumptionTable + ] + ) + end + attr_accessor :consumption_table + + # If true, the unit price will be prorated to the billing period + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :prorate + + # Configuration for threshold_total_amount pricing + sig do + params( + consumption_table: + T::Array[ + Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig::ConsumptionTable::OrHash + ], + prorate: T.nilable(T::Boolean) + ).returns(T.attached_class) + end + def self.new( + # When the quantity consumed passes a provided threshold, the configured total + # will be charged + consumption_table:, + # If true, the unit price will be prorated to the billing period + prorate: nil + ) + end + + sig do + override.returns( + { + consumption_table: + T::Array[ + Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig::ConsumptionTable + ], + prorate: T.nilable(T::Boolean) + } + ) + end + def to_hash + end + + class ConsumptionTable < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig::ConsumptionTable, + Orb::Internal::AnyHash + ) + end + + # Quantity threshold + sig { returns(String) } + attr_accessor :threshold + + # Total amount for this threshold + sig { returns(String) } + attr_accessor :total_amount + + # Configuration for a single threshold + sig do + params(threshold: String, total_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Quantity threshold + threshold:, + # Total amount for this threshold + total_amount: + ) + end + + sig do + override.returns({ threshold: String, total_amount: String }) + end + def to_hash + end + end + end end - class BulkBPS < Orb::Internal::Type::BaseModel + class TieredPackage < Orb::Internal::Type::BaseModel OrHash = - T.type_alias { T.any(Orb::Price::BulkBPS, Orb::Internal::AnyHash) } + T.type_alias do + T.any(Orb::Price::TieredPackage, Orb::Internal::AnyHash) + end sig { returns(String) } attr_accessor :id @@ -2021,21 +2340,21 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::BulkBPSConfig) } - attr_reader :bulk_bps_config + sig { returns(Orb::Price::TieredPackage::BillingMode::TaggedSymbol) } + attr_accessor :billing_mode - sig { params(bulk_bps_config: Orb::BulkBPSConfig::OrHash).void } - attr_writer :bulk_bps_config - - sig { returns(Orb::Price::BulkBPS::Cadence::TaggedSymbol) } + sig { returns(Orb::Price::TieredPackage::Cadence::TaggedSymbol) } attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( - T.nilable(Orb::Price::BulkBPS::ConversionRateConfig::Variants) + T.nilable(Orb::Price::TieredPackage::ConversionRateConfig::Variants) ) end attr_accessor :conversion_rate_config @@ -2074,6 +2393,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -2105,6 +2426,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -2114,7 +2436,7 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig { returns(Orb::Price::BulkBPS::PriceType::TaggedSymbol) } + sig { returns(Orb::Price::TieredPackage::PriceType::TaggedSymbol) } attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -2122,6 +2444,18 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :replaces_price_id + # Configuration for tiered_package pricing + sig { returns(Orb::Price::TieredPackage::TieredPackageConfig) } + attr_reader :tiered_package_config + + sig do + params( + tiered_package_config: + Orb::Price::TieredPackage::TieredPackageConfig::OrHash + ).void + end + attr_writer :tiered_package_config + sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) } attr_reader :dimensional_price_configuration @@ -2138,8 +2472,10 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - bulk_bps_config: Orb::BulkBPSConfig::OrHash, - cadence: Orb::Price::BulkBPS::Cadence::OrSymbol, + billing_mode: Orb::Price::TieredPackage::BillingMode::OrSymbol, + cadence: Orb::Price::TieredPackage::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -2172,8 +2508,10 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::BulkBPS::PriceType::OrSymbol, + price_type: Orb::Price::TieredPackage::PriceType::OrSymbol, replaces_price_id: T.nilable(String), + tiered_package_config: + Orb::Price::TieredPackage::TieredPackageConfig::OrHash, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -2183,8 +2521,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, - bulk_bps_config:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -2194,6 +2533,8 @@ module Orb external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -2210,8 +2551,11 @@ module Orb # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, + # Configuration for tiered_package pricing + tiered_package_config:, dimensional_price_configuration: nil, - model_type: :bulk_bps + # The pricing model type + model_type: :tiered_package ) end @@ -2221,13 +2565,18 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::Price::BulkBPS::Cadence::TaggedSymbol, + billing_mode: + Orb::Price::TieredPackage::BillingMode::TaggedSymbol, + cadence: Orb::Price::TieredPackage::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: - T.nilable(Orb::Price::BulkBPS::ConversionRateConfig::Variants), - created_at: Time, - credit_allocation: T.nilable(Orb::Allocation), + T.nilable( + Orb::Price::TieredPackage::ConversionRateConfig::Variants + ), + created_at: Time, + credit_allocation: T.nilable(Orb::Allocation), currency: String, discount: T.nilable(Orb::Discount::Variants), external_price_id: T.nilable(String), @@ -2243,8 +2592,10 @@ module Orb model_type: Symbol, name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::BulkBPS::PriceType::TaggedSymbol, + price_type: Orb::Price::TieredPackage::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), + tiered_package_config: + Orb::Price::TieredPackage::TieredPackageConfig, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -2253,49 +2604,64 @@ module Orb def to_hash end - module Cadence + module BillingMode extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::Price::BulkBPS::Cadence) } + T.type_alias do + T.all(Symbol, Orb::Price::TieredPackage::BillingMode) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - ONE_TIME = - T.let(:one_time, Orb::Price::BulkBPS::Cadence::TaggedSymbol) - MONTHLY = T.let(:monthly, Orb::Price::BulkBPS::Cadence::TaggedSymbol) - QUARTERLY = - T.let(:quarterly, Orb::Price::BulkBPS::Cadence::TaggedSymbol) - SEMI_ANNUAL = - T.let(:semi_annual, Orb::Price::BulkBPS::Cadence::TaggedSymbol) - ANNUAL = T.let(:annual, Orb::Price::BulkBPS::Cadence::TaggedSymbol) - CUSTOM = T.let(:custom, Orb::Price::BulkBPS::Cadence::TaggedSymbol) + IN_ADVANCE = + T.let( + :in_advance, + Orb::Price::TieredPackage::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::TieredPackage::BillingMode::TaggedSymbol + ) sig do override.returns( - T::Array[Orb::Price::BulkBPS::Cadence::TaggedSymbol] + T::Array[Orb::Price::TieredPackage::BillingMode::TaggedSymbol] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union + module Cadence + extend Orb::Internal::Type::Enum - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end + TaggedSymbol = + T.type_alias { T.all(Symbol, Orb::Price::TieredPackage::Cadence) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ONE_TIME = + T.let(:one_time, Orb::Price::TieredPackage::Cadence::TaggedSymbol) + MONTHLY = + T.let(:monthly, Orb::Price::TieredPackage::Cadence::TaggedSymbol) + QUARTERLY = + T.let(:quarterly, Orb::Price::TieredPackage::Cadence::TaggedSymbol) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::Price::TieredPackage::Cadence::TaggedSymbol + ) + ANNUAL = + T.let(:annual, Orb::Price::TieredPackage::Cadence::TaggedSymbol) + CUSTOM = + T.let(:custom, Orb::Price::TieredPackage::Cadence::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::BulkBPS::ConversionRateConfig::Variants] + T::Array[Orb::Price::TieredPackage::Cadence::TaggedSymbol] ) end - def self.variants + def self.values end end @@ -2303,27 +2669,136 @@ module Orb extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::Price::BulkBPS::PriceType) } + T.type_alias { T.all(Symbol, Orb::Price::TieredPackage::PriceType) } OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = - T.let(:usage_price, Orb::Price::BulkBPS::PriceType::TaggedSymbol) + T.let( + :usage_price, + Orb::Price::TieredPackage::PriceType::TaggedSymbol + ) FIXED_PRICE = - T.let(:fixed_price, Orb::Price::BulkBPS::PriceType::TaggedSymbol) + T.let( + :fixed_price, + Orb::Price::TieredPackage::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::TieredPackage::PriceType::TaggedSymbol + ) sig do override.returns( - T::Array[Orb::Price::BulkBPS::PriceType::TaggedSymbol] + T::Array[Orb::Price::TieredPackage::PriceType::TaggedSymbol] ) end def self.values end end + + class TieredPackageConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::TieredPackage::TieredPackageConfig, + Orb::Internal::AnyHash + ) + end + + # Package size + sig { returns(String) } + attr_accessor :package_size + + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. The tier bounds are defined based on + # the total quantity rather than the number of packages, so they must be multiples + # of the package size. + sig do + returns( + T::Array[Orb::Price::TieredPackage::TieredPackageConfig::Tier] + ) + end + attr_accessor :tiers + + # Configuration for tiered_package pricing + sig do + params( + package_size: String, + tiers: + T::Array[ + Orb::Price::TieredPackage::TieredPackageConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Package size + package_size:, + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. The tier bounds are defined based on + # the total quantity rather than the number of packages, so they must be multiples + # of the package size. + tiers: + ) + end + + sig do + override.returns( + { + package_size: String, + tiers: + T::Array[Orb::Price::TieredPackage::TieredPackageConfig::Tier] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::TieredPackage::TieredPackageConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Price per package + sig { returns(String) } + attr_accessor :per_unit + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Configuration for a single tier with business logic + sig do + params(per_unit: String, tier_lower_bound: String).returns( + T.attached_class + ) + end + def self.new( + # Price per package + per_unit:, + # Tier lower bound + tier_lower_bound: + ) + end + + sig do + override.returns({ per_unit: String, tier_lower_bound: String }) + end + def to_hash + end + end + end end - class Bulk < Orb::Internal::Type::BaseModel + class TieredWithMinimum < Orb::Internal::Type::BaseModel OrHash = - T.type_alias { T.any(Orb::Price::Bulk, Orb::Internal::AnyHash) } + T.type_alias do + T.any(Orb::Price::TieredWithMinimum, Orb::Internal::AnyHash) + end sig { returns(String) } attr_accessor :id @@ -2348,20 +2823,26 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::BulkConfig) } - attr_reader :bulk_config - - sig { params(bulk_config: Orb::BulkConfig::OrHash).void } - attr_writer :bulk_config + sig do + returns(Orb::Price::TieredWithMinimum::BillingMode::TaggedSymbol) + end + attr_accessor :billing_mode - sig { returns(Orb::Price::Bulk::Cadence::TaggedSymbol) } + sig { returns(Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol) } attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do - returns(T.nilable(Orb::Price::Bulk::ConversionRateConfig::Variants)) + returns( + T.nilable( + Orb::Price::TieredWithMinimum::ConversionRateConfig::Variants + ) + ) end attr_accessor :conversion_rate_config @@ -2399,6 +2880,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -2430,6 +2913,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -2439,7 +2923,7 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig { returns(Orb::Price::Bulk::PriceType::TaggedSymbol) } + sig { returns(Orb::Price::TieredWithMinimum::PriceType::TaggedSymbol) } attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -2447,6 +2931,18 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :replaces_price_id + # Configuration for tiered_with_minimum pricing + sig { returns(Orb::Price::TieredWithMinimum::TieredWithMinimumConfig) } + attr_reader :tiered_with_minimum_config + + sig do + params( + tiered_with_minimum_config: + Orb::Price::TieredWithMinimum::TieredWithMinimumConfig::OrHash + ).void + end + attr_writer :tiered_with_minimum_config + sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) } attr_reader :dimensional_price_configuration @@ -2463,8 +2959,10 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - bulk_config: Orb::BulkConfig::OrHash, - cadence: Orb::Price::Bulk::Cadence::OrSymbol, + billing_mode: Orb::Price::TieredWithMinimum::BillingMode::OrSymbol, + cadence: Orb::Price::TieredWithMinimum::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -2497,8 +2995,10 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::Bulk::PriceType::OrSymbol, + price_type: Orb::Price::TieredWithMinimum::PriceType::OrSymbol, replaces_price_id: T.nilable(String), + tiered_with_minimum_config: + Orb::Price::TieredWithMinimum::TieredWithMinimumConfig::OrHash, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -2508,8 +3008,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, - bulk_config:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -2519,6 +3020,8 @@ module Orb external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -2535,8 +3038,11 @@ module Orb # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, + # Configuration for tiered_with_minimum pricing + tiered_with_minimum_config:, dimensional_price_configuration: nil, - model_type: :bulk + # The pricing model type + model_type: :tiered_with_minimum ) end @@ -2546,11 +3052,16 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_config: Orb::BulkConfig, - cadence: Orb::Price::Bulk::Cadence::TaggedSymbol, + billing_mode: + Orb::Price::TieredWithMinimum::BillingMode::TaggedSymbol, + cadence: Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: - T.nilable(Orb::Price::Bulk::ConversionRateConfig::Variants), + T.nilable( + Orb::Price::TieredWithMinimum::ConversionRateConfig::Variants + ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), currency: String, @@ -2568,8 +3079,11 @@ module Orb model_type: Symbol, name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::Bulk::PriceType::TaggedSymbol, + price_type: + Orb::Price::TieredWithMinimum::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), + tiered_with_minimum_config: + Orb::Price::TieredWithMinimum::TieredWithMinimumConfig, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -2578,45 +3092,75 @@ module Orb def to_hash end - module Cadence + module BillingMode extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::Price::Bulk::Cadence) } + T.type_alias do + T.all(Symbol, Orb::Price::TieredWithMinimum::BillingMode) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - ONE_TIME = T.let(:one_time, Orb::Price::Bulk::Cadence::TaggedSymbol) - MONTHLY = T.let(:monthly, Orb::Price::Bulk::Cadence::TaggedSymbol) - QUARTERLY = T.let(:quarterly, Orb::Price::Bulk::Cadence::TaggedSymbol) - SEMI_ANNUAL = - T.let(:semi_annual, Orb::Price::Bulk::Cadence::TaggedSymbol) - ANNUAL = T.let(:annual, Orb::Price::Bulk::Cadence::TaggedSymbol) - CUSTOM = T.let(:custom, Orb::Price::Bulk::Cadence::TaggedSymbol) + IN_ADVANCE = + T.let( + :in_advance, + Orb::Price::TieredWithMinimum::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::TieredWithMinimum::BillingMode::TaggedSymbol + ) sig do - override.returns(T::Array[Orb::Price::Bulk::Cadence::TaggedSymbol]) + override.returns( + T::Array[Orb::Price::TieredWithMinimum::BillingMode::TaggedSymbol] + ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union + module Cadence + extend Orb::Internal::Type::Enum - Variants = + TaggedSymbol = T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) + T.all(Symbol, Orb::Price::TieredWithMinimum::Cadence) end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ONE_TIME = + T.let( + :one_time, + Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol + ) + ANNUAL = + T.let(:annual, Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol) + CUSTOM = + T.let(:custom, Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::Bulk::ConversionRateConfig::Variants] + T::Array[Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol] ) end - def self.variants + def self.values end end @@ -2624,28 +3168,165 @@ module Orb extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::Price::Bulk::PriceType) } + T.type_alias do + T.all(Symbol, Orb::Price::TieredWithMinimum::PriceType) + end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = - T.let(:usage_price, Orb::Price::Bulk::PriceType::TaggedSymbol) + T.let( + :usage_price, + Orb::Price::TieredWithMinimum::PriceType::TaggedSymbol + ) FIXED_PRICE = - T.let(:fixed_price, Orb::Price::Bulk::PriceType::TaggedSymbol) + T.let( + :fixed_price, + Orb::Price::TieredWithMinimum::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::TieredWithMinimum::PriceType::TaggedSymbol + ) sig do override.returns( - T::Array[Orb::Price::Bulk::PriceType::TaggedSymbol] + T::Array[Orb::Price::TieredWithMinimum::PriceType::TaggedSymbol] ) end def self.values end end + + class TieredWithMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::TieredWithMinimum::TieredWithMinimumConfig, + Orb::Internal::AnyHash + ) + end + + # Tiered pricing with a minimum amount dependent on the volume tier. Tiers are + # defined using exclusive lower bounds. + sig do + returns( + T::Array[ + Orb::Price::TieredWithMinimum::TieredWithMinimumConfig::Tier + ] + ) + end + attr_accessor :tiers + + # If true, tiers with an accrued amount of 0 will not be included in the rating. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :hide_zero_amount_tiers + + sig { params(hide_zero_amount_tiers: T::Boolean).void } + attr_writer :hide_zero_amount_tiers + + # If true, the unit price will be prorated to the billing period + sig { returns(T.nilable(T::Boolean)) } + attr_reader :prorate + + sig { params(prorate: T::Boolean).void } + attr_writer :prorate + + # Configuration for tiered_with_minimum pricing + sig do + params( + tiers: + T::Array[ + Orb::Price::TieredWithMinimum::TieredWithMinimumConfig::Tier::OrHash + ], + hide_zero_amount_tiers: T::Boolean, + prorate: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # Tiered pricing with a minimum amount dependent on the volume tier. Tiers are + # defined using exclusive lower bounds. + tiers:, + # If true, tiers with an accrued amount of 0 will not be included in the rating. + hide_zero_amount_tiers: nil, + # If true, the unit price will be prorated to the billing period + prorate: nil + ) + end + + sig do + override.returns( + { + tiers: + T::Array[ + Orb::Price::TieredWithMinimum::TieredWithMinimumConfig::Tier + ], + hide_zero_amount_tiers: T::Boolean, + prorate: T::Boolean + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::TieredWithMinimum::TieredWithMinimumConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Minimum amount + sig { returns(String) } + attr_accessor :minimum_amount + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tier + sig do + params( + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + ).returns(T.attached_class) + end + def self.new( + # Minimum amount + minimum_amount:, + # Tier lower bound + tier_lower_bound:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns( + { + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + } + ) + end + def to_hash + end + end + end end - class ThresholdTotalAmount < Orb::Internal::Type::BaseModel + class GroupedTiered < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::ThresholdTotalAmount, Orb::Internal::AnyHash) + T.any(Orb::Price::GroupedTiered, Orb::Internal::AnyHash) end sig { returns(String) } @@ -2671,17 +3352,21 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::Price::ThresholdTotalAmount::Cadence::TaggedSymbol) } + sig { returns(Orb::Price::GroupedTiered::BillingMode::TaggedSymbol) } + attr_accessor :billing_mode + + sig { returns(Orb::Price::GroupedTiered::Cadence::TaggedSymbol) } attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( - T.nilable( - Orb::Price::ThresholdTotalAmount::ConversionRateConfig::Variants - ) + T.nilable(Orb::Price::GroupedTiered::ConversionRateConfig::Variants) ) end attr_accessor :conversion_rate_config @@ -2709,6 +3394,18 @@ module Orb sig { returns(T.nilable(Float)) } attr_accessor :fixed_price_quantity + # Configuration for grouped_tiered pricing + sig { returns(Orb::Price::GroupedTiered::GroupedTieredConfig) } + attr_reader :grouped_tiered_config + + sig do + params( + grouped_tiered_config: + Orb::Price::GroupedTiered::GroupedTieredConfig::OrHash + ).void + end + attr_writer :grouped_tiered_config + sig { returns(T.nilable(Orb::BillingCycleConfiguration)) } attr_reader :invoicing_cycle_configuration @@ -2720,6 +3417,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -2751,6 +3450,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -2760,9 +3460,7 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig do - returns(Orb::Price::ThresholdTotalAmount::PriceType::TaggedSymbol) - end + sig { returns(Orb::Price::GroupedTiered::PriceType::TaggedSymbol) } attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -2770,9 +3468,6 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :replaces_price_id - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :threshold_total_amount_config - sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) } attr_reader :dimensional_price_configuration @@ -2789,7 +3484,10 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::ThresholdTotalAmount::Cadence::OrSymbol, + billing_mode: Orb::Price::GroupedTiered::BillingMode::OrSymbol, + cadence: Orb::Price::GroupedTiered::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -2812,6 +3510,8 @@ module Orb ), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), + grouped_tiered_config: + Orb::Price::GroupedTiered::GroupedTieredConfig::OrHash, invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration::OrHash), item: Orb::ItemSlim::OrHash, @@ -2822,9 +3522,8 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::ThresholdTotalAmount::PriceType::OrSymbol, + price_type: Orb::Price::GroupedTiered::PriceType::OrSymbol, replaces_price_id: T.nilable(String), - threshold_total_amount_config: T::Hash[Symbol, T.anything], dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -2834,7 +3533,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -2843,7 +3544,11 @@ module Orb discount:, external_price_id:, fixed_price_quantity:, + # Configuration for grouped_tiered pricing + grouped_tiered_config:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -2860,9 +3565,9 @@ module Orb # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, - threshold_total_amount_config:, dimensional_price_configuration: nil, - model_type: :threshold_total_amount + # The pricing model type + model_type: :grouped_tiered ) end @@ -2872,11 +3577,15 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::ThresholdTotalAmount::Cadence::TaggedSymbol, + billing_mode: + Orb::Price::GroupedTiered::BillingMode::TaggedSymbol, + cadence: Orb::Price::GroupedTiered::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( - Orb::Price::ThresholdTotalAmount::ConversionRateConfig::Variants + Orb::Price::GroupedTiered::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -2884,6 +3593,8 @@ module Orb discount: T.nilable(Orb::Discount::Variants), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), + grouped_tiered_config: + Orb::Price::GroupedTiered::GroupedTieredConfig, invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, @@ -2895,10 +3606,8 @@ module Orb model_type: Symbol, name: String, plan_phase_order: T.nilable(Integer), - price_type: - Orb::Price::ThresholdTotalAmount::PriceType::TaggedSymbol, + price_type: Orb::Price::GroupedTiered::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), - threshold_total_amount_config: T::Hash[Symbol, T.anything], dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -2907,74 +3616,158 @@ module Orb def to_hash end - module Cadence + module BillingMode extend Orb::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::ThresholdTotalAmount::Cadence) + T.all(Symbol, Orb::Price::GroupedTiered::BillingMode) end OrSymbol = T.type_alias { T.any(Symbol, String) } - ONE_TIME = + IN_ADVANCE = T.let( - :one_time, - Orb::Price::ThresholdTotalAmount::Cadence::TaggedSymbol + :in_advance, + Orb::Price::GroupedTiered::BillingMode::TaggedSymbol ) - MONTHLY = + IN_ARREAR = T.let( - :monthly, - Orb::Price::ThresholdTotalAmount::Cadence::TaggedSymbol + :in_arrear, + Orb::Price::GroupedTiered::BillingMode::TaggedSymbol ) - QUARTERLY = - T.let( - :quarterly, - Orb::Price::ThresholdTotalAmount::Cadence::TaggedSymbol + + sig do + override.returns( + T::Array[Orb::Price::GroupedTiered::BillingMode::TaggedSymbol] ) + end + def self.values + end + end + + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Orb::Price::GroupedTiered::Cadence) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ONE_TIME = + T.let(:one_time, Orb::Price::GroupedTiered::Cadence::TaggedSymbol) + MONTHLY = + T.let(:monthly, Orb::Price::GroupedTiered::Cadence::TaggedSymbol) + QUARTERLY = + T.let(:quarterly, Orb::Price::GroupedTiered::Cadence::TaggedSymbol) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::ThresholdTotalAmount::Cadence::TaggedSymbol + Orb::Price::GroupedTiered::Cadence::TaggedSymbol ) ANNUAL = - T.let( - :annual, - Orb::Price::ThresholdTotalAmount::Cadence::TaggedSymbol - ) + T.let(:annual, Orb::Price::GroupedTiered::Cadence::TaggedSymbol) CUSTOM = - T.let( - :custom, - Orb::Price::ThresholdTotalAmount::Cadence::TaggedSymbol - ) + T.let(:custom, Orb::Price::GroupedTiered::Cadence::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::ThresholdTotalAmount::Cadence::TaggedSymbol] + T::Array[Orb::Price::GroupedTiered::Cadence::TaggedSymbol] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class GroupedTieredConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::Price::GroupedTiered::GroupedTieredConfig, + Orb::Internal::AnyHash ) end + # The billable metric property used to group before tiering + sig { returns(String) } + attr_accessor :grouping_key + + # Apply tiered pricing to each segment generated after grouping with the provided + # key + sig do + returns( + T::Array[Orb::Price::GroupedTiered::GroupedTieredConfig::Tier] + ) + end + attr_accessor :tiers + + # Configuration for grouped_tiered pricing + sig do + params( + grouping_key: String, + tiers: + T::Array[ + Orb::Price::GroupedTiered::GroupedTieredConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The billable metric property used to group before tiering + grouping_key:, + # Apply tiered pricing to each segment generated after grouping with the provided + # key + tiers: + ) + end + sig do override.returns( - T::Array[ - Orb::Price::ThresholdTotalAmount::ConversionRateConfig::Variants - ] + { + grouping_key: String, + tiers: + T::Array[Orb::Price::GroupedTiered::GroupedTieredConfig::Tier] + } ) end - def self.variants + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::GroupedTiered::GroupedTieredConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tier + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Tier lower bound + tier_lower_bound:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns( + { tier_lower_bound: String, unit_amount: String } + ) + end + def to_hash + end end end @@ -2982,27 +3775,28 @@ module Orb extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias do - T.all(Symbol, Orb::Price::ThresholdTotalAmount::PriceType) - end + T.type_alias { T.all(Symbol, Orb::Price::GroupedTiered::PriceType) } OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::ThresholdTotalAmount::PriceType::TaggedSymbol + Orb::Price::GroupedTiered::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::ThresholdTotalAmount::PriceType::TaggedSymbol + Orb::Price::GroupedTiered::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::GroupedTiered::PriceType::TaggedSymbol ) sig do override.returns( - T::Array[ - Orb::Price::ThresholdTotalAmount::PriceType::TaggedSymbol - ] + T::Array[Orb::Price::GroupedTiered::PriceType::TaggedSymbol] ) end def self.values @@ -3010,10 +3804,10 @@ module Orb end end - class TieredPackage < Orb::Internal::Type::BaseModel + class TieredPackageWithMinimum < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::TieredPackage, Orb::Internal::AnyHash) + T.any(Orb::Price::TieredPackageWithMinimum, Orb::Internal::AnyHash) end sig { returns(String) } @@ -3039,15 +3833,29 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::Price::TieredPackage::Cadence::TaggedSymbol) } + sig do + returns( + Orb::Price::TieredPackageWithMinimum::BillingMode::TaggedSymbol + ) + end + attr_accessor :billing_mode + + sig do + returns(Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol) + end attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( - T.nilable(Orb::Price::TieredPackage::ConversionRateConfig::Variants) + T.nilable( + Orb::Price::TieredPackageWithMinimum::ConversionRateConfig::Variants + ) ) end attr_accessor :conversion_rate_config @@ -3086,6 +3894,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -3117,6 +3927,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -3126,7 +3937,9 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig { returns(Orb::Price::TieredPackage::PriceType::TaggedSymbol) } + sig do + returns(Orb::Price::TieredPackageWithMinimum::PriceType::TaggedSymbol) + end attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -3134,8 +3947,21 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :replaces_price_id - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_package_config + # Configuration for tiered_package_with_minimum pricing + sig do + returns( + Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig + ) + end + attr_reader :tiered_package_with_minimum_config + + sig do + params( + tiered_package_with_minimum_config: + Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig::OrHash + ).void + end + attr_writer :tiered_package_with_minimum_config sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) } attr_reader :dimensional_price_configuration @@ -3153,7 +3979,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::TieredPackage::Cadence::OrSymbol, + billing_mode: + Orb::Price::TieredPackageWithMinimum::BillingMode::OrSymbol, + cadence: Orb::Price::TieredPackageWithMinimum::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -3186,9 +4016,11 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::TieredPackage::PriceType::OrSymbol, + price_type: + Orb::Price::TieredPackageWithMinimum::PriceType::OrSymbol, replaces_price_id: T.nilable(String), - tiered_package_config: T::Hash[Symbol, T.anything], + tiered_package_with_minimum_config: + Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig::OrHash, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -3198,7 +4030,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -3208,6 +4042,8 @@ module Orb external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -3224,9 +4060,11 @@ module Orb # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, - tiered_package_config:, + # Configuration for tiered_package_with_minimum pricing + tiered_package_with_minimum_config:, dimensional_price_configuration: nil, - model_type: :tiered_package + # The pricing model type + model_type: :tiered_package_with_minimum ) end @@ -3236,11 +4074,16 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::TieredPackage::Cadence::TaggedSymbol, + billing_mode: + Orb::Price::TieredPackageWithMinimum::BillingMode::TaggedSymbol, + cadence: + Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( - Orb::Price::TieredPackage::ConversionRateConfig::Variants + Orb::Price::TieredPackageWithMinimum::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -3259,9 +4102,11 @@ module Orb model_type: Symbol, name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::TieredPackage::PriceType::TaggedSymbol, + price_type: + Orb::Price::TieredPackageWithMinimum::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), - tiered_package_config: T::Hash[Symbol, T.anything], + tiered_package_with_minimum_config: + Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -3270,57 +4115,85 @@ module Orb def to_hash end - module Cadence + module BillingMode extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::Price::TieredPackage::Cadence) } + T.type_alias do + T.all(Symbol, Orb::Price::TieredPackageWithMinimum::BillingMode) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - ONE_TIME = - T.let(:one_time, Orb::Price::TieredPackage::Cadence::TaggedSymbol) - MONTHLY = - T.let(:monthly, Orb::Price::TieredPackage::Cadence::TaggedSymbol) - QUARTERLY = - T.let(:quarterly, Orb::Price::TieredPackage::Cadence::TaggedSymbol) - SEMI_ANNUAL = + IN_ADVANCE = T.let( - :semi_annual, - Orb::Price::TieredPackage::Cadence::TaggedSymbol + :in_advance, + Orb::Price::TieredPackageWithMinimum::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::TieredPackageWithMinimum::BillingMode::TaggedSymbol ) - ANNUAL = - T.let(:annual, Orb::Price::TieredPackage::Cadence::TaggedSymbol) - CUSTOM = - T.let(:custom, Orb::Price::TieredPackage::Cadence::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::TieredPackage::Cadence::TaggedSymbol] + T::Array[ + Orb::Price::TieredPackageWithMinimum::BillingMode::TaggedSymbol + ] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union + module Cadence + extend Orb::Internal::Type::Enum - Variants = + TaggedSymbol = T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) + T.all(Symbol, Orb::Price::TieredPackageWithMinimum::Cadence) end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ONE_TIME = + T.let( + :one_time, + Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + ) + ANNUAL = + T.let( + :annual, + Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + ) sig do override.returns( T::Array[ - Orb::Price::TieredPackage::ConversionRateConfig::Variants + Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol ] ) end - def self.variants + def self.values end end @@ -3328,34 +4201,153 @@ module Orb extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::Price::TieredPackage::PriceType) } + T.type_alias do + T.all(Symbol, Orb::Price::TieredPackageWithMinimum::PriceType) + end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::TieredPackage::PriceType::TaggedSymbol + Orb::Price::TieredPackageWithMinimum::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::TieredPackage::PriceType::TaggedSymbol + Orb::Price::TieredPackageWithMinimum::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::TieredPackageWithMinimum::PriceType::TaggedSymbol ) sig do override.returns( - T::Array[Orb::Price::TieredPackage::PriceType::TaggedSymbol] + T::Array[ + Orb::Price::TieredPackageWithMinimum::PriceType::TaggedSymbol + ] ) end def self.values end end + + class TieredPackageWithMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig, + Orb::Internal::AnyHash + ) + end + + # Package size + sig { returns(Float) } + attr_accessor :package_size + + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + sig do + returns( + T::Array[ + Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for tiered_package_with_minimum pricing + sig do + params( + package_size: Float, + tiers: + T::Array[ + Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Package size + package_size:, + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + tiers: + ) + end + + sig do + override.returns( + { + package_size: Float, + tiers: + T::Array[ + Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Minimum amount + sig { returns(String) } + attr_accessor :minimum_amount + + # Price per package + sig { returns(String) } + attr_accessor :per_unit + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Configuration for a single tier + sig do + params( + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + ).returns(T.attached_class) + end + def self.new( + # Minimum amount + minimum_amount:, + # Price per package + per_unit:, + # Tier lower bound + tier_lower_bound: + ) + end + + sig do + override.returns( + { + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + } + ) + end + def to_hash + end + end + end end - class GroupedTiered < Orb::Internal::Type::BaseModel + class PackageWithAllocation < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::GroupedTiered, Orb::Internal::AnyHash) + T.any(Orb::Price::PackageWithAllocation, Orb::Internal::AnyHash) end sig { returns(String) } @@ -3381,15 +4373,27 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::Price::GroupedTiered::Cadence::TaggedSymbol) } + sig do + returns(Orb::Price::PackageWithAllocation::BillingMode::TaggedSymbol) + end + attr_accessor :billing_mode + + sig do + returns(Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol) + end attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( - T.nilable(Orb::Price::GroupedTiered::ConversionRateConfig::Variants) + T.nilable( + Orb::Price::PackageWithAllocation::ConversionRateConfig::Variants + ) ) end attr_accessor :conversion_rate_config @@ -3417,9 +4421,6 @@ module Orb sig { returns(T.nilable(Float)) } attr_accessor :fixed_price_quantity - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_tiered_config - sig { returns(T.nilable(Orb::BillingCycleConfiguration)) } attr_reader :invoicing_cycle_configuration @@ -3431,6 +4432,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -3462,16 +4465,35 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type sig { returns(String) } attr_accessor :name + # Configuration for package_with_allocation pricing + sig do + returns( + Orb::Price::PackageWithAllocation::PackageWithAllocationConfig + ) + end + attr_reader :package_with_allocation_config + + sig do + params( + package_with_allocation_config: + Orb::Price::PackageWithAllocation::PackageWithAllocationConfig::OrHash + ).void + end + attr_writer :package_with_allocation_config + sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig { returns(Orb::Price::GroupedTiered::PriceType::TaggedSymbol) } + sig do + returns(Orb::Price::PackageWithAllocation::PriceType::TaggedSymbol) + end attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -3495,7 +4517,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::GroupedTiered::Cadence::OrSymbol, + billing_mode: + Orb::Price::PackageWithAllocation::BillingMode::OrSymbol, + cadence: Orb::Price::PackageWithAllocation::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -3518,7 +4544,6 @@ module Orb ), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), - grouped_tiered_config: T::Hash[Symbol, T.anything], invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration::OrHash), item: Orb::ItemSlim::OrHash, @@ -3528,8 +4553,10 @@ module Orb minimum: T.nilable(Orb::Minimum::OrHash), minimum_amount: T.nilable(String), name: String, + package_with_allocation_config: + Orb::Price::PackageWithAllocation::PackageWithAllocationConfig::OrHash, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::GroupedTiered::PriceType::OrSymbol, + price_type: Orb::Price::PackageWithAllocation::PriceType::OrSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), @@ -3540,7 +4567,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -3549,8 +4578,9 @@ module Orb discount:, external_price_id:, fixed_price_quantity:, - grouped_tiered_config:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -3562,13 +4592,16 @@ module Orb minimum:, minimum_amount:, name:, + # Configuration for package_with_allocation pricing + package_with_allocation_config:, plan_phase_order:, price_type:, # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, dimensional_price_configuration: nil, - model_type: :grouped_tiered + # The pricing model type + model_type: :package_with_allocation ) end @@ -3578,11 +4611,15 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::GroupedTiered::Cadence::TaggedSymbol, + billing_mode: + Orb::Price::PackageWithAllocation::BillingMode::TaggedSymbol, + cadence: Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( - Orb::Price::GroupedTiered::ConversionRateConfig::Variants + Orb::Price::PackageWithAllocation::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -3590,7 +4627,6 @@ module Orb discount: T.nilable(Orb::Discount::Variants), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), - grouped_tiered_config: T::Hash[Symbol, T.anything], invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, @@ -3601,8 +4637,11 @@ module Orb minimum_amount: T.nilable(String), model_type: Symbol, name: String, + package_with_allocation_config: + Orb::Price::PackageWithAllocation::PackageWithAllocationConfig, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::GroupedTiered::PriceType::TaggedSymbol, + price_type: + Orb::Price::PackageWithAllocation::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) @@ -3612,57 +4651,135 @@ module Orb def to_hash end + module BillingMode + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Orb::Price::PackageWithAllocation::BillingMode) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_ADVANCE = + T.let( + :in_advance, + Orb::Price::PackageWithAllocation::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::PackageWithAllocation::BillingMode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Price::PackageWithAllocation::BillingMode::TaggedSymbol + ] + ) + end + def self.values + end + end + module Cadence extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::Price::GroupedTiered::Cadence) } + T.type_alias do + T.all(Symbol, Orb::Price::PackageWithAllocation::Cadence) + end OrSymbol = T.type_alias { T.any(Symbol, String) } ONE_TIME = - T.let(:one_time, Orb::Price::GroupedTiered::Cadence::TaggedSymbol) + T.let( + :one_time, + Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol + ) MONTHLY = - T.let(:monthly, Orb::Price::GroupedTiered::Cadence::TaggedSymbol) + T.let( + :monthly, + Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol + ) QUARTERLY = - T.let(:quarterly, Orb::Price::GroupedTiered::Cadence::TaggedSymbol) + T.let( + :quarterly, + Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol + ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::GroupedTiered::Cadence::TaggedSymbol + Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol ) ANNUAL = - T.let(:annual, Orb::Price::GroupedTiered::Cadence::TaggedSymbol) + T.let( + :annual, + Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol + ) CUSTOM = - T.let(:custom, Orb::Price::GroupedTiered::Cadence::TaggedSymbol) + T.let( + :custom, + Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol + ) sig do override.returns( - T::Array[Orb::Price::GroupedTiered::Cadence::TaggedSymbol] + T::Array[Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class PackageWithAllocationConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::Price::PackageWithAllocation::PackageWithAllocationConfig, + Orb::Internal::AnyHash ) end + # Usage allocation + sig { returns(String) } + attr_accessor :allocation + + # Price per package + sig { returns(String) } + attr_accessor :package_amount + + # Package size + sig { returns(String) } + attr_accessor :package_size + + # Configuration for package_with_allocation pricing + sig do + params( + allocation: String, + package_amount: String, + package_size: String + ).returns(T.attached_class) + end + def self.new( + # Usage allocation + allocation:, + # Price per package + package_amount:, + # Package size + package_size: + ) + end + sig do override.returns( - T::Array[ - Orb::Price::GroupedTiered::ConversionRateConfig::Variants - ] + { + allocation: String, + package_amount: String, + package_size: String + } ) end - def self.variants + def to_hash end end @@ -3670,23 +4787,32 @@ module Orb extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::Price::GroupedTiered::PriceType) } + T.type_alias do + T.all(Symbol, Orb::Price::PackageWithAllocation::PriceType) + end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::GroupedTiered::PriceType::TaggedSymbol + Orb::Price::PackageWithAllocation::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::GroupedTiered::PriceType::TaggedSymbol + Orb::Price::PackageWithAllocation::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::PackageWithAllocation::PriceType::TaggedSymbol ) sig do override.returns( - T::Array[Orb::Price::GroupedTiered::PriceType::TaggedSymbol] + T::Array[ + Orb::Price::PackageWithAllocation::PriceType::TaggedSymbol + ] ) end def self.values @@ -3694,10 +4820,10 @@ module Orb end end - class TieredWithMinimum < Orb::Internal::Type::BaseModel + class UnitWithPercent < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::TieredWithMinimum, Orb::Internal::AnyHash) + T.any(Orb::Price::UnitWithPercent, Orb::Internal::AnyHash) end sig { returns(String) } @@ -3723,16 +4849,22 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol) } + sig { returns(Orb::Price::UnitWithPercent::BillingMode::TaggedSymbol) } + attr_accessor :billing_mode + + sig { returns(Orb::Price::UnitWithPercent::Cadence::TaggedSymbol) } attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( T.nilable( - Orb::Price::TieredWithMinimum::ConversionRateConfig::Variants + Orb::Price::UnitWithPercent::ConversionRateConfig::Variants ) ) end @@ -3772,6 +4904,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -3803,6 +4937,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -3812,7 +4947,7 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig { returns(Orb::Price::TieredWithMinimum::PriceType::TaggedSymbol) } + sig { returns(Orb::Price::UnitWithPercent::PriceType::TaggedSymbol) } attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -3820,8 +4955,17 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :replaces_price_id - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_with_minimum_config + # Configuration for unit_with_percent pricing + sig { returns(Orb::Price::UnitWithPercent::UnitWithPercentConfig) } + attr_reader :unit_with_percent_config + + sig do + params( + unit_with_percent_config: + Orb::Price::UnitWithPercent::UnitWithPercentConfig::OrHash + ).void + end + attr_writer :unit_with_percent_config sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) } attr_reader :dimensional_price_configuration @@ -3839,7 +4983,10 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::TieredWithMinimum::Cadence::OrSymbol, + billing_mode: Orb::Price::UnitWithPercent::BillingMode::OrSymbol, + cadence: Orb::Price::UnitWithPercent::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -3872,9 +5019,10 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::TieredWithMinimum::PriceType::OrSymbol, + price_type: Orb::Price::UnitWithPercent::PriceType::OrSymbol, replaces_price_id: T.nilable(String), - tiered_with_minimum_config: T::Hash[Symbol, T.anything], + unit_with_percent_config: + Orb::Price::UnitWithPercent::UnitWithPercentConfig::OrHash, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -3884,7 +5032,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -3894,6 +5044,8 @@ module Orb external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -3910,9 +5062,11 @@ module Orb # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, - tiered_with_minimum_config:, + # Configuration for unit_with_percent pricing + unit_with_percent_config:, dimensional_price_configuration: nil, - model_type: :tiered_with_minimum + # The pricing model type + model_type: :unit_with_percent ) end @@ -3922,11 +5076,15 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol, + billing_mode: + Orb::Price::UnitWithPercent::BillingMode::TaggedSymbol, + cadence: Orb::Price::UnitWithPercent::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( - Orb::Price::TieredWithMinimum::ConversionRateConfig::Variants + Orb::Price::UnitWithPercent::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -3945,10 +5103,10 @@ module Orb model_type: Symbol, name: String, plan_phase_order: T.nilable(Integer), - price_type: - Orb::Price::TieredWithMinimum::PriceType::TaggedSymbol, + price_type: Orb::Price::UnitWithPercent::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), - tiered_with_minimum_config: T::Hash[Symbol, T.anything], + unit_with_percent_config: + Orb::Price::UnitWithPercent::UnitWithPercentConfig, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -3957,105 +5115,145 @@ module Orb def to_hash end - module Cadence + module BillingMode extend Orb::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::TieredWithMinimum::Cadence) + T.all(Symbol, Orb::Price::UnitWithPercent::BillingMode) end OrSymbol = T.type_alias { T.any(Symbol, String) } - ONE_TIME = + IN_ADVANCE = T.let( - :one_time, - Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol + :in_advance, + Orb::Price::UnitWithPercent::BillingMode::TaggedSymbol ) - MONTHLY = + IN_ARREAR = T.let( - :monthly, - Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol + :in_arrear, + Orb::Price::UnitWithPercent::BillingMode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Orb::Price::UnitWithPercent::BillingMode::TaggedSymbol] ) + end + def self.values + end + end + + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Orb::Price::UnitWithPercent::Cadence) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ONE_TIME = + T.let(:one_time, Orb::Price::UnitWithPercent::Cadence::TaggedSymbol) + MONTHLY = + T.let(:monthly, Orb::Price::UnitWithPercent::Cadence::TaggedSymbol) QUARTERLY = T.let( :quarterly, - Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol + Orb::Price::UnitWithPercent::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol + Orb::Price::UnitWithPercent::Cadence::TaggedSymbol ) ANNUAL = - T.let(:annual, Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol) + T.let(:annual, Orb::Price::UnitWithPercent::Cadence::TaggedSymbol) CUSTOM = - T.let(:custom, Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol) + T.let(:custom, Orb::Price::UnitWithPercent::Cadence::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol] + T::Array[Orb::Price::UnitWithPercent::Cadence::TaggedSymbol] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::Price::TieredWithMinimum::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end - module PriceType extend Orb::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::TieredWithMinimum::PriceType) + T.all(Symbol, Orb::Price::UnitWithPercent::PriceType) end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::TieredWithMinimum::PriceType::TaggedSymbol + Orb::Price::UnitWithPercent::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::TieredWithMinimum::PriceType::TaggedSymbol + Orb::Price::UnitWithPercent::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::UnitWithPercent::PriceType::TaggedSymbol ) sig do override.returns( - T::Array[Orb::Price::TieredWithMinimum::PriceType::TaggedSymbol] + T::Array[Orb::Price::UnitWithPercent::PriceType::TaggedSymbol] ) end def self.values end end + + class UnitWithPercentConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::UnitWithPercent::UnitWithPercentConfig, + Orb::Internal::AnyHash + ) + end + + # What percent, out of 100, of the calculated total to charge + sig { returns(String) } + attr_accessor :percent + + # Rate per unit of usage + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for unit_with_percent pricing + sig do + params(percent: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # What percent, out of 100, of the calculated total to charge + percent:, + # Rate per unit of usage + unit_amount: + ) + end + + sig { override.returns({ percent: String, unit_amount: String }) } + def to_hash + end + end end - class TieredPackageWithMinimum < Orb::Internal::Type::BaseModel + class MatrixWithAllocation < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::TieredPackageWithMinimum, Orb::Internal::AnyHash) + T.any(Orb::Price::MatrixWithAllocation, Orb::Internal::AnyHash) end sig { returns(String) } @@ -4082,17 +5280,23 @@ module Orb attr_writer :billing_cycle_configuration sig do - returns(Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol) + returns(Orb::Price::MatrixWithAllocation::BillingMode::TaggedSymbol) end + attr_accessor :billing_mode + + sig { returns(Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol) } attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( T.nilable( - Orb::Price::TieredPackageWithMinimum::ConversionRateConfig::Variants + Orb::Price::MatrixWithAllocation::ConversionRateConfig::Variants ) ) end @@ -4132,12 +5336,26 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item sig { params(item: Orb::ItemSlim::OrHash).void } attr_writer :item + # Configuration for matrix_with_allocation pricing + sig { returns(Orb::MatrixWithAllocationConfig) } + attr_reader :matrix_with_allocation_config + + sig do + params( + matrix_with_allocation_config: + Orb::MatrixWithAllocationConfig::OrHash + ).void + end + attr_writer :matrix_with_allocation_config + sig { returns(T.nilable(Orb::Maximum)) } attr_reader :maximum @@ -4163,6 +5381,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -4173,7 +5392,7 @@ module Orb attr_accessor :plan_phase_order sig do - returns(Orb::Price::TieredPackageWithMinimum::PriceType::TaggedSymbol) + returns(Orb::Price::MatrixWithAllocation::PriceType::TaggedSymbol) end attr_accessor :price_type @@ -4182,9 +5401,6 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :replaces_price_id - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_package_with_minimum_config - sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) } attr_reader :dimensional_price_configuration @@ -4201,7 +5417,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::TieredPackageWithMinimum::Cadence::OrSymbol, + billing_mode: + Orb::Price::MatrixWithAllocation::BillingMode::OrSymbol, + cadence: Orb::Price::MatrixWithAllocation::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -4227,6 +5447,8 @@ module Orb invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration::OrHash), item: Orb::ItemSlim::OrHash, + matrix_with_allocation_config: + Orb::MatrixWithAllocationConfig::OrHash, maximum: T.nilable(Orb::Maximum::OrHash), maximum_amount: T.nilable(String), metadata: T::Hash[Symbol, String], @@ -4234,10 +5456,8 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: - Orb::Price::TieredPackageWithMinimum::PriceType::OrSymbol, + price_type: Orb::Price::MatrixWithAllocation::PriceType::OrSymbol, replaces_price_id: T.nilable(String), - tiered_package_with_minimum_config: T::Hash[Symbol, T.anything], dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -4247,7 +5467,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -4257,7 +5479,11 @@ module Orb external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, + # Configuration for matrix_with_allocation pricing + matrix_with_allocation_config:, maximum:, maximum_amount:, # User specified key-value pairs for the resource. If not present, this defaults @@ -4273,9 +5499,9 @@ module Orb # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, - tiered_package_with_minimum_config:, dimensional_price_configuration: nil, - model_type: :tiered_package_with_minimum + # The pricing model type + model_type: :matrix_with_allocation ) end @@ -4285,12 +5511,15 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: - Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol, + billing_mode: + Orb::Price::MatrixWithAllocation::BillingMode::TaggedSymbol, + cadence: Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( - Orb::Price::TieredPackageWithMinimum::ConversionRateConfig::Variants + Orb::Price::MatrixWithAllocation::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -4301,6 +5530,7 @@ module Orb invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, + matrix_with_allocation_config: Orb::MatrixWithAllocationConfig, maximum: T.nilable(Orb::Maximum), maximum_amount: T.nilable(String), metadata: T::Hash[Symbol, String], @@ -4310,9 +5540,8 @@ module Orb name: String, plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::TieredPackageWithMinimum::PriceType::TaggedSymbol, + Orb::Price::MatrixWithAllocation::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), - tiered_package_with_minimum_config: T::Hash[Symbol, T.anything], dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -4321,103 +5550,115 @@ module Orb def to_hash end + module BillingMode + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Orb::Price::MatrixWithAllocation::BillingMode) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_ADVANCE = + T.let( + :in_advance, + Orb::Price::MatrixWithAllocation::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::MatrixWithAllocation::BillingMode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Price::MatrixWithAllocation::BillingMode::TaggedSymbol + ] + ) + end + def self.values + end + end + module Cadence extend Orb::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::TieredPackageWithMinimum::Cadence) + T.all(Symbol, Orb::Price::MatrixWithAllocation::Cadence) end OrSymbol = T.type_alias { T.any(Symbol, String) } ONE_TIME = T.let( :one_time, - Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol ) ANNUAL = T.let( :annual, - Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol ) CUSTOM = T.let( :custom, - Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol ) sig do override.returns( - T::Array[ - Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol - ] + T::Array[Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::Price::TieredPackageWithMinimum::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end - module PriceType extend Orb::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::TieredPackageWithMinimum::PriceType) + T.all(Symbol, Orb::Price::MatrixWithAllocation::PriceType) end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::TieredPackageWithMinimum::PriceType::TaggedSymbol + Orb::Price::MatrixWithAllocation::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::TieredPackageWithMinimum::PriceType::TaggedSymbol + Orb::Price::MatrixWithAllocation::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::MatrixWithAllocation::PriceType::TaggedSymbol ) sig do override.returns( T::Array[ - Orb::Price::TieredPackageWithMinimum::PriceType::TaggedSymbol + Orb::Price::MatrixWithAllocation::PriceType::TaggedSymbol ] ) end @@ -4426,10 +5667,10 @@ module Orb end end - class PackageWithAllocation < Orb::Internal::Type::BaseModel + class TieredWithProration < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::PackageWithAllocation, Orb::Internal::AnyHash) + T.any(Orb::Price::TieredWithProration, Orb::Internal::AnyHash) end sig { returns(String) } @@ -4456,17 +5697,23 @@ module Orb attr_writer :billing_cycle_configuration sig do - returns(Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol) + returns(Orb::Price::TieredWithProration::BillingMode::TaggedSymbol) end + attr_accessor :billing_mode + + sig { returns(Orb::Price::TieredWithProration::Cadence::TaggedSymbol) } attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( T.nilable( - Orb::Price::PackageWithAllocation::ConversionRateConfig::Variants + Orb::Price::TieredWithProration::ConversionRateConfig::Variants ) ) end @@ -4506,6 +5753,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -4537,20 +5786,18 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type sig { returns(String) } attr_accessor :name - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :package_with_allocation_config - sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order sig do - returns(Orb::Price::PackageWithAllocation::PriceType::TaggedSymbol) + returns(Orb::Price::TieredWithProration::PriceType::TaggedSymbol) end attr_accessor :price_type @@ -4559,6 +5806,20 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :replaces_price_id + # Configuration for tiered_with_proration pricing + sig do + returns(Orb::Price::TieredWithProration::TieredWithProrationConfig) + end + attr_reader :tiered_with_proration_config + + sig do + params( + tiered_with_proration_config: + Orb::Price::TieredWithProration::TieredWithProrationConfig::OrHash + ).void + end + attr_writer :tiered_with_proration_config + sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) } attr_reader :dimensional_price_configuration @@ -4575,7 +5836,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::PackageWithAllocation::Cadence::OrSymbol, + billing_mode: + Orb::Price::TieredWithProration::BillingMode::OrSymbol, + cadence: Orb::Price::TieredWithProration::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -4607,10 +5872,11 @@ module Orb minimum: T.nilable(Orb::Minimum::OrHash), minimum_amount: T.nilable(String), name: String, - package_with_allocation_config: T::Hash[Symbol, T.anything], plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::PackageWithAllocation::PriceType::OrSymbol, + price_type: Orb::Price::TieredWithProration::PriceType::OrSymbol, replaces_price_id: T.nilable(String), + tiered_with_proration_config: + Orb::Price::TieredWithProration::TieredWithProrationConfig::OrHash, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -4620,7 +5886,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -4630,6 +5898,8 @@ module Orb external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -4641,14 +5911,16 @@ module Orb minimum:, minimum_amount:, name:, - package_with_allocation_config:, plan_phase_order:, price_type:, # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, + # Configuration for tiered_with_proration pricing + tiered_with_proration_config:, dimensional_price_configuration: nil, - model_type: :package_with_allocation + # The pricing model type + model_type: :tiered_with_proration ) end @@ -4658,11 +5930,15 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol, + billing_mode: + Orb::Price::TieredWithProration::BillingMode::TaggedSymbol, + cadence: Orb::Price::TieredWithProration::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( - Orb::Price::PackageWithAllocation::ConversionRateConfig::Variants + Orb::Price::TieredWithProration::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -4680,11 +5956,12 @@ module Orb minimum_amount: T.nilable(String), model_type: Symbol, name: String, - package_with_allocation_config: T::Hash[Symbol, T.anything], plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::PackageWithAllocation::PriceType::TaggedSymbol, + Orb::Price::TieredWithProration::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), + tiered_with_proration_config: + Orb::Price::TieredWithProration::TieredWithProrationConfig, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -4693,113 +5970,215 @@ module Orb def to_hash end + module BillingMode + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Orb::Price::TieredWithProration::BillingMode) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_ADVANCE = + T.let( + :in_advance, + Orb::Price::TieredWithProration::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::TieredWithProration::BillingMode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Price::TieredWithProration::BillingMode::TaggedSymbol + ] + ) + end + def self.values + end + end + module Cadence extend Orb::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::PackageWithAllocation::Cadence) + T.all(Symbol, Orb::Price::TieredWithProration::Cadence) end OrSymbol = T.type_alias { T.any(Symbol, String) } ONE_TIME = T.let( :one_time, - Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol + Orb::Price::TieredWithProration::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol + Orb::Price::TieredWithProration::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol + Orb::Price::TieredWithProration::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol + Orb::Price::TieredWithProration::Cadence::TaggedSymbol ) ANNUAL = T.let( :annual, - Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol + Orb::Price::TieredWithProration::Cadence::TaggedSymbol ) CUSTOM = T.let( :custom, - Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol + Orb::Price::TieredWithProration::Cadence::TaggedSymbol ) sig do override.returns( - T::Array[Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol] + T::Array[Orb::Price::TieredWithProration::Cadence::TaggedSymbol] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::Price::PackageWithAllocation::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end - module PriceType extend Orb::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::PackageWithAllocation::PriceType) + T.all(Symbol, Orb::Price::TieredWithProration::PriceType) end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::PackageWithAllocation::PriceType::TaggedSymbol + Orb::Price::TieredWithProration::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::PackageWithAllocation::PriceType::TaggedSymbol + Orb::Price::TieredWithProration::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::TieredWithProration::PriceType::TaggedSymbol ) sig do override.returns( + T::Array[Orb::Price::TieredWithProration::PriceType::TaggedSymbol] + ) + end + def self.values + end + end + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::TieredWithProration::TieredWithProrationConfig, + Orb::Internal::AnyHash + ) + end + + # Tiers for rating based on total usage quantities into the specified tier with + # proration + sig do + returns( T::Array[ - Orb::Price::PackageWithAllocation::PriceType::TaggedSymbol + Orb::Price::TieredWithProration::TieredWithProrationConfig::Tier ] ) end - def self.values + attr_accessor :tiers + + # Configuration for tiered_with_proration pricing + sig do + params( + tiers: + T::Array[ + Orb::Price::TieredWithProration::TieredWithProrationConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Tiers for rating based on total usage quantities into the specified tier with + # proration + tiers: + ) + end + + sig do + override.returns( + { + tiers: + T::Array[ + Orb::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::TieredWithProration::TieredWithProrationConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Inclusive tier starting value + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Amount per unit + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tiered with proration tier + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Inclusive tier starting value + tier_lower_bound:, + # Amount per unit + unit_amount: + ) + end + + sig do + override.returns( + { tier_lower_bound: String, unit_amount: String } + ) + end + def to_hash + end end end end - class UnitWithPercent < Orb::Internal::Type::BaseModel + class UnitWithProration < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::UnitWithPercent, Orb::Internal::AnyHash) + T.any(Orb::Price::UnitWithProration, Orb::Internal::AnyHash) end sig { returns(String) } @@ -4825,16 +6204,24 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::Price::UnitWithPercent::Cadence::TaggedSymbol) } + sig do + returns(Orb::Price::UnitWithProration::BillingMode::TaggedSymbol) + end + attr_accessor :billing_mode + + sig { returns(Orb::Price::UnitWithProration::Cadence::TaggedSymbol) } attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( T.nilable( - Orb::Price::UnitWithPercent::ConversionRateConfig::Variants + Orb::Price::UnitWithProration::ConversionRateConfig::Variants ) ) end @@ -4874,6 +6261,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -4905,6 +6294,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -4914,7 +6304,7 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig { returns(Orb::Price::UnitWithPercent::PriceType::TaggedSymbol) } + sig { returns(Orb::Price::UnitWithProration::PriceType::TaggedSymbol) } attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -4922,8 +6312,17 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :replaces_price_id - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :unit_with_percent_config + # Configuration for unit_with_proration pricing + sig { returns(Orb::Price::UnitWithProration::UnitWithProrationConfig) } + attr_reader :unit_with_proration_config + + sig do + params( + unit_with_proration_config: + Orb::Price::UnitWithProration::UnitWithProrationConfig::OrHash + ).void + end + attr_writer :unit_with_proration_config sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) } attr_reader :dimensional_price_configuration @@ -4941,7 +6340,10 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::UnitWithPercent::Cadence::OrSymbol, + billing_mode: Orb::Price::UnitWithProration::BillingMode::OrSymbol, + cadence: Orb::Price::UnitWithProration::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -4974,9 +6376,10 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::UnitWithPercent::PriceType::OrSymbol, + price_type: Orb::Price::UnitWithProration::PriceType::OrSymbol, replaces_price_id: T.nilable(String), - unit_with_percent_config: T::Hash[Symbol, T.anything], + unit_with_proration_config: + Orb::Price::UnitWithProration::UnitWithProrationConfig::OrHash, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -4986,7 +6389,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -4996,6 +6401,8 @@ module Orb external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -5012,9 +6419,11 @@ module Orb # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, - unit_with_percent_config:, + # Configuration for unit_with_proration pricing + unit_with_proration_config:, dimensional_price_configuration: nil, - model_type: :unit_with_percent + # The pricing model type + model_type: :unit_with_proration ) end @@ -5024,11 +6433,15 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::UnitWithPercent::Cadence::TaggedSymbol, + billing_mode: + Orb::Price::UnitWithProration::BillingMode::TaggedSymbol, + cadence: Orb::Price::UnitWithProration::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( - Orb::Price::UnitWithPercent::ConversionRateConfig::Variants + Orb::Price::UnitWithProration::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -5047,9 +6460,11 @@ module Orb model_type: Symbol, name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::UnitWithPercent::PriceType::TaggedSymbol, + price_type: + Orb::Price::UnitWithProration::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), - unit_with_percent_config: T::Hash[Symbol, T.anything], + unit_with_proration_config: + Orb::Price::UnitWithProration::UnitWithProrationConfig, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -5058,60 +6473,75 @@ module Orb def to_hash end - module Cadence + module BillingMode extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::Price::UnitWithPercent::Cadence) } + T.type_alias do + T.all(Symbol, Orb::Price::UnitWithProration::BillingMode) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - ONE_TIME = - T.let(:one_time, Orb::Price::UnitWithPercent::Cadence::TaggedSymbol) - MONTHLY = - T.let(:monthly, Orb::Price::UnitWithPercent::Cadence::TaggedSymbol) - QUARTERLY = + IN_ADVANCE = T.let( - :quarterly, - Orb::Price::UnitWithPercent::Cadence::TaggedSymbol + :in_advance, + Orb::Price::UnitWithProration::BillingMode::TaggedSymbol ) - SEMI_ANNUAL = + IN_ARREAR = T.let( - :semi_annual, - Orb::Price::UnitWithPercent::Cadence::TaggedSymbol + :in_arrear, + Orb::Price::UnitWithProration::BillingMode::TaggedSymbol ) - ANNUAL = - T.let(:annual, Orb::Price::UnitWithPercent::Cadence::TaggedSymbol) - CUSTOM = - T.let(:custom, Orb::Price::UnitWithPercent::Cadence::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::UnitWithPercent::Cadence::TaggedSymbol] + T::Array[Orb::Price::UnitWithProration::BillingMode::TaggedSymbol] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union + module Cadence + extend Orb::Internal::Type::Enum - Variants = + TaggedSymbol = T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) + T.all(Symbol, Orb::Price::UnitWithProration::Cadence) end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ONE_TIME = + T.let( + :one_time, + Orb::Price::UnitWithProration::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::Price::UnitWithProration::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::Price::UnitWithProration::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::Price::UnitWithProration::Cadence::TaggedSymbol + ) + ANNUAL = + T.let(:annual, Orb::Price::UnitWithProration::Cadence::TaggedSymbol) + CUSTOM = + T.let(:custom, Orb::Price::UnitWithProration::Cadence::TaggedSymbol) sig do override.returns( - T::Array[ - Orb::Price::UnitWithPercent::ConversionRateConfig::Variants - ] + T::Array[Orb::Price::UnitWithProration::Cadence::TaggedSymbol] ) end - def self.variants + def self.values end end @@ -5120,35 +6550,66 @@ module Orb TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::UnitWithPercent::PriceType) + T.all(Symbol, Orb::Price::UnitWithProration::PriceType) end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::UnitWithPercent::PriceType::TaggedSymbol + Orb::Price::UnitWithProration::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::UnitWithPercent::PriceType::TaggedSymbol + Orb::Price::UnitWithProration::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::UnitWithProration::PriceType::TaggedSymbol ) sig do override.returns( - T::Array[Orb::Price::UnitWithPercent::PriceType::TaggedSymbol] + T::Array[Orb::Price::UnitWithProration::PriceType::TaggedSymbol] ) end def self.values end end + + class UnitWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::UnitWithProration::UnitWithProrationConfig, + Orb::Internal::AnyHash + ) + end + + # Rate per unit of usage + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for unit_with_proration pricing + sig { params(unit_amount: String).returns(T.attached_class) } + def self.new( + # Rate per unit of usage + unit_amount: + ) + end + + sig { override.returns({ unit_amount: String }) } + def to_hash + end + end end - class MatrixWithAllocation < Orb::Internal::Type::BaseModel + class GroupedAllocation < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::MatrixWithAllocation, Orb::Internal::AnyHash) + T.any(Orb::Price::GroupedAllocation, Orb::Internal::AnyHash) end sig { returns(String) } @@ -5174,16 +6635,24 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol) } + sig do + returns(Orb::Price::GroupedAllocation::BillingMode::TaggedSymbol) + end + attr_accessor :billing_mode + + sig { returns(Orb::Price::GroupedAllocation::Cadence::TaggedSymbol) } attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( T.nilable( - Orb::Price::MatrixWithAllocation::ConversionRateConfig::Variants + Orb::Price::GroupedAllocation::ConversionRateConfig::Variants ) ) end @@ -5212,6 +6681,18 @@ module Orb sig { returns(T.nilable(Float)) } attr_accessor :fixed_price_quantity + # Configuration for grouped_allocation pricing + sig { returns(Orb::Price::GroupedAllocation::GroupedAllocationConfig) } + attr_reader :grouped_allocation_config + + sig do + params( + grouped_allocation_config: + Orb::Price::GroupedAllocation::GroupedAllocationConfig::OrHash + ).void + end + attr_writer :grouped_allocation_config + sig { returns(T.nilable(Orb::BillingCycleConfiguration)) } attr_reader :invoicing_cycle_configuration @@ -5223,23 +6704,14 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item sig { params(item: Orb::ItemSlim::OrHash).void } attr_writer :item - sig { returns(Orb::MatrixWithAllocationConfig) } - attr_reader :matrix_with_allocation_config - - sig do - params( - matrix_with_allocation_config: - Orb::MatrixWithAllocationConfig::OrHash - ).void - end - attr_writer :matrix_with_allocation_config - sig { returns(T.nilable(Orb::Maximum)) } attr_reader :maximum @@ -5265,6 +6737,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -5274,9 +6747,7 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig do - returns(Orb::Price::MatrixWithAllocation::PriceType::TaggedSymbol) - end + sig { returns(Orb::Price::GroupedAllocation::PriceType::TaggedSymbol) } attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -5300,7 +6771,10 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::MatrixWithAllocation::Cadence::OrSymbol, + billing_mode: Orb::Price::GroupedAllocation::BillingMode::OrSymbol, + cadence: Orb::Price::GroupedAllocation::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -5323,11 +6797,11 @@ module Orb ), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), + grouped_allocation_config: + Orb::Price::GroupedAllocation::GroupedAllocationConfig::OrHash, invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration::OrHash), item: Orb::ItemSlim::OrHash, - matrix_with_allocation_config: - Orb::MatrixWithAllocationConfig::OrHash, maximum: T.nilable(Orb::Maximum::OrHash), maximum_amount: T.nilable(String), metadata: T::Hash[Symbol, String], @@ -5335,7 +6809,7 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::MatrixWithAllocation::PriceType::OrSymbol, + price_type: Orb::Price::GroupedAllocation::PriceType::OrSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), @@ -5346,7 +6820,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -5355,9 +6831,12 @@ module Orb discount:, external_price_id:, fixed_price_quantity:, + # Configuration for grouped_allocation pricing + grouped_allocation_config:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, - matrix_with_allocation_config:, maximum:, maximum_amount:, # User specified key-value pairs for the resource. If not present, this defaults @@ -5374,7 +6853,8 @@ module Orb # price in plan version migrations. replaces_price_id:, dimensional_price_configuration: nil, - model_type: :matrix_with_allocation + # The pricing model type + model_type: :grouped_allocation ) end @@ -5384,11 +6864,15 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol, + billing_mode: + Orb::Price::GroupedAllocation::BillingMode::TaggedSymbol, + cadence: Orb::Price::GroupedAllocation::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( - Orb::Price::MatrixWithAllocation::ConversionRateConfig::Variants + Orb::Price::GroupedAllocation::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -5396,10 +6880,11 @@ module Orb discount: T.nilable(Orb::Discount::Variants), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), + grouped_allocation_config: + Orb::Price::GroupedAllocation::GroupedAllocationConfig, invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, - matrix_with_allocation_config: Orb::MatrixWithAllocationConfig, maximum: T.nilable(Orb::Maximum), maximum_amount: T.nilable(String), metadata: T::Hash[Symbol, String], @@ -5409,7 +6894,7 @@ module Orb name: String, plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::MatrixWithAllocation::PriceType::TaggedSymbol, + Orb::Price::GroupedAllocation::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) @@ -5419,74 +6904,127 @@ module Orb def to_hash end + module BillingMode + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Orb::Price::GroupedAllocation::BillingMode) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_ADVANCE = + T.let( + :in_advance, + Orb::Price::GroupedAllocation::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::GroupedAllocation::BillingMode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Orb::Price::GroupedAllocation::BillingMode::TaggedSymbol] + ) + end + def self.values + end + end + module Cadence extend Orb::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::MatrixWithAllocation::Cadence) + T.all(Symbol, Orb::Price::GroupedAllocation::Cadence) end OrSymbol = T.type_alias { T.any(Symbol, String) } ONE_TIME = T.let( :one_time, - Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol + Orb::Price::GroupedAllocation::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol + Orb::Price::GroupedAllocation::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol + Orb::Price::GroupedAllocation::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol + Orb::Price::GroupedAllocation::Cadence::TaggedSymbol ) ANNUAL = - T.let( - :annual, - Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol - ) + T.let(:annual, Orb::Price::GroupedAllocation::Cadence::TaggedSymbol) CUSTOM = - T.let( - :custom, - Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol - ) + T.let(:custom, Orb::Price::GroupedAllocation::Cadence::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol] + T::Array[Orb::Price::GroupedAllocation::Cadence::TaggedSymbol] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class GroupedAllocationConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::Price::GroupedAllocation::GroupedAllocationConfig, + Orb::Internal::AnyHash ) end + # Usage allocation per group + sig { returns(String) } + attr_accessor :allocation + + # How to determine the groups that should each be allocated some quantity + sig { returns(String) } + attr_accessor :grouping_key + + # Unit rate for post-allocation + sig { returns(String) } + attr_accessor :overage_unit_rate + + # Configuration for grouped_allocation pricing + sig do + params( + allocation: String, + grouping_key: String, + overage_unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # Usage allocation per group + allocation:, + # How to determine the groups that should each be allocated some quantity + grouping_key:, + # Unit rate for post-allocation + overage_unit_rate: + ) + end + sig do override.returns( - T::Array[ - Orb::Price::MatrixWithAllocation::ConversionRateConfig::Variants - ] + { + allocation: String, + grouping_key: String, + overage_unit_rate: String + } ) end - def self.variants + def to_hash end end @@ -5495,26 +7033,29 @@ module Orb TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::MatrixWithAllocation::PriceType) + T.all(Symbol, Orb::Price::GroupedAllocation::PriceType) end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::MatrixWithAllocation::PriceType::TaggedSymbol + Orb::Price::GroupedAllocation::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::MatrixWithAllocation::PriceType::TaggedSymbol + Orb::Price::GroupedAllocation::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::GroupedAllocation::PriceType::TaggedSymbol ) sig do override.returns( - T::Array[ - Orb::Price::MatrixWithAllocation::PriceType::TaggedSymbol - ] + T::Array[Orb::Price::GroupedAllocation::PriceType::TaggedSymbol] ) end def self.values @@ -5522,10 +7063,10 @@ module Orb end end - class TieredWithProration < Orb::Internal::Type::BaseModel + class BulkWithProration < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::TieredWithProration, Orb::Internal::AnyHash) + T.any(Orb::Price::BulkWithProration, Orb::Internal::AnyHash) end sig { returns(String) } @@ -5551,16 +7092,36 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::Price::TieredWithProration::Cadence::TaggedSymbol) } + sig do + returns(Orb::Price::BulkWithProration::BillingMode::TaggedSymbol) + end + attr_accessor :billing_mode + + # Configuration for bulk_with_proration pricing + sig { returns(Orb::Price::BulkWithProration::BulkWithProrationConfig) } + attr_reader :bulk_with_proration_config + + sig do + params( + bulk_with_proration_config: + Orb::Price::BulkWithProration::BulkWithProrationConfig::OrHash + ).void + end + attr_writer :bulk_with_proration_config + + sig { returns(Orb::Price::BulkWithProration::Cadence::TaggedSymbol) } attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( T.nilable( - Orb::Price::TieredWithProration::ConversionRateConfig::Variants + Orb::Price::BulkWithProration::ConversionRateConfig::Variants ) ) end @@ -5600,6 +7161,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -5631,6 +7194,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -5640,9 +7204,7 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig do - returns(Orb::Price::TieredWithProration::PriceType::TaggedSymbol) - end + sig { returns(Orb::Price::BulkWithProration::PriceType::TaggedSymbol) } attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -5650,9 +7212,6 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :replaces_price_id - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_with_proration_config - sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) } attr_reader :dimensional_price_configuration @@ -5669,7 +7228,12 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::TieredWithProration::Cadence::OrSymbol, + billing_mode: Orb::Price::BulkWithProration::BillingMode::OrSymbol, + bulk_with_proration_config: + Orb::Price::BulkWithProration::BulkWithProrationConfig::OrHash, + cadence: Orb::Price::BulkWithProration::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -5702,9 +7266,8 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::TieredWithProration::PriceType::OrSymbol, + price_type: Orb::Price::BulkWithProration::PriceType::OrSymbol, replaces_price_id: T.nilable(String), - tiered_with_proration_config: T::Hash[Symbol, T.anything], dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -5714,7 +7277,11 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, + # Configuration for bulk_with_proration pricing + bulk_with_proration_config:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -5724,6 +7291,8 @@ module Orb external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -5740,9 +7309,9 @@ module Orb # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, - tiered_with_proration_config:, dimensional_price_configuration: nil, - model_type: :tiered_with_proration + # The pricing model type + model_type: :bulk_with_proration ) end @@ -5752,11 +7321,17 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::TieredWithProration::Cadence::TaggedSymbol, + billing_mode: + Orb::Price::BulkWithProration::BillingMode::TaggedSymbol, + bulk_with_proration_config: + Orb::Price::BulkWithProration::BulkWithProrationConfig, + cadence: Orb::Price::BulkWithProration::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( - Orb::Price::TieredWithProration::ConversionRateConfig::Variants + Orb::Price::BulkWithProration::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -5776,9 +7351,8 @@ module Orb name: String, plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::TieredWithProration::PriceType::TaggedSymbol, + Orb::Price::BulkWithProration::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), - tiered_with_proration_config: T::Hash[Symbol, T.anything], dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -5787,100 +7361,195 @@ module Orb def to_hash end + module BillingMode + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Orb::Price::BulkWithProration::BillingMode) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_ADVANCE = + T.let( + :in_advance, + Orb::Price::BulkWithProration::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::BulkWithProration::BillingMode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Orb::Price::BulkWithProration::BillingMode::TaggedSymbol] + ) + end + def self.values + end + end + + class BulkWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::BulkWithProration::BulkWithProrationConfig, + Orb::Internal::AnyHash + ) + end + + # Bulk tiers for rating based on total usage volume + sig do + returns( + T::Array[ + Orb::Price::BulkWithProration::BulkWithProrationConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for bulk_with_proration pricing + sig do + params( + tiers: + T::Array[ + Orb::Price::BulkWithProration::BulkWithProrationConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Bulk tiers for rating based on total usage volume + tiers: + ) + end + + sig do + override.returns( + { + tiers: + T::Array[ + Orb::Price::BulkWithProration::BulkWithProrationConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::BulkWithProration::BulkWithProrationConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Cost per unit + sig { returns(String) } + attr_accessor :unit_amount + + # The lower bound for this tier + sig { returns(T.nilable(String)) } + attr_accessor :tier_lower_bound + + # Configuration for a single bulk pricing tier with proration + sig do + params( + unit_amount: String, + tier_lower_bound: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Cost per unit + unit_amount:, + # The lower bound for this tier + tier_lower_bound: nil + ) + end + + sig do + override.returns( + { unit_amount: String, tier_lower_bound: T.nilable(String) } + ) + end + def to_hash + end + end + end + module Cadence extend Orb::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::TieredWithProration::Cadence) + T.all(Symbol, Orb::Price::BulkWithProration::Cadence) end OrSymbol = T.type_alias { T.any(Symbol, String) } ONE_TIME = T.let( :one_time, - Orb::Price::TieredWithProration::Cadence::TaggedSymbol + Orb::Price::BulkWithProration::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::TieredWithProration::Cadence::TaggedSymbol + Orb::Price::BulkWithProration::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::TieredWithProration::Cadence::TaggedSymbol + Orb::Price::BulkWithProration::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::TieredWithProration::Cadence::TaggedSymbol + Orb::Price::BulkWithProration::Cadence::TaggedSymbol ) ANNUAL = - T.let( - :annual, - Orb::Price::TieredWithProration::Cadence::TaggedSymbol - ) + T.let(:annual, Orb::Price::BulkWithProration::Cadence::TaggedSymbol) CUSTOM = - T.let( - :custom, - Orb::Price::TieredWithProration::Cadence::TaggedSymbol - ) + T.let(:custom, Orb::Price::BulkWithProration::Cadence::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::TieredWithProration::Cadence::TaggedSymbol] + T::Array[Orb::Price::BulkWithProration::Cadence::TaggedSymbol] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end - - sig do - override.returns( - T::Array[ - Orb::Price::TieredWithProration::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end - module PriceType extend Orb::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::TieredWithProration::PriceType) + T.all(Symbol, Orb::Price::BulkWithProration::PriceType) end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::TieredWithProration::PriceType::TaggedSymbol + Orb::Price::BulkWithProration::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::TieredWithProration::PriceType::TaggedSymbol + Orb::Price::BulkWithProration::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::BulkWithProration::PriceType::TaggedSymbol ) sig do override.returns( - T::Array[Orb::Price::TieredWithProration::PriceType::TaggedSymbol] + T::Array[Orb::Price::BulkWithProration::PriceType::TaggedSymbol] ) end def self.values @@ -5888,10 +7557,13 @@ module Orb end end - class UnitWithProration < Orb::Internal::Type::BaseModel + class GroupedWithProratedMinimum < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::UnitWithProration, Orb::Internal::AnyHash) + T.any( + Orb::Price::GroupedWithProratedMinimum, + Orb::Internal::AnyHash + ) end sig { returns(String) } @@ -5911,22 +7583,34 @@ module Orb attr_reader :billing_cycle_configuration sig do - params( - billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash - ).void + params( + billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash + ).void + end + attr_writer :billing_cycle_configuration + + sig do + returns( + Orb::Price::GroupedWithProratedMinimum::BillingMode::TaggedSymbol + ) + end + attr_accessor :billing_mode + + sig do + returns(Orb::Price::GroupedWithProratedMinimum::Cadence::TaggedSymbol) end - attr_writer :billing_cycle_configuration - - sig { returns(Orb::Price::UnitWithProration::Cadence::TaggedSymbol) } attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( T.nilable( - Orb::Price::UnitWithProration::ConversionRateConfig::Variants + Orb::Price::GroupedWithProratedMinimum::ConversionRateConfig::Variants ) ) end @@ -5955,6 +7639,22 @@ module Orb sig { returns(T.nilable(Float)) } attr_accessor :fixed_price_quantity + # Configuration for grouped_with_prorated_minimum pricing + sig do + returns( + Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig + ) + end + attr_reader :grouped_with_prorated_minimum_config + + sig do + params( + grouped_with_prorated_minimum_config: + Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig::OrHash + ).void + end + attr_writer :grouped_with_prorated_minimum_config + sig { returns(T.nilable(Orb::BillingCycleConfiguration)) } attr_reader :invoicing_cycle_configuration @@ -5966,6 +7666,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -5997,6 +7699,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -6006,7 +7709,11 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig { returns(Orb::Price::UnitWithProration::PriceType::TaggedSymbol) } + sig do + returns( + Orb::Price::GroupedWithProratedMinimum::PriceType::TaggedSymbol + ) + end attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -6014,9 +7721,6 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :replaces_price_id - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :unit_with_proration_config - sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) } attr_reader :dimensional_price_configuration @@ -6033,7 +7737,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::UnitWithProration::Cadence::OrSymbol, + billing_mode: + Orb::Price::GroupedWithProratedMinimum::BillingMode::OrSymbol, + cadence: Orb::Price::GroupedWithProratedMinimum::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -6056,6 +7764,8 @@ module Orb ), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), + grouped_with_prorated_minimum_config: + Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig::OrHash, invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration::OrHash), item: Orb::ItemSlim::OrHash, @@ -6066,9 +7776,9 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::UnitWithProration::PriceType::OrSymbol, + price_type: + Orb::Price::GroupedWithProratedMinimum::PriceType::OrSymbol, replaces_price_id: T.nilable(String), - unit_with_proration_config: T::Hash[Symbol, T.anything], dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -6078,7 +7788,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -6087,7 +7799,11 @@ module Orb discount:, external_price_id:, fixed_price_quantity:, + # Configuration for grouped_with_prorated_minimum pricing + grouped_with_prorated_minimum_config:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -6104,9 +7820,9 @@ module Orb # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, - unit_with_proration_config:, dimensional_price_configuration: nil, - model_type: :unit_with_proration + # The pricing model type + model_type: :grouped_with_prorated_minimum ) end @@ -6116,11 +7832,16 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::UnitWithProration::Cadence::TaggedSymbol, + billing_mode: + Orb::Price::GroupedWithProratedMinimum::BillingMode::TaggedSymbol, + cadence: + Orb::Price::GroupedWithProratedMinimum::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( - Orb::Price::UnitWithProration::ConversionRateConfig::Variants + Orb::Price::GroupedWithProratedMinimum::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -6128,6 +7849,8 @@ module Orb discount: T.nilable(Orb::Discount::Variants), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), + grouped_with_prorated_minimum_config: + Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig, invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, @@ -6140,9 +7863,8 @@ module Orb name: String, plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::UnitWithProration::PriceType::TaggedSymbol, + Orb::Price::GroupedWithProratedMinimum::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), - unit_with_proration_config: T::Hash[Symbol, T.anything], dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -6151,68 +7873,133 @@ module Orb def to_hash end + module BillingMode + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Orb::Price::GroupedWithProratedMinimum::BillingMode) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_ADVANCE = + T.let( + :in_advance, + Orb::Price::GroupedWithProratedMinimum::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::GroupedWithProratedMinimum::BillingMode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Price::GroupedWithProratedMinimum::BillingMode::TaggedSymbol + ] + ) + end + def self.values + end + end + module Cadence extend Orb::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::UnitWithProration::Cadence) + T.all(Symbol, Orb::Price::GroupedWithProratedMinimum::Cadence) end OrSymbol = T.type_alias { T.any(Symbol, String) } ONE_TIME = T.let( :one_time, - Orb::Price::UnitWithProration::Cadence::TaggedSymbol + Orb::Price::GroupedWithProratedMinimum::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::UnitWithProration::Cadence::TaggedSymbol + Orb::Price::GroupedWithProratedMinimum::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::UnitWithProration::Cadence::TaggedSymbol + Orb::Price::GroupedWithProratedMinimum::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::UnitWithProration::Cadence::TaggedSymbol + Orb::Price::GroupedWithProratedMinimum::Cadence::TaggedSymbol ) ANNUAL = - T.let(:annual, Orb::Price::UnitWithProration::Cadence::TaggedSymbol) + T.let( + :annual, + Orb::Price::GroupedWithProratedMinimum::Cadence::TaggedSymbol + ) CUSTOM = - T.let(:custom, Orb::Price::UnitWithProration::Cadence::TaggedSymbol) + T.let( + :custom, + Orb::Price::GroupedWithProratedMinimum::Cadence::TaggedSymbol + ) sig do override.returns( - T::Array[Orb::Price::UnitWithProration::Cadence::TaggedSymbol] + T::Array[ + Orb::Price::GroupedWithProratedMinimum::Cadence::TaggedSymbol + ] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class GroupedWithProratedMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig, + Orb::Internal::AnyHash ) end + # How to determine the groups that should each have a minimum + sig { returns(String) } + attr_accessor :grouping_key + + # The minimum amount to charge per group + sig { returns(String) } + attr_accessor :minimum + + # The amount to charge per unit + sig { returns(String) } + attr_accessor :unit_rate + + # Configuration for grouped_with_prorated_minimum pricing + sig do + params( + grouping_key: String, + minimum: String, + unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # How to determine the groups that should each have a minimum + grouping_key:, + # The minimum amount to charge per group + minimum:, + # The amount to charge per unit + unit_rate: + ) + end + sig do override.returns( - T::Array[ - Orb::Price::UnitWithProration::ConversionRateConfig::Variants - ] + { grouping_key: String, minimum: String, unit_rate: String } ) end - def self.variants + def to_hash end end @@ -6221,24 +8008,31 @@ module Orb TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::UnitWithProration::PriceType) + T.all(Symbol, Orb::Price::GroupedWithProratedMinimum::PriceType) end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::UnitWithProration::PriceType::TaggedSymbol + Orb::Price::GroupedWithProratedMinimum::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::UnitWithProration::PriceType::TaggedSymbol + Orb::Price::GroupedWithProratedMinimum::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::GroupedWithProratedMinimum::PriceType::TaggedSymbol ) sig do override.returns( - T::Array[Orb::Price::UnitWithProration::PriceType::TaggedSymbol] + T::Array[ + Orb::Price::GroupedWithProratedMinimum::PriceType::TaggedSymbol + ] ) end def self.values @@ -6246,10 +8040,10 @@ module Orb end end - class GroupedAllocation < Orb::Internal::Type::BaseModel + class GroupedWithMeteredMinimum < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::GroupedAllocation, Orb::Internal::AnyHash) + T.any(Orb::Price::GroupedWithMeteredMinimum, Orb::Internal::AnyHash) end sig { returns(String) } @@ -6275,16 +8069,28 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::Price::GroupedAllocation::Cadence::TaggedSymbol) } + sig do + returns( + Orb::Price::GroupedWithMeteredMinimum::BillingMode::TaggedSymbol + ) + end + attr_accessor :billing_mode + + sig do + returns(Orb::Price::GroupedWithMeteredMinimum::Cadence::TaggedSymbol) + end attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( T.nilable( - Orb::Price::GroupedAllocation::ConversionRateConfig::Variants + Orb::Price::GroupedWithMeteredMinimum::ConversionRateConfig::Variants ) ) end @@ -6313,8 +8119,21 @@ module Orb sig { returns(T.nilable(Float)) } attr_accessor :fixed_price_quantity - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_allocation_config + # Configuration for grouped_with_metered_minimum pricing + sig do + returns( + Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig + ) + end + attr_reader :grouped_with_metered_minimum_config + + sig do + params( + grouped_with_metered_minimum_config: + Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig::OrHash + ).void + end + attr_writer :grouped_with_metered_minimum_config sig { returns(T.nilable(Orb::BillingCycleConfiguration)) } attr_reader :invoicing_cycle_configuration @@ -6327,6 +8146,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -6358,6 +8179,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -6367,7 +8189,11 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig { returns(Orb::Price::GroupedAllocation::PriceType::TaggedSymbol) } + sig do + returns( + Orb::Price::GroupedWithMeteredMinimum::PriceType::TaggedSymbol + ) + end attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -6391,7 +8217,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::GroupedAllocation::Cadence::OrSymbol, + billing_mode: + Orb::Price::GroupedWithMeteredMinimum::BillingMode::OrSymbol, + cadence: Orb::Price::GroupedWithMeteredMinimum::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -6414,7 +8244,8 @@ module Orb ), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), - grouped_allocation_config: T::Hash[Symbol, T.anything], + grouped_with_metered_minimum_config: + Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig::OrHash, invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration::OrHash), item: Orb::ItemSlim::OrHash, @@ -6425,7 +8256,8 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::GroupedAllocation::PriceType::OrSymbol, + price_type: + Orb::Price::GroupedWithMeteredMinimum::PriceType::OrSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), @@ -6436,7 +8268,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -6445,8 +8279,11 @@ module Orb discount:, external_price_id:, fixed_price_quantity:, - grouped_allocation_config:, + # Configuration for grouped_with_metered_minimum pricing + grouped_with_metered_minimum_config:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -6464,7 +8301,8 @@ module Orb # price in plan version migrations. replaces_price_id:, dimensional_price_configuration: nil, - model_type: :grouped_allocation + # The pricing model type + model_type: :grouped_with_metered_minimum ) end @@ -6474,11 +8312,16 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::GroupedAllocation::Cadence::TaggedSymbol, + billing_mode: + Orb::Price::GroupedWithMeteredMinimum::BillingMode::TaggedSymbol, + cadence: + Orb::Price::GroupedWithMeteredMinimum::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( - Orb::Price::GroupedAllocation::ConversionRateConfig::Variants + Orb::Price::GroupedWithMeteredMinimum::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -6486,7 +8329,8 @@ module Orb discount: T.nilable(Orb::Discount::Variants), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), - grouped_allocation_config: T::Hash[Symbol, T.anything], + grouped_with_metered_minimum_config: + Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig, invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, @@ -6499,7 +8343,7 @@ module Orb name: String, plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::GroupedAllocation::PriceType::TaggedSymbol, + Orb::Price::GroupedWithMeteredMinimum::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) @@ -6509,68 +8353,267 @@ module Orb def to_hash end + module BillingMode + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Orb::Price::GroupedWithMeteredMinimum::BillingMode) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_ADVANCE = + T.let( + :in_advance, + Orb::Price::GroupedWithMeteredMinimum::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::GroupedWithMeteredMinimum::BillingMode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Price::GroupedWithMeteredMinimum::BillingMode::TaggedSymbol + ] + ) + end + def self.values + end + end + module Cadence extend Orb::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::GroupedAllocation::Cadence) + T.all(Symbol, Orb::Price::GroupedWithMeteredMinimum::Cadence) end OrSymbol = T.type_alias { T.any(Symbol, String) } ONE_TIME = T.let( :one_time, - Orb::Price::GroupedAllocation::Cadence::TaggedSymbol + Orb::Price::GroupedWithMeteredMinimum::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::GroupedAllocation::Cadence::TaggedSymbol + Orb::Price::GroupedWithMeteredMinimum::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::GroupedAllocation::Cadence::TaggedSymbol + Orb::Price::GroupedWithMeteredMinimum::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::GroupedAllocation::Cadence::TaggedSymbol + Orb::Price::GroupedWithMeteredMinimum::Cadence::TaggedSymbol ) ANNUAL = - T.let(:annual, Orb::Price::GroupedAllocation::Cadence::TaggedSymbol) + T.let( + :annual, + Orb::Price::GroupedWithMeteredMinimum::Cadence::TaggedSymbol + ) CUSTOM = - T.let(:custom, Orb::Price::GroupedAllocation::Cadence::TaggedSymbol) + T.let( + :custom, + Orb::Price::GroupedWithMeteredMinimum::Cadence::TaggedSymbol + ) sig do override.returns( - T::Array[Orb::Price::GroupedAllocation::Cadence::TaggedSymbol] + T::Array[ + Orb::Price::GroupedWithMeteredMinimum::Cadence::TaggedSymbol + ] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class GroupedWithMeteredMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig, + Orb::Internal::AnyHash ) end + # Used to partition the usage into groups. The minimum amount is applied to each + # group. + sig { returns(String) } + attr_accessor :grouping_key + + # The minimum amount to charge per group per unit + sig { returns(String) } + attr_accessor :minimum_unit_amount + + # Used to determine the unit rate + sig { returns(String) } + attr_accessor :pricing_key + + # Scale the unit rates by the scaling factor. sig do - override.returns( + returns( + T::Array[ + Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig::ScalingFactor + ] + ) + end + attr_accessor :scaling_factors + + # Used to determine the unit rate scaling factor + sig { returns(String) } + attr_accessor :scaling_key + + # Apply per unit pricing to each pricing value. The minimum amount is applied any + # unmatched usage. + sig do + returns( T::Array[ - Orb::Price::GroupedAllocation::ConversionRateConfig::Variants + Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig::UnitAmount ] ) end - def self.variants + attr_accessor :unit_amounts + + # Configuration for grouped_with_metered_minimum pricing + sig do + params( + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: + T::Array[ + Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig::ScalingFactor::OrHash + ], + scaling_key: String, + unit_amounts: + T::Array[ + Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig::UnitAmount::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Used to partition the usage into groups. The minimum amount is applied to each + # group. + grouping_key:, + # The minimum amount to charge per group per unit + minimum_unit_amount:, + # Used to determine the unit rate + pricing_key:, + # Scale the unit rates by the scaling factor. + scaling_factors:, + # Used to determine the unit rate scaling factor + scaling_key:, + # Apply per unit pricing to each pricing value. The minimum amount is applied any + # unmatched usage. + unit_amounts: + ) + end + + sig do + override.returns( + { + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: + T::Array[ + Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig::ScalingFactor + ], + scaling_key: String, + unit_amounts: + T::Array[ + Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig::UnitAmount + ] + } + ) + end + def to_hash + end + + class ScalingFactor < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig::ScalingFactor, + Orb::Internal::AnyHash + ) + end + + # Scaling factor + sig { returns(String) } + attr_accessor :scaling_factor + + # Scaling value + sig { returns(String) } + attr_accessor :scaling_value + + # Configuration for a scaling factor + sig do + params(scaling_factor: String, scaling_value: String).returns( + T.attached_class + ) + end + def self.new( + # Scaling factor + scaling_factor:, + # Scaling value + scaling_value: + ) + end + + sig do + override.returns( + { scaling_factor: String, scaling_value: String } + ) + end + def to_hash + end + end + + class UnitAmount < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig::UnitAmount, + Orb::Internal::AnyHash + ) + end + + # Pricing value + sig { returns(String) } + attr_accessor :pricing_value + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a unit amount + sig do + params(pricing_value: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Pricing value + pricing_value:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns({ pricing_value: String, unit_amount: String }) + end + def to_hash + end end end @@ -6579,24 +8622,31 @@ module Orb TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::GroupedAllocation::PriceType) + T.all(Symbol, Orb::Price::GroupedWithMeteredMinimum::PriceType) end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::GroupedAllocation::PriceType::TaggedSymbol + Orb::Price::GroupedWithMeteredMinimum::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::GroupedAllocation::PriceType::TaggedSymbol + Orb::Price::GroupedWithMeteredMinimum::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::GroupedWithMeteredMinimum::PriceType::TaggedSymbol ) sig do override.returns( - T::Array[Orb::Price::GroupedAllocation::PriceType::TaggedSymbol] + T::Array[ + Orb::Price::GroupedWithMeteredMinimum::PriceType::TaggedSymbol + ] ) end def self.values @@ -6604,11 +8654,11 @@ module Orb end end - class GroupedWithProratedMinimum < Orb::Internal::Type::BaseModel + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - Orb::Price::GroupedWithProratedMinimum, + Orb::Price::GroupedWithMinMaxThresholds, Orb::Internal::AnyHash ) end @@ -6637,17 +8687,29 @@ module Orb attr_writer :billing_cycle_configuration sig do - returns(Orb::Price::GroupedWithProratedMinimum::Cadence::TaggedSymbol) + returns( + Orb::Price::GroupedWithMinMaxThresholds::BillingMode::TaggedSymbol + ) + end + attr_accessor :billing_mode + + sig do + returns( + Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) end attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( T.nilable( - Orb::Price::GroupedWithProratedMinimum::ConversionRateConfig::Variants + Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig::Variants ) ) end @@ -6676,8 +8738,21 @@ module Orb sig { returns(T.nilable(Float)) } attr_accessor :fixed_price_quantity - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_with_prorated_minimum_config + # Configuration for grouped_with_min_max_thresholds pricing + sig do + returns( + Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + ) + end + attr_reader :grouped_with_min_max_thresholds_config + + sig do + params( + grouped_with_min_max_thresholds_config: + Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash + ).void + end + attr_writer :grouped_with_min_max_thresholds_config sig { returns(T.nilable(Orb::BillingCycleConfiguration)) } attr_reader :invoicing_cycle_configuration @@ -6690,6 +8765,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -6721,6 +8798,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -6732,7 +8810,7 @@ module Orb sig do returns( - Orb::Price::GroupedWithProratedMinimum::PriceType::TaggedSymbol + Orb::Price::GroupedWithMinMaxThresholds::PriceType::TaggedSymbol ) end attr_accessor :price_type @@ -6758,7 +8836,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::GroupedWithProratedMinimum::Cadence::OrSymbol, + billing_mode: + Orb::Price::GroupedWithMinMaxThresholds::BillingMode::OrSymbol, + cadence: Orb::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -6781,7 +8863,8 @@ module Orb ), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), - grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + grouped_with_min_max_thresholds_config: + Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash, invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration::OrHash), item: Orb::ItemSlim::OrHash, @@ -6793,7 +8876,7 @@ module Orb name: String, plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::GroupedWithProratedMinimum::PriceType::OrSymbol, + Orb::Price::GroupedWithMinMaxThresholds::PriceType::OrSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), @@ -6804,7 +8887,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -6813,8 +8898,11 @@ module Orb discount:, external_price_id:, fixed_price_quantity:, - grouped_with_prorated_minimum_config:, + # Configuration for grouped_with_min_max_thresholds pricing + grouped_with_min_max_thresholds_config:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -6832,7 +8920,8 @@ module Orb # price in plan version migrations. replaces_price_id:, dimensional_price_configuration: nil, - model_type: :grouped_with_prorated_minimum + # The pricing model type + model_type: :grouped_with_min_max_thresholds ) end @@ -6842,12 +8931,16 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: + Orb::Price::GroupedWithMinMaxThresholds::BillingMode::TaggedSymbol, cadence: - Orb::Price::GroupedWithProratedMinimum::Cadence::TaggedSymbol, + Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( - Orb::Price::GroupedWithProratedMinimum::ConversionRateConfig::Variants + Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -6855,7 +8948,8 @@ module Orb discount: T.nilable(Orb::Discount::Variants), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), - grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + grouped_with_min_max_thresholds_config: + Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, @@ -6868,7 +8962,7 @@ module Orb name: String, plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::GroupedWithProratedMinimum::PriceType::TaggedSymbol, + Orb::Price::GroupedWithMinMaxThresholds::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) @@ -6878,50 +8972,84 @@ module Orb def to_hash end + module BillingMode + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::Price::GroupedWithMinMaxThresholds::BillingMode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_ADVANCE = + T.let( + :in_advance, + Orb::Price::GroupedWithMinMaxThresholds::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::GroupedWithMinMaxThresholds::BillingMode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Price::GroupedWithMinMaxThresholds::BillingMode::TaggedSymbol + ] + ) + end + def self.values + end + end + module Cadence extend Orb::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::GroupedWithProratedMinimum::Cadence) + T.all(Symbol, Orb::Price::GroupedWithMinMaxThresholds::Cadence) end OrSymbol = T.type_alias { T.any(Symbol, String) } ONE_TIME = T.let( :one_time, - Orb::Price::GroupedWithProratedMinimum::Cadence::TaggedSymbol + Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::GroupedWithProratedMinimum::Cadence::TaggedSymbol + Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::GroupedWithProratedMinimum::Cadence::TaggedSymbol + Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::GroupedWithProratedMinimum::Cadence::TaggedSymbol + Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol ) ANNUAL = T.let( :annual, - Orb::Price::GroupedWithProratedMinimum::Cadence::TaggedSymbol + Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol ) CUSTOM = T.let( :custom, - Orb::Price::GroupedWithProratedMinimum::Cadence::TaggedSymbol + Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol ) sig do override.returns( T::Array[ - Orb::Price::GroupedWithProratedMinimum::Cadence::TaggedSymbol + Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol ] ) end @@ -6929,25 +9057,63 @@ module Orb end end - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + Orb::Internal::AnyHash ) end + # The event property used to group before applying thresholds + sig { returns(String) } + attr_accessor :grouping_key + + # The maximum amount to charge each group + sig { returns(String) } + attr_accessor :maximum_charge + + # The minimum amount to charge each group, regardless of usage + sig { returns(String) } + attr_accessor :minimum_charge + + # The base price charged per group + sig { returns(String) } + attr_accessor :per_unit_rate + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + params( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before applying thresholds + grouping_key:, + # The maximum amount to charge each group + maximum_charge:, + # The minimum amount to charge each group, regardless of usage + minimum_charge:, + # The base price charged per group + per_unit_rate: + ) + end + sig do override.returns( - T::Array[ - Orb::Price::GroupedWithProratedMinimum::ConversionRateConfig::Variants - ] + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } ) end - def self.variants + def to_hash end end @@ -6956,25 +9122,30 @@ module Orb TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::GroupedWithProratedMinimum::PriceType) + T.all(Symbol, Orb::Price::GroupedWithMinMaxThresholds::PriceType) end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::GroupedWithProratedMinimum::PriceType::TaggedSymbol + Orb::Price::GroupedWithMinMaxThresholds::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::GroupedWithProratedMinimum::PriceType::TaggedSymbol + Orb::Price::GroupedWithMinMaxThresholds::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::GroupedWithMinMaxThresholds::PriceType::TaggedSymbol ) sig do override.returns( T::Array[ - Orb::Price::GroupedWithProratedMinimum::PriceType::TaggedSymbol + Orb::Price::GroupedWithMinMaxThresholds::PriceType::TaggedSymbol ] ) end @@ -6983,10 +9154,10 @@ module Orb end end - class GroupedWithMeteredMinimum < Orb::Internal::Type::BaseModel + class MatrixWithDisplayName < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::GroupedWithMeteredMinimum, Orb::Internal::AnyHash) + T.any(Orb::Price::MatrixWithDisplayName, Orb::Internal::AnyHash) end sig { returns(String) } @@ -7013,17 +9184,25 @@ module Orb attr_writer :billing_cycle_configuration sig do - returns(Orb::Price::GroupedWithMeteredMinimum::Cadence::TaggedSymbol) + returns(Orb::Price::MatrixWithDisplayName::BillingMode::TaggedSymbol) + end + attr_accessor :billing_mode + + sig do + returns(Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol) end attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( T.nilable( - Orb::Price::GroupedWithMeteredMinimum::ConversionRateConfig::Variants + Orb::Price::MatrixWithDisplayName::ConversionRateConfig::Variants ) ) end @@ -7052,9 +9231,6 @@ module Orb sig { returns(T.nilable(Float)) } attr_accessor :fixed_price_quantity - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_with_metered_minimum_config - sig { returns(T.nilable(Orb::BillingCycleConfiguration)) } attr_reader :invoicing_cycle_configuration @@ -7066,12 +9242,30 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item sig { params(item: Orb::ItemSlim::OrHash).void } attr_writer :item + # Configuration for matrix_with_display_name pricing + sig do + returns( + Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig + ) + end + attr_reader :matrix_with_display_name_config + + sig do + params( + matrix_with_display_name_config: + Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig::OrHash + ).void + end + attr_writer :matrix_with_display_name_config + sig { returns(T.nilable(Orb::Maximum)) } attr_reader :maximum @@ -7097,6 +9291,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -7107,9 +9302,7 @@ module Orb attr_accessor :plan_phase_order sig do - returns( - Orb::Price::GroupedWithMeteredMinimum::PriceType::TaggedSymbol - ) + returns(Orb::Price::MatrixWithDisplayName::PriceType::TaggedSymbol) end attr_accessor :price_type @@ -7134,7 +9327,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::GroupedWithMeteredMinimum::Cadence::OrSymbol, + billing_mode: + Orb::Price::MatrixWithDisplayName::BillingMode::OrSymbol, + cadence: Orb::Price::MatrixWithDisplayName::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -7157,10 +9354,11 @@ module Orb ), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), - grouped_with_metered_minimum_config: T::Hash[Symbol, T.anything], invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration::OrHash), item: Orb::ItemSlim::OrHash, + matrix_with_display_name_config: + Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig::OrHash, maximum: T.nilable(Orb::Maximum::OrHash), maximum_amount: T.nilable(String), metadata: T::Hash[Symbol, String], @@ -7168,8 +9366,7 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: - Orb::Price::GroupedWithMeteredMinimum::PriceType::OrSymbol, + price_type: Orb::Price::MatrixWithDisplayName::PriceType::OrSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), @@ -7180,7 +9377,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -7189,9 +9388,12 @@ module Orb discount:, external_price_id:, fixed_price_quantity:, - grouped_with_metered_minimum_config:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, + # Configuration for matrix_with_display_name pricing + matrix_with_display_name_config:, maximum:, maximum_amount:, # User specified key-value pairs for the resource. If not present, this defaults @@ -7208,7 +9410,8 @@ module Orb # price in plan version migrations. replaces_price_id:, dimensional_price_configuration: nil, - model_type: :grouped_with_metered_minimum + # The pricing model type + model_type: :matrix_with_display_name ) end @@ -7218,12 +9421,15 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: - Orb::Price::GroupedWithMeteredMinimum::Cadence::TaggedSymbol, + billing_mode: + Orb::Price::MatrixWithDisplayName::BillingMode::TaggedSymbol, + cadence: Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( - Orb::Price::GroupedWithMeteredMinimum::ConversionRateConfig::Variants + Orb::Price::MatrixWithDisplayName::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -7231,10 +9437,11 @@ module Orb discount: T.nilable(Orb::Discount::Variants), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), - grouped_with_metered_minimum_config: T::Hash[Symbol, T.anything], invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, + matrix_with_display_name_config: + Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig, maximum: T.nilable(Orb::Maximum), maximum_amount: T.nilable(String), metadata: T::Hash[Symbol, String], @@ -7244,7 +9451,7 @@ module Orb name: String, plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::GroupedWithMeteredMinimum::PriceType::TaggedSymbol, + Orb::Price::MatrixWithDisplayName::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) @@ -7254,76 +9461,191 @@ module Orb def to_hash end + module BillingMode + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Orb::Price::MatrixWithDisplayName::BillingMode) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_ADVANCE = + T.let( + :in_advance, + Orb::Price::MatrixWithDisplayName::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::MatrixWithDisplayName::BillingMode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Price::MatrixWithDisplayName::BillingMode::TaggedSymbol + ] + ) + end + def self.values + end + end + module Cadence extend Orb::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::GroupedWithMeteredMinimum::Cadence) + T.all(Symbol, Orb::Price::MatrixWithDisplayName::Cadence) end OrSymbol = T.type_alias { T.any(Symbol, String) } ONE_TIME = T.let( :one_time, - Orb::Price::GroupedWithMeteredMinimum::Cadence::TaggedSymbol + Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::GroupedWithMeteredMinimum::Cadence::TaggedSymbol + Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::GroupedWithMeteredMinimum::Cadence::TaggedSymbol + Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::GroupedWithMeteredMinimum::Cadence::TaggedSymbol + Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol ) ANNUAL = T.let( :annual, - Orb::Price::GroupedWithMeteredMinimum::Cadence::TaggedSymbol + Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol ) CUSTOM = T.let( :custom, - Orb::Price::GroupedWithMeteredMinimum::Cadence::TaggedSymbol + Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol ) sig do override.returns( - T::Array[ - Orb::Price::GroupedWithMeteredMinimum::Cadence::TaggedSymbol - ] + T::Array[Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class MatrixWithDisplayNameConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig, + Orb::Internal::AnyHash ) end + # Used to determine the unit rate + sig { returns(String) } + attr_accessor :dimension + + # Apply per unit pricing to each dimension value sig do - override.returns( + returns( T::Array[ - Orb::Price::GroupedWithMeteredMinimum::ConversionRateConfig::Variants + Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig::UnitAmount ] ) end - def self.variants + attr_accessor :unit_amounts + + # Configuration for matrix_with_display_name pricing + sig do + params( + dimension: String, + unit_amounts: + T::Array[ + Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig::UnitAmount::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Used to determine the unit rate + dimension:, + # Apply per unit pricing to each dimension value + unit_amounts: + ) + end + + sig do + override.returns( + { + dimension: String, + unit_amounts: + T::Array[ + Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig::UnitAmount + ] + } + ) + end + def to_hash + end + + class UnitAmount < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig::UnitAmount, + Orb::Internal::AnyHash + ) + end + + # The dimension value + sig { returns(String) } + attr_accessor :dimension_value + + # Display name for this dimension value + sig { returns(String) } + attr_accessor :display_name + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a unit amount item + sig do + params( + dimension_value: String, + display_name: String, + unit_amount: String + ).returns(T.attached_class) + end + def self.new( + # The dimension value + dimension_value:, + # Display name for this dimension value + display_name:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns( + { + dimension_value: String, + display_name: String, + unit_amount: String + } + ) + end + def to_hash + end end end @@ -7332,25 +9654,30 @@ module Orb TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::GroupedWithMeteredMinimum::PriceType) + T.all(Symbol, Orb::Price::MatrixWithDisplayName::PriceType) end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::GroupedWithMeteredMinimum::PriceType::TaggedSymbol + Orb::Price::MatrixWithDisplayName::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::GroupedWithMeteredMinimum::PriceType::TaggedSymbol + Orb::Price::MatrixWithDisplayName::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::MatrixWithDisplayName::PriceType::TaggedSymbol ) sig do override.returns( T::Array[ - Orb::Price::GroupedWithMeteredMinimum::PriceType::TaggedSymbol + Orb::Price::MatrixWithDisplayName::PriceType::TaggedSymbol ] ) end @@ -7359,10 +9686,10 @@ module Orb end end - class MatrixWithDisplayName < Orb::Internal::Type::BaseModel + class GroupedTieredPackage < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::MatrixWithDisplayName, Orb::Internal::AnyHash) + T.any(Orb::Price::GroupedTieredPackage, Orb::Internal::AnyHash) end sig { returns(String) } @@ -7389,17 +9716,23 @@ module Orb attr_writer :billing_cycle_configuration sig do - returns(Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol) + returns(Orb::Price::GroupedTieredPackage::BillingMode::TaggedSymbol) end + attr_accessor :billing_mode + + sig { returns(Orb::Price::GroupedTieredPackage::Cadence::TaggedSymbol) } attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( T.nilable( - Orb::Price::MatrixWithDisplayName::ConversionRateConfig::Variants + Orb::Price::GroupedTieredPackage::ConversionRateConfig::Variants ) ) end @@ -7428,6 +9761,20 @@ module Orb sig { returns(T.nilable(Float)) } attr_accessor :fixed_price_quantity + # Configuration for grouped_tiered_package pricing + sig do + returns(Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig) + end + attr_reader :grouped_tiered_package_config + + sig do + params( + grouped_tiered_package_config: + Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig::OrHash + ).void + end + attr_writer :grouped_tiered_package_config + sig { returns(T.nilable(Orb::BillingCycleConfiguration)) } attr_reader :invoicing_cycle_configuration @@ -7439,15 +9786,14 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item sig { params(item: Orb::ItemSlim::OrHash).void } attr_writer :item - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :matrix_with_display_name_config - sig { returns(T.nilable(Orb::Maximum)) } attr_reader :maximum @@ -7473,6 +9819,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -7483,7 +9830,7 @@ module Orb attr_accessor :plan_phase_order sig do - returns(Orb::Price::MatrixWithDisplayName::PriceType::TaggedSymbol) + returns(Orb::Price::GroupedTieredPackage::PriceType::TaggedSymbol) end attr_accessor :price_type @@ -7508,7 +9855,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::MatrixWithDisplayName::Cadence::OrSymbol, + billing_mode: + Orb::Price::GroupedTieredPackage::BillingMode::OrSymbol, + cadence: Orb::Price::GroupedTieredPackage::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -7531,10 +9882,11 @@ module Orb ), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), + grouped_tiered_package_config: + Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig::OrHash, invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration::OrHash), item: Orb::ItemSlim::OrHash, - matrix_with_display_name_config: T::Hash[Symbol, T.anything], maximum: T.nilable(Orb::Maximum::OrHash), maximum_amount: T.nilable(String), metadata: T::Hash[Symbol, String], @@ -7542,7 +9894,7 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::MatrixWithDisplayName::PriceType::OrSymbol, + price_type: Orb::Price::GroupedTieredPackage::PriceType::OrSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), @@ -7553,7 +9905,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -7562,9 +9916,12 @@ module Orb discount:, external_price_id:, fixed_price_quantity:, + # Configuration for grouped_tiered_package pricing + grouped_tiered_package_config:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, - matrix_with_display_name_config:, maximum:, maximum_amount:, # User specified key-value pairs for the resource. If not present, this defaults @@ -7581,7 +9938,8 @@ module Orb # price in plan version migrations. replaces_price_id:, dimensional_price_configuration: nil, - model_type: :matrix_with_display_name + # The pricing model type + model_type: :grouped_tiered_package ) end @@ -7591,11 +9949,15 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol, + billing_mode: + Orb::Price::GroupedTieredPackage::BillingMode::TaggedSymbol, + cadence: Orb::Price::GroupedTieredPackage::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( - Orb::Price::MatrixWithDisplayName::ConversionRateConfig::Variants + Orb::Price::GroupedTieredPackage::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -7603,10 +9965,11 @@ module Orb discount: T.nilable(Orb::Discount::Variants), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), + grouped_tiered_package_config: + Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig, invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, - matrix_with_display_name_config: T::Hash[Symbol, T.anything], maximum: T.nilable(Orb::Maximum), maximum_amount: T.nilable(String), metadata: T::Hash[Symbol, String], @@ -7616,7 +9979,7 @@ module Orb name: String, plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::MatrixWithDisplayName::PriceType::TaggedSymbol, + Orb::Price::GroupedTieredPackage::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) @@ -7626,74 +9989,187 @@ module Orb def to_hash end + module BillingMode + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Orb::Price::GroupedTieredPackage::BillingMode) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_ADVANCE = + T.let( + :in_advance, + Orb::Price::GroupedTieredPackage::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::GroupedTieredPackage::BillingMode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Price::GroupedTieredPackage::BillingMode::TaggedSymbol + ] + ) + end + def self.values + end + end + module Cadence extend Orb::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::MatrixWithDisplayName::Cadence) + T.all(Symbol, Orb::Price::GroupedTieredPackage::Cadence) end OrSymbol = T.type_alias { T.any(Symbol, String) } ONE_TIME = T.let( :one_time, - Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol + Orb::Price::GroupedTieredPackage::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol + Orb::Price::GroupedTieredPackage::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol + Orb::Price::GroupedTieredPackage::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol + Orb::Price::GroupedTieredPackage::Cadence::TaggedSymbol ) ANNUAL = T.let( :annual, - Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol + Orb::Price::GroupedTieredPackage::Cadence::TaggedSymbol ) CUSTOM = T.let( :custom, - Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol + Orb::Price::GroupedTieredPackage::Cadence::TaggedSymbol ) sig do override.returns( - T::Array[Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol] + T::Array[Orb::Price::GroupedTieredPackage::Cadence::TaggedSymbol] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class GroupedTieredPackageConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig, + Orb::Internal::AnyHash ) end + # The event property used to group before tiering + sig { returns(String) } + attr_accessor :grouping_key + + # Package size + sig { returns(String) } + attr_accessor :package_size + + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. sig do - override.returns( + returns( T::Array[ - Orb::Price::MatrixWithDisplayName::ConversionRateConfig::Variants + Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig::Tier ] ) end - def self.variants + attr_accessor :tiers + + # Configuration for grouped_tiered_package pricing + sig do + params( + grouping_key: String, + package_size: String, + tiers: + T::Array[ + Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before tiering + grouping_key:, + # Package size + package_size:, + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + tiers: + ) + end + + sig do + override.returns( + { + grouping_key: String, + package_size: String, + tiers: + T::Array[ + Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Price per package + sig { returns(String) } + attr_accessor :per_unit + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Configuration for a single tier + sig do + params(per_unit: String, tier_lower_bound: String).returns( + T.attached_class + ) + end + def self.new( + # Price per package + per_unit:, + # Tier lower bound + tier_lower_bound: + ) + end + + sig do + override.returns({ per_unit: String, tier_lower_bound: String }) + end + def to_hash + end end end @@ -7702,25 +10178,30 @@ module Orb TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::MatrixWithDisplayName::PriceType) + T.all(Symbol, Orb::Price::GroupedTieredPackage::PriceType) end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::MatrixWithDisplayName::PriceType::TaggedSymbol + Orb::Price::GroupedTieredPackage::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::MatrixWithDisplayName::PriceType::TaggedSymbol + Orb::Price::GroupedTieredPackage::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::GroupedTieredPackage::PriceType::TaggedSymbol ) sig do override.returns( T::Array[ - Orb::Price::MatrixWithDisplayName::PriceType::TaggedSymbol + Orb::Price::GroupedTieredPackage::PriceType::TaggedSymbol ] ) end @@ -7729,10 +10210,10 @@ module Orb end end - class BulkWithProration < Orb::Internal::Type::BaseModel + class MaxGroupTieredPackage < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::BulkWithProration, Orb::Internal::AnyHash) + T.any(Orb::Price::MaxGroupTieredPackage, Orb::Internal::AnyHash) end sig { returns(String) } @@ -7758,19 +10239,26 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :bulk_with_proration_config + sig do + returns(Orb::Price::MaxGroupTieredPackage::BillingMode::TaggedSymbol) + end + attr_accessor :billing_mode - sig { returns(Orb::Price::BulkWithProration::Cadence::TaggedSymbol) } + sig do + returns(Orb::Price::MaxGroupTieredPackage::Cadence::TaggedSymbol) + end attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( T.nilable( - Orb::Price::BulkWithProration::ConversionRateConfig::Variants + Orb::Price::MaxGroupTieredPackage::ConversionRateConfig::Variants ) ) end @@ -7810,12 +10298,30 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item sig { params(item: Orb::ItemSlim::OrHash).void } attr_writer :item + # Configuration for max_group_tiered_package pricing + sig do + returns( + Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig + ) + end + attr_reader :max_group_tiered_package_config + + sig do + params( + max_group_tiered_package_config: + Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig::OrHash + ).void + end + attr_writer :max_group_tiered_package_config + sig { returns(T.nilable(Orb::Maximum)) } attr_reader :maximum @@ -7841,6 +10347,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -7850,7 +10357,9 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig { returns(Orb::Price::BulkWithProration::PriceType::TaggedSymbol) } + sig do + returns(Orb::Price::MaxGroupTieredPackage::PriceType::TaggedSymbol) + end attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -7874,8 +10383,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - bulk_with_proration_config: T::Hash[Symbol, T.anything], - cadence: Orb::Price::BulkWithProration::Cadence::OrSymbol, + billing_mode: + Orb::Price::MaxGroupTieredPackage::BillingMode::OrSymbol, + cadence: Orb::Price::MaxGroupTieredPackage::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -7901,6 +10413,8 @@ module Orb invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration::OrHash), item: Orb::ItemSlim::OrHash, + max_group_tiered_package_config: + Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig::OrHash, maximum: T.nilable(Orb::Maximum::OrHash), maximum_amount: T.nilable(String), metadata: T::Hash[Symbol, String], @@ -7908,7 +10422,7 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::BulkWithProration::PriceType::OrSymbol, + price_type: Orb::Price::MaxGroupTieredPackage::PriceType::OrSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), @@ -7919,8 +10433,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, - bulk_with_proration_config:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -7930,7 +10445,11 @@ module Orb external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, + # Configuration for max_group_tiered_package pricing + max_group_tiered_package_config:, maximum:, maximum_amount:, # User specified key-value pairs for the resource. If not present, this defaults @@ -7947,7 +10466,8 @@ module Orb # price in plan version migrations. replaces_price_id:, dimensional_price_configuration: nil, - model_type: :bulk_with_proration + # The pricing model type + model_type: :max_group_tiered_package ) end @@ -7957,12 +10477,15 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_with_proration_config: T::Hash[Symbol, T.anything], - cadence: Orb::Price::BulkWithProration::Cadence::TaggedSymbol, + billing_mode: + Orb::Price::MaxGroupTieredPackage::BillingMode::TaggedSymbol, + cadence: Orb::Price::MaxGroupTieredPackage::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( - Orb::Price::BulkWithProration::ConversionRateConfig::Variants + Orb::Price::MaxGroupTieredPackage::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -7973,6 +10496,8 @@ module Orb invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, + max_group_tiered_package_config: + Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig, maximum: T.nilable(Orb::Maximum), maximum_amount: T.nilable(String), metadata: T::Hash[Symbol, String], @@ -7982,7 +10507,7 @@ module Orb name: String, plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::BulkWithProration::PriceType::TaggedSymbol, + Orb::Price::MaxGroupTieredPackage::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) @@ -7992,68 +10517,187 @@ module Orb def to_hash end + module BillingMode + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Orb::Price::MaxGroupTieredPackage::BillingMode) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_ADVANCE = + T.let( + :in_advance, + Orb::Price::MaxGroupTieredPackage::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::MaxGroupTieredPackage::BillingMode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Price::MaxGroupTieredPackage::BillingMode::TaggedSymbol + ] + ) + end + def self.values + end + end + module Cadence extend Orb::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::BulkWithProration::Cadence) + T.all(Symbol, Orb::Price::MaxGroupTieredPackage::Cadence) end OrSymbol = T.type_alias { T.any(Symbol, String) } ONE_TIME = T.let( :one_time, - Orb::Price::BulkWithProration::Cadence::TaggedSymbol + Orb::Price::MaxGroupTieredPackage::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::BulkWithProration::Cadence::TaggedSymbol + Orb::Price::MaxGroupTieredPackage::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::BulkWithProration::Cadence::TaggedSymbol + Orb::Price::MaxGroupTieredPackage::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::BulkWithProration::Cadence::TaggedSymbol + Orb::Price::MaxGroupTieredPackage::Cadence::TaggedSymbol ) ANNUAL = - T.let(:annual, Orb::Price::BulkWithProration::Cadence::TaggedSymbol) + T.let( + :annual, + Orb::Price::MaxGroupTieredPackage::Cadence::TaggedSymbol + ) CUSTOM = - T.let(:custom, Orb::Price::BulkWithProration::Cadence::TaggedSymbol) + T.let( + :custom, + Orb::Price::MaxGroupTieredPackage::Cadence::TaggedSymbol + ) sig do override.returns( - T::Array[Orb::Price::BulkWithProration::Cadence::TaggedSymbol] + T::Array[Orb::Price::MaxGroupTieredPackage::Cadence::TaggedSymbol] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class MaxGroupTieredPackageConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig, + Orb::Internal::AnyHash ) end + # The event property used to group before tiering the group with the highest value + sig { returns(String) } + attr_accessor :grouping_key + + # Package size + sig { returns(String) } + attr_accessor :package_size + + # Apply tiered pricing to the largest group after grouping with the provided key. sig do - override.returns( + returns( T::Array[ - Orb::Price::BulkWithProration::ConversionRateConfig::Variants + Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig::Tier ] ) end - def self.variants + attr_accessor :tiers + + # Configuration for max_group_tiered_package pricing + sig do + params( + grouping_key: String, + package_size: String, + tiers: + T::Array[ + Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before tiering the group with the highest value + grouping_key:, + # Package size + package_size:, + # Apply tiered pricing to the largest group after grouping with the provided key. + tiers: + ) + end + + sig do + override.returns( + { + grouping_key: String, + package_size: String, + tiers: + T::Array[ + Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tier + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Tier lower bound + tier_lower_bound:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns( + { tier_lower_bound: String, unit_amount: String } + ) + end + def to_hash + end end end @@ -8062,24 +10706,31 @@ module Orb TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::BulkWithProration::PriceType) + T.all(Symbol, Orb::Price::MaxGroupTieredPackage::PriceType) end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::BulkWithProration::PriceType::TaggedSymbol + Orb::Price::MaxGroupTieredPackage::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::BulkWithProration::PriceType::TaggedSymbol + Orb::Price::MaxGroupTieredPackage::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::MaxGroupTieredPackage::PriceType::TaggedSymbol ) sig do override.returns( - T::Array[Orb::Price::BulkWithProration::PriceType::TaggedSymbol] + T::Array[ + Orb::Price::MaxGroupTieredPackage::PriceType::TaggedSymbol + ] ) end def self.values @@ -8087,10 +10738,13 @@ module Orb end end - class GroupedTieredPackage < Orb::Internal::Type::BaseModel + class ScalableMatrixWithUnitPricing < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::GroupedTieredPackage, Orb::Internal::AnyHash) + T.any( + Orb::Price::ScalableMatrixWithUnitPricing, + Orb::Internal::AnyHash + ) end sig { returns(String) } @@ -8116,16 +10770,30 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::Price::GroupedTieredPackage::Cadence::TaggedSymbol) } + sig do + returns( + Orb::Price::ScalableMatrixWithUnitPricing::BillingMode::TaggedSymbol + ) + end + attr_accessor :billing_mode + + sig do + returns( + Orb::Price::ScalableMatrixWithUnitPricing::Cadence::TaggedSymbol + ) + end attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( T.nilable( - Orb::Price::GroupedTieredPackage::ConversionRateConfig::Variants + Orb::Price::ScalableMatrixWithUnitPricing::ConversionRateConfig::Variants ) ) end @@ -8154,9 +10822,6 @@ module Orb sig { returns(T.nilable(Float)) } attr_accessor :fixed_price_quantity - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_tiered_package_config - sig { returns(T.nilable(Orb::BillingCycleConfiguration)) } attr_reader :invoicing_cycle_configuration @@ -8168,6 +10833,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -8199,6 +10866,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -8209,7 +10877,9 @@ module Orb attr_accessor :plan_phase_order sig do - returns(Orb::Price::GroupedTieredPackage::PriceType::TaggedSymbol) + returns( + Orb::Price::ScalableMatrixWithUnitPricing::PriceType::TaggedSymbol + ) end attr_accessor :price_type @@ -8218,6 +10888,22 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :replaces_price_id + # Configuration for scalable_matrix_with_unit_pricing pricing + sig do + returns( + Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig + ) + end + attr_reader :scalable_matrix_with_unit_pricing_config + + sig do + params( + scalable_matrix_with_unit_pricing_config: + Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig::OrHash + ).void + end + attr_writer :scalable_matrix_with_unit_pricing_config + sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) } attr_reader :dimensional_price_configuration @@ -8234,7 +10920,12 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::GroupedTieredPackage::Cadence::OrSymbol, + billing_mode: + Orb::Price::ScalableMatrixWithUnitPricing::BillingMode::OrSymbol, + cadence: + Orb::Price::ScalableMatrixWithUnitPricing::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -8257,7 +10948,6 @@ module Orb ), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), - grouped_tiered_package_config: T::Hash[Symbol, T.anything], invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration::OrHash), item: Orb::ItemSlim::OrHash, @@ -8268,8 +10958,11 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::GroupedTieredPackage::PriceType::OrSymbol, + price_type: + Orb::Price::ScalableMatrixWithUnitPricing::PriceType::OrSymbol, replaces_price_id: T.nilable(String), + scalable_matrix_with_unit_pricing_config: + Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig::OrHash, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -8279,7 +10972,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -8288,8 +10983,9 @@ module Orb discount:, external_price_id:, fixed_price_quantity:, - grouped_tiered_package_config:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -8306,8 +11002,11 @@ module Orb # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, + # Configuration for scalable_matrix_with_unit_pricing pricing + scalable_matrix_with_unit_pricing_config:, dimensional_price_configuration: nil, - model_type: :grouped_tiered_package + # The pricing model type + model_type: :scalable_matrix_with_unit_pricing ) end @@ -8317,11 +11016,16 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::GroupedTieredPackage::Cadence::TaggedSymbol, + billing_mode: + Orb::Price::ScalableMatrixWithUnitPricing::BillingMode::TaggedSymbol, + cadence: + Orb::Price::ScalableMatrixWithUnitPricing::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( - Orb::Price::GroupedTieredPackage::ConversionRateConfig::Variants + Orb::Price::ScalableMatrixWithUnitPricing::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -8329,7 +11033,6 @@ module Orb discount: T.nilable(Orb::Discount::Variants), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), - grouped_tiered_package_config: T::Hash[Symbol, T.anything], invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, @@ -8342,8 +11045,10 @@ module Orb name: String, plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::GroupedTieredPackage::PriceType::TaggedSymbol, + Orb::Price::ScalableMatrixWithUnitPricing::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), + scalable_matrix_with_unit_pricing_config: + Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -8352,74 +11057,88 @@ module Orb def to_hash end + module BillingMode + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::Price::ScalableMatrixWithUnitPricing::BillingMode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_ADVANCE = + T.let( + :in_advance, + Orb::Price::ScalableMatrixWithUnitPricing::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::ScalableMatrixWithUnitPricing::BillingMode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Price::ScalableMatrixWithUnitPricing::BillingMode::TaggedSymbol + ] + ) + end + def self.values + end + end + module Cadence extend Orb::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::GroupedTieredPackage::Cadence) + T.all(Symbol, Orb::Price::ScalableMatrixWithUnitPricing::Cadence) end OrSymbol = T.type_alias { T.any(Symbol, String) } ONE_TIME = T.let( :one_time, - Orb::Price::GroupedTieredPackage::Cadence::TaggedSymbol + Orb::Price::ScalableMatrixWithUnitPricing::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::GroupedTieredPackage::Cadence::TaggedSymbol + Orb::Price::ScalableMatrixWithUnitPricing::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::GroupedTieredPackage::Cadence::TaggedSymbol + Orb::Price::ScalableMatrixWithUnitPricing::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::GroupedTieredPackage::Cadence::TaggedSymbol + Orb::Price::ScalableMatrixWithUnitPricing::Cadence::TaggedSymbol ) ANNUAL = T.let( :annual, - Orb::Price::GroupedTieredPackage::Cadence::TaggedSymbol + Orb::Price::ScalableMatrixWithUnitPricing::Cadence::TaggedSymbol ) CUSTOM = T.let( :custom, - Orb::Price::GroupedTieredPackage::Cadence::TaggedSymbol - ) - - sig do - override.returns( - T::Array[Orb::Price::GroupedTieredPackage::Cadence::TaggedSymbol] + Orb::Price::ScalableMatrixWithUnitPricing::Cadence::TaggedSymbol ) - end - def self.values - end - end - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) - end sig do override.returns( T::Array[ - Orb::Price::GroupedTieredPackage::ConversionRateConfig::Variants + Orb::Price::ScalableMatrixWithUnitPricing::Cadence::TaggedSymbol ] ) end - def self.variants + def self.values end end @@ -8428,37 +11147,180 @@ module Orb TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::GroupedTieredPackage::PriceType) + T.all( + Symbol, + Orb::Price::ScalableMatrixWithUnitPricing::PriceType + ) end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::GroupedTieredPackage::PriceType::TaggedSymbol + Orb::Price::ScalableMatrixWithUnitPricing::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::GroupedTieredPackage::PriceType::TaggedSymbol + Orb::Price::ScalableMatrixWithUnitPricing::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::ScalableMatrixWithUnitPricing::PriceType::TaggedSymbol ) sig do override.returns( T::Array[ - Orb::Price::GroupedTieredPackage::PriceType::TaggedSymbol + Orb::Price::ScalableMatrixWithUnitPricing::PriceType::TaggedSymbol ] ) end def self.values end end + + class ScalableMatrixWithUnitPricingConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig, + Orb::Internal::AnyHash + ) + end + + # Used to determine the unit rate + sig { returns(String) } + attr_accessor :first_dimension + + # Apply a scaling factor to each dimension + sig do + returns( + T::Array[ + Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor + ] + ) + end + attr_accessor :matrix_scaling_factors + + # The final unit price to rate against the output of the matrix + sig { returns(String) } + attr_accessor :unit_price + + # If true, the unit price will be prorated to the billing period + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :prorate + + # Used to determine the unit rate (optional) + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension + + # Configuration for scalable_matrix_with_unit_pricing pricing + sig do + params( + first_dimension: String, + matrix_scaling_factors: + T::Array[ + Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor::OrHash + ], + unit_price: String, + prorate: T.nilable(T::Boolean), + second_dimension: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Used to determine the unit rate + first_dimension:, + # Apply a scaling factor to each dimension + matrix_scaling_factors:, + # The final unit price to rate against the output of the matrix + unit_price:, + # If true, the unit price will be prorated to the billing period + prorate: nil, + # Used to determine the unit rate (optional) + second_dimension: nil + ) + end + + sig do + override.returns( + { + first_dimension: String, + matrix_scaling_factors: + T::Array[ + Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor + ], + unit_price: String, + prorate: T.nilable(T::Boolean), + second_dimension: T.nilable(String) + } + ) + end + def to_hash + end + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor, + Orb::Internal::AnyHash + ) + end + + # First dimension value + sig { returns(String) } + attr_accessor :first_dimension_value + + # Scaling factor + sig { returns(String) } + attr_accessor :scaling_factor + + # Second dimension value (optional) + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension_value + + # Configuration for a single matrix scaling factor + sig do + params( + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # First dimension value + first_dimension_value:, + # Scaling factor + scaling_factor:, + # Second dimension value (optional) + second_dimension_value: nil + ) + end + + sig do + override.returns( + { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: T.nilable(String) + } + ) + end + def to_hash + end + end + end end - class MaxGroupTieredPackage < Orb::Internal::Type::BaseModel + class ScalableMatrixWithTieredPricing < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::MaxGroupTieredPackage, Orb::Internal::AnyHash) + T.any( + Orb::Price::ScalableMatrixWithTieredPricing, + Orb::Internal::AnyHash + ) end sig { returns(String) } @@ -8485,17 +11347,29 @@ module Orb attr_writer :billing_cycle_configuration sig do - returns(Orb::Price::MaxGroupTieredPackage::Cadence::TaggedSymbol) + returns( + Orb::Price::ScalableMatrixWithTieredPricing::BillingMode::TaggedSymbol + ) + end + attr_accessor :billing_mode + + sig do + returns( + Orb::Price::ScalableMatrixWithTieredPricing::Cadence::TaggedSymbol + ) end attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( T.nilable( - Orb::Price::MaxGroupTieredPackage::ConversionRateConfig::Variants + Orb::Price::ScalableMatrixWithTieredPricing::ConversionRateConfig::Variants ) ) end @@ -8535,15 +11409,14 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item sig { params(item: Orb::ItemSlim::OrHash).void } attr_writer :item - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :max_group_tiered_package_config - sig { returns(T.nilable(Orb::Maximum)) } attr_reader :maximum @@ -8569,6 +11442,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -8579,7 +11453,9 @@ module Orb attr_accessor :plan_phase_order sig do - returns(Orb::Price::MaxGroupTieredPackage::PriceType::TaggedSymbol) + returns( + Orb::Price::ScalableMatrixWithTieredPricing::PriceType::TaggedSymbol + ) end attr_accessor :price_type @@ -8588,6 +11464,22 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :replaces_price_id + # Configuration for scalable_matrix_with_tiered_pricing pricing + sig do + returns( + Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig + ) + end + attr_reader :scalable_matrix_with_tiered_pricing_config + + sig do + params( + scalable_matrix_with_tiered_pricing_config: + Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::OrHash + ).void + end + attr_writer :scalable_matrix_with_tiered_pricing_config + sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) } attr_reader :dimensional_price_configuration @@ -8604,7 +11496,12 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::MaxGroupTieredPackage::Cadence::OrSymbol, + billing_mode: + Orb::Price::ScalableMatrixWithTieredPricing::BillingMode::OrSymbol, + cadence: + Orb::Price::ScalableMatrixWithTieredPricing::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -8630,7 +11527,6 @@ module Orb invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration::OrHash), item: Orb::ItemSlim::OrHash, - max_group_tiered_package_config: T::Hash[Symbol, T.anything], maximum: T.nilable(Orb::Maximum::OrHash), maximum_amount: T.nilable(String), metadata: T::Hash[Symbol, String], @@ -8638,8 +11534,11 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::MaxGroupTieredPackage::PriceType::OrSymbol, + price_type: + Orb::Price::ScalableMatrixWithTieredPricing::PriceType::OrSymbol, replaces_price_id: T.nilable(String), + scalable_matrix_with_tiered_pricing_config: + Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::OrHash, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -8649,7 +11548,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -8659,8 +11560,9 @@ module Orb external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, - max_group_tiered_package_config:, maximum:, maximum_amount:, # User specified key-value pairs for the resource. If not present, this defaults @@ -8676,8 +11578,11 @@ module Orb # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, + # Configuration for scalable_matrix_with_tiered_pricing pricing + scalable_matrix_with_tiered_pricing_config:, dimensional_price_configuration: nil, - model_type: :max_group_tiered_package + # The pricing model type + model_type: :scalable_matrix_with_tiered_pricing ) end @@ -8687,11 +11592,16 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::MaxGroupTieredPackage::Cadence::TaggedSymbol, + billing_mode: + Orb::Price::ScalableMatrixWithTieredPricing::BillingMode::TaggedSymbol, + cadence: + Orb::Price::ScalableMatrixWithTieredPricing::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( - Orb::Price::MaxGroupTieredPackage::ConversionRateConfig::Variants + Orb::Price::ScalableMatrixWithTieredPricing::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -8702,7 +11612,6 @@ module Orb invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, - max_group_tiered_package_config: T::Hash[Symbol, T.anything], maximum: T.nilable(Orb::Maximum), maximum_amount: T.nilable(String), metadata: T::Hash[Symbol, String], @@ -8712,8 +11621,10 @@ module Orb name: String, plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::MaxGroupTieredPackage::PriceType::TaggedSymbol, + Orb::Price::ScalableMatrixWithTieredPricing::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), + scalable_matrix_with_tiered_pricing_config: + Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -8722,116 +11633,314 @@ module Orb def to_hash end + module BillingMode + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::Price::ScalableMatrixWithTieredPricing::BillingMode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_ADVANCE = + T.let( + :in_advance, + Orb::Price::ScalableMatrixWithTieredPricing::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::ScalableMatrixWithTieredPricing::BillingMode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Price::ScalableMatrixWithTieredPricing::BillingMode::TaggedSymbol + ] + ) + end + def self.values + end + end + module Cadence extend Orb::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::MaxGroupTieredPackage::Cadence) + T.all( + Symbol, + Orb::Price::ScalableMatrixWithTieredPricing::Cadence + ) end OrSymbol = T.type_alias { T.any(Symbol, String) } ONE_TIME = T.let( :one_time, - Orb::Price::MaxGroupTieredPackage::Cadence::TaggedSymbol + Orb::Price::ScalableMatrixWithTieredPricing::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::MaxGroupTieredPackage::Cadence::TaggedSymbol + Orb::Price::ScalableMatrixWithTieredPricing::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::MaxGroupTieredPackage::Cadence::TaggedSymbol + Orb::Price::ScalableMatrixWithTieredPricing::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::MaxGroupTieredPackage::Cadence::TaggedSymbol + Orb::Price::ScalableMatrixWithTieredPricing::Cadence::TaggedSymbol ) ANNUAL = T.let( :annual, - Orb::Price::MaxGroupTieredPackage::Cadence::TaggedSymbol + Orb::Price::ScalableMatrixWithTieredPricing::Cadence::TaggedSymbol ) CUSTOM = T.let( :custom, - Orb::Price::MaxGroupTieredPackage::Cadence::TaggedSymbol + Orb::Price::ScalableMatrixWithTieredPricing::Cadence::TaggedSymbol ) sig do override.returns( - T::Array[Orb::Price::MaxGroupTieredPackage::Cadence::TaggedSymbol] + T::Array[ + Orb::Price::ScalableMatrixWithTieredPricing::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + module PriceType + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::Price::ScalableMatrixWithTieredPricing::PriceType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USAGE_PRICE = + T.let( + :usage_price, + Orb::Price::ScalableMatrixWithTieredPricing::PriceType::TaggedSymbol + ) + FIXED_PRICE = + T.let( + :fixed_price, + Orb::Price::ScalableMatrixWithTieredPricing::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::ScalableMatrixWithTieredPricing::PriceType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Price::ScalableMatrixWithTieredPricing::PriceType::TaggedSymbol + ] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class ScalableMatrixWithTieredPricingConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig, + Orb::Internal::AnyHash ) end + # Used for the scalable matrix first dimension + sig { returns(String) } + attr_accessor :first_dimension + + # Apply a scaling factor to each dimension sig do - override.returns( + returns( T::Array[ - Orb::Price::MaxGroupTieredPackage::ConversionRateConfig::Variants + Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor ] ) end - def self.variants - end - end + attr_accessor :matrix_scaling_factors - module PriceType - extend Orb::Internal::Type::Enum + # Tier pricing structure + sig do + returns( + T::Array[ + Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::Tier + ] + ) + end + attr_accessor :tiers - TaggedSymbol = - T.type_alias do - T.all(Symbol, Orb::Price::MaxGroupTieredPackage::PriceType) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } + # Used for the scalable matrix second dimension (optional) + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension - USAGE_PRICE = - T.let( - :usage_price, - Orb::Price::MaxGroupTieredPackage::PriceType::TaggedSymbol - ) - FIXED_PRICE = - T.let( - :fixed_price, - Orb::Price::MaxGroupTieredPackage::PriceType::TaggedSymbol - ) + # Configuration for scalable_matrix_with_tiered_pricing pricing + sig do + params( + first_dimension: String, + matrix_scaling_factors: + T::Array[ + Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor::OrHash + ], + tiers: + T::Array[ + Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::Tier::OrHash + ], + second_dimension: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Used for the scalable matrix first dimension + first_dimension:, + # Apply a scaling factor to each dimension + matrix_scaling_factors:, + # Tier pricing structure + tiers:, + # Used for the scalable matrix second dimension (optional) + second_dimension: nil + ) + end sig do override.returns( - T::Array[ - Orb::Price::MaxGroupTieredPackage::PriceType::TaggedSymbol - ] + { + first_dimension: String, + matrix_scaling_factors: + T::Array[ + Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor + ], + tiers: + T::Array[ + Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::Tier + ], + second_dimension: T.nilable(String) + } + ) + end + def to_hash + end + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor, + Orb::Internal::AnyHash + ) + end + + # First dimension value + sig { returns(String) } + attr_accessor :first_dimension_value + + # Scaling factor + sig { returns(String) } + attr_accessor :scaling_factor + + # Second dimension value (optional) + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension_value + + # Configuration for a single matrix scaling factor + sig do + params( + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # First dimension value + first_dimension_value:, + # Scaling factor + scaling_factor:, + # Second dimension value (optional) + second_dimension_value: nil ) + end + + sig do + override.returns( + { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: T.nilable(String) + } + ) + end + def to_hash + end end - def self.values + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tier entry with business logic + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Tier lower bound + tier_lower_bound:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns( + { tier_lower_bound: String, unit_amount: String } + ) + end + def to_hash + end end end end - class ScalableMatrixWithUnitPricing < Orb::Internal::Type::BaseModel + class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any( - Orb::Price::ScalableMatrixWithUnitPricing, - Orb::Internal::AnyHash - ) + T.any(Orb::Price::CumulativeGroupedBulk, Orb::Internal::AnyHash) end sig { returns(String) } @@ -8858,19 +11967,25 @@ module Orb attr_writer :billing_cycle_configuration sig do - returns( - Orb::Price::ScalableMatrixWithUnitPricing::Cadence::TaggedSymbol - ) + returns(Orb::Price::CumulativeGroupedBulk::BillingMode::TaggedSymbol) + end + attr_accessor :billing_mode + + sig do + returns(Orb::Price::CumulativeGroupedBulk::Cadence::TaggedSymbol) end attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( T.nilable( - Orb::Price::ScalableMatrixWithUnitPricing::ConversionRateConfig::Variants + Orb::Price::CumulativeGroupedBulk::ConversionRateConfig::Variants ) ) end @@ -8887,6 +12002,22 @@ module Orb end attr_writer :credit_allocation + # Configuration for cumulative_grouped_bulk pricing + sig do + returns( + Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig + ) + end + attr_reader :cumulative_grouped_bulk_config + + sig do + params( + cumulative_grouped_bulk_config: + Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig::OrHash + ).void + end + attr_writer :cumulative_grouped_bulk_config + sig { returns(String) } attr_accessor :currency @@ -8910,6 +12041,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -8941,6 +12074,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -8951,9 +12085,7 @@ module Orb attr_accessor :plan_phase_order sig do - returns( - Orb::Price::ScalableMatrixWithUnitPricing::PriceType::TaggedSymbol - ) + returns(Orb::Price::CumulativeGroupedBulk::PriceType::TaggedSymbol) end attr_accessor :price_type @@ -8962,9 +12094,6 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :replaces_price_id - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :scalable_matrix_with_unit_pricing_config - sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) } attr_reader :dimensional_price_configuration @@ -8981,8 +12110,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: - Orb::Price::ScalableMatrixWithUnitPricing::Cadence::OrSymbol, + billing_mode: + Orb::Price::CumulativeGroupedBulk::BillingMode::OrSymbol, + cadence: Orb::Price::CumulativeGroupedBulk::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -8993,6 +12125,8 @@ module Orb ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation::OrHash), + cumulative_grouped_bulk_config: + Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig::OrHash, currency: String, discount: T.nilable( @@ -9015,11 +12149,8 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: - Orb::Price::ScalableMatrixWithUnitPricing::PriceType::OrSymbol, + price_type: Orb::Price::CumulativeGroupedBulk::PriceType::OrSymbol, replaces_price_id: T.nilable(String), - scalable_matrix_with_unit_pricing_config: - T::Hash[Symbol, T.anything], dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -9029,16 +12160,22 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, + # Configuration for cumulative_grouped_bulk pricing + cumulative_grouped_bulk_config:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -9055,9 +12192,9 @@ module Orb # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, - scalable_matrix_with_unit_pricing_config:, dimensional_price_configuration: nil, - model_type: :scalable_matrix_with_unit_pricing + # The pricing model type + model_type: :cumulative_grouped_bulk ) end @@ -9067,15 +12204,20 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: - Orb::Price::ScalableMatrixWithUnitPricing::Cadence::TaggedSymbol, + billing_mode: + Orb::Price::CumulativeGroupedBulk::BillingMode::TaggedSymbol, + cadence: Orb::Price::CumulativeGroupedBulk::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( - Orb::Price::ScalableMatrixWithUnitPricing::ConversionRateConfig::Variants + Orb::Price::CumulativeGroupedBulk::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), + cumulative_grouped_bulk_config: + Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig, currency: String, discount: T.nilable(Orb::Discount::Variants), external_price_id: T.nilable(String), @@ -9092,10 +12234,8 @@ module Orb name: String, plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::ScalableMatrixWithUnitPricing::PriceType::TaggedSymbol, + Orb::Price::CumulativeGroupedBulk::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), - scalable_matrix_with_unit_pricing_config: - T::Hash[Symbol, T.anything], dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -9104,76 +12244,191 @@ module Orb def to_hash end + module BillingMode + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Orb::Price::CumulativeGroupedBulk::BillingMode) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_ADVANCE = + T.let( + :in_advance, + Orb::Price::CumulativeGroupedBulk::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::CumulativeGroupedBulk::BillingMode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Price::CumulativeGroupedBulk::BillingMode::TaggedSymbol + ] + ) + end + def self.values + end + end + module Cadence extend Orb::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::ScalableMatrixWithUnitPricing::Cadence) + T.all(Symbol, Orb::Price::CumulativeGroupedBulk::Cadence) end OrSymbol = T.type_alias { T.any(Symbol, String) } ONE_TIME = T.let( :one_time, - Orb::Price::ScalableMatrixWithUnitPricing::Cadence::TaggedSymbol + Orb::Price::CumulativeGroupedBulk::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::ScalableMatrixWithUnitPricing::Cadence::TaggedSymbol + Orb::Price::CumulativeGroupedBulk::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::ScalableMatrixWithUnitPricing::Cadence::TaggedSymbol + Orb::Price::CumulativeGroupedBulk::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::ScalableMatrixWithUnitPricing::Cadence::TaggedSymbol + Orb::Price::CumulativeGroupedBulk::Cadence::TaggedSymbol ) ANNUAL = T.let( :annual, - Orb::Price::ScalableMatrixWithUnitPricing::Cadence::TaggedSymbol + Orb::Price::CumulativeGroupedBulk::Cadence::TaggedSymbol ) CUSTOM = T.let( :custom, - Orb::Price::ScalableMatrixWithUnitPricing::Cadence::TaggedSymbol + Orb::Price::CumulativeGroupedBulk::Cadence::TaggedSymbol ) sig do override.returns( - T::Array[ - Orb::Price::ScalableMatrixWithUnitPricing::Cadence::TaggedSymbol - ] + T::Array[Orb::Price::CumulativeGroupedBulk::Cadence::TaggedSymbol] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class CumulativeGroupedBulkConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig, + Orb::Internal::AnyHash ) end + # Each tier lower bound must have the same group of values. sig do - override.returns( + returns( T::Array[ - Orb::Price::ScalableMatrixWithUnitPricing::ConversionRateConfig::Variants + Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig::DimensionValue ] ) end - def self.variants + attr_accessor :dimension_values + + # Grouping key name + sig { returns(String) } + attr_accessor :group + + # Configuration for cumulative_grouped_bulk pricing + sig do + params( + dimension_values: + T::Array[ + Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig::DimensionValue::OrHash + ], + group: String + ).returns(T.attached_class) + end + def self.new( + # Each tier lower bound must have the same group of values. + dimension_values:, + # Grouping key name + group: + ) + end + + sig do + override.returns( + { + dimension_values: + T::Array[ + Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig::DimensionValue + ], + group: String + } + ) + end + def to_hash + end + + class DimensionValue < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig::DimensionValue, + Orb::Internal::AnyHash + ) + end + + # Grouping key value + sig { returns(String) } + attr_accessor :grouping_key + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Unit amount for this combination + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a dimension value entry + sig do + params( + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + ).returns(T.attached_class) + end + def self.new( + # Grouping key value + grouping_key:, + # Tier lower bound + tier_lower_bound:, + # Unit amount for this combination + unit_amount: + ) + end + + sig do + override.returns( + { + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + } + ) + end + def to_hash + end end end @@ -9182,28 +12437,30 @@ module Orb TaggedSymbol = T.type_alias do - T.all( - Symbol, - Orb::Price::ScalableMatrixWithUnitPricing::PriceType - ) + T.all(Symbol, Orb::Price::CumulativeGroupedBulk::PriceType) end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::ScalableMatrixWithUnitPricing::PriceType::TaggedSymbol + Orb::Price::CumulativeGroupedBulk::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::ScalableMatrixWithUnitPricing::PriceType::TaggedSymbol + Orb::Price::CumulativeGroupedBulk::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::CumulativeGroupedBulk::PriceType::TaggedSymbol ) sig do override.returns( T::Array[ - Orb::Price::ScalableMatrixWithUnitPricing::PriceType::TaggedSymbol + Orb::Price::CumulativeGroupedBulk::PriceType::TaggedSymbol ] ) end @@ -9212,14 +12469,9 @@ module Orb end end - class ScalableMatrixWithTieredPricing < Orb::Internal::Type::BaseModel + class Minimum < Orb::Internal::Type::BaseModel OrHash = - T.type_alias do - T.any( - Orb::Price::ScalableMatrixWithTieredPricing, - Orb::Internal::AnyHash - ) - end + T.type_alias { T.any(Orb::Price::Minimum, Orb::Internal::AnyHash) } sig { returns(String) } attr_accessor :id @@ -9244,21 +12496,21 @@ module Orb end attr_writer :billing_cycle_configuration - sig do - returns( - Orb::Price::ScalableMatrixWithTieredPricing::Cadence::TaggedSymbol - ) - end + sig { returns(Orb::Price::Minimum::BillingMode::TaggedSymbol) } + attr_accessor :billing_mode + + sig { returns(Orb::Price::Minimum::Cadence::TaggedSymbol) } attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( - T.nilable( - Orb::Price::ScalableMatrixWithTieredPricing::ConversionRateConfig::Variants - ) + T.nilable(Orb::Price::Minimum::ConversionRateConfig::Variants) ) end attr_accessor :conversion_rate_config @@ -9297,6 +12549,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -9328,6 +12582,18 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # Configuration for minimum pricing + sig { returns(Orb::Price::Minimum::MinimumConfig) } + attr_reader :minimum_config + + sig do + params( + minimum_config: Orb::Price::Minimum::MinimumConfig::OrHash + ).void + end + attr_writer :minimum_config + + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -9337,11 +12603,7 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig do - returns( - Orb::Price::ScalableMatrixWithTieredPricing::PriceType::TaggedSymbol - ) - end + sig { returns(Orb::Price::Minimum::PriceType::TaggedSymbol) } attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -9349,9 +12611,6 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :replaces_price_id - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :scalable_matrix_with_tiered_pricing_config - sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) } attr_reader :dimensional_price_configuration @@ -9368,8 +12627,10 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: - Orb::Price::ScalableMatrixWithTieredPricing::Cadence::OrSymbol, + billing_mode: Orb::Price::Minimum::BillingMode::OrSymbol, + cadence: Orb::Price::Minimum::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -9400,13 +12661,11 @@ module Orb metadata: T::Hash[Symbol, String], minimum: T.nilable(Orb::Minimum::OrHash), minimum_amount: T.nilable(String), + minimum_config: Orb::Price::Minimum::MinimumConfig::OrHash, name: String, plan_phase_order: T.nilable(Integer), - price_type: - Orb::Price::ScalableMatrixWithTieredPricing::PriceType::OrSymbol, + price_type: Orb::Price::Minimum::PriceType::OrSymbol, replaces_price_id: T.nilable(String), - scalable_matrix_with_tiered_pricing_config: - T::Hash[Symbol, T.anything], dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -9416,7 +12675,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -9426,6 +12687,8 @@ module Orb external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -9436,15 +12699,17 @@ module Orb metadata:, minimum:, minimum_amount:, + # Configuration for minimum pricing + minimum_config:, name:, plan_phase_order:, price_type:, # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, - scalable_matrix_with_tiered_pricing_config:, dimensional_price_configuration: nil, - model_type: :scalable_matrix_with_tiered_pricing + # The pricing model type + model_type: :minimum ) end @@ -9454,13 +12719,13 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: - Orb::Price::ScalableMatrixWithTieredPricing::Cadence::TaggedSymbol, + billing_mode: Orb::Price::Minimum::BillingMode::TaggedSymbol, + cadence: Orb::Price::Minimum::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: - T.nilable( - Orb::Price::ScalableMatrixWithTieredPricing::ConversionRateConfig::Variants - ), + T.nilable(Orb::Price::Minimum::ConversionRateConfig::Variants), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), currency: String, @@ -9475,14 +12740,12 @@ module Orb metadata: T::Hash[Symbol, String], minimum: T.nilable(Orb::Minimum), minimum_amount: T.nilable(String), + minimum_config: Orb::Price::Minimum::MinimumConfig, model_type: Symbol, name: String, plan_phase_order: T.nilable(Integer), - price_type: - Orb::Price::ScalableMatrixWithTieredPricing::PriceType::TaggedSymbol, + price_type: Orb::Price::Minimum::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), - scalable_matrix_with_tiered_pricing_config: - T::Hash[Symbol, T.anything], dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -9491,79 +12754,88 @@ module Orb def to_hash end - module Cadence + module BillingMode extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias do - T.all( - Symbol, - Orb::Price::ScalableMatrixWithTieredPricing::Cadence - ) - end + T.type_alias { T.all(Symbol, Orb::Price::Minimum::BillingMode) } OrSymbol = T.type_alias { T.any(Symbol, String) } - ONE_TIME = - T.let( - :one_time, - Orb::Price::ScalableMatrixWithTieredPricing::Cadence::TaggedSymbol - ) - MONTHLY = - T.let( - :monthly, - Orb::Price::ScalableMatrixWithTieredPricing::Cadence::TaggedSymbol + IN_ADVANCE = + T.let(:in_advance, Orb::Price::Minimum::BillingMode::TaggedSymbol) + IN_ARREAR = + T.let(:in_arrear, Orb::Price::Minimum::BillingMode::TaggedSymbol) + + sig do + override.returns( + T::Array[Orb::Price::Minimum::BillingMode::TaggedSymbol] ) + end + def self.values + end + end + + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Orb::Price::Minimum::Cadence) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ONE_TIME = + T.let(:one_time, Orb::Price::Minimum::Cadence::TaggedSymbol) + MONTHLY = T.let(:monthly, Orb::Price::Minimum::Cadence::TaggedSymbol) QUARTERLY = - T.let( - :quarterly, - Orb::Price::ScalableMatrixWithTieredPricing::Cadence::TaggedSymbol - ) + T.let(:quarterly, Orb::Price::Minimum::Cadence::TaggedSymbol) SEMI_ANNUAL = - T.let( - :semi_annual, - Orb::Price::ScalableMatrixWithTieredPricing::Cadence::TaggedSymbol - ) - ANNUAL = - T.let( - :annual, - Orb::Price::ScalableMatrixWithTieredPricing::Cadence::TaggedSymbol - ) - CUSTOM = - T.let( - :custom, - Orb::Price::ScalableMatrixWithTieredPricing::Cadence::TaggedSymbol - ) + T.let(:semi_annual, Orb::Price::Minimum::Cadence::TaggedSymbol) + ANNUAL = T.let(:annual, Orb::Price::Minimum::Cadence::TaggedSymbol) + CUSTOM = T.let(:custom, Orb::Price::Minimum::Cadence::TaggedSymbol) sig do override.returns( - T::Array[ - Orb::Price::ScalableMatrixWithTieredPricing::Cadence::TaggedSymbol - ] + T::Array[Orb::Price::Minimum::Cadence::TaggedSymbol] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class MinimumConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) + T.any(Orb::Price::Minimum::MinimumConfig, Orb::Internal::AnyHash) end + # The minimum amount to apply + sig { returns(String) } + attr_accessor :minimum_amount + + # If true, subtotals from this price are prorated based on the service period + sig { returns(T.nilable(T::Boolean)) } + attr_reader :prorated + + sig { params(prorated: T::Boolean).void } + attr_writer :prorated + + # Configuration for minimum pricing sig do - override.returns( - T::Array[ - Orb::Price::ScalableMatrixWithTieredPricing::ConversionRateConfig::Variants - ] + params(minimum_amount: String, prorated: T::Boolean).returns( + T.attached_class ) end - def self.variants + def self.new( + # The minimum amount to apply + minimum_amount:, + # If true, subtotals from this price are prorated based on the service period + prorated: nil + ) + end + + sig do + override.returns({ minimum_amount: String, prorated: T::Boolean }) + end + def to_hash end end @@ -9571,30 +12843,22 @@ module Orb extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias do - T.all( - Symbol, - Orb::Price::ScalableMatrixWithTieredPricing::PriceType - ) - end + T.type_alias { T.all(Symbol, Orb::Price::Minimum::PriceType) } OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = - T.let( - :usage_price, - Orb::Price::ScalableMatrixWithTieredPricing::PriceType::TaggedSymbol - ) + T.let(:usage_price, Orb::Price::Minimum::PriceType::TaggedSymbol) FIXED_PRICE = + T.let(:fixed_price, Orb::Price::Minimum::PriceType::TaggedSymbol) + COMPOSITE_PRICE = T.let( - :fixed_price, - Orb::Price::ScalableMatrixWithTieredPricing::PriceType::TaggedSymbol + :composite_price, + Orb::Price::Minimum::PriceType::TaggedSymbol ) sig do override.returns( - T::Array[ - Orb::Price::ScalableMatrixWithTieredPricing::PriceType::TaggedSymbol - ] + T::Array[Orb::Price::Minimum::PriceType::TaggedSymbol] ) end def self.values @@ -9602,11 +12866,9 @@ module Orb end end - class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel + class Percent < Orb::Internal::Type::BaseModel OrHash = - T.type_alias do - T.any(Orb::Price::CumulativeGroupedBulk, Orb::Internal::AnyHash) - end + T.type_alias { T.any(Orb::Price::Percent, Orb::Internal::AnyHash) } sig { returns(String) } attr_accessor :id @@ -9631,19 +12893,21 @@ module Orb end attr_writer :billing_cycle_configuration - sig do - returns(Orb::Price::CumulativeGroupedBulk::Cadence::TaggedSymbol) - end + sig { returns(Orb::Price::Percent::BillingMode::TaggedSymbol) } + attr_accessor :billing_mode + + sig { returns(Orb::Price::Percent::Cadence::TaggedSymbol) } attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( - T.nilable( - Orb::Price::CumulativeGroupedBulk::ConversionRateConfig::Variants - ) + T.nilable(Orb::Price::Percent::ConversionRateConfig::Variants) ) end attr_accessor :conversion_rate_config @@ -9659,9 +12923,6 @@ module Orb end attr_writer :credit_allocation - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :cumulative_grouped_bulk_config - sig { returns(String) } attr_accessor :currency @@ -9685,6 +12946,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -9716,18 +12979,28 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type sig { returns(String) } attr_accessor :name - sig { returns(T.nilable(Integer)) } - attr_accessor :plan_phase_order + # Configuration for percent pricing + sig { returns(Orb::Price::Percent::PercentConfig) } + attr_reader :percent_config sig do - returns(Orb::Price::CumulativeGroupedBulk::PriceType::TaggedSymbol) + params( + percent_config: Orb::Price::Percent::PercentConfig::OrHash + ).void end + attr_writer :percent_config + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Orb::Price::Percent::PriceType::TaggedSymbol) } attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -9751,7 +13024,10 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::CumulativeGroupedBulk::Cadence::OrSymbol, + billing_mode: Orb::Price::Percent::BillingMode::OrSymbol, + cadence: Orb::Price::Percent::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -9762,7 +13038,6 @@ module Orb ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation::OrHash), - cumulative_grouped_bulk_config: T::Hash[Symbol, T.anything], currency: String, discount: T.nilable( @@ -9784,8 +13059,9 @@ module Orb minimum: T.nilable(Orb::Minimum::OrHash), minimum_amount: T.nilable(String), name: String, + percent_config: Orb::Price::Percent::PercentConfig::OrHash, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::CumulativeGroupedBulk::PriceType::OrSymbol, + price_type: Orb::Price::Percent::PriceType::OrSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), @@ -9796,17 +13072,20 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, - cumulative_grouped_bulk_config:, currency:, discount:, external_price_id:, fixed_price_quantity:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -9818,13 +13097,16 @@ module Orb minimum:, minimum_amount:, name:, + # Configuration for percent pricing + percent_config:, plan_phase_order:, price_type:, # The price id this price replaces. This price will take the place of the replaced # price in plan version migrations. replaces_price_id:, dimensional_price_configuration: nil, - model_type: :cumulative_grouped_bulk + # The pricing model type + model_type: :percent ) end @@ -9834,15 +13116,15 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::CumulativeGroupedBulk::Cadence::TaggedSymbol, + billing_mode: Orb::Price::Percent::BillingMode::TaggedSymbol, + cadence: Orb::Price::Percent::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: - T.nilable( - Orb::Price::CumulativeGroupedBulk::ConversionRateConfig::Variants - ), + T.nilable(Orb::Price::Percent::ConversionRateConfig::Variants), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), - cumulative_grouped_bulk_config: T::Hash[Symbol, T.anything], currency: String, discount: T.nilable(Orb::Discount::Variants), external_price_id: T.nilable(String), @@ -9857,9 +13139,9 @@ module Orb minimum_amount: T.nilable(String), model_type: Symbol, name: String, + percent_config: Orb::Price::Percent::PercentConfig, plan_phase_order: T.nilable(Integer), - price_type: - Orb::Price::CumulativeGroupedBulk::PriceType::TaggedSymbol, + price_type: Orb::Price::Percent::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) @@ -9869,74 +13151,73 @@ module Orb def to_hash end + module BillingMode + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Orb::Price::Percent::BillingMode) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_ADVANCE = + T.let(:in_advance, Orb::Price::Percent::BillingMode::TaggedSymbol) + IN_ARREAR = + T.let(:in_arrear, Orb::Price::Percent::BillingMode::TaggedSymbol) + + sig do + override.returns( + T::Array[Orb::Price::Percent::BillingMode::TaggedSymbol] + ) + end + def self.values + end + end + module Cadence extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias do - T.all(Symbol, Orb::Price::CumulativeGroupedBulk::Cadence) - end + T.type_alias { T.all(Symbol, Orb::Price::Percent::Cadence) } OrSymbol = T.type_alias { T.any(Symbol, String) } ONE_TIME = - T.let( - :one_time, - Orb::Price::CumulativeGroupedBulk::Cadence::TaggedSymbol - ) - MONTHLY = - T.let( - :monthly, - Orb::Price::CumulativeGroupedBulk::Cadence::TaggedSymbol - ) + T.let(:one_time, Orb::Price::Percent::Cadence::TaggedSymbol) + MONTHLY = T.let(:monthly, Orb::Price::Percent::Cadence::TaggedSymbol) QUARTERLY = - T.let( - :quarterly, - Orb::Price::CumulativeGroupedBulk::Cadence::TaggedSymbol - ) + T.let(:quarterly, Orb::Price::Percent::Cadence::TaggedSymbol) SEMI_ANNUAL = - T.let( - :semi_annual, - Orb::Price::CumulativeGroupedBulk::Cadence::TaggedSymbol - ) - ANNUAL = - T.let( - :annual, - Orb::Price::CumulativeGroupedBulk::Cadence::TaggedSymbol - ) - CUSTOM = - T.let( - :custom, - Orb::Price::CumulativeGroupedBulk::Cadence::TaggedSymbol - ) + T.let(:semi_annual, Orb::Price::Percent::Cadence::TaggedSymbol) + ANNUAL = T.let(:annual, Orb::Price::Percent::Cadence::TaggedSymbol) + CUSTOM = T.let(:custom, Orb::Price::Percent::Cadence::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::CumulativeGroupedBulk::Cadence::TaggedSymbol] + T::Array[Orb::Price::Percent::Cadence::TaggedSymbol] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class PercentConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig - ) + T.any(Orb::Price::Percent::PercentConfig, Orb::Internal::AnyHash) end - sig do - override.returns( - T::Array[ - Orb::Price::CumulativeGroupedBulk::ConversionRateConfig::Variants - ] - ) + # What percent of the component subtotals to charge + sig { returns(Float) } + attr_accessor :percent + + # Configuration for percent pricing + sig { params(percent: Float).returns(T.attached_class) } + def self.new( + # What percent of the component subtotals to charge + percent: + ) end - def self.variants + + sig { override.returns({ percent: Float }) } + def to_hash end end @@ -9944,27 +13225,22 @@ module Orb extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias do - T.all(Symbol, Orb::Price::CumulativeGroupedBulk::PriceType) - end + T.type_alias { T.all(Symbol, Orb::Price::Percent::PriceType) } OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = - T.let( - :usage_price, - Orb::Price::CumulativeGroupedBulk::PriceType::TaggedSymbol - ) + T.let(:usage_price, Orb::Price::Percent::PriceType::TaggedSymbol) FIXED_PRICE = + T.let(:fixed_price, Orb::Price::Percent::PriceType::TaggedSymbol) + COMPOSITE_PRICE = T.let( - :fixed_price, - Orb::Price::CumulativeGroupedBulk::PriceType::TaggedSymbol + :composite_price, + Orb::Price::Percent::PriceType::TaggedSymbol ) sig do override.returns( - T::Array[ - Orb::Price::CumulativeGroupedBulk::PriceType::TaggedSymbol - ] + T::Array[Orb::Price::Percent::PriceType::TaggedSymbol] ) end def self.values @@ -9972,13 +13248,10 @@ module Orb end end - class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + class EventOutput < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any( - Orb::Price::GroupedWithMinMaxThresholds, - Orb::Internal::AnyHash - ) + T.any(Orb::Price::EventOutput, Orb::Internal::AnyHash) end sig { returns(String) } @@ -10004,21 +13277,21 @@ module Orb end attr_writer :billing_cycle_configuration - sig do - returns( - Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol - ) - end + sig { returns(Orb::Price::EventOutput::BillingMode::TaggedSymbol) } + attr_accessor :billing_mode + + sig { returns(Orb::Price::EventOutput::Cadence::TaggedSymbol) } attr_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate sig do returns( - T.nilable( - Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig::Variants - ) + T.nilable(Orb::Price::EventOutput::ConversionRateConfig::Variants) ) end attr_accessor :conversion_rate_config @@ -10040,15 +13313,24 @@ module Orb sig { returns(T.nilable(Orb::Discount::Variants)) } attr_accessor :discount + # Configuration for event_output pricing + sig { returns(Orb::Price::EventOutput::EventOutputConfig) } + attr_reader :event_output_config + + sig do + params( + event_output_config: + Orb::Price::EventOutput::EventOutputConfig::OrHash + ).void + end + attr_writer :event_output_config + sig { returns(T.nilable(String)) } attr_accessor :external_price_id sig { returns(T.nilable(Float)) } attr_accessor :fixed_price_quantity - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_with_min_max_thresholds_config - sig { returns(T.nilable(Orb::BillingCycleConfiguration)) } attr_reader :invoicing_cycle_configuration @@ -10060,6 +13342,8 @@ module Orb end attr_writer :invoicing_cycle_configuration + # A minimal representation of an Item containing only the essential identifying + # information. sig { returns(Orb::ItemSlim) } attr_reader :item @@ -10091,6 +13375,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -10100,11 +13385,7 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig do - returns( - Orb::Price::GroupedWithMinMaxThresholds::PriceType::TaggedSymbol - ) - end + sig { returns(Orb::Price::EventOutput::PriceType::TaggedSymbol) } attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -10128,7 +13409,10 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + billing_mode: Orb::Price::EventOutput::BillingMode::OrSymbol, + cadence: Orb::Price::EventOutput::Cadence::OrSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter::OrHash]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( @@ -10149,9 +13433,10 @@ module Orb Orb::AmountDiscount::OrHash ) ), + event_output_config: + Orb::Price::EventOutput::EventOutputConfig::OrHash, external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), - grouped_with_min_max_thresholds_config: T::Hash[Symbol, T.anything], invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration::OrHash), item: Orb::ItemSlim::OrHash, @@ -10162,8 +13447,7 @@ module Orb minimum_amount: T.nilable(String), name: String, plan_phase_order: T.nilable(Integer), - price_type: - Orb::Price::GroupedWithMinMaxThresholds::PriceType::OrSymbol, + price_type: Orb::Price::EventOutput::PriceType::OrSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), @@ -10174,17 +13458,22 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, credit_allocation:, currency:, discount:, + # Configuration for event_output pricing + event_output_config:, external_price_id:, fixed_price_quantity:, - grouped_with_min_max_thresholds_config:, invoicing_cycle_configuration:, + # A minimal representation of an Item containing only the essential identifying + # information. item:, maximum:, maximum_amount:, @@ -10202,7 +13491,8 @@ module Orb # price in plan version migrations. replaces_price_id:, dimensional_price_configuration: nil, - model_type: :grouped_with_min_max_thresholds + # The pricing model type + model_type: :event_output ) end @@ -10212,21 +13502,22 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: - Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol, + billing_mode: Orb::Price::EventOutput::BillingMode::TaggedSymbol, + cadence: Orb::Price::EventOutput::Cadence::TaggedSymbol, + composite_price_filters: + T.nilable(T::Array[Orb::TransformPriceFilter]), conversion_rate: T.nilable(Float), conversion_rate_config: T.nilable( - Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig::Variants + Orb::Price::EventOutput::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), currency: String, discount: T.nilable(Orb::Discount::Variants), + event_output_config: Orb::Price::EventOutput::EventOutputConfig, external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), - grouped_with_min_max_thresholds_config: - T::Hash[Symbol, T.anything], invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, @@ -10238,8 +13529,7 @@ module Orb model_type: Symbol, name: String, plan_phase_order: T.nilable(Integer), - price_type: - Orb::Price::GroupedWithMinMaxThresholds::PriceType::TaggedSymbol, + price_type: Orb::Price::EventOutput::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) @@ -10249,76 +13539,102 @@ module Orb def to_hash end - module Cadence + module BillingMode extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias do - T.all(Symbol, Orb::Price::GroupedWithMinMaxThresholds::Cadence) - end + T.type_alias { T.all(Symbol, Orb::Price::EventOutput::BillingMode) } OrSymbol = T.type_alias { T.any(Symbol, String) } - ONE_TIME = + IN_ADVANCE = T.let( - :one_time, - Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + :in_advance, + Orb::Price::EventOutput::BillingMode::TaggedSymbol ) - MONTHLY = + IN_ARREAR = T.let( - :monthly, - Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + :in_arrear, + Orb::Price::EventOutput::BillingMode::TaggedSymbol ) - QUARTERLY = - T.let( - :quarterly, - Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + + sig do + override.returns( + T::Array[Orb::Price::EventOutput::BillingMode::TaggedSymbol] ) + end + def self.values + end + end + + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Orb::Price::EventOutput::Cadence) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ONE_TIME = + T.let(:one_time, Orb::Price::EventOutput::Cadence::TaggedSymbol) + MONTHLY = + T.let(:monthly, Orb::Price::EventOutput::Cadence::TaggedSymbol) + QUARTERLY = + T.let(:quarterly, Orb::Price::EventOutput::Cadence::TaggedSymbol) SEMI_ANNUAL = - T.let( - :semi_annual, - Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol - ) + T.let(:semi_annual, Orb::Price::EventOutput::Cadence::TaggedSymbol) ANNUAL = - T.let( - :annual, - Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol - ) + T.let(:annual, Orb::Price::EventOutput::Cadence::TaggedSymbol) CUSTOM = - T.let( - :custom, - Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol - ) + T.let(:custom, Orb::Price::EventOutput::Cadence::TaggedSymbol) sig do override.returns( - T::Array[ - Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol - ] + T::Array[Orb::Price::EventOutput::Cadence::TaggedSymbol] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union - - Variants = + class EventOutputConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::Price::EventOutput::EventOutputConfig, + Orb::Internal::AnyHash ) end + # The key in the event data to extract the unit rate from. + sig { returns(String) } + attr_accessor :unit_rating_key + + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + sig { returns(T.nilable(String)) } + attr_accessor :grouping_key + + # Configuration for event_output pricing + sig do + params( + unit_rating_key: String, + grouping_key: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The key in the event data to extract the unit rate from. + unit_rating_key:, + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + grouping_key: nil + ) + end + sig do override.returns( - T::Array[ - Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig::Variants - ] + { unit_rating_key: String, grouping_key: T.nilable(String) } ) end - def self.variants + def to_hash end end @@ -10326,27 +13642,28 @@ module Orb extend Orb::Internal::Type::Enum TaggedSymbol = - T.type_alias do - T.all(Symbol, Orb::Price::GroupedWithMinMaxThresholds::PriceType) - end + T.type_alias { T.all(Symbol, Orb::Price::EventOutput::PriceType) } OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::GroupedWithMinMaxThresholds::PriceType::TaggedSymbol + Orb::Price::EventOutput::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::GroupedWithMinMaxThresholds::PriceType::TaggedSymbol + Orb::Price::EventOutput::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::EventOutput::PriceType::TaggedSymbol ) sig do override.returns( - T::Array[ - Orb::Price::GroupedWithMinMaxThresholds::PriceType::TaggedSymbol - ] + T::Array[Orb::Price::EventOutput::PriceType::TaggedSymbol] ) end def self.values diff --git a/rbi/orb/models/price_create_params.rbi b/rbi/orb/models/price_create_params.rbi index c839108a..839cb2f1 100644 --- a/rbi/orb/models/price_create_params.rbi +++ b/rbi/orb/models/price_create_params.rbi @@ -21,6 +21,7 @@ module Orb sig { returns(String) } attr_accessor :item_id + # The pricing model type sig { returns(Orb::PriceCreateParams::ModelType::OrSymbol) } attr_accessor :model_type @@ -28,6 +29,7 @@ module Orb sig { returns(String) } attr_accessor :name + # Configuration for unit pricing sig { returns(Orb::UnitConfig) } attr_reader :unit_config @@ -118,18 +120,119 @@ module Orb sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } attr_accessor :metadata + # Configuration for tiered pricing + sig { returns(Orb::TieredConfig) } + attr_reader :tiered_config + + sig { params(tiered_config: Orb::TieredConfig::OrHash).void } + attr_writer :tiered_config + + # Configuration for bulk pricing + sig { returns(Orb::BulkConfig) } + attr_reader :bulk_config + + sig { params(bulk_config: Orb::BulkConfig::OrHash).void } + attr_writer :bulk_config + + # Configuration for package pricing sig { returns(Orb::PackageConfig) } attr_reader :package_config sig { params(package_config: Orb::PackageConfig::OrHash).void } attr_writer :package_config + # Configuration for matrix pricing sig { returns(Orb::MatrixConfig) } attr_reader :matrix_config sig { params(matrix_config: Orb::MatrixConfig::OrHash).void } attr_writer :matrix_config + # Configuration for threshold_total_amount pricing + sig { returns(Orb::PriceCreateParams::ThresholdTotalAmountConfig) } + attr_reader :threshold_total_amount_config + + sig do + params( + threshold_total_amount_config: + Orb::PriceCreateParams::ThresholdTotalAmountConfig::OrHash + ).void + end + attr_writer :threshold_total_amount_config + + # Configuration for tiered_package pricing + sig { returns(Orb::PriceCreateParams::TieredPackageConfig) } + attr_reader :tiered_package_config + + sig do + params( + tiered_package_config: + Orb::PriceCreateParams::TieredPackageConfig::OrHash + ).void + end + attr_writer :tiered_package_config + + # Configuration for tiered_with_minimum pricing + sig { returns(Orb::PriceCreateParams::TieredWithMinimumConfig) } + attr_reader :tiered_with_minimum_config + + sig do + params( + tiered_with_minimum_config: + Orb::PriceCreateParams::TieredWithMinimumConfig::OrHash + ).void + end + attr_writer :tiered_with_minimum_config + + # Configuration for grouped_tiered pricing + sig { returns(Orb::PriceCreateParams::GroupedTieredConfig) } + attr_reader :grouped_tiered_config + + sig do + params( + grouped_tiered_config: + Orb::PriceCreateParams::GroupedTieredConfig::OrHash + ).void + end + attr_writer :grouped_tiered_config + + # Configuration for tiered_package_with_minimum pricing + sig { returns(Orb::PriceCreateParams::TieredPackageWithMinimumConfig) } + attr_reader :tiered_package_with_minimum_config + + sig do + params( + tiered_package_with_minimum_config: + Orb::PriceCreateParams::TieredPackageWithMinimumConfig::OrHash + ).void + end + attr_writer :tiered_package_with_minimum_config + + # Configuration for package_with_allocation pricing + sig { returns(Orb::PriceCreateParams::PackageWithAllocationConfig) } + attr_reader :package_with_allocation_config + + sig do + params( + package_with_allocation_config: + Orb::PriceCreateParams::PackageWithAllocationConfig::OrHash + ).void + end + attr_writer :package_with_allocation_config + + # Configuration for unit_with_percent pricing + sig { returns(Orb::PriceCreateParams::UnitWithPercentConfig) } + attr_reader :unit_with_percent_config + + sig do + params( + unit_with_percent_config: + Orb::PriceCreateParams::UnitWithPercentConfig::OrHash + ).void + end + attr_writer :unit_with_percent_config + + # Configuration for matrix_with_allocation pricing sig { returns(Orb::MatrixWithAllocationConfig) } attr_reader :matrix_with_allocation_config @@ -140,92 +243,198 @@ module Orb end attr_writer :matrix_with_allocation_config - sig { returns(Orb::TieredConfig) } - attr_reader :tiered_config + # Configuration for tiered_with_proration pricing + sig { returns(Orb::PriceCreateParams::TieredWithProrationConfig) } + attr_reader :tiered_with_proration_config - sig { params(tiered_config: Orb::TieredConfig::OrHash).void } - attr_writer :tiered_config + sig do + params( + tiered_with_proration_config: + Orb::PriceCreateParams::TieredWithProrationConfig::OrHash + ).void + end + attr_writer :tiered_with_proration_config + + # Configuration for unit_with_proration pricing + sig { returns(Orb::PriceCreateParams::UnitWithProrationConfig) } + attr_reader :unit_with_proration_config + + sig do + params( + unit_with_proration_config: + Orb::PriceCreateParams::UnitWithProrationConfig::OrHash + ).void + end + attr_writer :unit_with_proration_config - sig { returns(Orb::TieredBPSConfig) } - attr_reader :tiered_bps_config + # Configuration for grouped_allocation pricing + sig { returns(Orb::PriceCreateParams::GroupedAllocationConfig) } + attr_reader :grouped_allocation_config + + sig do + params( + grouped_allocation_config: + Orb::PriceCreateParams::GroupedAllocationConfig::OrHash + ).void + end + attr_writer :grouped_allocation_config - sig { params(tiered_bps_config: Orb::TieredBPSConfig::OrHash).void } - attr_writer :tiered_bps_config + # Configuration for bulk_with_proration pricing + sig { returns(Orb::PriceCreateParams::BulkWithProrationConfig) } + attr_reader :bulk_with_proration_config - sig { returns(Orb::BPSConfig) } - attr_reader :bps_config + sig do + params( + bulk_with_proration_config: + Orb::PriceCreateParams::BulkWithProrationConfig::OrHash + ).void + end + attr_writer :bulk_with_proration_config - sig { params(bps_config: Orb::BPSConfig::OrHash).void } - attr_writer :bps_config + # Configuration for grouped_with_prorated_minimum pricing + sig { returns(Orb::PriceCreateParams::GroupedWithProratedMinimumConfig) } + attr_reader :grouped_with_prorated_minimum_config - sig { returns(Orb::BulkBPSConfig) } - attr_reader :bulk_bps_config + sig do + params( + grouped_with_prorated_minimum_config: + Orb::PriceCreateParams::GroupedWithProratedMinimumConfig::OrHash + ).void + end + attr_writer :grouped_with_prorated_minimum_config - sig { params(bulk_bps_config: Orb::BulkBPSConfig::OrHash).void } - attr_writer :bulk_bps_config + # Configuration for grouped_with_metered_minimum pricing + sig { returns(Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig) } + attr_reader :grouped_with_metered_minimum_config - sig { returns(Orb::BulkConfig) } - attr_reader :bulk_config + sig do + params( + grouped_with_metered_minimum_config: + Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::OrHash + ).void + end + attr_writer :grouped_with_metered_minimum_config - sig { params(bulk_config: Orb::BulkConfig::OrHash).void } - attr_writer :bulk_config + # Configuration for grouped_with_min_max_thresholds pricing + sig { returns(Orb::PriceCreateParams::GroupedWithMinMaxThresholdsConfig) } + attr_reader :grouped_with_min_max_thresholds_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :threshold_total_amount_config + sig do + params( + grouped_with_min_max_thresholds_config: + Orb::PriceCreateParams::GroupedWithMinMaxThresholdsConfig::OrHash + ).void + end + attr_writer :grouped_with_min_max_thresholds_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_package_config + # Configuration for matrix_with_display_name pricing + sig { returns(Orb::PriceCreateParams::MatrixWithDisplayNameConfig) } + attr_reader :matrix_with_display_name_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_tiered_config + sig do + params( + matrix_with_display_name_config: + Orb::PriceCreateParams::MatrixWithDisplayNameConfig::OrHash + ).void + end + attr_writer :matrix_with_display_name_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :max_group_tiered_package_config + # Configuration for grouped_tiered_package pricing + sig { returns(Orb::PriceCreateParams::GroupedTieredPackageConfig) } + attr_reader :grouped_tiered_package_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_with_minimum_config + sig do + params( + grouped_tiered_package_config: + Orb::PriceCreateParams::GroupedTieredPackageConfig::OrHash + ).void + end + attr_writer :grouped_tiered_package_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :package_with_allocation_config + # Configuration for max_group_tiered_package pricing + sig { returns(Orb::PriceCreateParams::MaxGroupTieredPackageConfig) } + attr_reader :max_group_tiered_package_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_package_with_minimum_config + sig do + params( + max_group_tiered_package_config: + Orb::PriceCreateParams::MaxGroupTieredPackageConfig::OrHash + ).void + end + attr_writer :max_group_tiered_package_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :unit_with_percent_config + # Configuration for scalable_matrix_with_unit_pricing pricing + sig do + returns(Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig) + end + attr_reader :scalable_matrix_with_unit_pricing_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_with_proration_config + sig do + params( + scalable_matrix_with_unit_pricing_config: + Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig::OrHash + ).void + end + attr_writer :scalable_matrix_with_unit_pricing_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :unit_with_proration_config + # Configuration for scalable_matrix_with_tiered_pricing pricing + sig do + returns(Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig) + end + attr_reader :scalable_matrix_with_tiered_pricing_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_allocation_config + sig do + params( + scalable_matrix_with_tiered_pricing_config: + Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::OrHash + ).void + end + attr_writer :scalable_matrix_with_tiered_pricing_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_with_prorated_minimum_config + # Configuration for cumulative_grouped_bulk pricing + sig { returns(Orb::PriceCreateParams::CumulativeGroupedBulkConfig) } + attr_reader :cumulative_grouped_bulk_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_with_metered_minimum_config + sig do + params( + cumulative_grouped_bulk_config: + Orb::PriceCreateParams::CumulativeGroupedBulkConfig::OrHash + ).void + end + attr_writer :cumulative_grouped_bulk_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :matrix_with_display_name_config + # Configuration for minimum pricing + sig { returns(Orb::PriceCreateParams::MinimumConfig) } + attr_reader :minimum_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :bulk_with_proration_config + sig do + params( + minimum_config: Orb::PriceCreateParams::MinimumConfig::OrHash + ).void + end + attr_writer :minimum_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_tiered_package_config + # Configuration for percent pricing + sig { returns(Orb::PriceCreateParams::PercentConfig) } + attr_reader :percent_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :scalable_matrix_with_unit_pricing_config + sig do + params( + percent_config: Orb::PriceCreateParams::PercentConfig::OrHash + ).void + end + attr_writer :percent_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :scalable_matrix_with_tiered_pricing_config + # Configuration for event_output pricing + sig { returns(Orb::PriceCreateParams::EventOutputConfig) } + attr_reader :event_output_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :cumulative_grouped_bulk_config + sig do + params( + event_output_config: Orb::PriceCreateParams::EventOutputConfig::OrHash + ).void + end + attr_writer :event_output_config sig do params( @@ -235,35 +444,56 @@ module Orb model_type: Orb::PriceCreateParams::ModelType::OrSymbol, name: String, unit_config: Orb::UnitConfig::OrHash, + tiered_config: Orb::TieredConfig::OrHash, + bulk_config: Orb::BulkConfig::OrHash, package_config: Orb::PackageConfig::OrHash, matrix_config: Orb::MatrixConfig::OrHash, + threshold_total_amount_config: + Orb::PriceCreateParams::ThresholdTotalAmountConfig::OrHash, + tiered_package_config: + Orb::PriceCreateParams::TieredPackageConfig::OrHash, + tiered_with_minimum_config: + Orb::PriceCreateParams::TieredWithMinimumConfig::OrHash, + grouped_tiered_config: + Orb::PriceCreateParams::GroupedTieredConfig::OrHash, + tiered_package_with_minimum_config: + Orb::PriceCreateParams::TieredPackageWithMinimumConfig::OrHash, + package_with_allocation_config: + Orb::PriceCreateParams::PackageWithAllocationConfig::OrHash, + unit_with_percent_config: + Orb::PriceCreateParams::UnitWithPercentConfig::OrHash, matrix_with_allocation_config: Orb::MatrixWithAllocationConfig::OrHash, - tiered_config: Orb::TieredConfig::OrHash, - tiered_bps_config: Orb::TieredBPSConfig::OrHash, - bps_config: Orb::BPSConfig::OrHash, - bulk_bps_config: Orb::BulkBPSConfig::OrHash, - bulk_config: Orb::BulkConfig::OrHash, - threshold_total_amount_config: T::Hash[Symbol, T.anything], - tiered_package_config: T::Hash[Symbol, T.anything], - grouped_tiered_config: T::Hash[Symbol, T.anything], - max_group_tiered_package_config: T::Hash[Symbol, T.anything], - tiered_with_minimum_config: T::Hash[Symbol, T.anything], - package_with_allocation_config: T::Hash[Symbol, T.anything], - tiered_package_with_minimum_config: T::Hash[Symbol, T.anything], - unit_with_percent_config: T::Hash[Symbol, T.anything], - tiered_with_proration_config: T::Hash[Symbol, T.anything], - unit_with_proration_config: T::Hash[Symbol, T.anything], - grouped_allocation_config: T::Hash[Symbol, T.anything], - grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], - grouped_with_metered_minimum_config: T::Hash[Symbol, T.anything], - matrix_with_display_name_config: T::Hash[Symbol, T.anything], - bulk_with_proration_config: T::Hash[Symbol, T.anything], - grouped_tiered_package_config: T::Hash[Symbol, T.anything], - scalable_matrix_with_unit_pricing_config: T::Hash[Symbol, T.anything], + tiered_with_proration_config: + Orb::PriceCreateParams::TieredWithProrationConfig::OrHash, + unit_with_proration_config: + Orb::PriceCreateParams::UnitWithProrationConfig::OrHash, + grouped_allocation_config: + Orb::PriceCreateParams::GroupedAllocationConfig::OrHash, + bulk_with_proration_config: + Orb::PriceCreateParams::BulkWithProrationConfig::OrHash, + grouped_with_prorated_minimum_config: + Orb::PriceCreateParams::GroupedWithProratedMinimumConfig::OrHash, + grouped_with_metered_minimum_config: + Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::OrHash, + grouped_with_min_max_thresholds_config: + Orb::PriceCreateParams::GroupedWithMinMaxThresholdsConfig::OrHash, + matrix_with_display_name_config: + Orb::PriceCreateParams::MatrixWithDisplayNameConfig::OrHash, + grouped_tiered_package_config: + Orb::PriceCreateParams::GroupedTieredPackageConfig::OrHash, + max_group_tiered_package_config: + Orb::PriceCreateParams::MaxGroupTieredPackageConfig::OrHash, + scalable_matrix_with_unit_pricing_config: + Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig::OrHash, scalable_matrix_with_tiered_pricing_config: - T::Hash[Symbol, T.anything], - cumulative_grouped_bulk_config: T::Hash[Symbol, T.anything], + Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::OrHash, + cumulative_grouped_bulk_config: + Orb::PriceCreateParams::CumulativeGroupedBulkConfig::OrHash, + minimum_config: Orb::PriceCreateParams::MinimumConfig::OrHash, + percent_config: Orb::PriceCreateParams::PercentConfig::OrHash, + event_output_config: + Orb::PriceCreateParams::EventOutputConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -294,37 +524,68 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for unit pricing unit_config:, - package_config:, - matrix_config:, - matrix_with_allocation_config:, + # Configuration for tiered pricing tiered_config:, - tiered_bps_config:, - bps_config:, - bulk_bps_config:, + # Configuration for bulk pricing bulk_config:, + # Configuration for package pricing + package_config:, + # Configuration for matrix pricing + matrix_config:, + # Configuration for threshold_total_amount pricing threshold_total_amount_config:, + # Configuration for tiered_package pricing tiered_package_config:, - grouped_tiered_config:, - max_group_tiered_package_config:, + # Configuration for tiered_with_minimum pricing tiered_with_minimum_config:, - package_with_allocation_config:, + # Configuration for grouped_tiered pricing + grouped_tiered_config:, + # Configuration for tiered_package_with_minimum pricing tiered_package_with_minimum_config:, + # Configuration for package_with_allocation pricing + package_with_allocation_config:, + # Configuration for unit_with_percent pricing unit_with_percent_config:, + # Configuration for matrix_with_allocation pricing + matrix_with_allocation_config:, + # Configuration for tiered_with_proration pricing tiered_with_proration_config:, + # Configuration for unit_with_proration pricing unit_with_proration_config:, + # Configuration for grouped_allocation pricing grouped_allocation_config:, + # Configuration for bulk_with_proration pricing + bulk_with_proration_config:, + # Configuration for grouped_with_prorated_minimum pricing grouped_with_prorated_minimum_config:, + # Configuration for grouped_with_metered_minimum pricing grouped_with_metered_minimum_config:, + # Configuration for grouped_with_min_max_thresholds pricing + grouped_with_min_max_thresholds_config:, + # Configuration for matrix_with_display_name pricing matrix_with_display_name_config:, - bulk_with_proration_config:, + # Configuration for grouped_tiered_package pricing grouped_tiered_package_config:, + # Configuration for max_group_tiered_package pricing + max_group_tiered_package_config:, + # Configuration for scalable_matrix_with_unit_pricing pricing scalable_matrix_with_unit_pricing_config:, + # Configuration for scalable_matrix_with_tiered_pricing pricing scalable_matrix_with_tiered_pricing_config:, + # Configuration for cumulative_grouped_bulk pricing cumulative_grouped_bulk_config:, + # Configuration for minimum pricing + minimum_config:, + # Configuration for percent pricing + percent_config:, + # Configuration for event_output pricing + event_output_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. billable_metric_id: nil, @@ -387,35 +648,52 @@ module Orb invoicing_cycle_configuration: T.nilable(Orb::NewBillingCycleConfiguration), metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + tiered_config: Orb::TieredConfig, + bulk_config: Orb::BulkConfig, package_config: Orb::PackageConfig, matrix_config: Orb::MatrixConfig, + threshold_total_amount_config: + Orb::PriceCreateParams::ThresholdTotalAmountConfig, + tiered_package_config: Orb::PriceCreateParams::TieredPackageConfig, + tiered_with_minimum_config: + Orb::PriceCreateParams::TieredWithMinimumConfig, + grouped_tiered_config: Orb::PriceCreateParams::GroupedTieredConfig, + tiered_package_with_minimum_config: + Orb::PriceCreateParams::TieredPackageWithMinimumConfig, + package_with_allocation_config: + Orb::PriceCreateParams::PackageWithAllocationConfig, + unit_with_percent_config: + Orb::PriceCreateParams::UnitWithPercentConfig, matrix_with_allocation_config: Orb::MatrixWithAllocationConfig, - tiered_config: Orb::TieredConfig, - tiered_bps_config: Orb::TieredBPSConfig, - bps_config: Orb::BPSConfig, - bulk_bps_config: Orb::BulkBPSConfig, - bulk_config: Orb::BulkConfig, - threshold_total_amount_config: T::Hash[Symbol, T.anything], - tiered_package_config: T::Hash[Symbol, T.anything], - grouped_tiered_config: T::Hash[Symbol, T.anything], - max_group_tiered_package_config: T::Hash[Symbol, T.anything], - tiered_with_minimum_config: T::Hash[Symbol, T.anything], - package_with_allocation_config: T::Hash[Symbol, T.anything], - tiered_package_with_minimum_config: T::Hash[Symbol, T.anything], - unit_with_percent_config: T::Hash[Symbol, T.anything], - tiered_with_proration_config: T::Hash[Symbol, T.anything], - unit_with_proration_config: T::Hash[Symbol, T.anything], - grouped_allocation_config: T::Hash[Symbol, T.anything], - grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], - grouped_with_metered_minimum_config: T::Hash[Symbol, T.anything], - matrix_with_display_name_config: T::Hash[Symbol, T.anything], - bulk_with_proration_config: T::Hash[Symbol, T.anything], - grouped_tiered_package_config: T::Hash[Symbol, T.anything], + tiered_with_proration_config: + Orb::PriceCreateParams::TieredWithProrationConfig, + unit_with_proration_config: + Orb::PriceCreateParams::UnitWithProrationConfig, + grouped_allocation_config: + Orb::PriceCreateParams::GroupedAllocationConfig, + bulk_with_proration_config: + Orb::PriceCreateParams::BulkWithProrationConfig, + grouped_with_prorated_minimum_config: + Orb::PriceCreateParams::GroupedWithProratedMinimumConfig, + grouped_with_metered_minimum_config: + Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig, + grouped_with_min_max_thresholds_config: + Orb::PriceCreateParams::GroupedWithMinMaxThresholdsConfig, + matrix_with_display_name_config: + Orb::PriceCreateParams::MatrixWithDisplayNameConfig, + grouped_tiered_package_config: + Orb::PriceCreateParams::GroupedTieredPackageConfig, + max_group_tiered_package_config: + Orb::PriceCreateParams::MaxGroupTieredPackageConfig, scalable_matrix_with_unit_pricing_config: - T::Hash[Symbol, T.anything], + Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig, scalable_matrix_with_tiered_pricing_config: - T::Hash[Symbol, T.anything], - cumulative_grouped_bulk_config: T::Hash[Symbol, T.anything], + Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig, + cumulative_grouped_bulk_config: + Orb::PriceCreateParams::CumulativeGroupedBulkConfig, + minimum_config: Orb::PriceCreateParams::MinimumConfig, + percent_config: Orb::PriceCreateParams::PercentConfig, + event_output_config: Orb::PriceCreateParams::EventOutputConfig, request_options: Orb::RequestOptions } ) @@ -450,6 +728,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -457,11 +736,8 @@ module Orb T.type_alias { T.all(Symbol, Orb::PriceCreateParams::ModelType) } OrSymbol = T.type_alias { T.any(Symbol, String) } - CUMULATIVE_GROUPED_BULK = - T.let( - :cumulative_grouped_bulk, - Orb::PriceCreateParams::ModelType::TaggedSymbol - ) + EVENT_OUTPUT = + T.let(:event_output, Orb::PriceCreateParams::ModelType::TaggedSymbol) sig do override.returns( @@ -472,24 +748,1956 @@ module Orb end end - # The configuration for the rate of the price currency to the invoicing currency. - module ConversionRateConfig - extend Orb::Internal::Type::Union + class ThresholdTotalAmountConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::ThresholdTotalAmountConfig, + Orb::Internal::AnyHash + ) + end + + # When the quantity consumed passes a provided threshold, the configured total + # will be charged + sig do + returns( + T::Array[ + Orb::PriceCreateParams::ThresholdTotalAmountConfig::ConsumptionTable + ] + ) + end + attr_accessor :consumption_table + + # If true, the unit price will be prorated to the billing period + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :prorate + + # Configuration for threshold_total_amount pricing + sig do + params( + consumption_table: + T::Array[ + Orb::PriceCreateParams::ThresholdTotalAmountConfig::ConsumptionTable::OrHash + ], + prorate: T.nilable(T::Boolean) + ).returns(T.attached_class) + end + def self.new( + # When the quantity consumed passes a provided threshold, the configured total + # will be charged + consumption_table:, + # If true, the unit price will be prorated to the billing period + prorate: nil + ) + end + + sig do + override.returns( + { + consumption_table: + T::Array[ + Orb::PriceCreateParams::ThresholdTotalAmountConfig::ConsumptionTable + ], + prorate: T.nilable(T::Boolean) + } + ) + end + def to_hash + end + + class ConsumptionTable < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::ThresholdTotalAmountConfig::ConsumptionTable, + Orb::Internal::AnyHash + ) + end + + # Quantity threshold + sig { returns(String) } + attr_accessor :threshold + + # Total amount for this threshold + sig { returns(String) } + attr_accessor :total_amount + + # Configuration for a single threshold + sig do + params(threshold: String, total_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Quantity threshold + threshold:, + # Total amount for this threshold + total_amount: + ) + end + + sig { override.returns({ threshold: String, total_amount: String }) } + def to_hash + end + end + end - Variants = + class TieredPackageConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + Orb::PriceCreateParams::TieredPackageConfig, + Orb::Internal::AnyHash + ) + end + + # Package size + sig { returns(String) } + attr_accessor :package_size + + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. The tier bounds are defined based on + # the total quantity rather than the number of packages, so they must be multiples + # of the package size. + sig do + returns(T::Array[Orb::PriceCreateParams::TieredPackageConfig::Tier]) + end + attr_accessor :tiers + + # Configuration for tiered_package pricing + sig do + params( + package_size: String, + tiers: + T::Array[ + Orb::PriceCreateParams::TieredPackageConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Package size + package_size:, + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. The tier bounds are defined based on + # the total quantity rather than the number of packages, so they must be multiples + # of the package size. + tiers: + ) + end + + sig do + override.returns( + { + package_size: String, + tiers: T::Array[Orb::PriceCreateParams::TieredPackageConfig::Tier] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::TieredPackageConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Price per package + sig { returns(String) } + attr_accessor :per_unit + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Configuration for a single tier with business logic + sig do + params(per_unit: String, tier_lower_bound: String).returns( + T.attached_class + ) + end + def self.new( + # Price per package + per_unit:, + # Tier lower bound + tier_lower_bound: + ) + end + + sig do + override.returns({ per_unit: String, tier_lower_bound: String }) + end + def to_hash + end + end + end + + class TieredWithMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::TieredWithMinimumConfig, + Orb::Internal::AnyHash ) end + # Tiered pricing with a minimum amount dependent on the volume tier. Tiers are + # defined using exclusive lower bounds. + sig do + returns( + T::Array[Orb::PriceCreateParams::TieredWithMinimumConfig::Tier] + ) + end + attr_accessor :tiers + + # If true, tiers with an accrued amount of 0 will not be included in the rating. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :hide_zero_amount_tiers + + sig { params(hide_zero_amount_tiers: T::Boolean).void } + attr_writer :hide_zero_amount_tiers + + # If true, the unit price will be prorated to the billing period + sig { returns(T.nilable(T::Boolean)) } + attr_reader :prorate + + sig { params(prorate: T::Boolean).void } + attr_writer :prorate + + # Configuration for tiered_with_minimum pricing + sig do + params( + tiers: + T::Array[ + Orb::PriceCreateParams::TieredWithMinimumConfig::Tier::OrHash + ], + hide_zero_amount_tiers: T::Boolean, + prorate: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # Tiered pricing with a minimum amount dependent on the volume tier. Tiers are + # defined using exclusive lower bounds. + tiers:, + # If true, tiers with an accrued amount of 0 will not be included in the rating. + hide_zero_amount_tiers: nil, + # If true, the unit price will be prorated to the billing period + prorate: nil + ) + end + + sig do + override.returns( + { + tiers: + T::Array[Orb::PriceCreateParams::TieredWithMinimumConfig::Tier], + hide_zero_amount_tiers: T::Boolean, + prorate: T::Boolean + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::TieredWithMinimumConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Minimum amount + sig { returns(String) } + attr_accessor :minimum_amount + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tier + sig do + params( + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + ).returns(T.attached_class) + end + def self.new( + # Minimum amount + minimum_amount:, + # Tier lower bound + tier_lower_bound:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns( + { + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + } + ) + end + def to_hash + end + end + end + + class GroupedTieredConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::GroupedTieredConfig, + Orb::Internal::AnyHash + ) + end + + # The billable metric property used to group before tiering + sig { returns(String) } + attr_accessor :grouping_key + + # Apply tiered pricing to each segment generated after grouping with the provided + # key + sig do + returns(T::Array[Orb::PriceCreateParams::GroupedTieredConfig::Tier]) + end + attr_accessor :tiers + + # Configuration for grouped_tiered pricing + sig do + params( + grouping_key: String, + tiers: + T::Array[ + Orb::PriceCreateParams::GroupedTieredConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The billable metric property used to group before tiering + grouping_key:, + # Apply tiered pricing to each segment generated after grouping with the provided + # key + tiers: + ) + end + + sig do + override.returns( + { + grouping_key: String, + tiers: T::Array[Orb::PriceCreateParams::GroupedTieredConfig::Tier] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::GroupedTieredConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tier + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Tier lower bound + tier_lower_bound:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns({ tier_lower_bound: String, unit_amount: String }) + end + def to_hash + end + end + end + + class TieredPackageWithMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::TieredPackageWithMinimumConfig, + Orb::Internal::AnyHash + ) + end + + # Package size + sig { returns(Float) } + attr_accessor :package_size + + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + sig do + returns( + T::Array[ + Orb::PriceCreateParams::TieredPackageWithMinimumConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for tiered_package_with_minimum pricing + sig do + params( + package_size: Float, + tiers: + T::Array[ + Orb::PriceCreateParams::TieredPackageWithMinimumConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Package size + package_size:, + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + tiers: + ) + end + + sig do + override.returns( + { + package_size: Float, + tiers: + T::Array[ + Orb::PriceCreateParams::TieredPackageWithMinimumConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::TieredPackageWithMinimumConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Minimum amount + sig { returns(String) } + attr_accessor :minimum_amount + + # Price per package + sig { returns(String) } + attr_accessor :per_unit + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Configuration for a single tier + sig do + params( + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + ).returns(T.attached_class) + end + def self.new( + # Minimum amount + minimum_amount:, + # Price per package + per_unit:, + # Tier lower bound + tier_lower_bound: + ) + end + + sig do + override.returns( + { + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + } + ) + end + def to_hash + end + end + end + + class PackageWithAllocationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::PackageWithAllocationConfig, + Orb::Internal::AnyHash + ) + end + + # Usage allocation + sig { returns(String) } + attr_accessor :allocation + + # Price per package + sig { returns(String) } + attr_accessor :package_amount + + # Package size + sig { returns(String) } + attr_accessor :package_size + + # Configuration for package_with_allocation pricing + sig do + params( + allocation: String, + package_amount: String, + package_size: String + ).returns(T.attached_class) + end + def self.new( + # Usage allocation + allocation:, + # Price per package + package_amount:, + # Package size + package_size: + ) + end + + sig do + override.returns( + { allocation: String, package_amount: String, package_size: String } + ) + end + def to_hash + end + end + + class UnitWithPercentConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::UnitWithPercentConfig, + Orb::Internal::AnyHash + ) + end + + # What percent, out of 100, of the calculated total to charge + sig { returns(String) } + attr_accessor :percent + + # Rate per unit of usage + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for unit_with_percent pricing + sig do + params(percent: String, unit_amount: String).returns(T.attached_class) + end + def self.new( + # What percent, out of 100, of the calculated total to charge + percent:, + # Rate per unit of usage + unit_amount: + ) + end + + sig { override.returns({ percent: String, unit_amount: String }) } + def to_hash + end + end + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::TieredWithProrationConfig, + Orb::Internal::AnyHash + ) + end + + # Tiers for rating based on total usage quantities into the specified tier with + # proration + sig do + returns( + T::Array[Orb::PriceCreateParams::TieredWithProrationConfig::Tier] + ) + end + attr_accessor :tiers + + # Configuration for tiered_with_proration pricing + sig do + params( + tiers: + T::Array[ + Orb::PriceCreateParams::TieredWithProrationConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Tiers for rating based on total usage quantities into the specified tier with + # proration + tiers: + ) + end + + sig do + override.returns( + { + tiers: + T::Array[ + Orb::PriceCreateParams::TieredWithProrationConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::TieredWithProrationConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Inclusive tier starting value + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Amount per unit + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tiered with proration tier + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Inclusive tier starting value + tier_lower_bound:, + # Amount per unit + unit_amount: + ) + end + + sig do + override.returns({ tier_lower_bound: String, unit_amount: String }) + end + def to_hash + end + end + end + + class UnitWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::UnitWithProrationConfig, + Orb::Internal::AnyHash + ) + end + + # Rate per unit of usage + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for unit_with_proration pricing + sig { params(unit_amount: String).returns(T.attached_class) } + def self.new( + # Rate per unit of usage + unit_amount: + ) + end + + sig { override.returns({ unit_amount: String }) } + def to_hash + end + end + + class GroupedAllocationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::GroupedAllocationConfig, + Orb::Internal::AnyHash + ) + end + + # Usage allocation per group + sig { returns(String) } + attr_accessor :allocation + + # How to determine the groups that should each be allocated some quantity + sig { returns(String) } + attr_accessor :grouping_key + + # Unit rate for post-allocation + sig { returns(String) } + attr_accessor :overage_unit_rate + + # Configuration for grouped_allocation pricing + sig do + params( + allocation: String, + grouping_key: String, + overage_unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # Usage allocation per group + allocation:, + # How to determine the groups that should each be allocated some quantity + grouping_key:, + # Unit rate for post-allocation + overage_unit_rate: + ) + end + + sig do + override.returns( + { + allocation: String, + grouping_key: String, + overage_unit_rate: String + } + ) + end + def to_hash + end + end + + class BulkWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::BulkWithProrationConfig, + Orb::Internal::AnyHash + ) + end + + # Bulk tiers for rating based on total usage volume + sig do + returns( + T::Array[Orb::PriceCreateParams::BulkWithProrationConfig::Tier] + ) + end + attr_accessor :tiers + + # Configuration for bulk_with_proration pricing + sig do + params( + tiers: + T::Array[ + Orb::PriceCreateParams::BulkWithProrationConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Bulk tiers for rating based on total usage volume + tiers: + ) + end + + sig do + override.returns( + { + tiers: + T::Array[Orb::PriceCreateParams::BulkWithProrationConfig::Tier] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::BulkWithProrationConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Cost per unit + sig { returns(String) } + attr_accessor :unit_amount + + # The lower bound for this tier + sig { returns(T.nilable(String)) } + attr_accessor :tier_lower_bound + + # Configuration for a single bulk pricing tier with proration + sig do + params( + unit_amount: String, + tier_lower_bound: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Cost per unit + unit_amount:, + # The lower bound for this tier + tier_lower_bound: nil + ) + end + + sig do + override.returns( + { unit_amount: String, tier_lower_bound: T.nilable(String) } + ) + end + def to_hash + end + end + end + + class GroupedWithProratedMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::GroupedWithProratedMinimumConfig, + Orb::Internal::AnyHash + ) + end + + # How to determine the groups that should each have a minimum + sig { returns(String) } + attr_accessor :grouping_key + + # The minimum amount to charge per group + sig { returns(String) } + attr_accessor :minimum + + # The amount to charge per unit + sig { returns(String) } + attr_accessor :unit_rate + + # Configuration for grouped_with_prorated_minimum pricing + sig do + params( + grouping_key: String, + minimum: String, + unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # How to determine the groups that should each have a minimum + grouping_key:, + # The minimum amount to charge per group + minimum:, + # The amount to charge per unit + unit_rate: + ) + end + + sig do + override.returns( + { grouping_key: String, minimum: String, unit_rate: String } + ) + end + def to_hash + end + end + + class GroupedWithMeteredMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig, + Orb::Internal::AnyHash + ) + end + + # Used to partition the usage into groups. The minimum amount is applied to each + # group. + sig { returns(String) } + attr_accessor :grouping_key + + # The minimum amount to charge per group per unit + sig { returns(String) } + attr_accessor :minimum_unit_amount + + # Used to determine the unit rate + sig { returns(String) } + attr_accessor :pricing_key + + # Scale the unit rates by the scaling factor. + sig do + returns( + T::Array[ + Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::ScalingFactor + ] + ) + end + attr_accessor :scaling_factors + + # Used to determine the unit rate scaling factor + sig { returns(String) } + attr_accessor :scaling_key + + # Apply per unit pricing to each pricing value. The minimum amount is applied any + # unmatched usage. + sig do + returns( + T::Array[ + Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::UnitAmount + ] + ) + end + attr_accessor :unit_amounts + + # Configuration for grouped_with_metered_minimum pricing + sig do + params( + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: + T::Array[ + Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::ScalingFactor::OrHash + ], + scaling_key: String, + unit_amounts: + T::Array[ + Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::UnitAmount::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Used to partition the usage into groups. The minimum amount is applied to each + # group. + grouping_key:, + # The minimum amount to charge per group per unit + minimum_unit_amount:, + # Used to determine the unit rate + pricing_key:, + # Scale the unit rates by the scaling factor. + scaling_factors:, + # Used to determine the unit rate scaling factor + scaling_key:, + # Apply per unit pricing to each pricing value. The minimum amount is applied any + # unmatched usage. + unit_amounts: + ) + end + + sig do + override.returns( + { + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: + T::Array[ + Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::ScalingFactor + ], + scaling_key: String, + unit_amounts: + T::Array[ + Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::UnitAmount + ] + } + ) + end + def to_hash + end + + class ScalingFactor < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::ScalingFactor, + Orb::Internal::AnyHash + ) + end + + # Scaling factor + sig { returns(String) } + attr_accessor :scaling_factor + + # Scaling value + sig { returns(String) } + attr_accessor :scaling_value + + # Configuration for a scaling factor + sig do + params(scaling_factor: String, scaling_value: String).returns( + T.attached_class + ) + end + def self.new( + # Scaling factor + scaling_factor:, + # Scaling value + scaling_value: + ) + end + + sig do + override.returns({ scaling_factor: String, scaling_value: String }) + end + def to_hash + end + end + + class UnitAmount < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::UnitAmount, + Orb::Internal::AnyHash + ) + end + + # Pricing value + sig { returns(String) } + attr_accessor :pricing_value + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a unit amount + sig do + params(pricing_value: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Pricing value + pricing_value:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns({ pricing_value: String, unit_amount: String }) + end + def to_hash + end + end + end + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::GroupedWithMinMaxThresholdsConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before applying thresholds + sig { returns(String) } + attr_accessor :grouping_key + + # The maximum amount to charge each group + sig { returns(String) } + attr_accessor :maximum_charge + + # The minimum amount to charge each group, regardless of usage + sig { returns(String) } + attr_accessor :minimum_charge + + # The base price charged per group + sig { returns(String) } + attr_accessor :per_unit_rate + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + params( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before applying thresholds + grouping_key:, + # The maximum amount to charge each group + maximum_charge:, + # The minimum amount to charge each group, regardless of usage + minimum_charge:, + # The base price charged per group + per_unit_rate: + ) + end + + sig do + override.returns( + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + ) + end + def to_hash + end + end + + class MatrixWithDisplayNameConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::MatrixWithDisplayNameConfig, + Orb::Internal::AnyHash + ) + end + + # Used to determine the unit rate + sig { returns(String) } + attr_accessor :dimension + + # Apply per unit pricing to each dimension value + sig do + returns( + T::Array[ + Orb::PriceCreateParams::MatrixWithDisplayNameConfig::UnitAmount + ] + ) + end + attr_accessor :unit_amounts + + # Configuration for matrix_with_display_name pricing + sig do + params( + dimension: String, + unit_amounts: + T::Array[ + Orb::PriceCreateParams::MatrixWithDisplayNameConfig::UnitAmount::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Used to determine the unit rate + dimension:, + # Apply per unit pricing to each dimension value + unit_amounts: + ) + end + + sig do + override.returns( + { + dimension: String, + unit_amounts: + T::Array[ + Orb::PriceCreateParams::MatrixWithDisplayNameConfig::UnitAmount + ] + } + ) + end + def to_hash + end + + class UnitAmount < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::MatrixWithDisplayNameConfig::UnitAmount, + Orb::Internal::AnyHash + ) + end + + # The dimension value + sig { returns(String) } + attr_accessor :dimension_value + + # Display name for this dimension value + sig { returns(String) } + attr_accessor :display_name + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a unit amount item + sig do + params( + dimension_value: String, + display_name: String, + unit_amount: String + ).returns(T.attached_class) + end + def self.new( + # The dimension value + dimension_value:, + # Display name for this dimension value + display_name:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns( + { + dimension_value: String, + display_name: String, + unit_amount: String + } + ) + end + def to_hash + end + end + end + + class GroupedTieredPackageConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::GroupedTieredPackageConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before tiering + sig { returns(String) } + attr_accessor :grouping_key + + # Package size + sig { returns(String) } + attr_accessor :package_size + + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + sig do + returns( + T::Array[Orb::PriceCreateParams::GroupedTieredPackageConfig::Tier] + ) + end + attr_accessor :tiers + + # Configuration for grouped_tiered_package pricing + sig do + params( + grouping_key: String, + package_size: String, + tiers: + T::Array[ + Orb::PriceCreateParams::GroupedTieredPackageConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before tiering + grouping_key:, + # Package size + package_size:, + # Apply tiered pricing after rounding up the quantity to the package size. Tiers + # are defined using exclusive lower bounds. + tiers: + ) + end + + sig do + override.returns( + { + grouping_key: String, + package_size: String, + tiers: + T::Array[ + Orb::PriceCreateParams::GroupedTieredPackageConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::GroupedTieredPackageConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Price per package + sig { returns(String) } + attr_accessor :per_unit + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Configuration for a single tier + sig do + params(per_unit: String, tier_lower_bound: String).returns( + T.attached_class + ) + end + def self.new( + # Price per package + per_unit:, + # Tier lower bound + tier_lower_bound: + ) + end + + sig do + override.returns({ per_unit: String, tier_lower_bound: String }) + end + def to_hash + end + end + end + + class MaxGroupTieredPackageConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::MaxGroupTieredPackageConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before tiering the group with the highest value + sig { returns(String) } + attr_accessor :grouping_key + + # Package size + sig { returns(String) } + attr_accessor :package_size + + # Apply tiered pricing to the largest group after grouping with the provided key. + sig do + returns( + T::Array[Orb::PriceCreateParams::MaxGroupTieredPackageConfig::Tier] + ) + end + attr_accessor :tiers + + # Configuration for max_group_tiered_package pricing + sig do + params( + grouping_key: String, + package_size: String, + tiers: + T::Array[ + Orb::PriceCreateParams::MaxGroupTieredPackageConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before tiering the group with the highest value + grouping_key:, + # Package size + package_size:, + # Apply tiered pricing to the largest group after grouping with the provided key. + tiers: + ) + end + + sig do + override.returns( + { + grouping_key: String, + package_size: String, + tiers: + T::Array[ + Orb::PriceCreateParams::MaxGroupTieredPackageConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::MaxGroupTieredPackageConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tier + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Tier lower bound + tier_lower_bound:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns({ tier_lower_bound: String, unit_amount: String }) + end + def to_hash + end + end + end + + class ScalableMatrixWithUnitPricingConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig, + Orb::Internal::AnyHash + ) + end + + # Used to determine the unit rate + sig { returns(String) } + attr_accessor :first_dimension + + # Apply a scaling factor to each dimension + sig do + returns( + T::Array[ + Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor + ] + ) + end + attr_accessor :matrix_scaling_factors + + # The final unit price to rate against the output of the matrix + sig { returns(String) } + attr_accessor :unit_price + + # If true, the unit price will be prorated to the billing period + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :prorate + + # Used to determine the unit rate (optional) + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension + + # Configuration for scalable_matrix_with_unit_pricing pricing + sig do + params( + first_dimension: String, + matrix_scaling_factors: + T::Array[ + Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor::OrHash + ], + unit_price: String, + prorate: T.nilable(T::Boolean), + second_dimension: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Used to determine the unit rate + first_dimension:, + # Apply a scaling factor to each dimension + matrix_scaling_factors:, + # The final unit price to rate against the output of the matrix + unit_price:, + # If true, the unit price will be prorated to the billing period + prorate: nil, + # Used to determine the unit rate (optional) + second_dimension: nil + ) + end + + sig do + override.returns( + { + first_dimension: String, + matrix_scaling_factors: + T::Array[ + Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor + ], + unit_price: String, + prorate: T.nilable(T::Boolean), + second_dimension: T.nilable(String) + } + ) + end + def to_hash + end + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor, + Orb::Internal::AnyHash + ) + end + + # First dimension value + sig { returns(String) } + attr_accessor :first_dimension_value + + # Scaling factor + sig { returns(String) } + attr_accessor :scaling_factor + + # Second dimension value (optional) + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension_value + + # Configuration for a single matrix scaling factor + sig do + params( + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # First dimension value + first_dimension_value:, + # Scaling factor + scaling_factor:, + # Second dimension value (optional) + second_dimension_value: nil + ) + end + + sig do + override.returns( + { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: T.nilable(String) + } + ) + end + def to_hash + end + end + end + + class ScalableMatrixWithTieredPricingConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig, + Orb::Internal::AnyHash + ) + end + + # Used for the scalable matrix first dimension + sig { returns(String) } + attr_accessor :first_dimension + + # Apply a scaling factor to each dimension + sig do + returns( + T::Array[ + Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor + ] + ) + end + attr_accessor :matrix_scaling_factors + + # Tier pricing structure + sig do + returns( + T::Array[ + Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Used for the scalable matrix second dimension (optional) + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension + + # Configuration for scalable_matrix_with_tiered_pricing pricing + sig do + params( + first_dimension: String, + matrix_scaling_factors: + T::Array[ + Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor::OrHash + ], + tiers: + T::Array[ + Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::Tier::OrHash + ], + second_dimension: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Used for the scalable matrix first dimension + first_dimension:, + # Apply a scaling factor to each dimension + matrix_scaling_factors:, + # Tier pricing structure + tiers:, + # Used for the scalable matrix second dimension (optional) + second_dimension: nil + ) + end + + sig do + override.returns( + { + first_dimension: String, + matrix_scaling_factors: + T::Array[ + Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor + ], + tiers: + T::Array[ + Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::Tier + ], + second_dimension: T.nilable(String) + } + ) + end + def to_hash + end + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor, + Orb::Internal::AnyHash + ) + end + + # First dimension value + sig { returns(String) } + attr_accessor :first_dimension_value + + # Scaling factor + sig { returns(String) } + attr_accessor :scaling_factor + + # Second dimension value (optional) + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension_value + + # Configuration for a single matrix scaling factor + sig do + params( + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # First dimension value + first_dimension_value:, + # Scaling factor + scaling_factor:, + # Second dimension value (optional) + second_dimension_value: nil + ) + end + + sig do + override.returns( + { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Per unit amount + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tier entry with business logic + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Tier lower bound + tier_lower_bound:, + # Per unit amount + unit_amount: + ) + end + + sig do + override.returns({ tier_lower_bound: String, unit_amount: String }) + end + def to_hash + end + end + end + + class CumulativeGroupedBulkConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::CumulativeGroupedBulkConfig, + Orb::Internal::AnyHash + ) + end + + # Each tier lower bound must have the same group of values. + sig do + returns( + T::Array[ + Orb::PriceCreateParams::CumulativeGroupedBulkConfig::DimensionValue + ] + ) + end + attr_accessor :dimension_values + + # Grouping key name + sig { returns(String) } + attr_accessor :group + + # Configuration for cumulative_grouped_bulk pricing + sig do + params( + dimension_values: + T::Array[ + Orb::PriceCreateParams::CumulativeGroupedBulkConfig::DimensionValue::OrHash + ], + group: String + ).returns(T.attached_class) + end + def self.new( + # Each tier lower bound must have the same group of values. + dimension_values:, + # Grouping key name + group: + ) + end + + sig do + override.returns( + { + dimension_values: + T::Array[ + Orb::PriceCreateParams::CumulativeGroupedBulkConfig::DimensionValue + ], + group: String + } + ) + end + def to_hash + end + + class DimensionValue < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::CumulativeGroupedBulkConfig::DimensionValue, + Orb::Internal::AnyHash + ) + end + + # Grouping key value + sig { returns(String) } + attr_accessor :grouping_key + + # Tier lower bound + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Unit amount for this combination + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a dimension value entry + sig do + params( + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + ).returns(T.attached_class) + end + def self.new( + # Grouping key value + grouping_key:, + # Tier lower bound + tier_lower_bound:, + # Unit amount for this combination + unit_amount: + ) + end + + sig do + override.returns( + { + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + } + ) + end + def to_hash + end + end + end + + class MinimumConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Orb::PriceCreateParams::MinimumConfig, Orb::Internal::AnyHash) + end + + # The minimum amount to apply + sig { returns(String) } + attr_accessor :minimum_amount + + # If true, subtotals from this price are prorated based on the service period + sig { returns(T.nilable(T::Boolean)) } + attr_reader :prorated + + sig { params(prorated: T::Boolean).void } + attr_writer :prorated + + # Configuration for minimum pricing + sig do + params(minimum_amount: String, prorated: T::Boolean).returns( + T.attached_class + ) + end + def self.new( + # The minimum amount to apply + minimum_amount:, + # If true, subtotals from this price are prorated based on the service period + prorated: nil + ) + end + + sig do + override.returns({ minimum_amount: String, prorated: T::Boolean }) + end + def to_hash + end + end + + class PercentConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Orb::PriceCreateParams::PercentConfig, Orb::Internal::AnyHash) + end + + # What percent of the component subtotals to charge + sig { returns(Float) } + attr_accessor :percent + + # Configuration for percent pricing + sig { params(percent: Float).returns(T.attached_class) } + def self.new( + # What percent of the component subtotals to charge + percent: + ) + end + + sig { override.returns({ percent: Float }) } + def to_hash + end + end + + class EventOutputConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceCreateParams::EventOutputConfig, + Orb::Internal::AnyHash + ) + end + + # The key in the event data to extract the unit rate from. + sig { returns(String) } + attr_accessor :unit_rating_key + + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + sig { returns(T.nilable(String)) } + attr_accessor :grouping_key + + # Configuration for event_output pricing + sig do + params( + unit_rating_key: String, + grouping_key: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The key in the event data to extract the unit rate from. + unit_rating_key:, + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + grouping_key: nil + ) + end + sig do override.returns( - T::Array[Orb::PriceCreateParams::ConversionRateConfig::Variants] + { unit_rating_key: String, grouping_key: T.nilable(String) } ) end - def self.variants + def to_hash end end end diff --git a/rbi/orb/models/price_evaluate_multiple_params.rbi b/rbi/orb/models/price_evaluate_multiple_params.rbi index 3b9d57df..37244e96 100644 --- a/rbi/orb/models/price_evaluate_multiple_params.rbi +++ b/rbi/orb/models/price_evaluate_multiple_params.rbi @@ -113,40 +113,40 @@ module Orb sig { params(grouping_keys: T::Array[String]).void } attr_writer :grouping_keys - # An inline price definition to evaluate, allowing you to test price - # configurations before adding them to Orb. + # New floating price request body params. sig do returns( T.nilable( T.any( Orb::NewFloatingUnitPrice, - Orb::NewFloatingPackagePrice, - Orb::NewFloatingMatrixPrice, - Orb::NewFloatingMatrixWithAllocationPrice, Orb::NewFloatingTieredPrice, - Orb::NewFloatingTieredBPSPrice, - Orb::NewFloatingBPSPrice, - Orb::NewFloatingBulkBPSPrice, Orb::NewFloatingBulkPrice, + Orb::NewFloatingPackagePrice, + Orb::NewFloatingMatrixPrice, Orb::NewFloatingThresholdTotalAmountPrice, Orb::NewFloatingTieredPackagePrice, - Orb::NewFloatingGroupedTieredPrice, - Orb::NewFloatingMaxGroupTieredPackagePrice, Orb::NewFloatingTieredWithMinimumPrice, - Orb::NewFloatingPackageWithAllocationPrice, + Orb::NewFloatingGroupedTieredPrice, Orb::NewFloatingTieredPackageWithMinimumPrice, + Orb::NewFloatingPackageWithAllocationPrice, Orb::NewFloatingUnitWithPercentPrice, + Orb::NewFloatingMatrixWithAllocationPrice, Orb::NewFloatingTieredWithProrationPrice, Orb::NewFloatingUnitWithProrationPrice, Orb::NewFloatingGroupedAllocationPrice, + Orb::NewFloatingBulkWithProrationPrice, Orb::NewFloatingGroupedWithProratedMinimumPrice, Orb::NewFloatingGroupedWithMeteredMinimumPrice, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds, Orb::NewFloatingMatrixWithDisplayNamePrice, - Orb::NewFloatingBulkWithProrationPrice, Orb::NewFloatingGroupedTieredPackagePrice, + Orb::NewFloatingMaxGroupTieredPackagePrice, Orb::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::NewFloatingScalableMatrixWithTieredPricingPrice, - Orb::NewFloatingCumulativeGroupedBulkPrice + Orb::NewFloatingCumulativeGroupedBulkPrice, + Orb::NewFloatingMinimumCompositePrice, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput ) ) ) @@ -166,33 +166,34 @@ module Orb T.nilable( T.any( Orb::NewFloatingUnitPrice::OrHash, - Orb::NewFloatingPackagePrice::OrHash, - Orb::NewFloatingMatrixPrice::OrHash, - Orb::NewFloatingMatrixWithAllocationPrice::OrHash, Orb::NewFloatingTieredPrice::OrHash, - Orb::NewFloatingTieredBPSPrice::OrHash, - Orb::NewFloatingBPSPrice::OrHash, - Orb::NewFloatingBulkBPSPrice::OrHash, Orb::NewFloatingBulkPrice::OrHash, + Orb::NewFloatingPackagePrice::OrHash, + Orb::NewFloatingMatrixPrice::OrHash, Orb::NewFloatingThresholdTotalAmountPrice::OrHash, Orb::NewFloatingTieredPackagePrice::OrHash, - Orb::NewFloatingGroupedTieredPrice::OrHash, - Orb::NewFloatingMaxGroupTieredPackagePrice::OrHash, Orb::NewFloatingTieredWithMinimumPrice::OrHash, - Orb::NewFloatingPackageWithAllocationPrice::OrHash, + Orb::NewFloatingGroupedTieredPrice::OrHash, Orb::NewFloatingTieredPackageWithMinimumPrice::OrHash, + Orb::NewFloatingPackageWithAllocationPrice::OrHash, Orb::NewFloatingUnitWithPercentPrice::OrHash, + Orb::NewFloatingMatrixWithAllocationPrice::OrHash, Orb::NewFloatingTieredWithProrationPrice::OrHash, Orb::NewFloatingUnitWithProrationPrice::OrHash, Orb::NewFloatingGroupedAllocationPrice::OrHash, + Orb::NewFloatingBulkWithProrationPrice::OrHash, Orb::NewFloatingGroupedWithProratedMinimumPrice::OrHash, Orb::NewFloatingGroupedWithMeteredMinimumPrice::OrHash, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::OrHash, Orb::NewFloatingMatrixWithDisplayNamePrice::OrHash, - Orb::NewFloatingBulkWithProrationPrice::OrHash, Orb::NewFloatingGroupedTieredPackagePrice::OrHash, + Orb::NewFloatingMaxGroupTieredPackagePrice::OrHash, Orb::NewFloatingScalableMatrixWithUnitPricingPrice::OrHash, Orb::NewFloatingScalableMatrixWithTieredPricingPrice::OrHash, - Orb::NewFloatingCumulativeGroupedBulkPrice::OrHash + Orb::NewFloatingCumulativeGroupedBulkPrice::OrHash, + Orb::NewFloatingMinimumCompositePrice::OrHash, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::OrHash, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::OrHash ) ), price_id: T.nilable(String) @@ -209,8 +210,7 @@ module Orb # [computed properties](/extensibility/advanced-metrics#computed-properties)) used # to group the underlying billable metric grouping_keys: nil, - # An inline price definition to evaluate, allowing you to test price - # configurations before adding them to Orb. + # New floating price request body params. price: nil, # The ID of a price to evaluate that exists in your Orb account. price_id: nil @@ -227,33 +227,34 @@ module Orb T.nilable( T.any( Orb::NewFloatingUnitPrice, - Orb::NewFloatingPackagePrice, - Orb::NewFloatingMatrixPrice, - Orb::NewFloatingMatrixWithAllocationPrice, Orb::NewFloatingTieredPrice, - Orb::NewFloatingTieredBPSPrice, - Orb::NewFloatingBPSPrice, - Orb::NewFloatingBulkBPSPrice, Orb::NewFloatingBulkPrice, + Orb::NewFloatingPackagePrice, + Orb::NewFloatingMatrixPrice, Orb::NewFloatingThresholdTotalAmountPrice, Orb::NewFloatingTieredPackagePrice, - Orb::NewFloatingGroupedTieredPrice, - Orb::NewFloatingMaxGroupTieredPackagePrice, Orb::NewFloatingTieredWithMinimumPrice, - Orb::NewFloatingPackageWithAllocationPrice, + Orb::NewFloatingGroupedTieredPrice, Orb::NewFloatingTieredPackageWithMinimumPrice, + Orb::NewFloatingPackageWithAllocationPrice, Orb::NewFloatingUnitWithPercentPrice, + Orb::NewFloatingMatrixWithAllocationPrice, Orb::NewFloatingTieredWithProrationPrice, Orb::NewFloatingUnitWithProrationPrice, Orb::NewFloatingGroupedAllocationPrice, + Orb::NewFloatingBulkWithProrationPrice, Orb::NewFloatingGroupedWithProratedMinimumPrice, Orb::NewFloatingGroupedWithMeteredMinimumPrice, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds, Orb::NewFloatingMatrixWithDisplayNamePrice, - Orb::NewFloatingBulkWithProrationPrice, Orb::NewFloatingGroupedTieredPackagePrice, + Orb::NewFloatingMaxGroupTieredPackagePrice, Orb::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::NewFloatingScalableMatrixWithTieredPricingPrice, - Orb::NewFloatingCumulativeGroupedBulkPrice + Orb::NewFloatingCumulativeGroupedBulkPrice, + Orb::NewFloatingMinimumCompositePrice, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput ) ), price_id: T.nilable(String) @@ -263,8 +264,7 @@ module Orb def to_hash end - # An inline price definition to evaluate, allowing you to test price - # configurations before adding them to Orb. + # New floating price request body params. module Price extend Orb::Internal::Type::Union @@ -272,35 +272,1074 @@ module Orb T.type_alias do T.any( Orb::NewFloatingUnitPrice, - Orb::NewFloatingPackagePrice, - Orb::NewFloatingMatrixPrice, - Orb::NewFloatingMatrixWithAllocationPrice, Orb::NewFloatingTieredPrice, - Orb::NewFloatingTieredBPSPrice, - Orb::NewFloatingBPSPrice, - Orb::NewFloatingBulkBPSPrice, Orb::NewFloatingBulkPrice, + Orb::NewFloatingPackagePrice, + Orb::NewFloatingMatrixPrice, Orb::NewFloatingThresholdTotalAmountPrice, Orb::NewFloatingTieredPackagePrice, - Orb::NewFloatingGroupedTieredPrice, - Orb::NewFloatingMaxGroupTieredPackagePrice, Orb::NewFloatingTieredWithMinimumPrice, - Orb::NewFloatingPackageWithAllocationPrice, + Orb::NewFloatingGroupedTieredPrice, Orb::NewFloatingTieredPackageWithMinimumPrice, + Orb::NewFloatingPackageWithAllocationPrice, Orb::NewFloatingUnitWithPercentPrice, + Orb::NewFloatingMatrixWithAllocationPrice, Orb::NewFloatingTieredWithProrationPrice, Orb::NewFloatingUnitWithProrationPrice, Orb::NewFloatingGroupedAllocationPrice, + Orb::NewFloatingBulkWithProrationPrice, Orb::NewFloatingGroupedWithProratedMinimumPrice, Orb::NewFloatingGroupedWithMeteredMinimumPrice, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds, Orb::NewFloatingMatrixWithDisplayNamePrice, - Orb::NewFloatingBulkWithProrationPrice, Orb::NewFloatingGroupedTieredPackagePrice, + Orb::NewFloatingMaxGroupTieredPackagePrice, Orb::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::NewFloatingScalableMatrixWithTieredPricingPrice, - Orb::NewFloatingCumulativeGroupedBulkPrice + Orb::NewFloatingCumulativeGroupedBulkPrice, + Orb::NewFloatingMinimumCompositePrice, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput + ) + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # An ISO 4217 currency string for which this price is billed in. + sig { returns(String) } + attr_accessor :currency + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + returns( + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + ) + end + attr_reader :grouped_with_min_max_thresholds_config + + sig do + params( + grouped_with_min_max_thresholds_config: + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash + ).void + end + attr_writer :grouped_with_min_max_thresholds_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + currency: String, + grouped_with_min_max_thresholds_config: + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # An ISO 4217 currency string for which this price is billed in. + currency:, + # Configuration for grouped_with_min_max_thresholds pricing + grouped_with_min_max_thresholds_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # The pricing model type + model_type: :grouped_with_min_max_thresholds + ) + end + + sig do + override.returns( + { + cadence: + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + currency: String, + grouped_with_min_max_thresholds_config: + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before applying thresholds + sig { returns(String) } + attr_accessor :grouping_key + + # The maximum amount to charge each group + sig { returns(String) } + attr_accessor :maximum_charge + + # The minimum amount to charge each group, regardless of usage + sig { returns(String) } + attr_accessor :minimum_charge + + # The base price charged per group + sig { returns(String) } + attr_accessor :per_unit_rate + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + params( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before applying thresholds + grouping_key:, + # The maximum amount to charge each group + maximum_charge:, + # The minimum amount to charge each group, regardless of usage + minimum_charge:, + # The base price charged per group + per_unit_rate: + ) + end + + sig do + override.returns( + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + ) + end + def to_hash + end + end + end + + class Percent < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # An ISO 4217 currency string for which this price is billed in. + sig { returns(String) } + attr_accessor :currency + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # Configuration for percent pricing + sig do + returns( + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::PercentConfig + ) + end + attr_reader :percent_config + + sig do + params( + percent_config: + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::PercentConfig::OrHash + ).void + end + attr_writer :percent_config + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) ) end + attr_accessor :conversion_rate_config + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::Cadence::OrSymbol, + currency: String, + item_id: String, + name: String, + percent_config: + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::PercentConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # An ISO 4217 currency string for which this price is billed in. + currency:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for percent pricing + percent_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # The pricing model type + model_type: :percent + ) + end + + sig do + override.returns( + { + cadence: + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::Cadence::OrSymbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + percent_config: + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::PercentConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class PercentConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::PercentConfig, + Orb::Internal::AnyHash + ) + end + + # What percent of the component subtotals to charge + sig { returns(Float) } + attr_accessor :percent + + # Configuration for percent pricing + sig { params(percent: Float).returns(T.attached_class) } + def self.new( + # What percent of the component subtotals to charge + percent: + ) + end + + sig { override.returns({ percent: Float }) } + def to_hash + end + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # An ISO 4217 currency string for which this price is billed in. + sig { returns(String) } + attr_accessor :currency + + # Configuration for event_output pricing + sig do + returns( + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::EventOutputConfig + ) + end + attr_reader :event_output_config + + sig do + params( + event_output_config: + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::EventOutputConfig::OrHash + ).void + end + attr_writer :event_output_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::Cadence::OrSymbol, + currency: String, + event_output_config: + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::EventOutputConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # An ISO 4217 currency string for which this price is billed in. + currency:, + # Configuration for event_output pricing + event_output_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # The pricing model type + model_type: :event_output + ) + end + + sig do + override.returns( + { + cadence: + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::Cadence::OrSymbol, + currency: String, + event_output_config: + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class EventOutputConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::EventOutputConfig, + Orb::Internal::AnyHash + ) + end + + # The key in the event data to extract the unit rate from. + sig { returns(String) } + attr_accessor :unit_rating_key + + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + sig { returns(T.nilable(String)) } + attr_accessor :grouping_key + + # Configuration for event_output pricing + sig do + params( + unit_rating_key: String, + grouping_key: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The key in the event data to extract the unit rate from. + unit_rating_key:, + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + grouping_key: nil + ) + end + + sig do + override.returns( + { unit_rating_key: String, grouping_key: T.nilable(String) } + ) + end + def to_hash + end + end + end sig do override.returns( diff --git a/rbi/orb/models/price_evaluate_preview_events_params.rbi b/rbi/orb/models/price_evaluate_preview_events_params.rbi index 22a9bc58..749010a1 100644 --- a/rbi/orb/models/price_evaluate_preview_events_params.rbi +++ b/rbi/orb/models/price_evaluate_preview_events_params.rbi @@ -214,40 +214,40 @@ module Orb sig { params(grouping_keys: T::Array[String]).void } attr_writer :grouping_keys - # An inline price definition to evaluate, allowing you to test price - # configurations before adding them to Orb. + # New floating price request body params. sig do returns( T.nilable( T.any( Orb::NewFloatingUnitPrice, - Orb::NewFloatingPackagePrice, - Orb::NewFloatingMatrixPrice, - Orb::NewFloatingMatrixWithAllocationPrice, Orb::NewFloatingTieredPrice, - Orb::NewFloatingTieredBPSPrice, - Orb::NewFloatingBPSPrice, - Orb::NewFloatingBulkBPSPrice, Orb::NewFloatingBulkPrice, + Orb::NewFloatingPackagePrice, + Orb::NewFloatingMatrixPrice, Orb::NewFloatingThresholdTotalAmountPrice, Orb::NewFloatingTieredPackagePrice, - Orb::NewFloatingGroupedTieredPrice, - Orb::NewFloatingMaxGroupTieredPackagePrice, Orb::NewFloatingTieredWithMinimumPrice, - Orb::NewFloatingPackageWithAllocationPrice, + Orb::NewFloatingGroupedTieredPrice, Orb::NewFloatingTieredPackageWithMinimumPrice, + Orb::NewFloatingPackageWithAllocationPrice, Orb::NewFloatingUnitWithPercentPrice, + Orb::NewFloatingMatrixWithAllocationPrice, Orb::NewFloatingTieredWithProrationPrice, Orb::NewFloatingUnitWithProrationPrice, Orb::NewFloatingGroupedAllocationPrice, + Orb::NewFloatingBulkWithProrationPrice, Orb::NewFloatingGroupedWithProratedMinimumPrice, Orb::NewFloatingGroupedWithMeteredMinimumPrice, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds, Orb::NewFloatingMatrixWithDisplayNamePrice, - Orb::NewFloatingBulkWithProrationPrice, Orb::NewFloatingGroupedTieredPackagePrice, + Orb::NewFloatingMaxGroupTieredPackagePrice, Orb::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::NewFloatingScalableMatrixWithTieredPricingPrice, - Orb::NewFloatingCumulativeGroupedBulkPrice + Orb::NewFloatingCumulativeGroupedBulkPrice, + Orb::NewFloatingMinimumCompositePrice, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput ) ) ) @@ -267,33 +267,34 @@ module Orb T.nilable( T.any( Orb::NewFloatingUnitPrice::OrHash, - Orb::NewFloatingPackagePrice::OrHash, - Orb::NewFloatingMatrixPrice::OrHash, - Orb::NewFloatingMatrixWithAllocationPrice::OrHash, Orb::NewFloatingTieredPrice::OrHash, - Orb::NewFloatingTieredBPSPrice::OrHash, - Orb::NewFloatingBPSPrice::OrHash, - Orb::NewFloatingBulkBPSPrice::OrHash, Orb::NewFloatingBulkPrice::OrHash, + Orb::NewFloatingPackagePrice::OrHash, + Orb::NewFloatingMatrixPrice::OrHash, Orb::NewFloatingThresholdTotalAmountPrice::OrHash, Orb::NewFloatingTieredPackagePrice::OrHash, - Orb::NewFloatingGroupedTieredPrice::OrHash, - Orb::NewFloatingMaxGroupTieredPackagePrice::OrHash, Orb::NewFloatingTieredWithMinimumPrice::OrHash, - Orb::NewFloatingPackageWithAllocationPrice::OrHash, + Orb::NewFloatingGroupedTieredPrice::OrHash, Orb::NewFloatingTieredPackageWithMinimumPrice::OrHash, + Orb::NewFloatingPackageWithAllocationPrice::OrHash, Orb::NewFloatingUnitWithPercentPrice::OrHash, + Orb::NewFloatingMatrixWithAllocationPrice::OrHash, Orb::NewFloatingTieredWithProrationPrice::OrHash, Orb::NewFloatingUnitWithProrationPrice::OrHash, Orb::NewFloatingGroupedAllocationPrice::OrHash, + Orb::NewFloatingBulkWithProrationPrice::OrHash, Orb::NewFloatingGroupedWithProratedMinimumPrice::OrHash, Orb::NewFloatingGroupedWithMeteredMinimumPrice::OrHash, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::OrHash, Orb::NewFloatingMatrixWithDisplayNamePrice::OrHash, - Orb::NewFloatingBulkWithProrationPrice::OrHash, Orb::NewFloatingGroupedTieredPackagePrice::OrHash, + Orb::NewFloatingMaxGroupTieredPackagePrice::OrHash, Orb::NewFloatingScalableMatrixWithUnitPricingPrice::OrHash, Orb::NewFloatingScalableMatrixWithTieredPricingPrice::OrHash, - Orb::NewFloatingCumulativeGroupedBulkPrice::OrHash + Orb::NewFloatingCumulativeGroupedBulkPrice::OrHash, + Orb::NewFloatingMinimumCompositePrice::OrHash, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::OrHash, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::OrHash ) ), price_id: T.nilable(String) @@ -310,8 +311,7 @@ module Orb # [computed properties](/extensibility/advanced-metrics#computed-properties)) used # to group the underlying billable metric grouping_keys: nil, - # An inline price definition to evaluate, allowing you to test price - # configurations before adding them to Orb. + # New floating price request body params. price: nil, # The ID of a price to evaluate that exists in your Orb account. price_id: nil @@ -328,33 +328,34 @@ module Orb T.nilable( T.any( Orb::NewFloatingUnitPrice, - Orb::NewFloatingPackagePrice, - Orb::NewFloatingMatrixPrice, - Orb::NewFloatingMatrixWithAllocationPrice, Orb::NewFloatingTieredPrice, - Orb::NewFloatingTieredBPSPrice, - Orb::NewFloatingBPSPrice, - Orb::NewFloatingBulkBPSPrice, Orb::NewFloatingBulkPrice, + Orb::NewFloatingPackagePrice, + Orb::NewFloatingMatrixPrice, Orb::NewFloatingThresholdTotalAmountPrice, Orb::NewFloatingTieredPackagePrice, - Orb::NewFloatingGroupedTieredPrice, - Orb::NewFloatingMaxGroupTieredPackagePrice, Orb::NewFloatingTieredWithMinimumPrice, - Orb::NewFloatingPackageWithAllocationPrice, + Orb::NewFloatingGroupedTieredPrice, Orb::NewFloatingTieredPackageWithMinimumPrice, + Orb::NewFloatingPackageWithAllocationPrice, Orb::NewFloatingUnitWithPercentPrice, + Orb::NewFloatingMatrixWithAllocationPrice, Orb::NewFloatingTieredWithProrationPrice, Orb::NewFloatingUnitWithProrationPrice, Orb::NewFloatingGroupedAllocationPrice, + Orb::NewFloatingBulkWithProrationPrice, Orb::NewFloatingGroupedWithProratedMinimumPrice, Orb::NewFloatingGroupedWithMeteredMinimumPrice, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds, Orb::NewFloatingMatrixWithDisplayNamePrice, - Orb::NewFloatingBulkWithProrationPrice, Orb::NewFloatingGroupedTieredPackagePrice, + Orb::NewFloatingMaxGroupTieredPackagePrice, Orb::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::NewFloatingScalableMatrixWithTieredPricingPrice, - Orb::NewFloatingCumulativeGroupedBulkPrice + Orb::NewFloatingCumulativeGroupedBulkPrice, + Orb::NewFloatingMinimumCompositePrice, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput ) ), price_id: T.nilable(String) @@ -364,8 +365,7 @@ module Orb def to_hash end - # An inline price definition to evaluate, allowing you to test price - # configurations before adding them to Orb. + # New floating price request body params. module Price extend Orb::Internal::Type::Union @@ -373,35 +373,1074 @@ module Orb T.type_alias do T.any( Orb::NewFloatingUnitPrice, - Orb::NewFloatingPackagePrice, - Orb::NewFloatingMatrixPrice, - Orb::NewFloatingMatrixWithAllocationPrice, Orb::NewFloatingTieredPrice, - Orb::NewFloatingTieredBPSPrice, - Orb::NewFloatingBPSPrice, - Orb::NewFloatingBulkBPSPrice, Orb::NewFloatingBulkPrice, + Orb::NewFloatingPackagePrice, + Orb::NewFloatingMatrixPrice, Orb::NewFloatingThresholdTotalAmountPrice, Orb::NewFloatingTieredPackagePrice, - Orb::NewFloatingGroupedTieredPrice, - Orb::NewFloatingMaxGroupTieredPackagePrice, Orb::NewFloatingTieredWithMinimumPrice, - Orb::NewFloatingPackageWithAllocationPrice, + Orb::NewFloatingGroupedTieredPrice, Orb::NewFloatingTieredPackageWithMinimumPrice, + Orb::NewFloatingPackageWithAllocationPrice, Orb::NewFloatingUnitWithPercentPrice, + Orb::NewFloatingMatrixWithAllocationPrice, Orb::NewFloatingTieredWithProrationPrice, Orb::NewFloatingUnitWithProrationPrice, Orb::NewFloatingGroupedAllocationPrice, + Orb::NewFloatingBulkWithProrationPrice, Orb::NewFloatingGroupedWithProratedMinimumPrice, Orb::NewFloatingGroupedWithMeteredMinimumPrice, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds, Orb::NewFloatingMatrixWithDisplayNamePrice, - Orb::NewFloatingBulkWithProrationPrice, Orb::NewFloatingGroupedTieredPackagePrice, + Orb::NewFloatingMaxGroupTieredPackagePrice, Orb::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::NewFloatingScalableMatrixWithTieredPricingPrice, - Orb::NewFloatingCumulativeGroupedBulkPrice + Orb::NewFloatingCumulativeGroupedBulkPrice, + Orb::NewFloatingMinimumCompositePrice, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput + ) + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # An ISO 4217 currency string for which this price is billed in. + sig { returns(String) } + attr_accessor :currency + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + returns( + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + ) + end + attr_reader :grouped_with_min_max_thresholds_config + + sig do + params( + grouped_with_min_max_thresholds_config: + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash + ).void + end + attr_writer :grouped_with_min_max_thresholds_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + currency: String, + grouped_with_min_max_thresholds_config: + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # An ISO 4217 currency string for which this price is billed in. + currency:, + # Configuration for grouped_with_min_max_thresholds pricing + grouped_with_min_max_thresholds_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # The pricing model type + model_type: :grouped_with_min_max_thresholds + ) + end + + sig do + override.returns( + { + cadence: + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + currency: String, + grouped_with_min_max_thresholds_config: + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before applying thresholds + sig { returns(String) } + attr_accessor :grouping_key + + # The maximum amount to charge each group + sig { returns(String) } + attr_accessor :maximum_charge + + # The minimum amount to charge each group, regardless of usage + sig { returns(String) } + attr_accessor :minimum_charge + + # The base price charged per group + sig { returns(String) } + attr_accessor :per_unit_rate + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + params( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before applying thresholds + grouping_key:, + # The maximum amount to charge each group + maximum_charge:, + # The minimum amount to charge each group, regardless of usage + minimum_charge:, + # The base price charged per group + per_unit_rate: + ) + end + + sig do + override.returns( + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + ) + end + def to_hash + end + end + end + + class Percent < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # An ISO 4217 currency string for which this price is billed in. + sig { returns(String) } + attr_accessor :currency + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # Configuration for percent pricing + sig do + returns( + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::PercentConfig + ) + end + attr_reader :percent_config + + sig do + params( + percent_config: + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::PercentConfig::OrHash + ).void + end + attr_writer :percent_config + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) ) end + attr_accessor :conversion_rate_config + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::Cadence::OrSymbol, + currency: String, + item_id: String, + name: String, + percent_config: + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::PercentConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # An ISO 4217 currency string for which this price is billed in. + currency:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for percent pricing + percent_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # The pricing model type + model_type: :percent + ) + end + + sig do + override.returns( + { + cadence: + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::Cadence::OrSymbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + percent_config: + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::PercentConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class PercentConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::PercentConfig, + Orb::Internal::AnyHash + ) + end + + # What percent of the component subtotals to charge + sig { returns(Float) } + attr_accessor :percent + + # Configuration for percent pricing + sig { params(percent: Float).returns(T.attached_class) } + def self.new( + # What percent of the component subtotals to charge + percent: + ) + end + + sig { override.returns({ percent: Float }) } + def to_hash + end + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # An ISO 4217 currency string for which this price is billed in. + sig { returns(String) } + attr_accessor :currency + + # Configuration for event_output pricing + sig do + returns( + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::EventOutputConfig + ) + end + attr_reader :event_output_config + + sig do + params( + event_output_config: + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::EventOutputConfig::OrHash + ).void + end + attr_writer :event_output_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::Cadence::OrSymbol, + currency: String, + event_output_config: + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::EventOutputConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # An ISO 4217 currency string for which this price is billed in. + currency:, + # Configuration for event_output pricing + event_output_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # The pricing model type + model_type: :event_output + ) + end + + sig do + override.returns( + { + cadence: + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::Cadence::OrSymbol, + currency: String, + event_output_config: + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class EventOutputConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::EventOutputConfig, + Orb::Internal::AnyHash + ) + end + + # The key in the event data to extract the unit rate from. + sig { returns(String) } + attr_accessor :unit_rating_key + + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + sig { returns(T.nilable(String)) } + attr_accessor :grouping_key + + # Configuration for event_output pricing + sig do + params( + unit_rating_key: String, + grouping_key: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The key in the event data to extract the unit rate from. + unit_rating_key:, + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + grouping_key: nil + ) + end + + sig do + override.returns( + { unit_rating_key: String, grouping_key: T.nilable(String) } + ) + end + def to_hash + end + end + end sig do override.returns( diff --git a/rbi/orb/models/price_interval.rbi b/rbi/orb/models/price_interval.rbi index 4513fee2..1e875257 100644 --- a/rbi/orb/models/price_interval.rbi +++ b/rbi/orb/models/price_interval.rbi @@ -78,17 +78,14 @@ module Orb price: T.any( Orb::Price::Unit::OrHash, - Orb::Price::Package::OrHash, - Orb::Price::Matrix::OrHash, Orb::Price::Tiered::OrHash, - Orb::Price::TieredBPS::OrHash, - Orb::Price::BPS::OrHash, - Orb::Price::BulkBPS::OrHash, Orb::Price::Bulk::OrHash, + Orb::Price::Package::OrHash, + Orb::Price::Matrix::OrHash, Orb::Price::ThresholdTotalAmount::OrHash, Orb::Price::TieredPackage::OrHash, - Orb::Price::GroupedTiered::OrHash, Orb::Price::TieredWithMinimum::OrHash, + Orb::Price::GroupedTiered::OrHash, Orb::Price::TieredPackageWithMinimum::OrHash, Orb::Price::PackageWithAllocation::OrHash, Orb::Price::UnitWithPercent::OrHash, @@ -96,16 +93,19 @@ module Orb Orb::Price::TieredWithProration::OrHash, Orb::Price::UnitWithProration::OrHash, Orb::Price::GroupedAllocation::OrHash, + Orb::Price::BulkWithProration::OrHash, Orb::Price::GroupedWithProratedMinimum::OrHash, Orb::Price::GroupedWithMeteredMinimum::OrHash, + Orb::Price::GroupedWithMinMaxThresholds::OrHash, Orb::Price::MatrixWithDisplayName::OrHash, - Orb::Price::BulkWithProration::OrHash, Orb::Price::GroupedTieredPackage::OrHash, Orb::Price::MaxGroupTieredPackage::OrHash, Orb::Price::ScalableMatrixWithUnitPricing::OrHash, Orb::Price::ScalableMatrixWithTieredPricing::OrHash, Orb::Price::CumulativeGroupedBulk::OrHash, - Orb::Price::GroupedWithMinMaxThresholds::OrHash + Orb::Price::Minimum::OrHash, + Orb::Price::Percent::OrHash, + Orb::Price::EventOutput::OrHash ), start_date: Time, usage_customer_ids: T.nilable(T::Array[String]) diff --git a/rbi/orb/models/subscription_change_apply_params.rbi b/rbi/orb/models/subscription_change_apply_params.rbi index b523cd86..75829791 100644 --- a/rbi/orb/models/subscription_change_apply_params.rbi +++ b/rbi/orb/models/subscription_change_apply_params.rbi @@ -15,13 +15,20 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :description - # Amount already collected to apply to the customer's balance. + # Mark all pending invoices that are payable as paid. If amount is also provided, + # mark as paid and credit the difference to the customer's balance. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :mark_as_paid + + # Amount already collected to apply to the customer's balance. If mark_as_paid is + # also provided, credit the difference to the customer's balance. sig { returns(T.nilable(String)) } attr_accessor :previously_collected_amount sig do params( description: T.nilable(String), + mark_as_paid: T.nilable(T::Boolean), previously_collected_amount: T.nilable(String), request_options: Orb::RequestOptions::OrHash ).returns(T.attached_class) @@ -29,7 +36,11 @@ module Orb def self.new( # Description to apply to the balance transaction representing this credit. description: nil, - # Amount already collected to apply to the customer's balance. + # Mark all pending invoices that are payable as paid. If amount is also provided, + # mark as paid and credit the difference to the customer's balance. + mark_as_paid: nil, + # Amount already collected to apply to the customer's balance. If mark_as_paid is + # also provided, credit the difference to the customer's balance. previously_collected_amount: nil, request_options: {} ) @@ -39,6 +50,7 @@ module Orb override.returns( { description: T.nilable(String), + mark_as_paid: T.nilable(T::Boolean), previously_collected_amount: T.nilable(String), request_options: Orb::RequestOptions } diff --git a/rbi/orb/models/subscription_create_params.rbi b/rbi/orb/models/subscription_create_params.rbi index 408face6..12cc58cc 100644 --- a/rbi/orb/models/subscription_create_params.rbi +++ b/rbi/orb/models/subscription_create_params.rbi @@ -578,39 +578,40 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - # The definition of a new price to create and add to the subscription. + # New subscription price request body params. sig do returns( T.nilable( T.any( Orb::NewSubscriptionUnitPrice, - Orb::NewSubscriptionPackagePrice, - Orb::NewSubscriptionMatrixPrice, Orb::NewSubscriptionTieredPrice, - Orb::NewSubscriptionTieredBPSPrice, - Orb::NewSubscriptionBPSPrice, - Orb::NewSubscriptionBulkBPSPrice, Orb::NewSubscriptionBulkPrice, + Orb::NewSubscriptionPackagePrice, + Orb::NewSubscriptionMatrixPrice, Orb::NewSubscriptionThresholdTotalAmountPrice, Orb::NewSubscriptionTieredPackagePrice, Orb::NewSubscriptionTieredWithMinimumPrice, - Orb::NewSubscriptionUnitWithPercentPrice, + Orb::NewSubscriptionGroupedTieredPrice, + Orb::NewSubscriptionTieredPackageWithMinimumPrice, Orb::NewSubscriptionPackageWithAllocationPrice, - Orb::NewSubscriptionTierWithProrationPrice, + Orb::NewSubscriptionUnitWithPercentPrice, + Orb::NewSubscriptionMatrixWithAllocationPrice, + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration, Orb::NewSubscriptionUnitWithProrationPrice, Orb::NewSubscriptionGroupedAllocationPrice, - Orb::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::NewSubscriptionBulkWithProrationPrice, - Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, - Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, - Orb::NewSubscriptionCumulativeGroupedBulkPrice, - Orb::NewSubscriptionMaxGroupTieredPackagePrice, + Orb::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::NewSubscriptionGroupedWithMeteredMinimumPrice, + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::NewSubscriptionMatrixWithDisplayNamePrice, Orb::NewSubscriptionGroupedTieredPackagePrice, - Orb::NewSubscriptionMatrixWithAllocationPrice, - Orb::NewSubscriptionTieredPackageWithMinimumPrice, - Orb::NewSubscriptionGroupedTieredPrice + Orb::NewSubscriptionMaxGroupTieredPackagePrice, + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, + Orb::NewSubscriptionCumulativeGroupedBulkPrice, + Orb::NewSubscriptionMinimumCompositePrice, + Orb::SubscriptionCreateParams::AddPrice::Price::Percent, + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput ) ) ) @@ -640,33 +641,34 @@ module Orb T.nilable( T.any( Orb::NewSubscriptionUnitPrice::OrHash, - Orb::NewSubscriptionPackagePrice::OrHash, - Orb::NewSubscriptionMatrixPrice::OrHash, Orb::NewSubscriptionTieredPrice::OrHash, - Orb::NewSubscriptionTieredBPSPrice::OrHash, - Orb::NewSubscriptionBPSPrice::OrHash, - Orb::NewSubscriptionBulkBPSPrice::OrHash, Orb::NewSubscriptionBulkPrice::OrHash, + Orb::NewSubscriptionPackagePrice::OrHash, + Orb::NewSubscriptionMatrixPrice::OrHash, Orb::NewSubscriptionThresholdTotalAmountPrice::OrHash, Orb::NewSubscriptionTieredPackagePrice::OrHash, Orb::NewSubscriptionTieredWithMinimumPrice::OrHash, - Orb::NewSubscriptionUnitWithPercentPrice::OrHash, + Orb::NewSubscriptionGroupedTieredPrice::OrHash, + Orb::NewSubscriptionTieredPackageWithMinimumPrice::OrHash, Orb::NewSubscriptionPackageWithAllocationPrice::OrHash, - Orb::NewSubscriptionTierWithProrationPrice::OrHash, + Orb::NewSubscriptionUnitWithPercentPrice::OrHash, + Orb::NewSubscriptionMatrixWithAllocationPrice::OrHash, + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::OrHash, Orb::NewSubscriptionUnitWithProrationPrice::OrHash, Orb::NewSubscriptionGroupedAllocationPrice::OrHash, - Orb::NewSubscriptionGroupedWithProratedMinimumPrice::OrHash, Orb::NewSubscriptionBulkWithProrationPrice::OrHash, - Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::OrHash, - Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::OrHash, - Orb::NewSubscriptionCumulativeGroupedBulkPrice::OrHash, - Orb::NewSubscriptionMaxGroupTieredPackagePrice::OrHash, + Orb::NewSubscriptionGroupedWithProratedMinimumPrice::OrHash, Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::OrHash, + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::OrHash, Orb::NewSubscriptionMatrixWithDisplayNamePrice::OrHash, Orb::NewSubscriptionGroupedTieredPackagePrice::OrHash, - Orb::NewSubscriptionMatrixWithAllocationPrice::OrHash, - Orb::NewSubscriptionTieredPackageWithMinimumPrice::OrHash, - Orb::NewSubscriptionGroupedTieredPrice::OrHash + Orb::NewSubscriptionMaxGroupTieredPackagePrice::OrHash, + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::OrHash, + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::OrHash, + Orb::NewSubscriptionCumulativeGroupedBulkPrice::OrHash, + Orb::NewSubscriptionMinimumCompositePrice::OrHash, + Orb::SubscriptionCreateParams::AddPrice::Price::Percent::OrHash, + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::OrHash ) ), price_id: T.nilable(String), @@ -693,7 +695,7 @@ module Orb minimum_amount: nil, # The phase to add this price to. plan_phase_order: nil, - # The definition of a new price to create and add to the subscription. + # New subscription price request body params. price: nil, # The id of the price to add to the subscription. price_id: nil, @@ -718,33 +720,34 @@ module Orb T.nilable( T.any( Orb::NewSubscriptionUnitPrice, - Orb::NewSubscriptionPackagePrice, - Orb::NewSubscriptionMatrixPrice, Orb::NewSubscriptionTieredPrice, - Orb::NewSubscriptionTieredBPSPrice, - Orb::NewSubscriptionBPSPrice, - Orb::NewSubscriptionBulkBPSPrice, Orb::NewSubscriptionBulkPrice, + Orb::NewSubscriptionPackagePrice, + Orb::NewSubscriptionMatrixPrice, Orb::NewSubscriptionThresholdTotalAmountPrice, Orb::NewSubscriptionTieredPackagePrice, Orb::NewSubscriptionTieredWithMinimumPrice, - Orb::NewSubscriptionUnitWithPercentPrice, + Orb::NewSubscriptionGroupedTieredPrice, + Orb::NewSubscriptionTieredPackageWithMinimumPrice, Orb::NewSubscriptionPackageWithAllocationPrice, - Orb::NewSubscriptionTierWithProrationPrice, + Orb::NewSubscriptionUnitWithPercentPrice, + Orb::NewSubscriptionMatrixWithAllocationPrice, + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration, Orb::NewSubscriptionUnitWithProrationPrice, Orb::NewSubscriptionGroupedAllocationPrice, - Orb::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::NewSubscriptionBulkWithProrationPrice, - Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, - Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, - Orb::NewSubscriptionCumulativeGroupedBulkPrice, - Orb::NewSubscriptionMaxGroupTieredPackagePrice, + Orb::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::NewSubscriptionGroupedWithMeteredMinimumPrice, + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::NewSubscriptionMatrixWithDisplayNamePrice, Orb::NewSubscriptionGroupedTieredPackagePrice, - Orb::NewSubscriptionMatrixWithAllocationPrice, - Orb::NewSubscriptionTieredPackageWithMinimumPrice, - Orb::NewSubscriptionGroupedTieredPrice + Orb::NewSubscriptionMaxGroupTieredPackagePrice, + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, + Orb::NewSubscriptionCumulativeGroupedBulkPrice, + Orb::NewSubscriptionMinimumCompositePrice, + Orb::SubscriptionCreateParams::AddPrice::Price::Percent, + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput ) ), price_id: T.nilable(String), @@ -755,7 +758,7 @@ module Orb def to_hash end - # The definition of a new price to create and add to the subscription. + # New subscription price request body params. module Price extend Orb::Internal::Type::Union @@ -763,215 +766,1695 @@ module Orb T.type_alias do T.any( Orb::NewSubscriptionUnitPrice, - Orb::NewSubscriptionPackagePrice, - Orb::NewSubscriptionMatrixPrice, Orb::NewSubscriptionTieredPrice, - Orb::NewSubscriptionTieredBPSPrice, - Orb::NewSubscriptionBPSPrice, - Orb::NewSubscriptionBulkBPSPrice, Orb::NewSubscriptionBulkPrice, + Orb::NewSubscriptionPackagePrice, + Orb::NewSubscriptionMatrixPrice, Orb::NewSubscriptionThresholdTotalAmountPrice, Orb::NewSubscriptionTieredPackagePrice, Orb::NewSubscriptionTieredWithMinimumPrice, - Orb::NewSubscriptionUnitWithPercentPrice, + Orb::NewSubscriptionGroupedTieredPrice, + Orb::NewSubscriptionTieredPackageWithMinimumPrice, Orb::NewSubscriptionPackageWithAllocationPrice, - Orb::NewSubscriptionTierWithProrationPrice, + Orb::NewSubscriptionUnitWithPercentPrice, + Orb::NewSubscriptionMatrixWithAllocationPrice, + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration, Orb::NewSubscriptionUnitWithProrationPrice, Orb::NewSubscriptionGroupedAllocationPrice, - Orb::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::NewSubscriptionBulkWithProrationPrice, - Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, - Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, - Orb::NewSubscriptionCumulativeGroupedBulkPrice, - Orb::NewSubscriptionMaxGroupTieredPackagePrice, + Orb::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::NewSubscriptionGroupedWithMeteredMinimumPrice, + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::NewSubscriptionMatrixWithDisplayNamePrice, Orb::NewSubscriptionGroupedTieredPackagePrice, - Orb::NewSubscriptionMatrixWithAllocationPrice, - Orb::NewSubscriptionTieredPackageWithMinimumPrice, - Orb::NewSubscriptionGroupedTieredPrice + Orb::NewSubscriptionMaxGroupTieredPackagePrice, + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, + Orb::NewSubscriptionCumulativeGroupedBulkPrice, + Orb::NewSubscriptionMinimumCompositePrice, + Orb::SubscriptionCreateParams::AddPrice::Price::Percent, + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput ) end - sig do - override.returns( - T::Array[Orb::SubscriptionCreateParams::AddPrice::Price::Variants] - ) - end - def self.variants - end - end - end + class TieredWithProration < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration, + Orb::Internal::AnyHash + ) + end - module ExternalMarketplace - extend Orb::Internal::Type::Enum + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::Cadence::OrSymbol + ) + end + attr_accessor :cadence - TaggedSymbol = - T.type_alias do - T.all(Symbol, Orb::SubscriptionCreateParams::ExternalMarketplace) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id - GOOGLE = - T.let( - :google, - Orb::SubscriptionCreateParams::ExternalMarketplace::TaggedSymbol - ) - AWS = - T.let( - :aws, - Orb::SubscriptionCreateParams::ExternalMarketplace::TaggedSymbol - ) - AZURE = - T.let( - :azure, - Orb::SubscriptionCreateParams::ExternalMarketplace::TaggedSymbol - ) + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type - sig do - override.returns( - T::Array[ - Orb::SubscriptionCreateParams::ExternalMarketplace::TaggedSymbol - ] - ) - end - def self.values - end - end + # The name of the price. + sig { returns(String) } + attr_accessor :name - class RemoveAdjustment < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Orb::SubscriptionCreateParams::RemoveAdjustment, - Orb::Internal::AnyHash - ) - end + # Configuration for tiered_with_proration pricing + sig do + returns( + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig + ) + end + attr_reader :tiered_with_proration_config - # The id of the adjustment to remove on the subscription. - sig { returns(String) } - attr_accessor :adjustment_id + sig do + params( + tiered_with_proration_config: + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::OrHash + ).void + end + attr_writer :tiered_with_proration_config - sig { params(adjustment_id: String).returns(T.attached_class) } - def self.new( - # The id of the adjustment to remove on the subscription. - adjustment_id: - ) - end + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id - sig { override.returns({ adjustment_id: String }) } - def to_hash - end - end + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance - class RemovePrice < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Orb::SubscriptionCreateParams::RemovePrice, - Orb::Internal::AnyHash - ) - end + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration - # The external price id of the price to remove on the subscription. - sig { returns(T.nilable(String)) } - attr_accessor :external_price_id + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration - # The id of the price to remove on the subscription. - sig { returns(T.nilable(String)) } - attr_accessor :price_id + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate - sig do - params( - external_price_id: T.nilable(String), - price_id: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # The external price id of the price to remove on the subscription. - external_price_id: nil, - # The id of the price to remove on the subscription. - price_id: nil - ) - end + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config - sig do - override.returns( - { - external_price_id: T.nilable(String), - price_id: T.nilable(String) - } - ) - end - def to_hash - end - end + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency - class ReplaceAdjustment < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Orb::SubscriptionCreateParams::ReplaceAdjustment, - Orb::Internal::AnyHash - ) - end + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration - # The definition of a new adjustment to create and add to the subscription. - sig do - returns( - T.any( - Orb::NewPercentageDiscount, - Orb::NewUsageDiscount, - Orb::NewAmountDiscount, - Orb::NewMinimum, - Orb::NewMaximum - ) - ) - end - attr_accessor :adjustment + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration - # The id of the adjustment on the plan to replace in the subscription. - sig { returns(String) } - attr_accessor :replaces_adjustment_id + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id - sig do - params( - adjustment: - T.any( - Orb::NewPercentageDiscount::OrHash, - Orb::NewUsageDiscount::OrHash, - Orb::NewAmountDiscount::OrHash, - Orb::NewMinimum::OrHash, - Orb::NewMaximum::OrHash - ), - replaces_adjustment_id: String - ).returns(T.attached_class) - end - def self.new( - # The definition of a new adjustment to create and add to the subscription. - adjustment:, - # The id of the adjustment on the plan to replace in the subscription. - replaces_adjustment_id: - ) - end + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity - sig do - override.returns( - { - adjustment: - T.any( - Orb::NewPercentageDiscount, - Orb::NewUsageDiscount, - Orb::NewAmountDiscount, - Orb::NewMinimum, - Orb::NewMaximum - ), - replaces_adjustment_id: String - } - ) - end - def to_hash - end + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::Cadence::OrSymbol, + item_id: String, + name: String, + tiered_with_proration_config: + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for tiered_with_proration pricing + tiered_with_proration_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :tiered_with_proration + ) + end + + sig do + override.returns( + { + cadence: + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::Cadence::OrSymbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_proration_config: + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig, + Orb::Internal::AnyHash + ) + end + + # Tiers for rating based on total usage quantities into the specified tier with + # proration + sig do + returns( + T::Array[ + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for tiered_with_proration pricing + sig do + params( + tiers: + T::Array[ + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Tiers for rating based on total usage quantities into the specified tier with + # proration + tiers: + ) + end + + sig do + override.returns( + { + tiers: + T::Array[ + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Inclusive tier starting value + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Amount per unit + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tiered with proration tier + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Inclusive tier starting value + tier_lower_bound:, + # Amount per unit + unit_amount: + ) + end + + sig do + override.returns( + { tier_lower_bound: String, unit_amount: String } + ) + end + def to_hash + end + end + end + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + returns( + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + ) + end + attr_reader :grouped_with_min_max_thresholds_config + + sig do + params( + grouped_with_min_max_thresholds_config: + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash + ).void + end + attr_writer :grouped_with_min_max_thresholds_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + grouped_with_min_max_thresholds_config: + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # Configuration for grouped_with_min_max_thresholds pricing + grouped_with_min_max_thresholds_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :grouped_with_min_max_thresholds + ) + end + + sig do + override.returns( + { + cadence: + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + grouped_with_min_max_thresholds_config: + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before applying thresholds + sig { returns(String) } + attr_accessor :grouping_key + + # The maximum amount to charge each group + sig { returns(String) } + attr_accessor :maximum_charge + + # The minimum amount to charge each group, regardless of usage + sig { returns(String) } + attr_accessor :minimum_charge + + # The base price charged per group + sig { returns(String) } + attr_accessor :per_unit_rate + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + params( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before applying thresholds + grouping_key:, + # The maximum amount to charge each group + maximum_charge:, + # The minimum amount to charge each group, regardless of usage + minimum_charge:, + # The base price charged per group + per_unit_rate: + ) + end + + sig do + override.returns( + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + ) + end + def to_hash + end + end + end + + class Percent < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::AddPrice::Price::Percent, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionCreateParams::AddPrice::Price::Percent::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # Configuration for percent pricing + sig do + returns( + Orb::SubscriptionCreateParams::AddPrice::Price::Percent::PercentConfig + ) + end + attr_reader :percent_config + + sig do + params( + percent_config: + Orb::SubscriptionCreateParams::AddPrice::Price::Percent::PercentConfig::OrHash + ).void + end + attr_writer :percent_config + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::SubscriptionCreateParams::AddPrice::Price::Percent::Cadence::OrSymbol, + item_id: String, + name: String, + percent_config: + Orb::SubscriptionCreateParams::AddPrice::Price::Percent::PercentConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for percent pricing + percent_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :percent + ) + end + + sig do + override.returns( + { + cadence: + Orb::SubscriptionCreateParams::AddPrice::Price::Percent::Cadence::OrSymbol, + item_id: String, + model_type: Symbol, + name: String, + percent_config: + Orb::SubscriptionCreateParams::AddPrice::Price::Percent::PercentConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::SubscriptionCreateParams::AddPrice::Price::Percent::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::SubscriptionCreateParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::SubscriptionCreateParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::SubscriptionCreateParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::SubscriptionCreateParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::SubscriptionCreateParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::SubscriptionCreateParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::SubscriptionCreateParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class PercentConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::AddPrice::Price::Percent::PercentConfig, + Orb::Internal::AnyHash + ) + end + + # What percent of the component subtotals to charge + sig { returns(Float) } + attr_accessor :percent + + # Configuration for percent pricing + sig { params(percent: Float).returns(T.attached_class) } + def self.new( + # What percent of the component subtotals to charge + percent: + ) + end + + sig { override.returns({ percent: Float }) } + def to_hash + end + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # Configuration for event_output pricing + sig do + returns( + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::EventOutputConfig + ) + end + attr_reader :event_output_config + + sig do + params( + event_output_config: + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::EventOutputConfig::OrHash + ).void + end + attr_writer :event_output_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::Cadence::OrSymbol, + event_output_config: + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::EventOutputConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # Configuration for event_output pricing + event_output_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :event_output + ) + end + + sig do + override.returns( + { + cadence: + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::Cadence::OrSymbol, + event_output_config: + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class EventOutputConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::EventOutputConfig, + Orb::Internal::AnyHash + ) + end + + # The key in the event data to extract the unit rate from. + sig { returns(String) } + attr_accessor :unit_rating_key + + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + sig { returns(T.nilable(String)) } + attr_accessor :grouping_key + + # Configuration for event_output pricing + sig do + params( + unit_rating_key: String, + grouping_key: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The key in the event data to extract the unit rate from. + unit_rating_key:, + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + grouping_key: nil + ) + end + + sig do + override.returns( + { unit_rating_key: String, grouping_key: T.nilable(String) } + ) + end + def to_hash + end + end + end + + sig do + override.returns( + T::Array[Orb::SubscriptionCreateParams::AddPrice::Price::Variants] + ) + end + def self.variants + end + end + end + + module ExternalMarketplace + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Orb::SubscriptionCreateParams::ExternalMarketplace) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GOOGLE = + T.let( + :google, + Orb::SubscriptionCreateParams::ExternalMarketplace::TaggedSymbol + ) + AWS = + T.let( + :aws, + Orb::SubscriptionCreateParams::ExternalMarketplace::TaggedSymbol + ) + AZURE = + T.let( + :azure, + Orb::SubscriptionCreateParams::ExternalMarketplace::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::SubscriptionCreateParams::ExternalMarketplace::TaggedSymbol + ] + ) + end + def self.values + end + end + + class RemoveAdjustment < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::RemoveAdjustment, + Orb::Internal::AnyHash + ) + end + + # The id of the adjustment to remove on the subscription. + sig { returns(String) } + attr_accessor :adjustment_id + + sig { params(adjustment_id: String).returns(T.attached_class) } + def self.new( + # The id of the adjustment to remove on the subscription. + adjustment_id: + ) + end + + sig { override.returns({ adjustment_id: String }) } + def to_hash + end + end + + class RemovePrice < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::RemovePrice, + Orb::Internal::AnyHash + ) + end + + # The external price id of the price to remove on the subscription. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # The id of the price to remove on the subscription. + sig { returns(T.nilable(String)) } + attr_accessor :price_id + + sig do + params( + external_price_id: T.nilable(String), + price_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The external price id of the price to remove on the subscription. + external_price_id: nil, + # The id of the price to remove on the subscription. + price_id: nil + ) + end + + sig do + override.returns( + { + external_price_id: T.nilable(String), + price_id: T.nilable(String) + } + ) + end + def to_hash + end + end + + class ReplaceAdjustment < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::ReplaceAdjustment, + Orb::Internal::AnyHash + ) + end + + # The definition of a new adjustment to create and add to the subscription. + sig do + returns( + T.any( + Orb::NewPercentageDiscount, + Orb::NewUsageDiscount, + Orb::NewAmountDiscount, + Orb::NewMinimum, + Orb::NewMaximum + ) + ) + end + attr_accessor :adjustment + + # The id of the adjustment on the plan to replace in the subscription. + sig { returns(String) } + attr_accessor :replaces_adjustment_id + + sig do + params( + adjustment: + T.any( + Orb::NewPercentageDiscount::OrHash, + Orb::NewUsageDiscount::OrHash, + Orb::NewAmountDiscount::OrHash, + Orb::NewMinimum::OrHash, + Orb::NewMaximum::OrHash + ), + replaces_adjustment_id: String + ).returns(T.attached_class) + end + def self.new( + # The definition of a new adjustment to create and add to the subscription. + adjustment:, + # The id of the adjustment on the plan to replace in the subscription. + replaces_adjustment_id: + ) + end + + sig do + override.returns( + { + adjustment: + T.any( + Orb::NewPercentageDiscount, + Orb::NewUsageDiscount, + Orb::NewAmountDiscount, + Orb::NewMinimum, + Orb::NewMaximum + ), + replaces_adjustment_id: String + } + ) + end + def to_hash + end # The definition of a new adjustment to create and add to the subscription. module Adjustment @@ -980,273 +2463,1756 @@ module Orb Variants = T.type_alias do T.any( - Orb::NewPercentageDiscount, - Orb::NewUsageDiscount, - Orb::NewAmountDiscount, - Orb::NewMinimum, - Orb::NewMaximum + Orb::NewPercentageDiscount, + Orb::NewUsageDiscount, + Orb::NewAmountDiscount, + Orb::NewMinimum, + Orb::NewMaximum + ) + end + + sig do + override.returns( + T::Array[ + Orb::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::Variants + ] + ) + end + def self.variants + end + end + end + + class ReplacePrice < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::ReplacePrice, + Orb::Internal::AnyHash + ) + end + + # The id of the price on the plan to replace in the subscription. + sig { returns(String) } + attr_accessor :replaces_price_id + + # The definition of a new allocation price to create and add to the subscription. + sig { returns(T.nilable(Orb::NewAllocationPrice)) } + attr_reader :allocation_price + + sig do + params( + allocation_price: T.nilable(Orb::NewAllocationPrice::OrHash) + ).void + end + attr_writer :allocation_price + + # [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the + # replacement price. + sig { returns(T.nilable(T::Array[Orb::DiscountOverride])) } + attr_accessor :discounts + + # The external price id of the price to add to the subscription. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # The new quantity of the price, if the price is a fixed price. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for + # the replacement price. + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + # [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for + # the replacement price. + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + # New subscription price request body params. + sig do + returns( + T.nilable( + T.any( + Orb::NewSubscriptionUnitPrice, + Orb::NewSubscriptionTieredPrice, + Orb::NewSubscriptionBulkPrice, + Orb::NewSubscriptionPackagePrice, + Orb::NewSubscriptionMatrixPrice, + Orb::NewSubscriptionThresholdTotalAmountPrice, + Orb::NewSubscriptionTieredPackagePrice, + Orb::NewSubscriptionTieredWithMinimumPrice, + Orb::NewSubscriptionGroupedTieredPrice, + Orb::NewSubscriptionTieredPackageWithMinimumPrice, + Orb::NewSubscriptionPackageWithAllocationPrice, + Orb::NewSubscriptionUnitWithPercentPrice, + Orb::NewSubscriptionMatrixWithAllocationPrice, + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration, + Orb::NewSubscriptionUnitWithProrationPrice, + Orb::NewSubscriptionGroupedAllocationPrice, + Orb::NewSubscriptionBulkWithProrationPrice, + Orb::NewSubscriptionGroupedWithProratedMinimumPrice, + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice, + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, + Orb::NewSubscriptionMatrixWithDisplayNamePrice, + Orb::NewSubscriptionGroupedTieredPackagePrice, + Orb::NewSubscriptionMaxGroupTieredPackagePrice, + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, + Orb::NewSubscriptionCumulativeGroupedBulkPrice, + Orb::NewSubscriptionMinimumCompositePrice, + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent, + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput + ) + ) + ) + end + attr_accessor :price + + # The id of the price to add to the subscription. + sig { returns(T.nilable(String)) } + attr_accessor :price_id + + sig do + params( + replaces_price_id: String, + allocation_price: T.nilable(Orb::NewAllocationPrice::OrHash), + discounts: T.nilable(T::Array[Orb::DiscountOverride::OrHash]), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + maximum_amount: T.nilable(String), + minimum_amount: T.nilable(String), + price: + T.nilable( + T.any( + Orb::NewSubscriptionUnitPrice::OrHash, + Orb::NewSubscriptionTieredPrice::OrHash, + Orb::NewSubscriptionBulkPrice::OrHash, + Orb::NewSubscriptionPackagePrice::OrHash, + Orb::NewSubscriptionMatrixPrice::OrHash, + Orb::NewSubscriptionThresholdTotalAmountPrice::OrHash, + Orb::NewSubscriptionTieredPackagePrice::OrHash, + Orb::NewSubscriptionTieredWithMinimumPrice::OrHash, + Orb::NewSubscriptionGroupedTieredPrice::OrHash, + Orb::NewSubscriptionTieredPackageWithMinimumPrice::OrHash, + Orb::NewSubscriptionPackageWithAllocationPrice::OrHash, + Orb::NewSubscriptionUnitWithPercentPrice::OrHash, + Orb::NewSubscriptionMatrixWithAllocationPrice::OrHash, + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::OrHash, + Orb::NewSubscriptionUnitWithProrationPrice::OrHash, + Orb::NewSubscriptionGroupedAllocationPrice::OrHash, + Orb::NewSubscriptionBulkWithProrationPrice::OrHash, + Orb::NewSubscriptionGroupedWithProratedMinimumPrice::OrHash, + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::OrHash, + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::OrHash, + Orb::NewSubscriptionMatrixWithDisplayNamePrice::OrHash, + Orb::NewSubscriptionGroupedTieredPackagePrice::OrHash, + Orb::NewSubscriptionMaxGroupTieredPackagePrice::OrHash, + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::OrHash, + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::OrHash, + Orb::NewSubscriptionCumulativeGroupedBulkPrice::OrHash, + Orb::NewSubscriptionMinimumCompositePrice::OrHash, + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::OrHash, + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::OrHash + ) + ), + price_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The id of the price on the plan to replace in the subscription. + replaces_price_id:, + # The definition of a new allocation price to create and add to the subscription. + allocation_price: nil, + # [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the + # replacement price. + discounts: nil, + # The external price id of the price to add to the subscription. + external_price_id: nil, + # The new quantity of the price, if the price is a fixed price. + fixed_price_quantity: nil, + # [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for + # the replacement price. + maximum_amount: nil, + # [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for + # the replacement price. + minimum_amount: nil, + # New subscription price request body params. + price: nil, + # The id of the price to add to the subscription. + price_id: nil + ) + end + + sig do + override.returns( + { + replaces_price_id: String, + allocation_price: T.nilable(Orb::NewAllocationPrice), + discounts: T.nilable(T::Array[Orb::DiscountOverride]), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + maximum_amount: T.nilable(String), + minimum_amount: T.nilable(String), + price: + T.nilable( + T.any( + Orb::NewSubscriptionUnitPrice, + Orb::NewSubscriptionTieredPrice, + Orb::NewSubscriptionBulkPrice, + Orb::NewSubscriptionPackagePrice, + Orb::NewSubscriptionMatrixPrice, + Orb::NewSubscriptionThresholdTotalAmountPrice, + Orb::NewSubscriptionTieredPackagePrice, + Orb::NewSubscriptionTieredWithMinimumPrice, + Orb::NewSubscriptionGroupedTieredPrice, + Orb::NewSubscriptionTieredPackageWithMinimumPrice, + Orb::NewSubscriptionPackageWithAllocationPrice, + Orb::NewSubscriptionUnitWithPercentPrice, + Orb::NewSubscriptionMatrixWithAllocationPrice, + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration, + Orb::NewSubscriptionUnitWithProrationPrice, + Orb::NewSubscriptionGroupedAllocationPrice, + Orb::NewSubscriptionBulkWithProrationPrice, + Orb::NewSubscriptionGroupedWithProratedMinimumPrice, + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice, + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, + Orb::NewSubscriptionMatrixWithDisplayNamePrice, + Orb::NewSubscriptionGroupedTieredPackagePrice, + Orb::NewSubscriptionMaxGroupTieredPackagePrice, + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, + Orb::NewSubscriptionCumulativeGroupedBulkPrice, + Orb::NewSubscriptionMinimumCompositePrice, + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent, + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput + ) + ), + price_id: T.nilable(String) + } + ) + end + def to_hash + end + + # New subscription price request body params. + module Price + extend Orb::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Orb::NewSubscriptionUnitPrice, + Orb::NewSubscriptionTieredPrice, + Orb::NewSubscriptionBulkPrice, + Orb::NewSubscriptionPackagePrice, + Orb::NewSubscriptionMatrixPrice, + Orb::NewSubscriptionThresholdTotalAmountPrice, + Orb::NewSubscriptionTieredPackagePrice, + Orb::NewSubscriptionTieredWithMinimumPrice, + Orb::NewSubscriptionGroupedTieredPrice, + Orb::NewSubscriptionTieredPackageWithMinimumPrice, + Orb::NewSubscriptionPackageWithAllocationPrice, + Orb::NewSubscriptionUnitWithPercentPrice, + Orb::NewSubscriptionMatrixWithAllocationPrice, + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration, + Orb::NewSubscriptionUnitWithProrationPrice, + Orb::NewSubscriptionGroupedAllocationPrice, + Orb::NewSubscriptionBulkWithProrationPrice, + Orb::NewSubscriptionGroupedWithProratedMinimumPrice, + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice, + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, + Orb::NewSubscriptionMatrixWithDisplayNamePrice, + Orb::NewSubscriptionGroupedTieredPackagePrice, + Orb::NewSubscriptionMaxGroupTieredPackagePrice, + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, + Orb::NewSubscriptionCumulativeGroupedBulkPrice, + Orb::NewSubscriptionMinimumCompositePrice, + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent, + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput + ) + end + + class TieredWithProration < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # Configuration for tiered_with_proration pricing + sig do + returns( + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig + ) + end + attr_reader :tiered_with_proration_config + + sig do + params( + tiered_with_proration_config: + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::OrHash + ).void + end + attr_writer :tiered_with_proration_config + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::Cadence::OrSymbol, + item_id: String, + name: String, + tiered_with_proration_config: + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for tiered_with_proration pricing + tiered_with_proration_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :tiered_with_proration + ) + end + + sig do + override.returns( + { + cadence: + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::Cadence::OrSymbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_proration_config: + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig, + Orb::Internal::AnyHash + ) + end + + # Tiers for rating based on total usage quantities into the specified tier with + # proration + sig do + returns( + T::Array[ + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for tiered_with_proration pricing + sig do + params( + tiers: + T::Array[ + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Tiers for rating based on total usage quantities into the specified tier with + # proration + tiers: + ) + end + + sig do + override.returns( + { + tiers: + T::Array[ + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Inclusive tier starting value + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Amount per unit + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tiered with proration tier + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Inclusive tier starting value + tier_lower_bound:, + # Amount per unit + unit_amount: + ) + end + + sig do + override.returns( + { tier_lower_bound: String, unit_amount: String } + ) + end + def to_hash + end + end + end + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + returns( + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + ) + end + attr_reader :grouped_with_min_max_thresholds_config + + sig do + params( + grouped_with_min_max_thresholds_config: + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash + ).void + end + attr_writer :grouped_with_min_max_thresholds_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + grouped_with_min_max_thresholds_config: + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # Configuration for grouped_with_min_max_thresholds pricing + grouped_with_min_max_thresholds_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :grouped_with_min_max_thresholds + ) + end + + sig do + override.returns( + { + cadence: + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + grouped_with_min_max_thresholds_config: + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before applying thresholds + sig { returns(String) } + attr_accessor :grouping_key + + # The maximum amount to charge each group + sig { returns(String) } + attr_accessor :maximum_charge + + # The minimum amount to charge each group, regardless of usage + sig { returns(String) } + attr_accessor :minimum_charge + + # The base price charged per group + sig { returns(String) } + attr_accessor :per_unit_rate + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + params( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before applying thresholds + grouping_key:, + # The maximum amount to charge each group + maximum_charge:, + # The minimum amount to charge each group, regardless of usage + minimum_charge:, + # The base price charged per group + per_unit_rate: + ) + end + + sig do + override.returns( + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + ) + end + def to_hash + end + end + end + + class Percent < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # Configuration for percent pricing + sig do + returns( + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::PercentConfig + ) + end + attr_reader :percent_config + + sig do + params( + percent_config: + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::PercentConfig::OrHash + ).void + end + attr_writer :percent_config + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::Cadence::OrSymbol, + item_id: String, + name: String, + percent_config: + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::PercentConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for percent pricing + percent_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :percent + ) + end + + sig do + override.returns( + { + cadence: + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::Cadence::OrSymbol, + item_id: String, + model_type: Symbol, + name: String, + percent_config: + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::PercentConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class PercentConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::PercentConfig, + Orb::Internal::AnyHash + ) + end + + # What percent of the component subtotals to charge + sig { returns(Float) } + attr_accessor :percent + + # Configuration for percent pricing + sig { params(percent: Float).returns(T.attached_class) } + def self.new( + # What percent of the component subtotals to charge + percent: + ) + end + + sig { override.returns({ percent: Float }) } + def to_hash + end + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::Cadence::OrSymbol ) end + attr_accessor :cadence - sig do - override.returns( - T::Array[ - Orb::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::Variants - ] - ) - end - def self.variants - end - end - end + # Configuration for event_output pricing + sig do + returns( + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::EventOutputConfig + ) + end + attr_reader :event_output_config - class ReplacePrice < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Orb::SubscriptionCreateParams::ReplacePrice, - Orb::Internal::AnyHash - ) - end + sig do + params( + event_output_config: + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::EventOutputConfig::OrHash + ).void + end + attr_writer :event_output_config - # The id of the price on the plan to replace in the subscription. - sig { returns(String) } - attr_accessor :replaces_price_id + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id - # The definition of a new allocation price to create and add to the subscription. - sig { returns(T.nilable(Orb::NewAllocationPrice)) } - attr_reader :allocation_price + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type - sig do - params( - allocation_price: T.nilable(Orb::NewAllocationPrice::OrHash) - ).void - end - attr_writer :allocation_price + # The name of the price. + sig { returns(String) } + attr_accessor :name - # [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the - # replacement price. - sig { returns(T.nilable(T::Array[Orb::DiscountOverride])) } - attr_accessor :discounts + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id - # The external price id of the price to add to the subscription. - sig { returns(T.nilable(String)) } - attr_accessor :external_price_id + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance - # The new quantity of the price, if the price is a fixed price. - sig { returns(T.nilable(Float)) } - attr_accessor :fixed_price_quantity + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration - # [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for - # the replacement price. - sig { returns(T.nilable(String)) } - attr_accessor :maximum_amount + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration - # [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for - # the replacement price. - sig { returns(T.nilable(String)) } - attr_accessor :minimum_amount + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate - # The definition of a new price to create and add to the subscription. - sig do - returns( - T.nilable( - T.any( - Orb::NewSubscriptionUnitPrice, - Orb::NewSubscriptionPackagePrice, - Orb::NewSubscriptionMatrixPrice, - Orb::NewSubscriptionTieredPrice, - Orb::NewSubscriptionTieredBPSPrice, - Orb::NewSubscriptionBPSPrice, - Orb::NewSubscriptionBulkBPSPrice, - Orb::NewSubscriptionBulkPrice, - Orb::NewSubscriptionThresholdTotalAmountPrice, - Orb::NewSubscriptionTieredPackagePrice, - Orb::NewSubscriptionTieredWithMinimumPrice, - Orb::NewSubscriptionUnitWithPercentPrice, - Orb::NewSubscriptionPackageWithAllocationPrice, - Orb::NewSubscriptionTierWithProrationPrice, - Orb::NewSubscriptionUnitWithProrationPrice, - Orb::NewSubscriptionGroupedAllocationPrice, - Orb::NewSubscriptionGroupedWithProratedMinimumPrice, - Orb::NewSubscriptionBulkWithProrationPrice, - Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, - Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, - Orb::NewSubscriptionCumulativeGroupedBulkPrice, - Orb::NewSubscriptionMaxGroupTieredPackagePrice, - Orb::NewSubscriptionGroupedWithMeteredMinimumPrice, - Orb::NewSubscriptionMatrixWithDisplayNamePrice, - Orb::NewSubscriptionGroupedTieredPackagePrice, - Orb::NewSubscriptionMatrixWithAllocationPrice, - Orb::NewSubscriptionTieredPackageWithMinimumPrice, - Orb::NewSubscriptionGroupedTieredPrice + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::Cadence::OrSymbol, + event_output_config: + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::EventOutputConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # Configuration for event_output pricing + event_output_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :event_output ) - ) - end - attr_accessor :price + end - # The id of the price to add to the subscription. - sig { returns(T.nilable(String)) } - attr_accessor :price_id + sig do + override.returns( + { + cadence: + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::Cadence::OrSymbol, + event_output_config: + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end - sig do - params( - replaces_price_id: String, - allocation_price: T.nilable(Orb::NewAllocationPrice::OrHash), - discounts: T.nilable(T::Array[Orb::DiscountOverride::OrHash]), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - maximum_amount: T.nilable(String), - minimum_amount: T.nilable(String), - price: - T.nilable( - T.any( - Orb::NewSubscriptionUnitPrice::OrHash, - Orb::NewSubscriptionPackagePrice::OrHash, - Orb::NewSubscriptionMatrixPrice::OrHash, - Orb::NewSubscriptionTieredPrice::OrHash, - Orb::NewSubscriptionTieredBPSPrice::OrHash, - Orb::NewSubscriptionBPSPrice::OrHash, - Orb::NewSubscriptionBulkBPSPrice::OrHash, - Orb::NewSubscriptionBulkPrice::OrHash, - Orb::NewSubscriptionThresholdTotalAmountPrice::OrHash, - Orb::NewSubscriptionTieredPackagePrice::OrHash, - Orb::NewSubscriptionTieredWithMinimumPrice::OrHash, - Orb::NewSubscriptionUnitWithPercentPrice::OrHash, - Orb::NewSubscriptionPackageWithAllocationPrice::OrHash, - Orb::NewSubscriptionTierWithProrationPrice::OrHash, - Orb::NewSubscriptionUnitWithProrationPrice::OrHash, - Orb::NewSubscriptionGroupedAllocationPrice::OrHash, - Orb::NewSubscriptionGroupedWithProratedMinimumPrice::OrHash, - Orb::NewSubscriptionBulkWithProrationPrice::OrHash, - Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::OrHash, - Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::OrHash, - Orb::NewSubscriptionCumulativeGroupedBulkPrice::OrHash, - Orb::NewSubscriptionMaxGroupTieredPackagePrice::OrHash, - Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::OrHash, - Orb::NewSubscriptionMatrixWithDisplayNamePrice::OrHash, - Orb::NewSubscriptionGroupedTieredPackagePrice::OrHash, - Orb::NewSubscriptionMatrixWithAllocationPrice::OrHash, - Orb::NewSubscriptionTieredPackageWithMinimumPrice::OrHash, - Orb::NewSubscriptionGroupedTieredPrice::OrHash + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol ) - ), - price_id: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # The id of the price on the plan to replace in the subscription. - replaces_price_id:, - # The definition of a new allocation price to create and add to the subscription. - allocation_price: nil, - # [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the - # replacement price. - discounts: nil, - # The external price id of the price to add to the subscription. - external_price_id: nil, - # The new quantity of the price, if the price is a fixed price. - fixed_price_quantity: nil, - # [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for - # the replacement price. - maximum_amount: nil, - # [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for - # the replacement price. - minimum_amount: nil, - # The definition of a new price to create and add to the subscription. - price: nil, - # The id of the price to add to the subscription. - price_id: nil - ) - end - sig do - override.returns( - { - replaces_price_id: String, - allocation_price: T.nilable(Orb::NewAllocationPrice), - discounts: T.nilable(T::Array[Orb::DiscountOverride]), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - maximum_amount: T.nilable(String), - minimum_amount: T.nilable(String), - price: - T.nilable( + sig do + override.returns( + T::Array[ + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class EventOutputConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do T.any( - Orb::NewSubscriptionUnitPrice, - Orb::NewSubscriptionPackagePrice, - Orb::NewSubscriptionMatrixPrice, - Orb::NewSubscriptionTieredPrice, - Orb::NewSubscriptionTieredBPSPrice, - Orb::NewSubscriptionBPSPrice, - Orb::NewSubscriptionBulkBPSPrice, - Orb::NewSubscriptionBulkPrice, - Orb::NewSubscriptionThresholdTotalAmountPrice, - Orb::NewSubscriptionTieredPackagePrice, - Orb::NewSubscriptionTieredWithMinimumPrice, - Orb::NewSubscriptionUnitWithPercentPrice, - Orb::NewSubscriptionPackageWithAllocationPrice, - Orb::NewSubscriptionTierWithProrationPrice, - Orb::NewSubscriptionUnitWithProrationPrice, - Orb::NewSubscriptionGroupedAllocationPrice, - Orb::NewSubscriptionGroupedWithProratedMinimumPrice, - Orb::NewSubscriptionBulkWithProrationPrice, - Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, - Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, - Orb::NewSubscriptionCumulativeGroupedBulkPrice, - Orb::NewSubscriptionMaxGroupTieredPackagePrice, - Orb::NewSubscriptionGroupedWithMeteredMinimumPrice, - Orb::NewSubscriptionMatrixWithDisplayNamePrice, - Orb::NewSubscriptionGroupedTieredPackagePrice, - Orb::NewSubscriptionMatrixWithAllocationPrice, - Orb::NewSubscriptionTieredPackageWithMinimumPrice, - Orb::NewSubscriptionGroupedTieredPrice + Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::EventOutputConfig, + Orb::Internal::AnyHash ) - ), - price_id: T.nilable(String) - } - ) - end - def to_hash - end + end - # The definition of a new price to create and add to the subscription. - module Price - extend Orb::Internal::Type::Union + # The key in the event data to extract the unit rate from. + sig { returns(String) } + attr_accessor :unit_rating_key - Variants = - T.type_alias do - T.any( - Orb::NewSubscriptionUnitPrice, - Orb::NewSubscriptionPackagePrice, - Orb::NewSubscriptionMatrixPrice, - Orb::NewSubscriptionTieredPrice, - Orb::NewSubscriptionTieredBPSPrice, - Orb::NewSubscriptionBPSPrice, - Orb::NewSubscriptionBulkBPSPrice, - Orb::NewSubscriptionBulkPrice, - Orb::NewSubscriptionThresholdTotalAmountPrice, - Orb::NewSubscriptionTieredPackagePrice, - Orb::NewSubscriptionTieredWithMinimumPrice, - Orb::NewSubscriptionUnitWithPercentPrice, - Orb::NewSubscriptionPackageWithAllocationPrice, - Orb::NewSubscriptionTierWithProrationPrice, - Orb::NewSubscriptionUnitWithProrationPrice, - Orb::NewSubscriptionGroupedAllocationPrice, - Orb::NewSubscriptionGroupedWithProratedMinimumPrice, - Orb::NewSubscriptionBulkWithProrationPrice, - Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, - Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, - Orb::NewSubscriptionCumulativeGroupedBulkPrice, - Orb::NewSubscriptionMaxGroupTieredPackagePrice, - Orb::NewSubscriptionGroupedWithMeteredMinimumPrice, - Orb::NewSubscriptionMatrixWithDisplayNamePrice, - Orb::NewSubscriptionGroupedTieredPackagePrice, - Orb::NewSubscriptionMatrixWithAllocationPrice, - Orb::NewSubscriptionTieredPackageWithMinimumPrice, - Orb::NewSubscriptionGroupedTieredPrice + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + sig { returns(T.nilable(String)) } + attr_accessor :grouping_key + + # Configuration for event_output pricing + sig do + params( + unit_rating_key: String, + grouping_key: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The key in the event data to extract the unit rate from. + unit_rating_key:, + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + grouping_key: nil ) + end + + sig do + override.returns( + { unit_rating_key: String, grouping_key: T.nilable(String) } + ) + end + def to_hash + end end + end sig do override.returns( diff --git a/rbi/orb/models/subscription_list_params.rbi b/rbi/orb/models/subscription_list_params.rbi index 00f88590..674a2322 100644 --- a/rbi/orb/models/subscription_list_params.rbi +++ b/rbi/orb/models/subscription_list_params.rbi @@ -34,6 +34,9 @@ module Orb sig { returns(T.nilable(T::Array[String])) } attr_accessor :external_customer_id + sig { returns(T.nilable(String)) } + attr_accessor :external_plan_id + # The number of items to fetch. Defaults to 20. sig { returns(T.nilable(Integer)) } attr_reader :limit @@ -41,6 +44,9 @@ module Orb sig { params(limit: Integer).void } attr_writer :limit + sig { returns(T.nilable(String)) } + attr_accessor :plan_id + sig { returns(T.nilable(Orb::SubscriptionListParams::Status::OrSymbol)) } attr_accessor :status @@ -53,7 +59,9 @@ module Orb cursor: T.nilable(String), customer_id: T.nilable(T::Array[String]), external_customer_id: T.nilable(T::Array[String]), + external_plan_id: T.nilable(String), limit: Integer, + plan_id: T.nilable(String), status: T.nilable(Orb::SubscriptionListParams::Status::OrSymbol), request_options: Orb::RequestOptions::OrHash ).returns(T.attached_class) @@ -68,8 +76,10 @@ module Orb cursor: nil, customer_id: nil, external_customer_id: nil, + external_plan_id: nil, # The number of items to fetch. Defaults to 20. limit: nil, + plan_id: nil, status: nil, request_options: {} ) @@ -85,7 +95,9 @@ module Orb cursor: T.nilable(String), customer_id: T.nilable(T::Array[String]), external_customer_id: T.nilable(T::Array[String]), + external_plan_id: T.nilable(String), limit: Integer, + plan_id: T.nilable(String), status: T.nilable(Orb::SubscriptionListParams::Status::OrSymbol), request_options: Orb::RequestOptions } diff --git a/rbi/orb/models/subscription_price_intervals_params.rbi b/rbi/orb/models/subscription_price_intervals_params.rbi index b797820a..fec209cd 100644 --- a/rbi/orb/models/subscription_price_intervals_params.rbi +++ b/rbi/orb/models/subscription_price_intervals_params.rbi @@ -218,39 +218,40 @@ module Orb sig { returns(T.nilable(Float)) } attr_accessor :minimum_amount - # The definition of a new price to create and add to the subscription. + # New floating price request body params. sig do returns( T.nilable( T.any( Orb::NewFloatingUnitPrice, - Orb::NewFloatingPackagePrice, - Orb::NewFloatingMatrixPrice, - Orb::NewFloatingMatrixWithAllocationPrice, Orb::NewFloatingTieredPrice, - Orb::NewFloatingTieredBPSPrice, - Orb::NewFloatingBPSPrice, - Orb::NewFloatingBulkBPSPrice, Orb::NewFloatingBulkPrice, + Orb::NewFloatingPackagePrice, + Orb::NewFloatingMatrixPrice, Orb::NewFloatingThresholdTotalAmountPrice, Orb::NewFloatingTieredPackagePrice, - Orb::NewFloatingGroupedTieredPrice, - Orb::NewFloatingMaxGroupTieredPackagePrice, Orb::NewFloatingTieredWithMinimumPrice, - Orb::NewFloatingPackageWithAllocationPrice, + Orb::NewFloatingGroupedTieredPrice, Orb::NewFloatingTieredPackageWithMinimumPrice, + Orb::NewFloatingPackageWithAllocationPrice, Orb::NewFloatingUnitWithPercentPrice, + Orb::NewFloatingMatrixWithAllocationPrice, Orb::NewFloatingTieredWithProrationPrice, Orb::NewFloatingUnitWithProrationPrice, Orb::NewFloatingGroupedAllocationPrice, + Orb::NewFloatingBulkWithProrationPrice, Orb::NewFloatingGroupedWithProratedMinimumPrice, Orb::NewFloatingGroupedWithMeteredMinimumPrice, + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds, Orb::NewFloatingMatrixWithDisplayNamePrice, - Orb::NewFloatingBulkWithProrationPrice, Orb::NewFloatingGroupedTieredPackagePrice, + Orb::NewFloatingMaxGroupTieredPackagePrice, Orb::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::NewFloatingScalableMatrixWithTieredPricingPrice, - Orb::NewFloatingCumulativeGroupedBulkPrice + Orb::NewFloatingCumulativeGroupedBulkPrice, + Orb::NewFloatingMinimumCompositePrice, + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent, + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput ) ) ) @@ -300,33 +301,34 @@ module Orb T.nilable( T.any( Orb::NewFloatingUnitPrice::OrHash, - Orb::NewFloatingPackagePrice::OrHash, - Orb::NewFloatingMatrixPrice::OrHash, - Orb::NewFloatingMatrixWithAllocationPrice::OrHash, Orb::NewFloatingTieredPrice::OrHash, - Orb::NewFloatingTieredBPSPrice::OrHash, - Orb::NewFloatingBPSPrice::OrHash, - Orb::NewFloatingBulkBPSPrice::OrHash, Orb::NewFloatingBulkPrice::OrHash, + Orb::NewFloatingPackagePrice::OrHash, + Orb::NewFloatingMatrixPrice::OrHash, Orb::NewFloatingThresholdTotalAmountPrice::OrHash, Orb::NewFloatingTieredPackagePrice::OrHash, - Orb::NewFloatingGroupedTieredPrice::OrHash, - Orb::NewFloatingMaxGroupTieredPackagePrice::OrHash, Orb::NewFloatingTieredWithMinimumPrice::OrHash, - Orb::NewFloatingPackageWithAllocationPrice::OrHash, + Orb::NewFloatingGroupedTieredPrice::OrHash, Orb::NewFloatingTieredPackageWithMinimumPrice::OrHash, + Orb::NewFloatingPackageWithAllocationPrice::OrHash, Orb::NewFloatingUnitWithPercentPrice::OrHash, + Orb::NewFloatingMatrixWithAllocationPrice::OrHash, Orb::NewFloatingTieredWithProrationPrice::OrHash, Orb::NewFloatingUnitWithProrationPrice::OrHash, Orb::NewFloatingGroupedAllocationPrice::OrHash, + Orb::NewFloatingBulkWithProrationPrice::OrHash, Orb::NewFloatingGroupedWithProratedMinimumPrice::OrHash, Orb::NewFloatingGroupedWithMeteredMinimumPrice::OrHash, + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::OrHash, Orb::NewFloatingMatrixWithDisplayNamePrice::OrHash, - Orb::NewFloatingBulkWithProrationPrice::OrHash, Orb::NewFloatingGroupedTieredPackagePrice::OrHash, + Orb::NewFloatingMaxGroupTieredPackagePrice::OrHash, Orb::NewFloatingScalableMatrixWithUnitPricingPrice::OrHash, Orb::NewFloatingScalableMatrixWithTieredPricingPrice::OrHash, - Orb::NewFloatingCumulativeGroupedBulkPrice::OrHash + Orb::NewFloatingCumulativeGroupedBulkPrice::OrHash, + Orb::NewFloatingMinimumCompositePrice::OrHash, + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::OrHash, + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::OrHash ) ), price_id: T.nilable(String), @@ -359,7 +361,7 @@ module Orb # The minimum amount that will be billed for this price interval for a given # billing period. minimum_amount: nil, - # The definition of a new price to create and add to the subscription. + # New floating price request body params. price: nil, # The id of the price to add to the subscription. price_id: nil, @@ -404,33 +406,34 @@ module Orb T.nilable( T.any( Orb::NewFloatingUnitPrice, - Orb::NewFloatingPackagePrice, - Orb::NewFloatingMatrixPrice, - Orb::NewFloatingMatrixWithAllocationPrice, Orb::NewFloatingTieredPrice, - Orb::NewFloatingTieredBPSPrice, - Orb::NewFloatingBPSPrice, - Orb::NewFloatingBulkBPSPrice, Orb::NewFloatingBulkPrice, + Orb::NewFloatingPackagePrice, + Orb::NewFloatingMatrixPrice, Orb::NewFloatingThresholdTotalAmountPrice, Orb::NewFloatingTieredPackagePrice, - Orb::NewFloatingGroupedTieredPrice, - Orb::NewFloatingMaxGroupTieredPackagePrice, Orb::NewFloatingTieredWithMinimumPrice, - Orb::NewFloatingPackageWithAllocationPrice, + Orb::NewFloatingGroupedTieredPrice, Orb::NewFloatingTieredPackageWithMinimumPrice, + Orb::NewFloatingPackageWithAllocationPrice, Orb::NewFloatingUnitWithPercentPrice, + Orb::NewFloatingMatrixWithAllocationPrice, Orb::NewFloatingTieredWithProrationPrice, Orb::NewFloatingUnitWithProrationPrice, Orb::NewFloatingGroupedAllocationPrice, + Orb::NewFloatingBulkWithProrationPrice, Orb::NewFloatingGroupedWithProratedMinimumPrice, Orb::NewFloatingGroupedWithMeteredMinimumPrice, + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds, Orb::NewFloatingMatrixWithDisplayNamePrice, - Orb::NewFloatingBulkWithProrationPrice, Orb::NewFloatingGroupedTieredPackagePrice, + Orb::NewFloatingMaxGroupTieredPackagePrice, Orb::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::NewFloatingScalableMatrixWithTieredPricingPrice, - Orb::NewFloatingCumulativeGroupedBulkPrice + Orb::NewFloatingCumulativeGroupedBulkPrice, + Orb::NewFloatingMinimumCompositePrice, + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent, + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput ) ), price_id: T.nilable(String), @@ -654,7 +657,7 @@ module Orb end end - # The definition of a new price to create and add to the subscription. + # New floating price request body params. module Price extend Orb::Internal::Type::Union @@ -662,35 +665,1074 @@ module Orb T.type_alias do T.any( Orb::NewFloatingUnitPrice, - Orb::NewFloatingPackagePrice, - Orb::NewFloatingMatrixPrice, - Orb::NewFloatingMatrixWithAllocationPrice, Orb::NewFloatingTieredPrice, - Orb::NewFloatingTieredBPSPrice, - Orb::NewFloatingBPSPrice, - Orb::NewFloatingBulkBPSPrice, Orb::NewFloatingBulkPrice, + Orb::NewFloatingPackagePrice, + Orb::NewFloatingMatrixPrice, Orb::NewFloatingThresholdTotalAmountPrice, Orb::NewFloatingTieredPackagePrice, - Orb::NewFloatingGroupedTieredPrice, - Orb::NewFloatingMaxGroupTieredPackagePrice, Orb::NewFloatingTieredWithMinimumPrice, - Orb::NewFloatingPackageWithAllocationPrice, + Orb::NewFloatingGroupedTieredPrice, Orb::NewFloatingTieredPackageWithMinimumPrice, + Orb::NewFloatingPackageWithAllocationPrice, Orb::NewFloatingUnitWithPercentPrice, + Orb::NewFloatingMatrixWithAllocationPrice, Orb::NewFloatingTieredWithProrationPrice, Orb::NewFloatingUnitWithProrationPrice, Orb::NewFloatingGroupedAllocationPrice, + Orb::NewFloatingBulkWithProrationPrice, Orb::NewFloatingGroupedWithProratedMinimumPrice, Orb::NewFloatingGroupedWithMeteredMinimumPrice, + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds, Orb::NewFloatingMatrixWithDisplayNamePrice, - Orb::NewFloatingBulkWithProrationPrice, Orb::NewFloatingGroupedTieredPackagePrice, + Orb::NewFloatingMaxGroupTieredPackagePrice, Orb::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::NewFloatingScalableMatrixWithTieredPricingPrice, - Orb::NewFloatingCumulativeGroupedBulkPrice + Orb::NewFloatingCumulativeGroupedBulkPrice, + Orb::NewFloatingMinimumCompositePrice, + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent, + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput + ) + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # An ISO 4217 currency string for which this price is billed in. + sig { returns(String) } + attr_accessor :currency + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + returns( + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + ) + end + attr_reader :grouped_with_min_max_thresholds_config + + sig do + params( + grouped_with_min_max_thresholds_config: + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash + ).void + end + attr_writer :grouped_with_min_max_thresholds_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + currency: String, + grouped_with_min_max_thresholds_config: + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # An ISO 4217 currency string for which this price is billed in. + currency:, + # Configuration for grouped_with_min_max_thresholds pricing + grouped_with_min_max_thresholds_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # The pricing model type + model_type: :grouped_with_min_max_thresholds + ) + end + + sig do + override.returns( + { + cadence: + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + currency: String, + grouped_with_min_max_thresholds_config: + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before applying thresholds + sig { returns(String) } + attr_accessor :grouping_key + + # The maximum amount to charge each group + sig { returns(String) } + attr_accessor :maximum_charge + + # The minimum amount to charge each group, regardless of usage + sig { returns(String) } + attr_accessor :minimum_charge + + # The base price charged per group + sig { returns(String) } + attr_accessor :per_unit_rate + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + params( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before applying thresholds + grouping_key:, + # The maximum amount to charge each group + maximum_charge:, + # The minimum amount to charge each group, regardless of usage + minimum_charge:, + # The base price charged per group + per_unit_rate: + ) + end + + sig do + override.returns( + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + ) + end + def to_hash + end + end + end + + class Percent < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # An ISO 4217 currency string for which this price is billed in. + sig { returns(String) } + attr_accessor :currency + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # Configuration for percent pricing + sig do + returns( + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig + ) + end + attr_reader :percent_config + + sig do + params( + percent_config: + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig::OrHash + ).void + end + attr_writer :percent_config + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::OrSymbol, + currency: String, + item_id: String, + name: String, + percent_config: + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # An ISO 4217 currency string for which this price is billed in. + currency:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for percent pricing + percent_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # The pricing model type + model_type: :percent + ) + end + + sig do + override.returns( + { + cadence: + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::OrSymbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + percent_config: + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class PercentConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig, + Orb::Internal::AnyHash + ) + end + + # What percent of the component subtotals to charge + sig { returns(Float) } + attr_accessor :percent + + # Configuration for percent pricing + sig { params(percent: Float).returns(T.attached_class) } + def self.new( + # What percent of the component subtotals to charge + percent: + ) + end + + sig { override.returns({ percent: Float }) } + def to_hash + end + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # An ISO 4217 currency string for which this price is billed in. + sig { returns(String) } + attr_accessor :currency + + # Configuration for event_output pricing + sig do + returns( + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig + ) + end + attr_reader :event_output_config + + sig do + params( + event_output_config: + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig::OrHash + ).void + end + attr_writer :event_output_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::OrSymbol, + currency: String, + event_output_config: + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # An ISO 4217 currency string for which this price is billed in. + currency:, + # Configuration for event_output pricing + event_output_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # The pricing model type + model_type: :event_output + ) + end + + sig do + override.returns( + { + cadence: + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::OrSymbol, + currency: String, + event_output_config: + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } ) end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class EventOutputConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig, + Orb::Internal::AnyHash + ) + end + + # The key in the event data to extract the unit rate from. + sig { returns(String) } + attr_accessor :unit_rating_key + + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + sig { returns(T.nilable(String)) } + attr_accessor :grouping_key + + # Configuration for event_output pricing + sig do + params( + unit_rating_key: String, + grouping_key: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The key in the event data to extract the unit rate from. + unit_rating_key:, + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + grouping_key: nil + ) + end + + sig do + override.returns( + { unit_rating_key: String, grouping_key: T.nilable(String) } + ) + end + def to_hash + end + end + end sig do override.returns( @@ -713,26 +1755,34 @@ module Orb ) end + # The start date of the adjustment interval. This is the date that the adjustment + # will start affecting prices on the subscription. The adjustment will apply to + # invoice dates that overlap with this `start_date`. This `start_date` is treated + # as inclusive for in-advance prices, and exclusive for in-arrears prices. + sig { returns(T.any(Time, Orb::BillingCycleRelativeDate::OrSymbol)) } + attr_accessor :start_date + # The definition of a new adjustment to create and add to the subscription. sig do returns( - T.any( - Orb::NewPercentageDiscount, - Orb::NewUsageDiscount, - Orb::NewAmountDiscount, - Orb::NewMinimum, - Orb::NewMaximum + T.nilable( + T.any( + Orb::NewPercentageDiscount, + Orb::NewUsageDiscount, + Orb::NewAmountDiscount, + Orb::NewMinimum, + Orb::NewMaximum + ) ) ) end attr_accessor :adjustment - # The start date of the adjustment interval. This is the date that the adjustment - # will start affecting prices on the subscription. The adjustment will apply to - # invoice dates that overlap with this `start_date`. This `start_date` is treated - # as inclusive for in-advance prices, and exclusive for in-arrears prices. - sig { returns(T.any(Time, Orb::BillingCycleRelativeDate::OrSymbol)) } - attr_accessor :start_date + # The ID of the adjustment to add to the subscription. Adjustment IDs can be + # re-used from existing subscriptions or plans, but adjustments associated with + # coupon redemptions cannot be re-used. + sig { returns(T.nilable(String)) } + attr_accessor :adjustment_id # The end date of the adjustment interval. This is the date that the adjustment # will stop affecting prices on the subscription. The adjustment will apply to @@ -747,27 +1797,34 @@ module Orb sig do params( + start_date: T.any(Time, Orb::BillingCycleRelativeDate::OrSymbol), adjustment: - T.any( - Orb::NewPercentageDiscount::OrHash, - Orb::NewUsageDiscount::OrHash, - Orb::NewAmountDiscount::OrHash, - Orb::NewMinimum::OrHash, - Orb::NewMaximum::OrHash + T.nilable( + T.any( + Orb::NewPercentageDiscount::OrHash, + Orb::NewUsageDiscount::OrHash, + Orb::NewAmountDiscount::OrHash, + Orb::NewMinimum::OrHash, + Orb::NewMaximum::OrHash + ) ), - start_date: T.any(Time, Orb::BillingCycleRelativeDate::OrSymbol), + adjustment_id: T.nilable(String), end_date: T.nilable(T.any(Time, Orb::BillingCycleRelativeDate::OrSymbol)) ).returns(T.attached_class) end def self.new( - # The definition of a new adjustment to create and add to the subscription. - adjustment:, # The start date of the adjustment interval. This is the date that the adjustment # will start affecting prices on the subscription. The adjustment will apply to # invoice dates that overlap with this `start_date`. This `start_date` is treated # as inclusive for in-advance prices, and exclusive for in-arrears prices. start_date:, + # The definition of a new adjustment to create and add to the subscription. + adjustment: nil, + # The ID of the adjustment to add to the subscription. Adjustment IDs can be + # re-used from existing subscriptions or plans, but adjustments associated with + # coupon redemptions cannot be re-used. + adjustment_id: nil, # The end date of the adjustment interval. This is the date that the adjustment # will stop affecting prices on the subscription. The adjustment will apply to # invoice dates that overlap with this `end_date`.This `end_date` is treated as @@ -779,15 +1836,18 @@ module Orb sig do override.returns( { + start_date: T.any(Time, Orb::BillingCycleRelativeDate::OrSymbol), adjustment: - T.any( - Orb::NewPercentageDiscount, - Orb::NewUsageDiscount, - Orb::NewAmountDiscount, - Orb::NewMinimum, - Orb::NewMaximum + T.nilable( + T.any( + Orb::NewPercentageDiscount, + Orb::NewUsageDiscount, + Orb::NewAmountDiscount, + Orb::NewMinimum, + Orb::NewMaximum + ) ), - start_date: T.any(Time, Orb::BillingCycleRelativeDate::OrSymbol), + adjustment_id: T.nilable(String), end_date: T.nilable(T.any(Time, Orb::BillingCycleRelativeDate::OrSymbol)) } @@ -796,25 +1856,22 @@ module Orb def to_hash end - # The definition of a new adjustment to create and add to the subscription. - module Adjustment + # The start date of the adjustment interval. This is the date that the adjustment + # will start affecting prices on the subscription. The adjustment will apply to + # invoice dates that overlap with this `start_date`. This `start_date` is treated + # as inclusive for in-advance prices, and exclusive for in-arrears prices. + module StartDate extend Orb::Internal::Type::Union Variants = T.type_alias do - T.any( - Orb::NewPercentageDiscount, - Orb::NewUsageDiscount, - Orb::NewAmountDiscount, - Orb::NewMinimum, - Orb::NewMaximum - ) + T.any(Time, Orb::BillingCycleRelativeDate::TaggedSymbol) end sig do override.returns( T::Array[ - Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::Variants + Orb::SubscriptionPriceIntervalsParams::AddAdjustment::StartDate::Variants ] ) end @@ -822,22 +1879,25 @@ module Orb end end - # The start date of the adjustment interval. This is the date that the adjustment - # will start affecting prices on the subscription. The adjustment will apply to - # invoice dates that overlap with this `start_date`. This `start_date` is treated - # as inclusive for in-advance prices, and exclusive for in-arrears prices. - module StartDate + # The definition of a new adjustment to create and add to the subscription. + module Adjustment extend Orb::Internal::Type::Union Variants = T.type_alias do - T.any(Time, Orb::BillingCycleRelativeDate::TaggedSymbol) + T.any( + Orb::NewPercentageDiscount, + Orb::NewUsageDiscount, + Orb::NewAmountDiscount, + Orb::NewMinimum, + Orb::NewMaximum + ) end sig do override.returns( T::Array[ - Orb::SubscriptionPriceIntervalsParams::AddAdjustment::StartDate::Variants + Orb::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::Variants ] ) end diff --git a/rbi/orb/models/subscription_schedule_plan_change_params.rbi b/rbi/orb/models/subscription_schedule_plan_change_params.rbi index 7e26c94b..44fc00d3 100644 --- a/rbi/orb/models/subscription_schedule_plan_change_params.rbi +++ b/rbi/orb/models/subscription_schedule_plan_change_params.rbi @@ -629,39 +629,40 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - # The definition of a new price to create and add to the subscription. + # New subscription price request body params. sig do returns( T.nilable( T.any( Orb::NewSubscriptionUnitPrice, - Orb::NewSubscriptionPackagePrice, - Orb::NewSubscriptionMatrixPrice, Orb::NewSubscriptionTieredPrice, - Orb::NewSubscriptionTieredBPSPrice, - Orb::NewSubscriptionBPSPrice, - Orb::NewSubscriptionBulkBPSPrice, Orb::NewSubscriptionBulkPrice, + Orb::NewSubscriptionPackagePrice, + Orb::NewSubscriptionMatrixPrice, Orb::NewSubscriptionThresholdTotalAmountPrice, Orb::NewSubscriptionTieredPackagePrice, Orb::NewSubscriptionTieredWithMinimumPrice, - Orb::NewSubscriptionUnitWithPercentPrice, + Orb::NewSubscriptionGroupedTieredPrice, + Orb::NewSubscriptionTieredPackageWithMinimumPrice, Orb::NewSubscriptionPackageWithAllocationPrice, - Orb::NewSubscriptionTierWithProrationPrice, + Orb::NewSubscriptionUnitWithPercentPrice, + Orb::NewSubscriptionMatrixWithAllocationPrice, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration, Orb::NewSubscriptionUnitWithProrationPrice, Orb::NewSubscriptionGroupedAllocationPrice, - Orb::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::NewSubscriptionBulkWithProrationPrice, - Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, - Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, - Orb::NewSubscriptionCumulativeGroupedBulkPrice, - Orb::NewSubscriptionMaxGroupTieredPackagePrice, + Orb::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::NewSubscriptionGroupedWithMeteredMinimumPrice, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::NewSubscriptionMatrixWithDisplayNamePrice, Orb::NewSubscriptionGroupedTieredPackagePrice, - Orb::NewSubscriptionMatrixWithAllocationPrice, - Orb::NewSubscriptionTieredPackageWithMinimumPrice, - Orb::NewSubscriptionGroupedTieredPrice + Orb::NewSubscriptionMaxGroupTieredPackagePrice, + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, + Orb::NewSubscriptionCumulativeGroupedBulkPrice, + Orb::NewSubscriptionMinimumCompositePrice, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput ) ) ) @@ -691,33 +692,34 @@ module Orb T.nilable( T.any( Orb::NewSubscriptionUnitPrice::OrHash, - Orb::NewSubscriptionPackagePrice::OrHash, - Orb::NewSubscriptionMatrixPrice::OrHash, Orb::NewSubscriptionTieredPrice::OrHash, - Orb::NewSubscriptionTieredBPSPrice::OrHash, - Orb::NewSubscriptionBPSPrice::OrHash, - Orb::NewSubscriptionBulkBPSPrice::OrHash, Orb::NewSubscriptionBulkPrice::OrHash, + Orb::NewSubscriptionPackagePrice::OrHash, + Orb::NewSubscriptionMatrixPrice::OrHash, Orb::NewSubscriptionThresholdTotalAmountPrice::OrHash, Orb::NewSubscriptionTieredPackagePrice::OrHash, Orb::NewSubscriptionTieredWithMinimumPrice::OrHash, - Orb::NewSubscriptionUnitWithPercentPrice::OrHash, + Orb::NewSubscriptionGroupedTieredPrice::OrHash, + Orb::NewSubscriptionTieredPackageWithMinimumPrice::OrHash, Orb::NewSubscriptionPackageWithAllocationPrice::OrHash, - Orb::NewSubscriptionTierWithProrationPrice::OrHash, + Orb::NewSubscriptionUnitWithPercentPrice::OrHash, + Orb::NewSubscriptionMatrixWithAllocationPrice::OrHash, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::OrHash, Orb::NewSubscriptionUnitWithProrationPrice::OrHash, Orb::NewSubscriptionGroupedAllocationPrice::OrHash, - Orb::NewSubscriptionGroupedWithProratedMinimumPrice::OrHash, Orb::NewSubscriptionBulkWithProrationPrice::OrHash, - Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::OrHash, - Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::OrHash, - Orb::NewSubscriptionCumulativeGroupedBulkPrice::OrHash, - Orb::NewSubscriptionMaxGroupTieredPackagePrice::OrHash, + Orb::NewSubscriptionGroupedWithProratedMinimumPrice::OrHash, Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::OrHash, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::OrHash, Orb::NewSubscriptionMatrixWithDisplayNamePrice::OrHash, Orb::NewSubscriptionGroupedTieredPackagePrice::OrHash, - Orb::NewSubscriptionMatrixWithAllocationPrice::OrHash, - Orb::NewSubscriptionTieredPackageWithMinimumPrice::OrHash, - Orb::NewSubscriptionGroupedTieredPrice::OrHash + Orb::NewSubscriptionMaxGroupTieredPackagePrice::OrHash, + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::OrHash, + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::OrHash, + Orb::NewSubscriptionCumulativeGroupedBulkPrice::OrHash, + Orb::NewSubscriptionMinimumCompositePrice::OrHash, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::OrHash, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::OrHash ) ), price_id: T.nilable(String), @@ -744,7 +746,7 @@ module Orb minimum_amount: nil, # The phase to add this price to. plan_phase_order: nil, - # The definition of a new price to create and add to the subscription. + # New subscription price request body params. price: nil, # The id of the price to add to the subscription. price_id: nil, @@ -769,33 +771,34 @@ module Orb T.nilable( T.any( Orb::NewSubscriptionUnitPrice, - Orb::NewSubscriptionPackagePrice, - Orb::NewSubscriptionMatrixPrice, Orb::NewSubscriptionTieredPrice, - Orb::NewSubscriptionTieredBPSPrice, - Orb::NewSubscriptionBPSPrice, - Orb::NewSubscriptionBulkBPSPrice, Orb::NewSubscriptionBulkPrice, + Orb::NewSubscriptionPackagePrice, + Orb::NewSubscriptionMatrixPrice, Orb::NewSubscriptionThresholdTotalAmountPrice, Orb::NewSubscriptionTieredPackagePrice, Orb::NewSubscriptionTieredWithMinimumPrice, - Orb::NewSubscriptionUnitWithPercentPrice, + Orb::NewSubscriptionGroupedTieredPrice, + Orb::NewSubscriptionTieredPackageWithMinimumPrice, Orb::NewSubscriptionPackageWithAllocationPrice, - Orb::NewSubscriptionTierWithProrationPrice, + Orb::NewSubscriptionUnitWithPercentPrice, + Orb::NewSubscriptionMatrixWithAllocationPrice, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration, Orb::NewSubscriptionUnitWithProrationPrice, Orb::NewSubscriptionGroupedAllocationPrice, - Orb::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::NewSubscriptionBulkWithProrationPrice, - Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, - Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, - Orb::NewSubscriptionCumulativeGroupedBulkPrice, - Orb::NewSubscriptionMaxGroupTieredPackagePrice, + Orb::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::NewSubscriptionGroupedWithMeteredMinimumPrice, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::NewSubscriptionMatrixWithDisplayNamePrice, Orb::NewSubscriptionGroupedTieredPackagePrice, - Orb::NewSubscriptionMatrixWithAllocationPrice, - Orb::NewSubscriptionTieredPackageWithMinimumPrice, - Orb::NewSubscriptionGroupedTieredPrice + Orb::NewSubscriptionMaxGroupTieredPackagePrice, + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, + Orb::NewSubscriptionCumulativeGroupedBulkPrice, + Orb::NewSubscriptionMinimumCompositePrice, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput ) ), price_id: T.nilable(String), @@ -806,7 +809,7 @@ module Orb def to_hash end - # The definition of a new price to create and add to the subscription. + # New subscription price request body params. module Price extend Orb::Internal::Type::Union @@ -814,215 +817,1695 @@ module Orb T.type_alias do T.any( Orb::NewSubscriptionUnitPrice, - Orb::NewSubscriptionPackagePrice, - Orb::NewSubscriptionMatrixPrice, Orb::NewSubscriptionTieredPrice, - Orb::NewSubscriptionTieredBPSPrice, - Orb::NewSubscriptionBPSPrice, - Orb::NewSubscriptionBulkBPSPrice, Orb::NewSubscriptionBulkPrice, + Orb::NewSubscriptionPackagePrice, + Orb::NewSubscriptionMatrixPrice, Orb::NewSubscriptionThresholdTotalAmountPrice, Orb::NewSubscriptionTieredPackagePrice, Orb::NewSubscriptionTieredWithMinimumPrice, - Orb::NewSubscriptionUnitWithPercentPrice, + Orb::NewSubscriptionGroupedTieredPrice, + Orb::NewSubscriptionTieredPackageWithMinimumPrice, Orb::NewSubscriptionPackageWithAllocationPrice, - Orb::NewSubscriptionTierWithProrationPrice, + Orb::NewSubscriptionUnitWithPercentPrice, + Orb::NewSubscriptionMatrixWithAllocationPrice, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration, Orb::NewSubscriptionUnitWithProrationPrice, Orb::NewSubscriptionGroupedAllocationPrice, - Orb::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::NewSubscriptionBulkWithProrationPrice, - Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, - Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, - Orb::NewSubscriptionCumulativeGroupedBulkPrice, - Orb::NewSubscriptionMaxGroupTieredPackagePrice, + Orb::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::NewSubscriptionGroupedWithMeteredMinimumPrice, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds, Orb::NewSubscriptionMatrixWithDisplayNamePrice, Orb::NewSubscriptionGroupedTieredPackagePrice, - Orb::NewSubscriptionMatrixWithAllocationPrice, - Orb::NewSubscriptionTieredPackageWithMinimumPrice, - Orb::NewSubscriptionGroupedTieredPrice + Orb::NewSubscriptionMaxGroupTieredPackagePrice, + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, + Orb::NewSubscriptionCumulativeGroupedBulkPrice, + Orb::NewSubscriptionMinimumCompositePrice, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput ) end - sig do - override.returns( - T::Array[ - Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Variants - ] - ) - end - def self.variants - end - end - end + class TieredWithProration < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration, + Orb::Internal::AnyHash + ) + end - # Reset billing periods to be aligned with the plan change's effective date or - # start of the month. Defaults to `unchanged` which keeps subscription's existing - # billing cycle alignment. - module BillingCycleAlignment - extend Orb::Internal::Type::Enum + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::Cadence::OrSymbol + ) + end + attr_accessor :cadence - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - Orb::SubscriptionSchedulePlanChangeParams::BillingCycleAlignment - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id - UNCHANGED = - T.let( - :unchanged, - Orb::SubscriptionSchedulePlanChangeParams::BillingCycleAlignment::TaggedSymbol - ) - PLAN_CHANGE_DATE = - T.let( - :plan_change_date, - Orb::SubscriptionSchedulePlanChangeParams::BillingCycleAlignment::TaggedSymbol - ) - START_OF_MONTH = - T.let( - :start_of_month, - Orb::SubscriptionSchedulePlanChangeParams::BillingCycleAlignment::TaggedSymbol - ) + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type - sig do - override.returns( - T::Array[ - Orb::SubscriptionSchedulePlanChangeParams::BillingCycleAlignment::TaggedSymbol - ] - ) - end - def self.values - end - end + # The name of the price. + sig { returns(String) } + attr_accessor :name - class RemoveAdjustment < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Orb::SubscriptionSchedulePlanChangeParams::RemoveAdjustment, - Orb::Internal::AnyHash - ) - end + # Configuration for tiered_with_proration pricing + sig do + returns( + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig + ) + end + attr_reader :tiered_with_proration_config - # The id of the adjustment to remove on the subscription. - sig { returns(String) } - attr_accessor :adjustment_id + sig do + params( + tiered_with_proration_config: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::OrHash + ).void + end + attr_writer :tiered_with_proration_config - sig { params(adjustment_id: String).returns(T.attached_class) } - def self.new( - # The id of the adjustment to remove on the subscription. - adjustment_id: - ) - end + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id - sig { override.returns({ adjustment_id: String }) } - def to_hash - end - end + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance - class RemovePrice < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Orb::SubscriptionSchedulePlanChangeParams::RemovePrice, - Orb::Internal::AnyHash - ) - end + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration - # The external price id of the price to remove on the subscription. - sig { returns(T.nilable(String)) } - attr_accessor :external_price_id + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration - # The id of the price to remove on the subscription. - sig { returns(T.nilable(String)) } - attr_accessor :price_id + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate - sig do - params( - external_price_id: T.nilable(String), - price_id: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # The external price id of the price to remove on the subscription. - external_price_id: nil, - # The id of the price to remove on the subscription. - price_id: nil - ) - end + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config - sig do - override.returns( - { - external_price_id: T.nilable(String), - price_id: T.nilable(String) - } - ) - end - def to_hash - end - end + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency - class ReplaceAdjustment < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Orb::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment, - Orb::Internal::AnyHash - ) - end + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration - # The definition of a new adjustment to create and add to the subscription. - sig do - returns( - T.any( - Orb::NewPercentageDiscount, - Orb::NewUsageDiscount, - Orb::NewAmountDiscount, - Orb::NewMinimum, - Orb::NewMaximum - ) - ) - end - attr_accessor :adjustment + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration - # The id of the adjustment on the plan to replace in the subscription. - sig { returns(String) } - attr_accessor :replaces_adjustment_id + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id - sig do - params( - adjustment: - T.any( - Orb::NewPercentageDiscount::OrHash, - Orb::NewUsageDiscount::OrHash, - Orb::NewAmountDiscount::OrHash, - Orb::NewMinimum::OrHash, - Orb::NewMaximum::OrHash - ), - replaces_adjustment_id: String - ).returns(T.attached_class) - end - def self.new( - # The definition of a new adjustment to create and add to the subscription. - adjustment:, - # The id of the adjustment on the plan to replace in the subscription. - replaces_adjustment_id: - ) - end + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity - sig do - override.returns( - { - adjustment: - T.any( - Orb::NewPercentageDiscount, - Orb::NewUsageDiscount, - Orb::NewAmountDiscount, - Orb::NewMinimum, + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::Cadence::OrSymbol, + item_id: String, + name: String, + tiered_with_proration_config: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for tiered_with_proration pricing + tiered_with_proration_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :tiered_with_proration + ) + end + + sig do + override.returns( + { + cadence: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::Cadence::OrSymbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_proration_config: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig, + Orb::Internal::AnyHash + ) + end + + # Tiers for rating based on total usage quantities into the specified tier with + # proration + sig do + returns( + T::Array[ + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for tiered_with_proration pricing + sig do + params( + tiers: + T::Array[ + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Tiers for rating based on total usage quantities into the specified tier with + # proration + tiers: + ) + end + + sig do + override.returns( + { + tiers: + T::Array[ + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Inclusive tier starting value + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Amount per unit + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tiered with proration tier + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Inclusive tier starting value + tier_lower_bound:, + # Amount per unit + unit_amount: + ) + end + + sig do + override.returns( + { tier_lower_bound: String, unit_amount: String } + ) + end + def to_hash + end + end + end + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + returns( + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + ) + end + attr_reader :grouped_with_min_max_thresholds_config + + sig do + params( + grouped_with_min_max_thresholds_config: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash + ).void + end + attr_writer :grouped_with_min_max_thresholds_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + grouped_with_min_max_thresholds_config: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # Configuration for grouped_with_min_max_thresholds pricing + grouped_with_min_max_thresholds_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :grouped_with_min_max_thresholds + ) + end + + sig do + override.returns( + { + cadence: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + grouped_with_min_max_thresholds_config: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before applying thresholds + sig { returns(String) } + attr_accessor :grouping_key + + # The maximum amount to charge each group + sig { returns(String) } + attr_accessor :maximum_charge + + # The minimum amount to charge each group, regardless of usage + sig { returns(String) } + attr_accessor :minimum_charge + + # The base price charged per group + sig { returns(String) } + attr_accessor :per_unit_rate + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + params( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before applying thresholds + grouping_key:, + # The maximum amount to charge each group + maximum_charge:, + # The minimum amount to charge each group, regardless of usage + minimum_charge:, + # The base price charged per group + per_unit_rate: + ) + end + + sig do + override.returns( + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + ) + end + def to_hash + end + end + end + + class Percent < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # Configuration for percent pricing + sig do + returns( + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::PercentConfig + ) + end + attr_reader :percent_config + + sig do + params( + percent_config: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::PercentConfig::OrHash + ).void + end + attr_writer :percent_config + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::Cadence::OrSymbol, + item_id: String, + name: String, + percent_config: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::PercentConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for percent pricing + percent_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :percent + ) + end + + sig do + override.returns( + { + cadence: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::Cadence::OrSymbol, + item_id: String, + model_type: Symbol, + name: String, + percent_config: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::PercentConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class PercentConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::PercentConfig, + Orb::Internal::AnyHash + ) + end + + # What percent of the component subtotals to charge + sig { returns(Float) } + attr_accessor :percent + + # Configuration for percent pricing + sig { params(percent: Float).returns(T.attached_class) } + def self.new( + # What percent of the component subtotals to charge + percent: + ) + end + + sig { override.returns({ percent: Float }) } + def to_hash + end + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # Configuration for event_output pricing + sig do + returns( + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::EventOutputConfig + ) + end + attr_reader :event_output_config + + sig do + params( + event_output_config: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::EventOutputConfig::OrHash + ).void + end + attr_writer :event_output_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::Cadence::OrSymbol, + event_output_config: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::EventOutputConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # Configuration for event_output pricing + event_output_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :event_output + ) + end + + sig do + override.returns( + { + cadence: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::Cadence::OrSymbol, + event_output_config: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class EventOutputConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::EventOutputConfig, + Orb::Internal::AnyHash + ) + end + + # The key in the event data to extract the unit rate from. + sig { returns(String) } + attr_accessor :unit_rating_key + + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + sig { returns(T.nilable(String)) } + attr_accessor :grouping_key + + # Configuration for event_output pricing + sig do + params( + unit_rating_key: String, + grouping_key: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The key in the event data to extract the unit rate from. + unit_rating_key:, + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + grouping_key: nil + ) + end + + sig do + override.returns( + { unit_rating_key: String, grouping_key: T.nilable(String) } + ) + end + def to_hash + end + end + end + + sig do + override.returns( + T::Array[ + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Variants + ] + ) + end + def self.variants + end + end + end + + # Reset billing periods to be aligned with the plan change's effective date or + # start of the month. Defaults to `unchanged` which keeps subscription's existing + # billing cycle alignment. + module BillingCycleAlignment + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::SubscriptionSchedulePlanChangeParams::BillingCycleAlignment + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + UNCHANGED = + T.let( + :unchanged, + Orb::SubscriptionSchedulePlanChangeParams::BillingCycleAlignment::TaggedSymbol + ) + PLAN_CHANGE_DATE = + T.let( + :plan_change_date, + Orb::SubscriptionSchedulePlanChangeParams::BillingCycleAlignment::TaggedSymbol + ) + START_OF_MONTH = + T.let( + :start_of_month, + Orb::SubscriptionSchedulePlanChangeParams::BillingCycleAlignment::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::SubscriptionSchedulePlanChangeParams::BillingCycleAlignment::TaggedSymbol + ] + ) + end + def self.values + end + end + + class RemoveAdjustment < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::RemoveAdjustment, + Orb::Internal::AnyHash + ) + end + + # The id of the adjustment to remove on the subscription. + sig { returns(String) } + attr_accessor :adjustment_id + + sig { params(adjustment_id: String).returns(T.attached_class) } + def self.new( + # The id of the adjustment to remove on the subscription. + adjustment_id: + ) + end + + sig { override.returns({ adjustment_id: String }) } + def to_hash + end + end + + class RemovePrice < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::RemovePrice, + Orb::Internal::AnyHash + ) + end + + # The external price id of the price to remove on the subscription. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # The id of the price to remove on the subscription. + sig { returns(T.nilable(String)) } + attr_accessor :price_id + + sig do + params( + external_price_id: T.nilable(String), + price_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The external price id of the price to remove on the subscription. + external_price_id: nil, + # The id of the price to remove on the subscription. + price_id: nil + ) + end + + sig do + override.returns( + { + external_price_id: T.nilable(String), + price_id: T.nilable(String) + } + ) + end + def to_hash + end + end + + class ReplaceAdjustment < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment, + Orb::Internal::AnyHash + ) + end + + # The definition of a new adjustment to create and add to the subscription. + sig do + returns( + T.any( + Orb::NewPercentageDiscount, + Orb::NewUsageDiscount, + Orb::NewAmountDiscount, + Orb::NewMinimum, + Orb::NewMaximum + ) + ) + end + attr_accessor :adjustment + + # The id of the adjustment on the plan to replace in the subscription. + sig { returns(String) } + attr_accessor :replaces_adjustment_id + + sig do + params( + adjustment: + T.any( + Orb::NewPercentageDiscount::OrHash, + Orb::NewUsageDiscount::OrHash, + Orb::NewAmountDiscount::OrHash, + Orb::NewMinimum::OrHash, + Orb::NewMaximum::OrHash + ), + replaces_adjustment_id: String + ).returns(T.attached_class) + end + def self.new( + # The definition of a new adjustment to create and add to the subscription. + adjustment:, + # The id of the adjustment on the plan to replace in the subscription. + replaces_adjustment_id: + ) + end + + sig do + override.returns( + { + adjustment: + T.any( + Orb::NewPercentageDiscount, + Orb::NewUsageDiscount, + Orb::NewAmountDiscount, + Orb::NewMinimum, Orb::NewMaximum ), replaces_adjustment_id: String @@ -1032,280 +2515,1763 @@ module Orb def to_hash end - # The definition of a new adjustment to create and add to the subscription. - module Adjustment - extend Orb::Internal::Type::Union + # The definition of a new adjustment to create and add to the subscription. + module Adjustment + extend Orb::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Orb::NewPercentageDiscount, + Orb::NewUsageDiscount, + Orb::NewAmountDiscount, + Orb::NewMinimum, + Orb::NewMaximum + ) + end + + sig do + override.returns( + T::Array[ + Orb::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::Variants + ] + ) + end + def self.variants + end + end + end + + class ReplacePrice < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice, + Orb::Internal::AnyHash + ) + end + + # The id of the price on the plan to replace in the subscription. + sig { returns(String) } + attr_accessor :replaces_price_id + + # The definition of a new allocation price to create and add to the subscription. + sig { returns(T.nilable(Orb::NewAllocationPrice)) } + attr_reader :allocation_price + + sig do + params( + allocation_price: T.nilable(Orb::NewAllocationPrice::OrHash) + ).void + end + attr_writer :allocation_price + + # [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the + # replacement price. + sig { returns(T.nilable(T::Array[Orb::DiscountOverride])) } + attr_accessor :discounts + + # The external price id of the price to add to the subscription. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # The new quantity of the price, if the price is a fixed price. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for + # the replacement price. + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + # [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for + # the replacement price. + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + # New subscription price request body params. + sig do + returns( + T.nilable( + T.any( + Orb::NewSubscriptionUnitPrice, + Orb::NewSubscriptionTieredPrice, + Orb::NewSubscriptionBulkPrice, + Orb::NewSubscriptionPackagePrice, + Orb::NewSubscriptionMatrixPrice, + Orb::NewSubscriptionThresholdTotalAmountPrice, + Orb::NewSubscriptionTieredPackagePrice, + Orb::NewSubscriptionTieredWithMinimumPrice, + Orb::NewSubscriptionGroupedTieredPrice, + Orb::NewSubscriptionTieredPackageWithMinimumPrice, + Orb::NewSubscriptionPackageWithAllocationPrice, + Orb::NewSubscriptionUnitWithPercentPrice, + Orb::NewSubscriptionMatrixWithAllocationPrice, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration, + Orb::NewSubscriptionUnitWithProrationPrice, + Orb::NewSubscriptionGroupedAllocationPrice, + Orb::NewSubscriptionBulkWithProrationPrice, + Orb::NewSubscriptionGroupedWithProratedMinimumPrice, + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, + Orb::NewSubscriptionMatrixWithDisplayNamePrice, + Orb::NewSubscriptionGroupedTieredPackagePrice, + Orb::NewSubscriptionMaxGroupTieredPackagePrice, + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, + Orb::NewSubscriptionCumulativeGroupedBulkPrice, + Orb::NewSubscriptionMinimumCompositePrice, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput + ) + ) + ) + end + attr_accessor :price + + # The id of the price to add to the subscription. + sig { returns(T.nilable(String)) } + attr_accessor :price_id + + sig do + params( + replaces_price_id: String, + allocation_price: T.nilable(Orb::NewAllocationPrice::OrHash), + discounts: T.nilable(T::Array[Orb::DiscountOverride::OrHash]), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + maximum_amount: T.nilable(String), + minimum_amount: T.nilable(String), + price: + T.nilable( + T.any( + Orb::NewSubscriptionUnitPrice::OrHash, + Orb::NewSubscriptionTieredPrice::OrHash, + Orb::NewSubscriptionBulkPrice::OrHash, + Orb::NewSubscriptionPackagePrice::OrHash, + Orb::NewSubscriptionMatrixPrice::OrHash, + Orb::NewSubscriptionThresholdTotalAmountPrice::OrHash, + Orb::NewSubscriptionTieredPackagePrice::OrHash, + Orb::NewSubscriptionTieredWithMinimumPrice::OrHash, + Orb::NewSubscriptionGroupedTieredPrice::OrHash, + Orb::NewSubscriptionTieredPackageWithMinimumPrice::OrHash, + Orb::NewSubscriptionPackageWithAllocationPrice::OrHash, + Orb::NewSubscriptionUnitWithPercentPrice::OrHash, + Orb::NewSubscriptionMatrixWithAllocationPrice::OrHash, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::OrHash, + Orb::NewSubscriptionUnitWithProrationPrice::OrHash, + Orb::NewSubscriptionGroupedAllocationPrice::OrHash, + Orb::NewSubscriptionBulkWithProrationPrice::OrHash, + Orb::NewSubscriptionGroupedWithProratedMinimumPrice::OrHash, + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::OrHash, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::OrHash, + Orb::NewSubscriptionMatrixWithDisplayNamePrice::OrHash, + Orb::NewSubscriptionGroupedTieredPackagePrice::OrHash, + Orb::NewSubscriptionMaxGroupTieredPackagePrice::OrHash, + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::OrHash, + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::OrHash, + Orb::NewSubscriptionCumulativeGroupedBulkPrice::OrHash, + Orb::NewSubscriptionMinimumCompositePrice::OrHash, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::OrHash, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::OrHash + ) + ), + price_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The id of the price on the plan to replace in the subscription. + replaces_price_id:, + # The definition of a new allocation price to create and add to the subscription. + allocation_price: nil, + # [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the + # replacement price. + discounts: nil, + # The external price id of the price to add to the subscription. + external_price_id: nil, + # The new quantity of the price, if the price is a fixed price. + fixed_price_quantity: nil, + # [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for + # the replacement price. + maximum_amount: nil, + # [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for + # the replacement price. + minimum_amount: nil, + # New subscription price request body params. + price: nil, + # The id of the price to add to the subscription. + price_id: nil + ) + end + + sig do + override.returns( + { + replaces_price_id: String, + allocation_price: T.nilable(Orb::NewAllocationPrice), + discounts: T.nilable(T::Array[Orb::DiscountOverride]), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + maximum_amount: T.nilable(String), + minimum_amount: T.nilable(String), + price: + T.nilable( + T.any( + Orb::NewSubscriptionUnitPrice, + Orb::NewSubscriptionTieredPrice, + Orb::NewSubscriptionBulkPrice, + Orb::NewSubscriptionPackagePrice, + Orb::NewSubscriptionMatrixPrice, + Orb::NewSubscriptionThresholdTotalAmountPrice, + Orb::NewSubscriptionTieredPackagePrice, + Orb::NewSubscriptionTieredWithMinimumPrice, + Orb::NewSubscriptionGroupedTieredPrice, + Orb::NewSubscriptionTieredPackageWithMinimumPrice, + Orb::NewSubscriptionPackageWithAllocationPrice, + Orb::NewSubscriptionUnitWithPercentPrice, + Orb::NewSubscriptionMatrixWithAllocationPrice, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration, + Orb::NewSubscriptionUnitWithProrationPrice, + Orb::NewSubscriptionGroupedAllocationPrice, + Orb::NewSubscriptionBulkWithProrationPrice, + Orb::NewSubscriptionGroupedWithProratedMinimumPrice, + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, + Orb::NewSubscriptionMatrixWithDisplayNamePrice, + Orb::NewSubscriptionGroupedTieredPackagePrice, + Orb::NewSubscriptionMaxGroupTieredPackagePrice, + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, + Orb::NewSubscriptionCumulativeGroupedBulkPrice, + Orb::NewSubscriptionMinimumCompositePrice, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput + ) + ), + price_id: T.nilable(String) + } + ) + end + def to_hash + end + + # New subscription price request body params. + module Price + extend Orb::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Orb::NewSubscriptionUnitPrice, + Orb::NewSubscriptionTieredPrice, + Orb::NewSubscriptionBulkPrice, + Orb::NewSubscriptionPackagePrice, + Orb::NewSubscriptionMatrixPrice, + Orb::NewSubscriptionThresholdTotalAmountPrice, + Orb::NewSubscriptionTieredPackagePrice, + Orb::NewSubscriptionTieredWithMinimumPrice, + Orb::NewSubscriptionGroupedTieredPrice, + Orb::NewSubscriptionTieredPackageWithMinimumPrice, + Orb::NewSubscriptionPackageWithAllocationPrice, + Orb::NewSubscriptionUnitWithPercentPrice, + Orb::NewSubscriptionMatrixWithAllocationPrice, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration, + Orb::NewSubscriptionUnitWithProrationPrice, + Orb::NewSubscriptionGroupedAllocationPrice, + Orb::NewSubscriptionBulkWithProrationPrice, + Orb::NewSubscriptionGroupedWithProratedMinimumPrice, + Orb::NewSubscriptionGroupedWithMeteredMinimumPrice, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, + Orb::NewSubscriptionMatrixWithDisplayNamePrice, + Orb::NewSubscriptionGroupedTieredPackagePrice, + Orb::NewSubscriptionMaxGroupTieredPackagePrice, + Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, + Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, + Orb::NewSubscriptionCumulativeGroupedBulkPrice, + Orb::NewSubscriptionMinimumCompositePrice, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput + ) + end + + class TieredWithProration < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # Configuration for tiered_with_proration pricing + sig do + returns( + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig + ) + end + attr_reader :tiered_with_proration_config + + sig do + params( + tiered_with_proration_config: + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::OrHash + ).void + end + attr_writer :tiered_with_proration_config + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::Cadence::OrSymbol, + item_id: String, + name: String, + tiered_with_proration_config: + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for tiered_with_proration pricing + tiered_with_proration_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :tiered_with_proration + ) + end + + sig do + override.returns( + { + cadence: + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::Cadence::OrSymbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_proration_config: + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig, + Orb::Internal::AnyHash + ) + end + + # Tiers for rating based on total usage quantities into the specified tier with + # proration + sig do + returns( + T::Array[ + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + ) + end + attr_accessor :tiers + + # Configuration for tiered_with_proration pricing + sig do + params( + tiers: + T::Array[ + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Tiers for rating based on total usage quantities into the specified tier with + # proration + tiers: + ) + end + + sig do + override.returns( + { + tiers: + T::Array[ + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + } + ) + end + def to_hash + end + + class Tier < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier, + Orb::Internal::AnyHash + ) + end + + # Inclusive tier starting value + sig { returns(String) } + attr_accessor :tier_lower_bound + + # Amount per unit + sig { returns(String) } + attr_accessor :unit_amount + + # Configuration for a single tiered with proration tier + sig do + params(tier_lower_bound: String, unit_amount: String).returns( + T.attached_class + ) + end + def self.new( + # Inclusive tier starting value + tier_lower_bound:, + # Amount per unit + unit_amount: + ) + end + + sig do + override.returns( + { tier_lower_bound: String, unit_amount: String } + ) + end + def to_hash + end + end + end + end + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + returns( + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + ) + end + attr_reader :grouped_with_min_max_thresholds_config + + sig do + params( + grouped_with_min_max_thresholds_config: + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash + ).void + end + attr_writer :grouped_with_min_max_thresholds_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + grouped_with_min_max_thresholds_config: + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # Configuration for grouped_with_min_max_thresholds pricing + grouped_with_min_max_thresholds_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :grouped_with_min_max_thresholds + ) + end + + sig do + override.returns( + { + cadence: + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::OrSymbol, + grouped_with_min_max_thresholds_config: + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + Orb::Internal::AnyHash + ) + end + + # The event property used to group before applying thresholds + sig { returns(String) } + attr_accessor :grouping_key + + # The maximum amount to charge each group + sig { returns(String) } + attr_accessor :maximum_charge + + # The minimum amount to charge each group, regardless of usage + sig { returns(String) } + attr_accessor :minimum_charge + + # The base price charged per group + sig { returns(String) } + attr_accessor :per_unit_rate + + # Configuration for grouped_with_min_max_thresholds pricing + sig do + params( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ).returns(T.attached_class) + end + def self.new( + # The event property used to group before applying thresholds + grouping_key:, + # The maximum amount to charge each group + maximum_charge:, + # The minimum amount to charge each group, regardless of usage + minimum_charge:, + # The base price charged per group + per_unit_rate: + ) + end + + sig do + override.returns( + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + ) + end + def to_hash + end + end + end + + class Percent < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # Configuration for percent pricing + sig do + returns( + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::PercentConfig + ) + end + attr_reader :percent_config + + sig do + params( + percent_config: + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::PercentConfig::OrHash + ).void + end + attr_writer :percent_config + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) + ) + end + attr_accessor :conversion_rate_config + + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration + + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration + + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration + + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration + + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::Cadence::OrSymbol, + item_id: String, + name: String, + percent_config: + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::PercentConfig::OrHash, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # Configuration for percent pricing + percent_config:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :percent + ) + end + + sig do + override.returns( + { + cadence: + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::Cadence::OrSymbol, + item_id: String, + model_type: Symbol, + name: String, + percent_config: + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::PercentConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class PercentConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::PercentConfig, + Orb::Internal::AnyHash + ) + end + + # What percent of the component subtotals to charge + sig { returns(Float) } + attr_accessor :percent + + # Configuration for percent pricing + sig { params(percent: Float).returns(T.attached_class) } + def self.new( + # What percent of the component subtotals to charge + percent: + ) + end + + sig { override.returns({ percent: Float }) } + def to_hash + end + end + end + + class EventOutput < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::Cadence::OrSymbol + ) + end + attr_accessor :cadence + + # Configuration for event_output pricing + sig do + returns( + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::EventOutputConfig + ) + end + attr_reader :event_output_config + + sig do + params( + event_output_config: + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::EventOutputConfig::OrHash + ).void + end + attr_writer :event_output_config + + # The id of the item the price will be associated with. + sig { returns(String) } + attr_accessor :item_id + + # The pricing model type + sig { returns(Symbol) } + attr_accessor :model_type + + # The name of the price. + sig { returns(String) } + attr_accessor :name + + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance - Variants = - T.type_alias do - T.any( - Orb::NewPercentageDiscount, - Orb::NewUsageDiscount, - Orb::NewAmountDiscount, - Orb::NewMinimum, - Orb::NewMaximum + # For custom cadence: specifies the duration of the billing period in days or + # months. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :billing_cycle_configuration + + sig do + params( + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :billing_cycle_configuration + + # The per unit conversion rate of the price currency to the invoicing currency. + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + # The configuration for the rate of the price currency to the invoicing currency. + sig do + returns( + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ) ) end + attr_accessor :conversion_rate_config - sig do - override.returns( - T::Array[ - Orb::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::Variants - ] - ) - end - def self.variants - end - end - end + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + sig { returns(T.nilable(String)) } + attr_accessor :currency - class ReplacePrice < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice, - Orb::Internal::AnyHash - ) - end + # For dimensional price: specifies a price group and dimension values + sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) } + attr_reader :dimensional_price_configuration - # The id of the price on the plan to replace in the subscription. - sig { returns(String) } - attr_accessor :replaces_price_id + sig do + params( + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash) + ).void + end + attr_writer :dimensional_price_configuration - # The definition of a new allocation price to create and add to the subscription. - sig { returns(T.nilable(Orb::NewAllocationPrice)) } - attr_reader :allocation_price + # An alias for the price. + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id - sig do - params( - allocation_price: T.nilable(Orb::NewAllocationPrice::OrHash) - ).void - end - attr_writer :allocation_price + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity - # [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the - # replacement price. - sig { returns(T.nilable(T::Array[Orb::DiscountOverride])) } - attr_accessor :discounts + # The property used to group this price on an invoice + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key - # The external price id of the price to add to the subscription. - sig { returns(T.nilable(String)) } - attr_accessor :external_price_id + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) } + attr_reader :invoicing_cycle_configuration - # The new quantity of the price, if the price is a fixed price. - sig { returns(T.nilable(Float)) } - attr_accessor :fixed_price_quantity + sig do + params( + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash) + ).void + end + attr_writer :invoicing_cycle_configuration - # [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for - # the replacement price. - sig { returns(T.nilable(String)) } - attr_accessor :maximum_amount + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata - # [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for - # the replacement price. - sig { returns(T.nilable(String)) } - attr_accessor :minimum_amount + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id - # The definition of a new price to create and add to the subscription. - sig do - returns( - T.nilable( - T.any( - Orb::NewSubscriptionUnitPrice, - Orb::NewSubscriptionPackagePrice, - Orb::NewSubscriptionMatrixPrice, - Orb::NewSubscriptionTieredPrice, - Orb::NewSubscriptionTieredBPSPrice, - Orb::NewSubscriptionBPSPrice, - Orb::NewSubscriptionBulkBPSPrice, - Orb::NewSubscriptionBulkPrice, - Orb::NewSubscriptionThresholdTotalAmountPrice, - Orb::NewSubscriptionTieredPackagePrice, - Orb::NewSubscriptionTieredWithMinimumPrice, - Orb::NewSubscriptionUnitWithPercentPrice, - Orb::NewSubscriptionPackageWithAllocationPrice, - Orb::NewSubscriptionTierWithProrationPrice, - Orb::NewSubscriptionUnitWithProrationPrice, - Orb::NewSubscriptionGroupedAllocationPrice, - Orb::NewSubscriptionGroupedWithProratedMinimumPrice, - Orb::NewSubscriptionBulkWithProrationPrice, - Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, - Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, - Orb::NewSubscriptionCumulativeGroupedBulkPrice, - Orb::NewSubscriptionMaxGroupTieredPackagePrice, - Orb::NewSubscriptionGroupedWithMeteredMinimumPrice, - Orb::NewSubscriptionMatrixWithDisplayNamePrice, - Orb::NewSubscriptionGroupedTieredPackagePrice, - Orb::NewSubscriptionMatrixWithAllocationPrice, - Orb::NewSubscriptionTieredPackageWithMinimumPrice, - Orb::NewSubscriptionGroupedTieredPrice - ) + sig do + params( + cadence: + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::Cadence::OrSymbol, + event_output_config: + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::EventOutputConfig::OrHash, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig::OrHash, + Orb::TieredConversionRateConfig::OrHash + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The cadence to bill for this price on. + cadence:, + # Configuration for event_output pricing + event_output_config:, + # The id of the item the price will be associated with. + item_id:, + # The name of the price. + name:, + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + billable_metric_id: nil, + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + billed_in_advance: nil, + # For custom cadence: specifies the duration of the billing period in days or + # months. + billing_cycle_configuration: nil, + # The per unit conversion rate of the price currency to the invoicing currency. + conversion_rate: nil, + # The configuration for the rate of the price currency to the invoicing currency. + conversion_rate_config: nil, + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + currency: nil, + # For dimensional price: specifies a price group and dimension values + dimensional_price_configuration: nil, + # An alias for the price. + external_price_id: nil, + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + fixed_price_quantity: nil, + # The property used to group this price on an invoice + invoice_grouping_key: nil, + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + invoicing_cycle_configuration: nil, + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + metadata: nil, + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + reference_id: nil, + # The pricing model type + model_type: :event_output ) - ) - end - attr_accessor :price + end - # The id of the price to add to the subscription. - sig { returns(T.nilable(String)) } - attr_accessor :price_id + sig do + override.returns( + { + cadence: + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::Cadence::OrSymbol, + event_output_config: + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + conversion_rate: T.nilable(Float), + conversion_rate_config: + T.nilable( + T.any( + Orb::UnitConversionRateConfig, + Orb::TieredConversionRateConfig + ) + ), + currency: T.nilable(String), + dimensional_price_configuration: + T.nilable(Orb::NewDimensionalPriceConfiguration), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: + T.nilable(Orb::NewBillingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + ) + end + def to_hash + end - sig do - params( - replaces_price_id: String, - allocation_price: T.nilable(Orb::NewAllocationPrice::OrHash), - discounts: T.nilable(T::Array[Orb::DiscountOverride::OrHash]), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - maximum_amount: T.nilable(String), - minimum_amount: T.nilable(String), - price: - T.nilable( - T.any( - Orb::NewSubscriptionUnitPrice::OrHash, - Orb::NewSubscriptionPackagePrice::OrHash, - Orb::NewSubscriptionMatrixPrice::OrHash, - Orb::NewSubscriptionTieredPrice::OrHash, - Orb::NewSubscriptionTieredBPSPrice::OrHash, - Orb::NewSubscriptionBPSPrice::OrHash, - Orb::NewSubscriptionBulkBPSPrice::OrHash, - Orb::NewSubscriptionBulkPrice::OrHash, - Orb::NewSubscriptionThresholdTotalAmountPrice::OrHash, - Orb::NewSubscriptionTieredPackagePrice::OrHash, - Orb::NewSubscriptionTieredWithMinimumPrice::OrHash, - Orb::NewSubscriptionUnitWithPercentPrice::OrHash, - Orb::NewSubscriptionPackageWithAllocationPrice::OrHash, - Orb::NewSubscriptionTierWithProrationPrice::OrHash, - Orb::NewSubscriptionUnitWithProrationPrice::OrHash, - Orb::NewSubscriptionGroupedAllocationPrice::OrHash, - Orb::NewSubscriptionGroupedWithProratedMinimumPrice::OrHash, - Orb::NewSubscriptionBulkWithProrationPrice::OrHash, - Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::OrHash, - Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::OrHash, - Orb::NewSubscriptionCumulativeGroupedBulkPrice::OrHash, - Orb::NewSubscriptionMaxGroupTieredPackagePrice::OrHash, - Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::OrHash, - Orb::NewSubscriptionMatrixWithDisplayNamePrice::OrHash, - Orb::NewSubscriptionGroupedTieredPackagePrice::OrHash, - Orb::NewSubscriptionMatrixWithAllocationPrice::OrHash, - Orb::NewSubscriptionTieredPackageWithMinimumPrice::OrHash, - Orb::NewSubscriptionGroupedTieredPrice::OrHash + # The cadence to bill for this price on. + module Cadence + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::Cadence + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUAL = + T.let( + :annual, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol ) - ), - price_id: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # The id of the price on the plan to replace in the subscription. - replaces_price_id:, - # The definition of a new allocation price to create and add to the subscription. - allocation_price: nil, - # [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the - # replacement price. - discounts: nil, - # The external price id of the price to add to the subscription. - external_price_id: nil, - # The new quantity of the price, if the price is a fixed price. - fixed_price_quantity: nil, - # [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for - # the replacement price. - maximum_amount: nil, - # [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for - # the replacement price. - minimum_amount: nil, - # The definition of a new price to create and add to the subscription. - price: nil, - # The id of the price to add to the subscription. - price_id: nil - ) - end - sig do - override.returns( - { - replaces_price_id: String, - allocation_price: T.nilable(Orb::NewAllocationPrice), - discounts: T.nilable(T::Array[Orb::DiscountOverride]), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - maximum_amount: T.nilable(String), - minimum_amount: T.nilable(String), - price: - T.nilable( + sig do + override.returns( + T::Array[ + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::Cadence::TaggedSymbol + ] + ) + end + def self.values + end + end + + class EventOutputConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do T.any( - Orb::NewSubscriptionUnitPrice, - Orb::NewSubscriptionPackagePrice, - Orb::NewSubscriptionMatrixPrice, - Orb::NewSubscriptionTieredPrice, - Orb::NewSubscriptionTieredBPSPrice, - Orb::NewSubscriptionBPSPrice, - Orb::NewSubscriptionBulkBPSPrice, - Orb::NewSubscriptionBulkPrice, - Orb::NewSubscriptionThresholdTotalAmountPrice, - Orb::NewSubscriptionTieredPackagePrice, - Orb::NewSubscriptionTieredWithMinimumPrice, - Orb::NewSubscriptionUnitWithPercentPrice, - Orb::NewSubscriptionPackageWithAllocationPrice, - Orb::NewSubscriptionTierWithProrationPrice, - Orb::NewSubscriptionUnitWithProrationPrice, - Orb::NewSubscriptionGroupedAllocationPrice, - Orb::NewSubscriptionGroupedWithProratedMinimumPrice, - Orb::NewSubscriptionBulkWithProrationPrice, - Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, - Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, - Orb::NewSubscriptionCumulativeGroupedBulkPrice, - Orb::NewSubscriptionMaxGroupTieredPackagePrice, - Orb::NewSubscriptionGroupedWithMeteredMinimumPrice, - Orb::NewSubscriptionMatrixWithDisplayNamePrice, - Orb::NewSubscriptionGroupedTieredPackagePrice, - Orb::NewSubscriptionMatrixWithAllocationPrice, - Orb::NewSubscriptionTieredPackageWithMinimumPrice, - Orb::NewSubscriptionGroupedTieredPrice + Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::EventOutputConfig, + Orb::Internal::AnyHash ) - ), - price_id: T.nilable(String) - } - ) - end - def to_hash - end + end - # The definition of a new price to create and add to the subscription. - module Price - extend Orb::Internal::Type::Union + # The key in the event data to extract the unit rate from. + sig { returns(String) } + attr_accessor :unit_rating_key - Variants = - T.type_alias do - T.any( - Orb::NewSubscriptionUnitPrice, - Orb::NewSubscriptionPackagePrice, - Orb::NewSubscriptionMatrixPrice, - Orb::NewSubscriptionTieredPrice, - Orb::NewSubscriptionTieredBPSPrice, - Orb::NewSubscriptionBPSPrice, - Orb::NewSubscriptionBulkBPSPrice, - Orb::NewSubscriptionBulkPrice, - Orb::NewSubscriptionThresholdTotalAmountPrice, - Orb::NewSubscriptionTieredPackagePrice, - Orb::NewSubscriptionTieredWithMinimumPrice, - Orb::NewSubscriptionUnitWithPercentPrice, - Orb::NewSubscriptionPackageWithAllocationPrice, - Orb::NewSubscriptionTierWithProrationPrice, - Orb::NewSubscriptionUnitWithProrationPrice, - Orb::NewSubscriptionGroupedAllocationPrice, - Orb::NewSubscriptionGroupedWithProratedMinimumPrice, - Orb::NewSubscriptionBulkWithProrationPrice, - Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice, - Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice, - Orb::NewSubscriptionCumulativeGroupedBulkPrice, - Orb::NewSubscriptionMaxGroupTieredPackagePrice, - Orb::NewSubscriptionGroupedWithMeteredMinimumPrice, - Orb::NewSubscriptionMatrixWithDisplayNamePrice, - Orb::NewSubscriptionGroupedTieredPackagePrice, - Orb::NewSubscriptionMatrixWithAllocationPrice, - Orb::NewSubscriptionTieredPackageWithMinimumPrice, - Orb::NewSubscriptionGroupedTieredPrice + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + sig { returns(T.nilable(String)) } + attr_accessor :grouping_key + + # Configuration for event_output pricing + sig do + params( + unit_rating_key: String, + grouping_key: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The key in the event data to extract the unit rate from. + unit_rating_key:, + # An optional key in the event data to group by (e.g., event ID). All events will + # also be grouped by their unit rate. + grouping_key: nil ) + end + + sig do + override.returns( + { unit_rating_key: String, grouping_key: T.nilable(String) } + ) + end + def to_hash + end end + end sig do override.returns( diff --git a/rbi/orb/models/tier.rbi b/rbi/orb/models/tier.rbi index c1ec86ef..bb670e98 100644 --- a/rbi/orb/models/tier.rbi +++ b/rbi/orb/models/tier.rbi @@ -13,10 +13,12 @@ module Orb sig { returns(String) } attr_accessor :unit_amount - # Inclusive tier ending value. If null, this is treated as the last tier + # Inclusive tier ending value. This value is null if and only if this is the last + # tier. sig { returns(T.nilable(Float)) } attr_accessor :last_unit + # Configuration for a single tier sig do params( first_unit: Float, @@ -29,7 +31,8 @@ module Orb first_unit:, # Amount per unit unit_amount:, - # Inclusive tier ending value. If null, this is treated as the last tier + # Inclusive tier ending value. This value is null if and only if this is the last + # tier. last_unit: nil ) end diff --git a/rbi/orb/models/tier_config.rbi b/rbi/orb/models/tier_config.rbi deleted file mode 100644 index ce59fb3d..00000000 --- a/rbi/orb/models/tier_config.rbi +++ /dev/null @@ -1,40 +0,0 @@ -# typed: strong - -module Orb - module Models - class TierConfig < Orb::Internal::Type::BaseModel - OrHash = T.type_alias { T.any(Orb::TierConfig, Orb::Internal::AnyHash) } - - sig { returns(Float) } - attr_accessor :first_unit - - sig { returns(T.nilable(Float)) } - attr_accessor :last_unit - - sig { returns(String) } - attr_accessor :unit_amount - - sig do - params( - first_unit: Float, - last_unit: T.nilable(Float), - unit_amount: String - ).returns(T.attached_class) - end - def self.new(first_unit:, last_unit:, unit_amount:) - end - - sig do - override.returns( - { - first_unit: Float, - last_unit: T.nilable(Float), - unit_amount: String - } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/orb/models/tier_sub_line_item.rbi b/rbi/orb/models/tier_sub_line_item.rbi index f94fccca..8da04a95 100644 --- a/rbi/orb/models/tier_sub_line_item.rbi +++ b/rbi/orb/models/tier_sub_line_item.rbi @@ -22,10 +22,10 @@ module Orb sig { returns(Float) } attr_accessor :quantity - sig { returns(Orb::TierConfig) } + sig { returns(Orb::TierSubLineItem::TierConfig) } attr_reader :tier_config - sig { params(tier_config: Orb::TierConfig::OrHash).void } + sig { params(tier_config: Orb::TierSubLineItem::TierConfig::OrHash).void } attr_writer :tier_config sig { returns(Orb::TierSubLineItem::Type::TaggedSymbol) } @@ -37,7 +37,7 @@ module Orb grouping: T.nilable(Orb::SubLineItemGrouping::OrHash), name: String, quantity: Float, - tier_config: Orb::TierConfig::OrHash, + tier_config: Orb::TierSubLineItem::TierConfig::OrHash, type: Orb::TierSubLineItem::Type::OrSymbol ).returns(T.attached_class) end @@ -59,7 +59,7 @@ module Orb grouping: T.nilable(Orb::SubLineItemGrouping), name: String, quantity: Float, - tier_config: Orb::TierConfig, + tier_config: Orb::TierSubLineItem::TierConfig, type: Orb::TierSubLineItem::Type::TaggedSymbol } ) @@ -67,6 +67,44 @@ module Orb def to_hash end + class TierConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Orb::TierSubLineItem::TierConfig, Orb::Internal::AnyHash) + end + + sig { returns(Float) } + attr_accessor :first_unit + + sig { returns(T.nilable(Float)) } + attr_accessor :last_unit + + sig { returns(String) } + attr_accessor :unit_amount + + sig do + params( + first_unit: Float, + last_unit: T.nilable(Float), + unit_amount: String + ).returns(T.attached_class) + end + def self.new(first_unit:, last_unit:, unit_amount:) + end + + sig do + override.returns( + { + first_unit: Float, + last_unit: T.nilable(Float), + unit_amount: String + } + ) + end + def to_hash + end + end + module Type extend Orb::Internal::Type::Enum diff --git a/rbi/orb/models/tiered_bps_config.rbi b/rbi/orb/models/tiered_bps_config.rbi deleted file mode 100644 index b1c72cdf..00000000 --- a/rbi/orb/models/tiered_bps_config.rbi +++ /dev/null @@ -1,29 +0,0 @@ -# typed: strong - -module Orb - module Models - class TieredBPSConfig < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias { T.any(Orb::TieredBPSConfig, Orb::Internal::AnyHash) } - - # Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - # tiers - sig { returns(T::Array[Orb::BPSTier]) } - attr_accessor :tiers - - sig do - params(tiers: T::Array[Orb::BPSTier::OrHash]).returns(T.attached_class) - end - def self.new( - # Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - # tiers - tiers: - ) - end - - sig { override.returns({ tiers: T::Array[Orb::BPSTier] }) } - def to_hash - end - end - end -end diff --git a/rbi/orb/models/tiered_config.rbi b/rbi/orb/models/tiered_config.rbi index c39068c1..af54d5f8 100644 --- a/rbi/orb/models/tiered_config.rbi +++ b/rbi/orb/models/tiered_config.rbi @@ -9,6 +9,7 @@ module Orb sig { returns(T::Array[Orb::Tier]) } attr_accessor :tiers + # Configuration for tiered pricing sig do params(tiers: T::Array[Orb::Tier::OrHash]).returns(T.attached_class) end diff --git a/rbi/orb/models/unit_config.rbi b/rbi/orb/models/unit_config.rbi index bf189098..d79c5612 100644 --- a/rbi/orb/models/unit_config.rbi +++ b/rbi/orb/models/unit_config.rbi @@ -9,6 +9,7 @@ module Orb sig { returns(String) } attr_accessor :unit_amount + # Configuration for unit pricing sig { params(unit_amount: String).returns(T.attached_class) } def self.new( # Rate per unit of usage diff --git a/rbi/orb/resources/alerts.rbi b/rbi/orb/resources/alerts.rbi index 13e4bae0..ba2b6abb 100644 --- a/rbi/orb/resources/alerts.rbi +++ b/rbi/orb/resources/alerts.rbi @@ -34,7 +34,7 @@ module Orb # The request must specify one of `customer_id`, `external_customer_id`, or # `subscription_id`. # - # If querying by subscripion_id, the endpoint will return the subscription level + # If querying by subscription_id, the endpoint will return the subscription level # alerts as well as the plan level alerts associated with the subscription. # # The list of alerts is ordered starting from the most recently created alert. diff --git a/rbi/orb/resources/beta.rbi b/rbi/orb/resources/beta.rbi index cf606026..ce2a236b 100644 --- a/rbi/orb/resources/beta.rbi +++ b/rbi/orb/resources/beta.rbi @@ -6,9 +6,6 @@ module Orb sig { returns(Orb::Resources::Beta::ExternalPlanID) } attr_reader :external_plan_id - # This API endpoint is in beta and its interface may change. It is recommended for - # use only in test mode. - # # This endpoint allows the creation of a new plan version for an existing plan. sig do params( diff --git a/rbi/orb/resources/beta/external_plan_id.rbi b/rbi/orb/resources/beta/external_plan_id.rbi index 46b536ac..d40c459c 100644 --- a/rbi/orb/resources/beta/external_plan_id.rbi +++ b/rbi/orb/resources/beta/external_plan_id.rbi @@ -4,9 +4,6 @@ module Orb module Resources class Beta class ExternalPlanID - # This API endpoint is in beta and its interface may change. It is recommended for - # use only in test mode. - # # This endpoint allows the creation of a new plan version for an existing plan. sig do params( diff --git a/rbi/orb/resources/customers.rbi b/rbi/orb/resources/customers.rbi index 58fbf3be..e7c2376a 100644 --- a/rbi/orb/resources/customers.rbi +++ b/rbi/orb/resources/customers.rbi @@ -32,6 +32,7 @@ module Orb T.nilable(Orb::NewAccountingSyncConfiguration::OrHash), additional_emails: T.nilable(T::Array[String]), auto_collection: T.nilable(T::Boolean), + auto_issuance: T.nilable(T::Boolean), billing_address: T.nilable(Orb::AddressInput::OrHash), currency: T.nilable(String), email_delivery: T.nilable(T::Boolean), @@ -49,7 +50,8 @@ module Orb T.any( Orb::NewAvalaraTaxConfiguration::OrHash, Orb::NewTaxJarConfiguration::OrHash, - Orb::NewSphereConfiguration::OrHash + Orb::NewSphereConfiguration::OrHash, + Orb::CustomerCreateParams::TaxConfiguration::Numeral::OrHash ) ), tax_id: T.nilable(Orb::CustomerTaxID::OrHash), @@ -66,12 +68,18 @@ module Orb name:, accounting_sync_configuration: nil, # Additional email addresses for this customer. If populated, these email - # addresses will be CC'd for customer communications. + # addresses will be CC'd for customer communications. The total number of email + # addresses (including the primary email) cannot exceed 50. additional_emails: nil, # Used to determine if invoices for this customer will automatically attempt to # charge a saved payment method, if available. This parameter defaults to `True` # when a payment provider is provided on customer creation. auto_collection: nil, + # Used to determine if invoices for this customer will be automatically issued. If + # true, invoices will be automatically issued. If false, invoices will require + # manual approval. If `null` is specified, the customer's auto issuance setting + # will be inherited from the account-level setting. + auto_issuance: nil, billing_address: nil, # An ISO 4217 currency string used for the customer's invoices and balance. If not # set at creation time, will be set at subscription creation time. @@ -262,6 +270,7 @@ module Orb T.nilable(Orb::NewAccountingSyncConfiguration::OrHash), additional_emails: T.nilable(T::Array[String]), auto_collection: T.nilable(T::Boolean), + auto_issuance: T.nilable(T::Boolean), billing_address: T.nilable(Orb::AddressInput::OrHash), currency: T.nilable(String), email: T.nilable(String), @@ -281,7 +290,8 @@ module Orb T.any( Orb::NewAvalaraTaxConfiguration::OrHash, Orb::NewTaxJarConfiguration::OrHash, - Orb::NewSphereConfiguration::OrHash + Orb::NewSphereConfiguration::OrHash, + Orb::CustomerUpdateParams::TaxConfiguration::Numeral::OrHash ) ), tax_id: T.nilable(Orb::CustomerTaxID::OrHash), @@ -292,12 +302,18 @@ module Orb customer_id, accounting_sync_configuration: nil, # Additional email addresses for this customer. If populated, these email - # addresses will be CC'd for customer communications. + # addresses will be CC'd for customer communications. The total number of email + # addresses (including the primary email) cannot exceed 50. additional_emails: nil, # Used to determine if invoices for this customer will automatically attempt to # charge a saved payment method, if available. This parameter defaults to `True` # when a payment provider is provided on customer creation. auto_collection: nil, + # Used to determine if invoices for this customer will be automatically issued. If + # true, invoices will be automatically issued. If false, invoices will require + # manual approval.If `null` is specified, the customer's auto issuance setting + # will be inherited from the account-level setting. + auto_issuance: nil, billing_address: nil, # An ISO 4217 currency string used for the customer's invoices and balance. If not # set at creation time, will be set at subscription creation time. @@ -607,6 +623,7 @@ module Orb T.nilable(Orb::NewAccountingSyncConfiguration::OrHash), additional_emails: T.nilable(T::Array[String]), auto_collection: T.nilable(T::Boolean), + auto_issuance: T.nilable(T::Boolean), billing_address: T.nilable(Orb::AddressInput::OrHash), currency: T.nilable(String), email: T.nilable(String), @@ -628,7 +645,8 @@ module Orb T.any( Orb::NewAvalaraTaxConfiguration::OrHash, Orb::NewTaxJarConfiguration::OrHash, - Orb::NewSphereConfiguration::OrHash + Orb::NewSphereConfiguration::OrHash, + Orb::CustomerUpdateByExternalIDParams::TaxConfiguration::Numeral::OrHash ) ), tax_id: T.nilable(Orb::CustomerTaxID::OrHash), @@ -639,12 +657,18 @@ module Orb id, accounting_sync_configuration: nil, # Additional email addresses for this customer. If populated, these email - # addresses will be CC'd for customer communications. + # addresses will be CC'd for customer communications. The total number of email + # addresses (including the primary email) cannot exceed 50. additional_emails: nil, # Used to determine if invoices for this customer will automatically attempt to # charge a saved payment method, if available. This parameter defaults to `True` # when a payment provider is provided on customer creation. auto_collection: nil, + # Used to determine if invoices for this customer will be automatically issued. If + # true, invoices will be automatically issued. If false, invoices will require + # manual approval.If `null` is specified, the customer's auto issuance setting + # will be inherited from the account-level setting. + auto_issuance: nil, billing_address: nil, # An ISO 4217 currency string used for the customer's invoices and balance. If not # set at creation time, will be set at subscription creation time. diff --git a/rbi/orb/resources/customers/credits/ledger.rbi b/rbi/orb/resources/customers/credits/ledger.rbi index f93cb07d..0c0f377d 100644 --- a/rbi/orb/resources/customers/credits/ledger.rbi +++ b/rbi/orb/resources/customers/credits/ledger.rbi @@ -62,7 +62,7 @@ module Orb # Note that for this entry type, `starting_balance` will equal `ending_balance`, # and the `amount` represents the balance transferred. The credit block linked to # the ledger entry is the source credit block from which there was an expiration - # change + # change. # # ## Credits expiry # @@ -547,7 +547,7 @@ module Orb # Note that for this entry type, `starting_balance` will equal `ending_balance`, # and the `amount` represents the balance transferred. The credit block linked to # the ledger entry is the source credit block from which there was an expiration - # change + # change. # # ## Credits expiry # diff --git a/rbi/orb/resources/dimensional_price_groups.rbi b/rbi/orb/resources/dimensional_price_groups.rbi index fd728620..d9caa5f7 100644 --- a/rbi/orb/resources/dimensional_price_groups.rbi +++ b/rbi/orb/resources/dimensional_price_groups.rbi @@ -11,7 +11,7 @@ module Orb attr_reader :external_dimensional_price_group_id # A dimensional price group is used to partition the result of a billable metric - # by a set of dimensions. Prices in a price group must specify the parition used + # by a set of dimensions. Prices in a price group must specify the partition used # to derive their usage. # # For example, suppose we have a billable metric that measures the number of diff --git a/rbi/orb/resources/events/backfills.rbi b/rbi/orb/resources/events/backfills.rbi index e872260d..27834c2b 100644 --- a/rbi/orb/resources/events/backfills.rbi +++ b/rbi/orb/resources/events/backfills.rbi @@ -36,8 +36,8 @@ module Orb # # When `replace_existing_events` is `true`, this indicates that existing events in # the timeframe should no longer be counted towards invoiced usage. In this - # scenario, the parameter `filter` can be optionally added which enables filtering - # using + # scenario, the parameter `deprecation_filter` can be optionally added which + # enables filtering using # [computed properties](/extensibility/advanced-metrics#computed-properties). The # expressiveness of computed properties allows you to deprecate existing events # based on both a period of time and specific property values. diff --git a/rbi/orb/resources/invoice_line_items.rbi b/rbi/orb/resources/invoice_line_items.rbi index 3edf0d24..c1426145 100644 --- a/rbi/orb/resources/invoice_line_items.rbi +++ b/rbi/orb/resources/invoice_line_items.rbi @@ -5,14 +5,26 @@ module Orb class InvoiceLineItems # This creates a one-off fixed fee invoice line item on an Invoice. This can only # be done for invoices that are in a `draft` status. + # + # The behavior depends on which parameters are provided: + # + # - If `item_id` is provided without `name`: The item is looked up by ID, and the + # item's name is used for the line item. + # - If `name` is provided without `item_id`: An item with the given name is + # searched for in the account. If found, that item is used. If not found, a new + # item is created with that name. The new item's name is used for the line item. + # - If both `item_id` and `name` are provided: The item is looked up by ID for + # association, but the provided `name` is used for the line item (not the item's + # name). sig do params( amount: String, end_date: Date, invoice_id: String, - name: String, quantity: Float, start_date: Date, + item_id: T.nilable(String), + name: T.nilable(String), request_options: Orb::RequestOptions::OrHash ).returns(Orb::Models::InvoiceLineItemCreateResponse) end @@ -23,13 +35,22 @@ module Orb end_date:, # The id of the Invoice to add this line item. invoice_id:, - # The item name associated with this line item. If an item with the same name - # exists in Orb, that item will be associated with the line item. - name:, # The number of units on the line item quantity:, # A date string to specify the line item's start date in the customer's timezone. start_date:, + # The id of the item to associate with this line item. If provided without `name`, + # the item's name will be used for the price/line item. If provided with `name`, + # the item will be associated but `name` will be used for the line item. At least + # one of `name` or `item_id` must be provided. + item_id: nil, + # The name to use for the line item. If `item_id` is not provided, Orb will search + # for an item with this name. If found, that item will be associated with the line + # item. If not found, a new item will be created with this name. If `item_id` is + # provided, this name will be used for the line item, but the item association + # will be based on `item_id`. At least one of `name` or `item_id` must be + # provided. + name: nil, request_options: {} ) end diff --git a/rbi/orb/resources/invoices.rbi b/rbi/orb/resources/invoices.rbi index 371d588d..267c2c79 100644 --- a/rbi/orb/resources/invoices.rbi +++ b/rbi/orb/resources/invoices.rbi @@ -19,6 +19,7 @@ module Orb Orb::AmountDiscount::OrHash ) ), + due_date: T.nilable(Orb::InvoiceCreateParams::DueDate::Variants), external_customer_id: T.nilable(String), memo: T.nilable(String), metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), @@ -40,19 +41,24 @@ module Orb customer_id: nil, # An optional discount to attach to the invoice. discount: nil, + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + due_date: nil, # The `external_customer_id` of the `Customer` to create this invoice for. One of # `customer_id` and `external_customer_id` are required. external_customer_id: nil, - # An optional memo to attach to the invoice. + # An optional memo to attach to the invoice. If no memo is provided, we will + # attach the default memo memo: nil, # User-specified key/value pairs for the resource. Individual keys can be removed # by setting the value to `null`, and the entire metadata mapping can be cleared # by setting `metadata` to `null`. metadata: nil, - # Determines the difference between the invoice issue date for subscription - # invoices as the date that they are due. A value of '0' here represents that the - # invoice is due on issue, whereas a value of 30 represents that the customer has - # 30 days to pay the invoice. + # The net terms determines the due date of the invoice. Due date is calculated + # based on the invoice or issuance date, depending on the account's configured due + # date calculation method. A value of '0' here represents that the invoice is due + # on issue, whereas a value of '30' represents that the customer has 30 days to + # pay the invoice. Do not set this field if you want to set a custom due date. net_terms: nil, # When true, this invoice will be submitted for issuance upon creation. When # false, the resulting invoice will require manual review to issue. Defaulted to @@ -71,16 +77,27 @@ module Orb sig do params( invoice_id: String, + due_date: T.nilable(Orb::InvoiceUpdateParams::DueDate::Variants), metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + net_terms: T.nilable(Integer), request_options: Orb::RequestOptions::OrHash ).returns(Orb::Invoice) end def update( invoice_id, + # An optional custom due date for the invoice. If not set, the due date will be + # calculated based on the `net_terms` value. + due_date: nil, # User-specified key/value pairs for the resource. Individual keys can be removed # by setting the value to `null`, and the entire metadata mapping can be cleared # by setting `metadata` to `null`. metadata: nil, + # The net terms determines the due date of the invoice. Due date is calculated + # based on the invoice or issuance date, depending on the account's configured due + # date calculation method. A value of '0' here represents that the invoice is due + # on issue, whereas a value of '30' represents that the customer has 30 days to + # pay the invoice. Do not set this field if you want to set a custom due date. + net_terms: nil, request_options: {} ) end @@ -201,8 +218,8 @@ module Orb ) end - # This endpoint allows an invoice's status to be set the `paid` status. This can - # only be done to invoices that are in the `issued` status. + # This endpoint allows an invoice's status to be set to the `paid` status. This + # can only be done to invoices that are in the `issued` or `synced` status. sig do params( invoice_id: String, @@ -235,8 +252,8 @@ module Orb def pay(invoice_id, request_options: {}) end - # This endpoint allows an invoice's status to be set the `void` status. This can - # only be done to invoices that are in the `issued` status. + # This endpoint allows an invoice's status to be set to the `void` status. This + # can only be done to invoices that are in the `issued` status. # # If the associated invoice has used the customer balance to change the amount # due, the customer balance operation will be reverted. For example, if the diff --git a/rbi/orb/resources/prices.rbi b/rbi/orb/resources/prices.rbi index 17ae8d6f..a4c57416 100644 --- a/rbi/orb/resources/prices.rbi +++ b/rbi/orb/resources/prices.rbi @@ -24,35 +24,56 @@ module Orb model_type: Orb::PriceCreateParams::ModelType::OrSymbol, name: String, unit_config: Orb::UnitConfig::OrHash, + tiered_config: Orb::TieredConfig::OrHash, + bulk_config: Orb::BulkConfig::OrHash, package_config: Orb::PackageConfig::OrHash, matrix_config: Orb::MatrixConfig::OrHash, + threshold_total_amount_config: + Orb::PriceCreateParams::ThresholdTotalAmountConfig::OrHash, + tiered_package_config: + Orb::PriceCreateParams::TieredPackageConfig::OrHash, + tiered_with_minimum_config: + Orb::PriceCreateParams::TieredWithMinimumConfig::OrHash, + grouped_tiered_config: + Orb::PriceCreateParams::GroupedTieredConfig::OrHash, + tiered_package_with_minimum_config: + Orb::PriceCreateParams::TieredPackageWithMinimumConfig::OrHash, + package_with_allocation_config: + Orb::PriceCreateParams::PackageWithAllocationConfig::OrHash, + unit_with_percent_config: + Orb::PriceCreateParams::UnitWithPercentConfig::OrHash, matrix_with_allocation_config: Orb::MatrixWithAllocationConfig::OrHash, - tiered_config: Orb::TieredConfig::OrHash, - tiered_bps_config: Orb::TieredBPSConfig::OrHash, - bps_config: Orb::BPSConfig::OrHash, - bulk_bps_config: Orb::BulkBPSConfig::OrHash, - bulk_config: Orb::BulkConfig::OrHash, - threshold_total_amount_config: T::Hash[Symbol, T.anything], - tiered_package_config: T::Hash[Symbol, T.anything], - grouped_tiered_config: T::Hash[Symbol, T.anything], - max_group_tiered_package_config: T::Hash[Symbol, T.anything], - tiered_with_minimum_config: T::Hash[Symbol, T.anything], - package_with_allocation_config: T::Hash[Symbol, T.anything], - tiered_package_with_minimum_config: T::Hash[Symbol, T.anything], - unit_with_percent_config: T::Hash[Symbol, T.anything], - tiered_with_proration_config: T::Hash[Symbol, T.anything], - unit_with_proration_config: T::Hash[Symbol, T.anything], - grouped_allocation_config: T::Hash[Symbol, T.anything], - grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], - grouped_with_metered_minimum_config: T::Hash[Symbol, T.anything], - matrix_with_display_name_config: T::Hash[Symbol, T.anything], - bulk_with_proration_config: T::Hash[Symbol, T.anything], - grouped_tiered_package_config: T::Hash[Symbol, T.anything], - scalable_matrix_with_unit_pricing_config: T::Hash[Symbol, T.anything], + tiered_with_proration_config: + Orb::PriceCreateParams::TieredWithProrationConfig::OrHash, + unit_with_proration_config: + Orb::PriceCreateParams::UnitWithProrationConfig::OrHash, + grouped_allocation_config: + Orb::PriceCreateParams::GroupedAllocationConfig::OrHash, + bulk_with_proration_config: + Orb::PriceCreateParams::BulkWithProrationConfig::OrHash, + grouped_with_prorated_minimum_config: + Orb::PriceCreateParams::GroupedWithProratedMinimumConfig::OrHash, + grouped_with_metered_minimum_config: + Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::OrHash, + grouped_with_min_max_thresholds_config: + Orb::PriceCreateParams::GroupedWithMinMaxThresholdsConfig::OrHash, + matrix_with_display_name_config: + Orb::PriceCreateParams::MatrixWithDisplayNameConfig::OrHash, + grouped_tiered_package_config: + Orb::PriceCreateParams::GroupedTieredPackageConfig::OrHash, + max_group_tiered_package_config: + Orb::PriceCreateParams::MaxGroupTieredPackageConfig::OrHash, + scalable_matrix_with_unit_pricing_config: + Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig::OrHash, scalable_matrix_with_tiered_pricing_config: - T::Hash[Symbol, T.anything], - cumulative_grouped_bulk_config: T::Hash[Symbol, T.anything], + Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::OrHash, + cumulative_grouped_bulk_config: + Orb::PriceCreateParams::CumulativeGroupedBulkConfig::OrHash, + minimum_config: Orb::PriceCreateParams::MinimumConfig::OrHash, + percent_config: Orb::PriceCreateParams::PercentConfig::OrHash, + event_output_config: + Orb::PriceCreateParams::EventOutputConfig::OrHash, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -83,37 +104,68 @@ module Orb currency:, # The id of the item the price will be associated with. item_id:, + # The pricing model type model_type:, # The name of the price. name:, + # Configuration for unit pricing unit_config:, - package_config:, - matrix_config:, - matrix_with_allocation_config:, + # Configuration for tiered pricing tiered_config:, - tiered_bps_config:, - bps_config:, - bulk_bps_config:, + # Configuration for bulk pricing bulk_config:, + # Configuration for package pricing + package_config:, + # Configuration for matrix pricing + matrix_config:, + # Configuration for threshold_total_amount pricing threshold_total_amount_config:, + # Configuration for tiered_package pricing tiered_package_config:, - grouped_tiered_config:, - max_group_tiered_package_config:, + # Configuration for tiered_with_minimum pricing tiered_with_minimum_config:, - package_with_allocation_config:, + # Configuration for grouped_tiered pricing + grouped_tiered_config:, + # Configuration for tiered_package_with_minimum pricing tiered_package_with_minimum_config:, + # Configuration for package_with_allocation pricing + package_with_allocation_config:, + # Configuration for unit_with_percent pricing unit_with_percent_config:, + # Configuration for matrix_with_allocation pricing + matrix_with_allocation_config:, + # Configuration for tiered_with_proration pricing tiered_with_proration_config:, + # Configuration for unit_with_proration pricing unit_with_proration_config:, + # Configuration for grouped_allocation pricing grouped_allocation_config:, + # Configuration for bulk_with_proration pricing + bulk_with_proration_config:, + # Configuration for grouped_with_prorated_minimum pricing grouped_with_prorated_minimum_config:, + # Configuration for grouped_with_metered_minimum pricing grouped_with_metered_minimum_config:, + # Configuration for grouped_with_min_max_thresholds pricing + grouped_with_min_max_thresholds_config:, + # Configuration for matrix_with_display_name pricing matrix_with_display_name_config:, - bulk_with_proration_config:, + # Configuration for grouped_tiered_package pricing grouped_tiered_package_config:, + # Configuration for max_group_tiered_package pricing + max_group_tiered_package_config:, + # Configuration for scalable_matrix_with_unit_pricing pricing scalable_matrix_with_unit_pricing_config:, + # Configuration for scalable_matrix_with_tiered_pricing pricing scalable_matrix_with_tiered_pricing_config:, + # Configuration for cumulative_grouped_bulk pricing cumulative_grouped_bulk_config:, + # Configuration for minimum pricing + minimum_config:, + # Configuration for percent pricing + percent_config:, + # Configuration for event_output pricing + event_output_config:, # The id of the billable metric for the price. Only needed if the price is # usage-based. billable_metric_id: nil, diff --git a/rbi/orb/resources/subscription_changes.rbi b/rbi/orb/resources/subscription_changes.rbi index 5f04e8bb..c0b3afd2 100644 --- a/rbi/orb/resources/subscription_changes.rbi +++ b/rbi/orb/resources/subscription_changes.rbi @@ -28,6 +28,7 @@ module Orb params( subscription_change_id: String, description: T.nilable(String), + mark_as_paid: T.nilable(T::Boolean), previously_collected_amount: T.nilable(String), request_options: Orb::RequestOptions::OrHash ).returns(Orb::Models::SubscriptionChangeApplyResponse) @@ -36,7 +37,11 @@ module Orb subscription_change_id, # Description to apply to the balance transaction representing this credit. description: nil, - # Amount already collected to apply to the customer's balance. + # Mark all pending invoices that are payable as paid. If amount is also provided, + # mark as paid and credit the difference to the customer's balance. + mark_as_paid: nil, + # Amount already collected to apply to the customer's balance. If mark_as_paid is + # also provided, credit the difference to the customer's balance. previously_collected_amount: nil, request_options: {} ) diff --git a/rbi/orb/resources/subscriptions.rbi b/rbi/orb/resources/subscriptions.rbi index 2991abe1..975bafb5 100644 --- a/rbi/orb/resources/subscriptions.rbi +++ b/rbi/orb/resources/subscriptions.rbi @@ -470,7 +470,9 @@ module Orb cursor: T.nilable(String), customer_id: T.nilable(T::Array[String]), external_customer_id: T.nilable(T::Array[String]), + external_plan_id: T.nilable(String), limit: Integer, + plan_id: T.nilable(String), status: T.nilable(Orb::SubscriptionListParams::Status::OrSymbol), request_options: Orb::RequestOptions::OrHash ).returns(Orb::Internal::Page[Orb::Subscription]) @@ -485,8 +487,10 @@ module Orb cursor: nil, customer_id: nil, external_customer_id: nil, + external_plan_id: nil, # The number of items to fetch. Defaults to 20. limit: nil, + plan_id: nil, status: nil, request_options: {} ) @@ -1039,7 +1043,7 @@ module Orb # This endpoint can be used to change an existing subscription's plan. It returns # the serialized updated subscription object. # - # The body parameter `change_option` determines when the plan change occurrs. Orb + # The body parameter `change_option` determines when the plan change occurs. Orb # supports three options: # # - `end_of_subscription_term`: changes the plan at the end of the existing plan's diff --git a/scripts/bootstrap b/scripts/bootstrap index cc31aa85..34878642 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,10 +4,18 @@ set -e cd -- "$(dirname -- "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { - echo "==> Installing Homebrew dependencies…" - brew bundle + echo -n "==> Install Homebrew dependencies? (y/N): " + read -r response + case "$response" in + [yY][eE][sS]|[yY]) + brew bundle + ;; + *) + ;; + esac + echo } fi diff --git a/scripts/fast-format b/scripts/fast-format new file mode 100755 index 00000000..6d5973fb --- /dev/null +++ b/scripts/fast-format @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -euo pipefail + +echo "Script started with $# arguments" +echo "Arguments: $*" +echo "Script location: $(dirname "$0")" + +cd -- "$(dirname "$0")/.." +echo "Changed to directory: $PWD" + +if [ $# -eq 0 ]; then + echo "Usage: $0 [additional-formatter-args...]" + echo "The file should contain one file path per line" + exit 1 +fi + +exec -- bundle exec rake format FORMAT_FILE="$1" diff --git a/sig/orb/errors.rbs b/sig/orb/errors.rbs index 1631d86f..f92e25ae 100644 --- a/sig/orb/errors.rbs +++ b/sig/orb/errors.rbs @@ -21,11 +21,14 @@ module Orb attr_accessor status: Integer? + attr_accessor headers: ::Hash[String, String]? + attr_accessor body: top? def initialize: ( url: URI::Generic, ?status: Integer?, + ?headers: ::Hash[String, String]?, ?body: Object?, ?request: nil, ?response: nil, @@ -37,6 +40,7 @@ module Orb def initialize: ( url: URI::Generic, ?status: nil, + ?headers: ::Hash[String, String]?, ?body: nil, ?request: nil, ?response: nil, @@ -48,6 +52,7 @@ module Orb def initialize: ( url: URI::Generic, ?status: nil, + ?headers: ::Hash[String, String]?, ?body: nil, ?request: nil, ?response: nil, @@ -59,6 +64,7 @@ module Orb def self.for: ( url: URI::Generic, status: Integer, + headers: ::Hash[String, String]?, body: Object?, request: nil, response: nil, @@ -68,6 +74,7 @@ module Orb def initialize: ( url: URI::Generic, status: Integer, + headers: ::Hash[String, String]?, body: Object?, request: nil, response: nil, diff --git a/sig/orb/file_part.rbs b/sig/orb/file_part.rbs index e151025e..e1747cb0 100644 --- a/sig/orb/file_part.rbs +++ b/sig/orb/file_part.rbs @@ -14,7 +14,7 @@ module Orb def initialize: ( Pathname | StringIO | IO | String content, - ?filename: String?, + ?filename: (Pathname | String)?, ?content_type: String? ) -> void end diff --git a/sig/orb/models.rbs b/sig/orb/models.rbs index 627e24a0..04600de1 100644 --- a/sig/orb/models.rbs +++ b/sig/orb/models.rbs @@ -51,14 +51,6 @@ module Orb module BillingCycleRelativeDate = Orb::Models::BillingCycleRelativeDate - class BPSConfig = Orb::Models::BPSConfig - - class BPSTier = Orb::Models::BPSTier - - class BulkBPSConfig = Orb::Models::BulkBPSConfig - - class BulkBPSTier = Orb::Models::BulkBPSTier - class BulkConfig = Orb::Models::BulkConfig class BulkTier = Orb::Models::BulkTier @@ -249,10 +241,6 @@ module Orb class NewDimensionalPriceConfiguration = Orb::Models::NewDimensionalPriceConfiguration - class NewFloatingBPSPrice = Orb::Models::NewFloatingBPSPrice - - class NewFloatingBulkBPSPrice = Orb::Models::NewFloatingBulkBPSPrice - class NewFloatingBulkPrice = Orb::Models::NewFloatingBulkPrice class NewFloatingBulkWithProrationPrice = Orb::Models::NewFloatingBulkWithProrationPrice @@ -277,6 +265,8 @@ module Orb class NewFloatingMaxGroupTieredPackagePrice = Orb::Models::NewFloatingMaxGroupTieredPackagePrice + class NewFloatingMinimumCompositePrice = Orb::Models::NewFloatingMinimumCompositePrice + class NewFloatingPackagePrice = Orb::Models::NewFloatingPackagePrice class NewFloatingPackageWithAllocationPrice = Orb::Models::NewFloatingPackageWithAllocationPrice @@ -287,8 +277,6 @@ module Orb class NewFloatingThresholdTotalAmountPrice = Orb::Models::NewFloatingThresholdTotalAmountPrice - class NewFloatingTieredBPSPrice = Orb::Models::NewFloatingTieredBPSPrice - class NewFloatingTieredPackagePrice = Orb::Models::NewFloatingTieredPackagePrice class NewFloatingTieredPackageWithMinimumPrice = Orb::Models::NewFloatingTieredPackageWithMinimumPrice @@ -311,10 +299,6 @@ module Orb class NewPercentageDiscount = Orb::Models::NewPercentageDiscount - class NewPlanBPSPrice = Orb::Models::NewPlanBPSPrice - - class NewPlanBulkBPSPrice = Orb::Models::NewPlanBulkBPSPrice - class NewPlanBulkPrice = Orb::Models::NewPlanBulkPrice class NewPlanBulkWithProrationPrice = Orb::Models::NewPlanBulkWithProrationPrice @@ -339,6 +323,8 @@ module Orb class NewPlanMaxGroupTieredPackagePrice = Orb::Models::NewPlanMaxGroupTieredPackagePrice + class NewPlanMinimumCompositePrice = Orb::Models::NewPlanMinimumCompositePrice + class NewPlanPackagePrice = Orb::Models::NewPlanPackagePrice class NewPlanPackageWithAllocationPrice = Orb::Models::NewPlanPackageWithAllocationPrice @@ -349,8 +335,6 @@ module Orb class NewPlanThresholdTotalAmountPrice = Orb::Models::NewPlanThresholdTotalAmountPrice - class NewPlanTieredBPSPrice = Orb::Models::NewPlanTieredBPSPrice - class NewPlanTieredPackagePrice = Orb::Models::NewPlanTieredPackagePrice class NewPlanTieredPackageWithMinimumPrice = Orb::Models::NewPlanTieredPackageWithMinimumPrice @@ -359,8 +343,6 @@ module Orb class NewPlanTieredWithMinimumPrice = Orb::Models::NewPlanTieredWithMinimumPrice - class NewPlanTierWithProrationPrice = Orb::Models::NewPlanTierWithProrationPrice - class NewPlanUnitPrice = Orb::Models::NewPlanUnitPrice class NewPlanUnitWithPercentPrice = Orb::Models::NewPlanUnitWithPercentPrice @@ -371,10 +353,6 @@ module Orb class NewSphereConfiguration = Orb::Models::NewSphereConfiguration - class NewSubscriptionBPSPrice = Orb::Models::NewSubscriptionBPSPrice - - class NewSubscriptionBulkBPSPrice = Orb::Models::NewSubscriptionBulkBPSPrice - class NewSubscriptionBulkPrice = Orb::Models::NewSubscriptionBulkPrice class NewSubscriptionBulkWithProrationPrice = Orb::Models::NewSubscriptionBulkWithProrationPrice @@ -399,6 +377,8 @@ module Orb class NewSubscriptionMaxGroupTieredPackagePrice = Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice + class NewSubscriptionMinimumCompositePrice = Orb::Models::NewSubscriptionMinimumCompositePrice + class NewSubscriptionPackagePrice = Orb::Models::NewSubscriptionPackagePrice class NewSubscriptionPackageWithAllocationPrice = Orb::Models::NewSubscriptionPackageWithAllocationPrice @@ -409,8 +389,6 @@ module Orb class NewSubscriptionThresholdTotalAmountPrice = Orb::Models::NewSubscriptionThresholdTotalAmountPrice - class NewSubscriptionTieredBPSPrice = Orb::Models::NewSubscriptionTieredBPSPrice - class NewSubscriptionTieredPackagePrice = Orb::Models::NewSubscriptionTieredPackagePrice class NewSubscriptionTieredPackageWithMinimumPrice = Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice @@ -419,8 +397,6 @@ module Orb class NewSubscriptionTieredWithMinimumPrice = Orb::Models::NewSubscriptionTieredWithMinimumPrice - class NewSubscriptionTierWithProrationPrice = Orb::Models::NewSubscriptionTierWithProrationPrice - class NewSubscriptionUnitPrice = Orb::Models::NewSubscriptionUnitPrice class NewSubscriptionUnitWithPercentPrice = Orb::Models::NewSubscriptionUnitWithPercentPrice @@ -551,10 +527,6 @@ module Orb class Tier = Orb::Models::Tier - class TierConfig = Orb::Models::TierConfig - - class TieredBPSConfig = Orb::Models::TieredBPSConfig - class TieredConfig = Orb::Models::TieredConfig class TieredConversionRateConfig = Orb::Models::TieredConversionRateConfig diff --git a/sig/orb/models/beta/external_plan_id_create_plan_version_params.rbs b/sig/orb/models/beta/external_plan_id_create_plan_version_params.rbs index b3043ac4..1ee14102 100644 --- a/sig/orb/models/beta/external_plan_id_create_plan_version_params.rbs +++ b/sig/orb/models/beta/external_plan_id_create_plan_version_params.rbs @@ -121,37 +121,626 @@ module Orb type price = Orb::NewPlanUnitPrice - | Orb::NewPlanPackagePrice - | Orb::NewPlanMatrixPrice | Orb::NewPlanTieredPrice - | Orb::NewPlanTieredBPSPrice - | Orb::NewPlanBPSPrice - | Orb::NewPlanBulkBPSPrice | Orb::NewPlanBulkPrice + | Orb::NewPlanPackagePrice + | Orb::NewPlanMatrixPrice | Orb::NewPlanThresholdTotalAmountPrice | Orb::NewPlanTieredPackagePrice | Orb::NewPlanTieredWithMinimumPrice - | Orb::NewPlanUnitWithPercentPrice + | Orb::NewPlanGroupedTieredPrice + | Orb::NewPlanTieredPackageWithMinimumPrice | Orb::NewPlanPackageWithAllocationPrice - | Orb::NewPlanTierWithProrationPrice + | Orb::NewPlanUnitWithPercentPrice + | Orb::NewPlanMatrixWithAllocationPrice + | Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration | Orb::NewPlanUnitWithProrationPrice | Orb::NewPlanGroupedAllocationPrice + | Orb::NewPlanBulkWithProrationPrice | Orb::NewPlanGroupedWithProratedMinimumPrice | Orb::NewPlanGroupedWithMeteredMinimumPrice + | Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds | Orb::NewPlanMatrixWithDisplayNamePrice - | Orb::NewPlanBulkWithProrationPrice | Orb::NewPlanGroupedTieredPackagePrice | Orb::NewPlanMaxGroupTieredPackagePrice | Orb::NewPlanScalableMatrixWithUnitPricingPrice | Orb::NewPlanScalableMatrixWithTieredPricingPrice | Orb::NewPlanCumulativeGroupedBulkPrice - | Orb::NewPlanTieredPackageWithMinimumPrice - | Orb::NewPlanMatrixWithAllocationPrice - | Orb::NewPlanGroupedTieredPrice + | Orb::NewPlanMinimumCompositePrice + | Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent + | Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput module Price extend Orb::Internal::Type::Union + type tiered_with_proration = + { + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class TieredWithProration < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_proration + + attr_accessor name: String + + attr_accessor tiered_with_proration_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::cadence, + item_id: String, + name: String, + tiered_with_proration_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :tiered_with_proration + ) -> void + + def to_hash: -> { + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::cadence] + end + + type tiered_with_proration_config = + { + tiers: ::Array[Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + } + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + + def initialize: ( + tiers: ::Array[Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { + tier_lower_bound: String, + unit_amount: String + } + end + end + end + + type grouped_with_min_max_thresholds = + { + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::cadence + + attr_accessor grouped_with_min_max_thresholds_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_with_min_max_thresholds + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :grouped_with_min_max_thresholds + ) -> void + + def to_hash: -> { + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::cadence] + end + + type grouped_with_min_max_thresholds_config = + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor maximum_charge: String + + attr_accessor minimum_charge: String + + attr_accessor per_unit_rate: String + + def initialize: ( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ) -> void + + def to_hash: -> { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + end + end + + type percent = + { + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::cadence, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class Percent < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :percent + + attr_accessor name: String + + attr_accessor percent_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::cadence, + item_id: String, + name: String, + percent_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :percent + ) -> void + + def to_hash: -> { + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::cadence, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::Percent::cadence] + end + + type percent_config = { percent: Float } + + class PercentConfig < Orb::Internal::Type::BaseModel + attr_accessor percent: Float + + def initialize: (percent: Float) -> void + + def to_hash: -> { percent: Float } + end + end + + type event_output = + { + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::cadence, + event_output_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class EventOutput < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::cadence + + attr_accessor event_output_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig + + attr_accessor item_id: String + + attr_accessor model_type: :event_output + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::cadence, + event_output_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :event_output + ) -> void + + def to_hash: -> { + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::cadence, + event_output_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::EventOutput::cadence] + end + + type event_output_config = + { unit_rating_key: String, grouping_key: String? } + + class EventOutputConfig < Orb::Internal::Type::BaseModel + attr_accessor unit_rating_key: String + + attr_accessor grouping_key: String? + + def initialize: ( + unit_rating_key: String, + ?grouping_key: String? + ) -> void + + def to_hash: -> { + unit_rating_key: String, + grouping_key: String? + } + end + end + def self?.variants: -> ::Array[Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::price] end end @@ -260,37 +849,626 @@ module Orb type price = Orb::NewPlanUnitPrice - | Orb::NewPlanPackagePrice - | Orb::NewPlanMatrixPrice | Orb::NewPlanTieredPrice - | Orb::NewPlanTieredBPSPrice - | Orb::NewPlanBPSPrice - | Orb::NewPlanBulkBPSPrice | Orb::NewPlanBulkPrice + | Orb::NewPlanPackagePrice + | Orb::NewPlanMatrixPrice | Orb::NewPlanThresholdTotalAmountPrice | Orb::NewPlanTieredPackagePrice | Orb::NewPlanTieredWithMinimumPrice - | Orb::NewPlanUnitWithPercentPrice + | Orb::NewPlanGroupedTieredPrice + | Orb::NewPlanTieredPackageWithMinimumPrice | Orb::NewPlanPackageWithAllocationPrice - | Orb::NewPlanTierWithProrationPrice + | Orb::NewPlanUnitWithPercentPrice + | Orb::NewPlanMatrixWithAllocationPrice + | Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration | Orb::NewPlanUnitWithProrationPrice | Orb::NewPlanGroupedAllocationPrice + | Orb::NewPlanBulkWithProrationPrice | Orb::NewPlanGroupedWithProratedMinimumPrice | Orb::NewPlanGroupedWithMeteredMinimumPrice + | Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds | Orb::NewPlanMatrixWithDisplayNamePrice - | Orb::NewPlanBulkWithProrationPrice | Orb::NewPlanGroupedTieredPackagePrice | Orb::NewPlanMaxGroupTieredPackagePrice | Orb::NewPlanScalableMatrixWithUnitPricingPrice | Orb::NewPlanScalableMatrixWithTieredPricingPrice | Orb::NewPlanCumulativeGroupedBulkPrice - | Orb::NewPlanTieredPackageWithMinimumPrice - | Orb::NewPlanMatrixWithAllocationPrice - | Orb::NewPlanGroupedTieredPrice + | Orb::NewPlanMinimumCompositePrice + | Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent + | Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput module Price extend Orb::Internal::Type::Union + type tiered_with_proration = + { + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class TieredWithProration < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_proration + + attr_accessor name: String + + attr_accessor tiered_with_proration_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::cadence, + item_id: String, + name: String, + tiered_with_proration_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :tiered_with_proration + ) -> void + + def to_hash: -> { + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::cadence] + end + + type tiered_with_proration_config = + { + tiers: ::Array[Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + } + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + + def initialize: ( + tiers: ::Array[Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { + tier_lower_bound: String, + unit_amount: String + } + end + end + end + + type grouped_with_min_max_thresholds = + { + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::cadence + + attr_accessor grouped_with_min_max_thresholds_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_with_min_max_thresholds + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :grouped_with_min_max_thresholds + ) -> void + + def to_hash: -> { + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::cadence] + end + + type grouped_with_min_max_thresholds_config = + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor maximum_charge: String + + attr_accessor minimum_charge: String + + attr_accessor per_unit_rate: String + + def initialize: ( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ) -> void + + def to_hash: -> { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + end + end + + type percent = + { + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::cadence, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class Percent < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :percent + + attr_accessor name: String + + attr_accessor percent_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::cadence, + item_id: String, + name: String, + percent_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :percent + ) -> void + + def to_hash: -> { + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::cadence, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::Percent::cadence] + end + + type percent_config = { percent: Float } + + class PercentConfig < Orb::Internal::Type::BaseModel + attr_accessor percent: Float + + def initialize: (percent: Float) -> void + + def to_hash: -> { percent: Float } + end + end + + type event_output = + { + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::cadence, + event_output_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class EventOutput < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::cadence + + attr_accessor event_output_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig + + attr_accessor item_id: String + + attr_accessor model_type: :event_output + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::cadence, + event_output_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :event_output + ) -> void + + def to_hash: -> { + cadence: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::cadence, + event_output_config: Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price::EventOutput::cadence] + end + + type event_output_config = + { unit_rating_key: String, grouping_key: String? } + + class EventOutputConfig < Orb::Internal::Type::BaseModel + attr_accessor unit_rating_key: String + + attr_accessor grouping_key: String? + + def initialize: ( + unit_rating_key: String, + ?grouping_key: String? + ) -> void + + def to_hash: -> { + unit_rating_key: String, + grouping_key: String? + } + end + end + def self?.variants: -> ::Array[Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::price] end end diff --git a/sig/orb/models/beta_create_plan_version_params.rbs b/sig/orb/models/beta_create_plan_version_params.rbs index d6528a38..4682f041 100644 --- a/sig/orb/models/beta_create_plan_version_params.rbs +++ b/sig/orb/models/beta_create_plan_version_params.rbs @@ -120,37 +120,623 @@ module Orb type price = Orb::NewPlanUnitPrice - | Orb::NewPlanPackagePrice - | Orb::NewPlanMatrixPrice | Orb::NewPlanTieredPrice - | Orb::NewPlanTieredBPSPrice - | Orb::NewPlanBPSPrice - | Orb::NewPlanBulkBPSPrice | Orb::NewPlanBulkPrice + | Orb::NewPlanPackagePrice + | Orb::NewPlanMatrixPrice | Orb::NewPlanThresholdTotalAmountPrice | Orb::NewPlanTieredPackagePrice | Orb::NewPlanTieredWithMinimumPrice - | Orb::NewPlanUnitWithPercentPrice + | Orb::NewPlanGroupedTieredPrice + | Orb::NewPlanTieredPackageWithMinimumPrice | Orb::NewPlanPackageWithAllocationPrice - | Orb::NewPlanTierWithProrationPrice + | Orb::NewPlanUnitWithPercentPrice + | Orb::NewPlanMatrixWithAllocationPrice + | Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration | Orb::NewPlanUnitWithProrationPrice | Orb::NewPlanGroupedAllocationPrice + | Orb::NewPlanBulkWithProrationPrice | Orb::NewPlanGroupedWithProratedMinimumPrice | Orb::NewPlanGroupedWithMeteredMinimumPrice + | Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds | Orb::NewPlanMatrixWithDisplayNamePrice - | Orb::NewPlanBulkWithProrationPrice | Orb::NewPlanGroupedTieredPackagePrice | Orb::NewPlanMaxGroupTieredPackagePrice | Orb::NewPlanScalableMatrixWithUnitPricingPrice | Orb::NewPlanScalableMatrixWithTieredPricingPrice | Orb::NewPlanCumulativeGroupedBulkPrice - | Orb::NewPlanTieredPackageWithMinimumPrice - | Orb::NewPlanMatrixWithAllocationPrice - | Orb::NewPlanGroupedTieredPrice + | Orb::NewPlanMinimumCompositePrice + | Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent + | Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput module Price extend Orb::Internal::Type::Union + type tiered_with_proration = + { + cadence: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class TieredWithProration < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_proration + + attr_accessor name: String + + attr_accessor tiered_with_proration_config: Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::cadence, + item_id: String, + name: String, + tiered_with_proration_config: Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :tiered_with_proration + ) -> void + + def to_hash: -> { + cadence: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::cadence] + end + + type tiered_with_proration_config = + { + tiers: ::Array[Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + } + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + + def initialize: ( + tiers: ::Array[Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { + tier_lower_bound: String, + unit_amount: String + } + end + end + end + + type grouped_with_min_max_thresholds = + { + cadence: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::cadence + + attr_accessor grouped_with_min_max_thresholds_config: Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_with_min_max_thresholds + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :grouped_with_min_max_thresholds + ) -> void + + def to_hash: -> { + cadence: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::GroupedWithMinMaxThresholds::cadence] + end + + type grouped_with_min_max_thresholds_config = + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor maximum_charge: String + + attr_accessor minimum_charge: String + + attr_accessor per_unit_rate: String + + def initialize: ( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ) -> void + + def to_hash: -> { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + end + end + + type percent = + { + cadence: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::Percent::cadence, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::Percent::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class Percent < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::Percent::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :percent + + attr_accessor name: String + + attr_accessor percent_config: Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::Percent::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::Percent::cadence, + item_id: String, + name: String, + percent_config: Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::Percent::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :percent + ) -> void + + def to_hash: -> { + cadence: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::Percent::cadence, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::BetaCreatePlanVersionParams::AddPrice::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::Percent::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::Percent::cadence] + end + + type percent_config = { percent: Float } + + class PercentConfig < Orb::Internal::Type::BaseModel + attr_accessor percent: Float + + def initialize: (percent: Float) -> void + + def to_hash: -> { percent: Float } + end + end + + type event_output = + { + cadence: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::cadence, + event_output_config: Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class EventOutput < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::cadence + + attr_accessor event_output_config: Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig + + attr_accessor item_id: String + + attr_accessor model_type: :event_output + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::cadence, + event_output_config: Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :event_output + ) -> void + + def to_hash: -> { + cadence: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::cadence, + event_output_config: Orb::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::BetaCreatePlanVersionParams::AddPrice::Price::EventOutput::cadence] + end + + type event_output_config = + { unit_rating_key: String, grouping_key: String? } + + class EventOutputConfig < Orb::Internal::Type::BaseModel + attr_accessor unit_rating_key: String + + attr_accessor grouping_key: String? + + def initialize: ( + unit_rating_key: String, + ?grouping_key: String? + ) -> void + + def to_hash: -> { unit_rating_key: String, grouping_key: String? } + end + end + def self?.variants: -> ::Array[Orb::Models::BetaCreatePlanVersionParams::AddPrice::price] end end @@ -256,37 +842,623 @@ module Orb type price = Orb::NewPlanUnitPrice - | Orb::NewPlanPackagePrice - | Orb::NewPlanMatrixPrice | Orb::NewPlanTieredPrice - | Orb::NewPlanTieredBPSPrice - | Orb::NewPlanBPSPrice - | Orb::NewPlanBulkBPSPrice | Orb::NewPlanBulkPrice + | Orb::NewPlanPackagePrice + | Orb::NewPlanMatrixPrice | Orb::NewPlanThresholdTotalAmountPrice | Orb::NewPlanTieredPackagePrice | Orb::NewPlanTieredWithMinimumPrice - | Orb::NewPlanUnitWithPercentPrice + | Orb::NewPlanGroupedTieredPrice + | Orb::NewPlanTieredPackageWithMinimumPrice | Orb::NewPlanPackageWithAllocationPrice - | Orb::NewPlanTierWithProrationPrice + | Orb::NewPlanUnitWithPercentPrice + | Orb::NewPlanMatrixWithAllocationPrice + | Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration | Orb::NewPlanUnitWithProrationPrice | Orb::NewPlanGroupedAllocationPrice + | Orb::NewPlanBulkWithProrationPrice | Orb::NewPlanGroupedWithProratedMinimumPrice | Orb::NewPlanGroupedWithMeteredMinimumPrice + | Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds | Orb::NewPlanMatrixWithDisplayNamePrice - | Orb::NewPlanBulkWithProrationPrice | Orb::NewPlanGroupedTieredPackagePrice | Orb::NewPlanMaxGroupTieredPackagePrice | Orb::NewPlanScalableMatrixWithUnitPricingPrice | Orb::NewPlanScalableMatrixWithTieredPricingPrice | Orb::NewPlanCumulativeGroupedBulkPrice - | Orb::NewPlanTieredPackageWithMinimumPrice - | Orb::NewPlanMatrixWithAllocationPrice - | Orb::NewPlanGroupedTieredPrice + | Orb::NewPlanMinimumCompositePrice + | Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent + | Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput module Price extend Orb::Internal::Type::Union + type tiered_with_proration = + { + cadence: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class TieredWithProration < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_proration + + attr_accessor name: String + + attr_accessor tiered_with_proration_config: Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::cadence, + item_id: String, + name: String, + tiered_with_proration_config: Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :tiered_with_proration + ) -> void + + def to_hash: -> { + cadence: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::cadence] + end + + type tiered_with_proration_config = + { + tiers: ::Array[Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + } + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + + def initialize: ( + tiers: ::Array[Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { + tier_lower_bound: String, + unit_amount: String + } + end + end + end + + type grouped_with_min_max_thresholds = + { + cadence: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::cadence + + attr_accessor grouped_with_min_max_thresholds_config: Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_with_min_max_thresholds + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :grouped_with_min_max_thresholds + ) -> void + + def to_hash: -> { + cadence: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::cadence] + end + + type grouped_with_min_max_thresholds_config = + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor maximum_charge: String + + attr_accessor minimum_charge: String + + attr_accessor per_unit_rate: String + + def initialize: ( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ) -> void + + def to_hash: -> { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + end + end + + type percent = + { + cadence: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::cadence, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class Percent < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :percent + + attr_accessor name: String + + attr_accessor percent_config: Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::cadence, + item_id: String, + name: String, + percent_config: Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :percent + ) -> void + + def to_hash: -> { + cadence: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::cadence, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::Percent::cadence] + end + + type percent_config = { percent: Float } + + class PercentConfig < Orb::Internal::Type::BaseModel + attr_accessor percent: Float + + def initialize: (percent: Float) -> void + + def to_hash: -> { percent: Float } + end + end + + type event_output = + { + cadence: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::cadence, + event_output_config: Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class EventOutput < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::cadence + + attr_accessor event_output_config: Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig + + attr_accessor item_id: String + + attr_accessor model_type: :event_output + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::cadence, + event_output_config: Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :event_output + ) -> void + + def to_hash: -> { + cadence: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::cadence, + event_output_config: Orb::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::Price::EventOutput::cadence] + end + + type event_output_config = + { unit_rating_key: String, grouping_key: String? } + + class EventOutputConfig < Orb::Internal::Type::BaseModel + attr_accessor unit_rating_key: String + + attr_accessor grouping_key: String? + + def initialize: ( + unit_rating_key: String, + ?grouping_key: String? + ) -> void + + def to_hash: -> { unit_rating_key: String, grouping_key: String? } + end + end + def self?.variants: -> ::Array[Orb::Models::BetaCreatePlanVersionParams::ReplacePrice::price] end end diff --git a/sig/orb/models/bps_config.rbs b/sig/orb/models/bps_config.rbs deleted file mode 100644 index b0af8411..00000000 --- a/sig/orb/models/bps_config.rbs +++ /dev/null @@ -1,15 +0,0 @@ -module Orb - module Models - type bps_config = { bps: Float, per_unit_maximum: String? } - - class BPSConfig < Orb::Internal::Type::BaseModel - attr_accessor bps: Float - - attr_accessor per_unit_maximum: String? - - def initialize: (bps: Float, ?per_unit_maximum: String?) -> void - - def to_hash: -> { bps: Float, per_unit_maximum: String? } - end - end -end diff --git a/sig/orb/models/bps_tier.rbs b/sig/orb/models/bps_tier.rbs deleted file mode 100644 index d9f4187e..00000000 --- a/sig/orb/models/bps_tier.rbs +++ /dev/null @@ -1,35 +0,0 @@ -module Orb - module Models - type bps_tier = - { - bps: Float, - minimum_amount: String, - maximum_amount: String?, - per_unit_maximum: String? - } - - class BPSTier < Orb::Internal::Type::BaseModel - attr_accessor bps: Float - - attr_accessor minimum_amount: String - - attr_accessor maximum_amount: String? - - attr_accessor per_unit_maximum: String? - - def initialize: ( - bps: Float, - minimum_amount: String, - ?maximum_amount: String?, - ?per_unit_maximum: String? - ) -> void - - def to_hash: -> { - bps: Float, - minimum_amount: String, - maximum_amount: String?, - per_unit_maximum: String? - } - end - end -end diff --git a/sig/orb/models/bulk_bps_config.rbs b/sig/orb/models/bulk_bps_config.rbs deleted file mode 100644 index f30bf072..00000000 --- a/sig/orb/models/bulk_bps_config.rbs +++ /dev/null @@ -1,13 +0,0 @@ -module Orb - module Models - type bulk_bps_config = { tiers: ::Array[Orb::BulkBPSTier] } - - class BulkBPSConfig < Orb::Internal::Type::BaseModel - attr_accessor tiers: ::Array[Orb::BulkBPSTier] - - def initialize: (tiers: ::Array[Orb::BulkBPSTier]) -> void - - def to_hash: -> { tiers: ::Array[Orb::BulkBPSTier] } - end - end -end diff --git a/sig/orb/models/bulk_bps_tier.rbs b/sig/orb/models/bulk_bps_tier.rbs deleted file mode 100644 index fbfc5dd6..00000000 --- a/sig/orb/models/bulk_bps_tier.rbs +++ /dev/null @@ -1,26 +0,0 @@ -module Orb - module Models - type bulk_bps_tier = - { bps: Float, maximum_amount: String?, per_unit_maximum: String? } - - class BulkBPSTier < Orb::Internal::Type::BaseModel - attr_accessor bps: Float - - attr_accessor maximum_amount: String? - - attr_accessor per_unit_maximum: String? - - def initialize: ( - bps: Float, - ?maximum_amount: String?, - ?per_unit_maximum: String? - ) -> void - - def to_hash: -> { - bps: Float, - maximum_amount: String?, - per_unit_maximum: String? - } - end - end -end diff --git a/sig/orb/models/changed_subscription_resources.rbs b/sig/orb/models/changed_subscription_resources.rbs index 8e01b335..6e6bede6 100644 --- a/sig/orb/models/changed_subscription_resources.rbs +++ b/sig/orb/models/changed_subscription_resources.rbs @@ -3,7 +3,7 @@ module Orb type changed_subscription_resources = { created_credit_notes: ::Array[Orb::CreditNote], - created_invoices: ::Array[Orb::Invoice], + created_invoices: ::Array[Orb::ChangedSubscriptionResources::CreatedInvoice], voided_credit_notes: ::Array[Orb::CreditNote], voided_invoices: ::Array[Orb::Invoice] } @@ -11,7 +11,7 @@ module Orb class ChangedSubscriptionResources < Orb::Internal::Type::BaseModel attr_accessor created_credit_notes: ::Array[Orb::CreditNote] - attr_accessor created_invoices: ::Array[Orb::Invoice] + attr_accessor created_invoices: ::Array[Orb::ChangedSubscriptionResources::CreatedInvoice] attr_accessor voided_credit_notes: ::Array[Orb::CreditNote] @@ -19,17 +19,649 @@ module Orb def initialize: ( created_credit_notes: ::Array[Orb::CreditNote], - created_invoices: ::Array[Orb::Invoice], + created_invoices: ::Array[Orb::ChangedSubscriptionResources::CreatedInvoice], voided_credit_notes: ::Array[Orb::CreditNote], voided_invoices: ::Array[Orb::Invoice] ) -> void def to_hash: -> { created_credit_notes: ::Array[Orb::CreditNote], - created_invoices: ::Array[Orb::Invoice], + created_invoices: ::Array[Orb::ChangedSubscriptionResources::CreatedInvoice], voided_credit_notes: ::Array[Orb::CreditNote], voided_invoices: ::Array[Orb::Invoice] } + + type created_invoice = + { + id: String, + amount_due: String, + auto_collection: Orb::ChangedSubscriptionResources::CreatedInvoice::AutoCollection, + billing_address: Orb::Address?, + created_at: Time, + credit_notes: ::Array[Orb::ChangedSubscriptionResources::CreatedInvoice::CreditNote], + currency: String, + customer: Orb::CustomerMinified, + customer_balance_transactions: ::Array[Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction], + customer_tax_id: Orb::CustomerTaxID?, + discount: top, + discounts: ::Array[Orb::Models::invoice_level_discount], + due_date: Time?, + eligible_to_issue_at: Time?, + hosted_invoice_url: String?, + invoice_date: Time, + invoice_number: String, + invoice_pdf: String?, + invoice_source: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::invoice_source, + is_payable_now: bool, + issue_failed_at: Time?, + issued_at: Time?, + line_items: ::Array[Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem], + maximum: Orb::Maximum?, + maximum_amount: String?, + memo: String?, + metadata: ::Hash[Symbol, String], + minimum: Orb::Minimum?, + minimum_amount: String?, + paid_at: Time?, + payment_attempts: ::Array[Orb::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt], + payment_failed_at: Time?, + payment_started_at: Time?, + scheduled_issue_at: Time?, + shipping_address: Orb::Address?, + status: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::status, + subscription: Orb::SubscriptionMinified?, + subtotal: String, + sync_failed_at: Time?, + total: String, + voided_at: Time?, + will_auto_issue: bool + } + + class CreatedInvoice < Orb::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor amount_due: String + + attr_accessor auto_collection: Orb::ChangedSubscriptionResources::CreatedInvoice::AutoCollection + + attr_accessor billing_address: Orb::Address? + + attr_accessor created_at: Time + + attr_accessor credit_notes: ::Array[Orb::ChangedSubscriptionResources::CreatedInvoice::CreditNote] + + attr_accessor currency: String + + attr_accessor customer: Orb::CustomerMinified + + attr_accessor customer_balance_transactions: ::Array[Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction] + + attr_accessor customer_tax_id: Orb::CustomerTaxID? + + attr_accessor discount: top + + attr_accessor discounts: ::Array[Orb::Models::invoice_level_discount] + + attr_accessor due_date: Time? + + attr_accessor eligible_to_issue_at: Time? + + attr_accessor hosted_invoice_url: String? + + attr_accessor invoice_date: Time + + attr_accessor invoice_number: String + + attr_accessor invoice_pdf: String? + + attr_accessor invoice_source: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::invoice_source + + attr_accessor is_payable_now: bool + + attr_accessor issue_failed_at: Time? + + attr_accessor issued_at: Time? + + attr_accessor line_items: ::Array[Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem] + + attr_accessor maximum: Orb::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor memo: String? + + attr_accessor metadata: ::Hash[Symbol, String] + + attr_accessor minimum: Orb::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor paid_at: Time? + + attr_accessor payment_attempts: ::Array[Orb::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt] + + attr_accessor payment_failed_at: Time? + + attr_accessor payment_started_at: Time? + + attr_accessor scheduled_issue_at: Time? + + attr_accessor shipping_address: Orb::Address? + + attr_accessor status: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::status + + attr_accessor subscription: Orb::SubscriptionMinified? + + attr_accessor subtotal: String + + attr_accessor sync_failed_at: Time? + + attr_accessor total: String + + attr_accessor voided_at: Time? + + attr_accessor will_auto_issue: bool + + def initialize: ( + id: String, + amount_due: String, + auto_collection: Orb::ChangedSubscriptionResources::CreatedInvoice::AutoCollection, + billing_address: Orb::Address?, + created_at: Time, + credit_notes: ::Array[Orb::ChangedSubscriptionResources::CreatedInvoice::CreditNote], + currency: String, + customer: Orb::CustomerMinified, + customer_balance_transactions: ::Array[Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction], + customer_tax_id: Orb::CustomerTaxID?, + discount: top, + discounts: ::Array[Orb::Models::invoice_level_discount], + due_date: Time?, + eligible_to_issue_at: Time?, + hosted_invoice_url: String?, + invoice_date: Time, + invoice_number: String, + invoice_pdf: String?, + invoice_source: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::invoice_source, + is_payable_now: bool, + issue_failed_at: Time?, + issued_at: Time?, + line_items: ::Array[Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem], + maximum: Orb::Maximum?, + maximum_amount: String?, + memo: String?, + metadata: ::Hash[Symbol, String], + minimum: Orb::Minimum?, + minimum_amount: String?, + paid_at: Time?, + payment_attempts: ::Array[Orb::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt], + payment_failed_at: Time?, + payment_started_at: Time?, + scheduled_issue_at: Time?, + shipping_address: Orb::Address?, + status: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::status, + subscription: Orb::SubscriptionMinified?, + subtotal: String, + sync_failed_at: Time?, + total: String, + voided_at: Time?, + will_auto_issue: bool + ) -> void + + def to_hash: -> { + id: String, + amount_due: String, + auto_collection: Orb::ChangedSubscriptionResources::CreatedInvoice::AutoCollection, + billing_address: Orb::Address?, + created_at: Time, + credit_notes: ::Array[Orb::ChangedSubscriptionResources::CreatedInvoice::CreditNote], + currency: String, + customer: Orb::CustomerMinified, + customer_balance_transactions: ::Array[Orb::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction], + customer_tax_id: Orb::CustomerTaxID?, + discount: top, + discounts: ::Array[Orb::Models::invoice_level_discount], + due_date: Time?, + eligible_to_issue_at: Time?, + hosted_invoice_url: String?, + invoice_date: Time, + invoice_number: String, + invoice_pdf: String?, + invoice_source: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::invoice_source, + is_payable_now: bool, + issue_failed_at: Time?, + issued_at: Time?, + line_items: ::Array[Orb::ChangedSubscriptionResources::CreatedInvoice::LineItem], + maximum: Orb::Maximum?, + maximum_amount: String?, + memo: String?, + metadata: ::Hash[Symbol, String], + minimum: Orb::Minimum?, + minimum_amount: String?, + paid_at: Time?, + payment_attempts: ::Array[Orb::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt], + payment_failed_at: Time?, + payment_started_at: Time?, + scheduled_issue_at: Time?, + shipping_address: Orb::Address?, + status: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::status, + subscription: Orb::SubscriptionMinified?, + subtotal: String, + sync_failed_at: Time?, + total: String, + voided_at: Time?, + will_auto_issue: bool + } + + type auto_collection = + { + enabled: bool?, + next_attempt_at: Time?, + num_attempts: Integer?, + previously_attempted_at: Time? + } + + class AutoCollection < Orb::Internal::Type::BaseModel + attr_accessor enabled: bool? + + attr_accessor next_attempt_at: Time? + + attr_accessor num_attempts: Integer? + + attr_accessor previously_attempted_at: Time? + + def initialize: ( + enabled: bool?, + next_attempt_at: Time?, + num_attempts: Integer?, + previously_attempted_at: Time? + ) -> void + + def to_hash: -> { + enabled: bool?, + next_attempt_at: Time?, + num_attempts: Integer?, + previously_attempted_at: Time? + } + end + + type credit_note = + { + id: String, + credit_note_number: String, + memo: String?, + reason: String, + total: String, + type: String, + voided_at: Time? + } + + class CreditNote < Orb::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor credit_note_number: String + + attr_accessor memo: String? + + attr_accessor reason: String + + attr_accessor total: String + + attr_accessor type: String + + attr_accessor voided_at: Time? + + def initialize: ( + id: String, + credit_note_number: String, + memo: String?, + reason: String, + total: String, + type: String, + voided_at: Time? + ) -> void + + def to_hash: -> { + id: String, + credit_note_number: String, + memo: String?, + reason: String, + total: String, + type: String, + voided_at: Time? + } + end + + type customer_balance_transaction = + { + id: String, + action: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::action, + amount: String, + created_at: Time, + credit_note: Orb::CreditNoteTiny?, + description: String?, + ending_balance: String, + invoice: Orb::InvoiceTiny?, + starting_balance: String, + type: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::type_ + } + + class CustomerBalanceTransaction < Orb::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor action: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::action + + attr_accessor amount: String + + attr_accessor created_at: Time + + attr_accessor credit_note: Orb::CreditNoteTiny? + + attr_accessor description: String? + + attr_accessor ending_balance: String + + attr_accessor invoice: Orb::InvoiceTiny? + + attr_accessor starting_balance: String + + attr_accessor type: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::type_ + + def initialize: ( + id: String, + action: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::action, + amount: String, + created_at: Time, + credit_note: Orb::CreditNoteTiny?, + description: String?, + ending_balance: String, + invoice: Orb::InvoiceTiny?, + starting_balance: String, + type: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::type_ + ) -> void + + def to_hash: -> { + id: String, + action: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::action, + amount: String, + created_at: Time, + credit_note: Orb::CreditNoteTiny?, + description: String?, + ending_balance: String, + invoice: Orb::InvoiceTiny?, + starting_balance: String, + type: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::type_ + } + + type action = + :applied_to_invoice + | :manual_adjustment + | :prorated_refund + | :revert_prorated_refund + | :return_from_voiding + | :credit_note_applied + | :credit_note_voided + | :overpayment_refund + | :external_payment + | :small_invoice_carryover + + module Action + extend Orb::Internal::Type::Enum + + APPLIED_TO_INVOICE: :applied_to_invoice + MANUAL_ADJUSTMENT: :manual_adjustment + PRORATED_REFUND: :prorated_refund + REVERT_PRORATED_REFUND: :revert_prorated_refund + RETURN_FROM_VOIDING: :return_from_voiding + CREDIT_NOTE_APPLIED: :credit_note_applied + CREDIT_NOTE_VOIDED: :credit_note_voided + OVERPAYMENT_REFUND: :overpayment_refund + EXTERNAL_PAYMENT: :external_payment + SMALL_INVOICE_CARRYOVER: :small_invoice_carryover + + def self?.values: -> ::Array[Orb::Models::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::action] + end + + type type_ = :increment | :decrement + + module Type + extend Orb::Internal::Type::Enum + + INCREMENT: :increment + DECREMENT: :decrement + + def self?.values: -> ::Array[Orb::Models::ChangedSubscriptionResources::CreatedInvoice::CustomerBalanceTransaction::type_] + end + end + + type invoice_source = :subscription | :partial | :one_off + + module InvoiceSource + extend Orb::Internal::Type::Enum + + SUBSCRIPTION: :subscription + PARTIAL: :partial + ONE_OFF: :one_off + + def self?.values: -> ::Array[Orb::Models::ChangedSubscriptionResources::CreatedInvoice::invoice_source] + end + + type line_item = + { + id: String, + adjusted_subtotal: String, + adjustments: ::Array[Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::adjustment], + amount: String, + credits_applied: String, + discount: Orb::Models::discount?, + end_date: Time, + filter: String?, + grouping: String?, + maximum: Orb::Maximum?, + maximum_amount: String?, + minimum: Orb::Minimum?, + minimum_amount: String?, + name: String, + partially_invoiced_amount: String, + price: Orb::Models::price, + quantity: Float, + start_date: Time, + sub_line_items: ::Array[Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::sub_line_item], + subtotal: String, + tax_amounts: ::Array[Orb::TaxAmount], + usage_customer_ids: ::Array[String]? + } + + class LineItem < Orb::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor adjusted_subtotal: String + + attr_accessor adjustments: ::Array[Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::adjustment] + + attr_accessor amount: String + + attr_accessor credits_applied: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor end_date: Time + + attr_accessor filter: String? + + attr_accessor grouping: String? + + attr_accessor maximum: Orb::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor minimum: Orb::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor name: String + + attr_accessor partially_invoiced_amount: String + + attr_accessor price: Orb::Models::price + + attr_accessor quantity: Float + + attr_accessor start_date: Time + + attr_accessor sub_line_items: ::Array[Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::sub_line_item] + + attr_accessor subtotal: String + + attr_accessor tax_amounts: ::Array[Orb::TaxAmount] + + attr_accessor usage_customer_ids: ::Array[String]? + + def initialize: ( + id: String, + adjusted_subtotal: String, + adjustments: ::Array[Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::adjustment], + amount: String, + credits_applied: String, + discount: Orb::Models::discount?, + end_date: Time, + filter: String?, + grouping: String?, + maximum: Orb::Maximum?, + maximum_amount: String?, + minimum: Orb::Minimum?, + minimum_amount: String?, + name: String, + partially_invoiced_amount: String, + price: Orb::Models::price, + quantity: Float, + start_date: Time, + sub_line_items: ::Array[Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::sub_line_item], + subtotal: String, + tax_amounts: ::Array[Orb::TaxAmount], + usage_customer_ids: ::Array[String]? + ) -> void + + def to_hash: -> { + id: String, + adjusted_subtotal: String, + adjustments: ::Array[Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::adjustment], + amount: String, + credits_applied: String, + discount: Orb::Models::discount?, + end_date: Time, + filter: String?, + grouping: String?, + maximum: Orb::Maximum?, + maximum_amount: String?, + minimum: Orb::Minimum?, + minimum_amount: String?, + name: String, + partially_invoiced_amount: String, + price: Orb::Models::price, + quantity: Float, + start_date: Time, + sub_line_items: ::Array[Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::sub_line_item], + subtotal: String, + tax_amounts: ::Array[Orb::TaxAmount], + usage_customer_ids: ::Array[String]? + } + + type adjustment = + Orb::MonetaryUsageDiscountAdjustment + | Orb::MonetaryAmountDiscountAdjustment + | Orb::MonetaryPercentageDiscountAdjustment + | Orb::MonetaryMinimumAdjustment + | Orb::MonetaryMaximumAdjustment + + module Adjustment + extend Orb::Internal::Type::Union + + def self?.variants: -> ::Array[Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::adjustment] + end + + type sub_line_item = + Orb::MatrixSubLineItem + | Orb::TierSubLineItem + | Orb::OtherSubLineItem + + module SubLineItem + extend Orb::Internal::Type::Union + + def self?.variants: -> ::Array[Orb::Models::ChangedSubscriptionResources::CreatedInvoice::LineItem::sub_line_item] + end + end + + type payment_attempt = + { + id: String, + amount: String, + created_at: Time, + payment_provider: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt::payment_provider?, + payment_provider_id: String?, + receipt_pdf: String?, + succeeded: bool + } + + class PaymentAttempt < Orb::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor amount: String + + attr_accessor created_at: Time + + attr_accessor payment_provider: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt::payment_provider? + + attr_accessor payment_provider_id: String? + + attr_accessor receipt_pdf: String? + + attr_accessor succeeded: bool + + def initialize: ( + id: String, + amount: String, + created_at: Time, + payment_provider: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt::payment_provider?, + payment_provider_id: String?, + receipt_pdf: String?, + succeeded: bool + ) -> void + + def to_hash: -> { + id: String, + amount: String, + created_at: Time, + payment_provider: Orb::Models::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt::payment_provider?, + payment_provider_id: String?, + receipt_pdf: String?, + succeeded: bool + } + + type payment_provider = :stripe + + module PaymentProvider + extend Orb::Internal::Type::Enum + + STRIPE: :stripe + + def self?.values: -> ::Array[Orb::Models::ChangedSubscriptionResources::CreatedInvoice::PaymentAttempt::payment_provider] + end + end + + type status = :issued | :paid | :synced | :void | :draft + + module Status + extend Orb::Internal::Type::Enum + + ISSUED: :issued + PAID: :paid + SYNCED: :synced + VOID: :void + DRAFT: :draft + + def self?.values: -> ::Array[Orb::Models::ChangedSubscriptionResources::CreatedInvoice::status] + end + end end end end diff --git a/sig/orb/models/customer.rbs b/sig/orb/models/customer.rbs index e99e414e..63effa3e 100644 --- a/sig/orb/models/customer.rbs +++ b/sig/orb/models/customer.rbs @@ -5,6 +5,7 @@ module Orb id: String, additional_emails: ::Array[String], auto_collection: bool, + auto_issuance: bool?, balance: String, billing_address: Orb::Address?, created_at: Time, @@ -33,6 +34,8 @@ module Orb attr_accessor auto_collection: bool + attr_accessor auto_issuance: bool? + attr_accessor balance: String attr_accessor billing_address: Orb::Address? @@ -75,6 +78,7 @@ module Orb id: String, additional_emails: ::Array[String], auto_collection: bool, + auto_issuance: bool?, balance: String, billing_address: Orb::Address?, created_at: Time, @@ -100,6 +104,7 @@ module Orb id: String, additional_emails: ::Array[String], auto_collection: bool, + auto_issuance: bool?, balance: String, billing_address: Orb::Address?, created_at: Time, diff --git a/sig/orb/models/customer_create_params.rbs b/sig/orb/models/customer_create_params.rbs index 165a6e5a..1d9d1856 100644 --- a/sig/orb/models/customer_create_params.rbs +++ b/sig/orb/models/customer_create_params.rbs @@ -7,6 +7,7 @@ module Orb accounting_sync_configuration: Orb::NewAccountingSyncConfiguration?, additional_emails: ::Array[String]?, auto_collection: bool?, + auto_issuance: bool?, billing_address: Orb::AddressInput?, currency: String?, email_delivery: bool?, @@ -37,6 +38,8 @@ module Orb attr_accessor auto_collection: bool? + attr_accessor auto_issuance: bool? + attr_accessor billing_address: Orb::AddressInput? attr_accessor currency: String? @@ -69,6 +72,7 @@ module Orb ?accounting_sync_configuration: Orb::NewAccountingSyncConfiguration?, ?additional_emails: ::Array[String]?, ?auto_collection: bool?, + ?auto_issuance: bool?, ?billing_address: Orb::AddressInput?, ?currency: String?, ?email_delivery: bool?, @@ -91,6 +95,7 @@ module Orb accounting_sync_configuration: Orb::NewAccountingSyncConfiguration?, additional_emails: ::Array[String]?, auto_collection: bool?, + auto_issuance: bool?, billing_address: Orb::AddressInput?, currency: String?, email_delivery: bool?, @@ -126,10 +131,23 @@ module Orb Orb::NewAvalaraTaxConfiguration | Orb::NewTaxJarConfiguration | Orb::NewSphereConfiguration + | Orb::CustomerCreateParams::TaxConfiguration::Numeral module TaxConfiguration extend Orb::Internal::Type::Union + type numeral = { tax_exempt: bool, tax_provider: :numeral } + + class Numeral < Orb::Internal::Type::BaseModel + attr_accessor tax_exempt: bool + + attr_accessor tax_provider: :numeral + + def initialize: (tax_exempt: bool, ?tax_provider: :numeral) -> void + + def to_hash: -> { tax_exempt: bool, tax_provider: :numeral } + end + def self?.variants: -> ::Array[Orb::Models::CustomerCreateParams::tax_configuration] end end diff --git a/sig/orb/models/customer_update_by_external_id_params.rbs b/sig/orb/models/customer_update_by_external_id_params.rbs index 14130b29..511e28c8 100644 --- a/sig/orb/models/customer_update_by_external_id_params.rbs +++ b/sig/orb/models/customer_update_by_external_id_params.rbs @@ -5,6 +5,7 @@ module Orb accounting_sync_configuration: Orb::NewAccountingSyncConfiguration?, additional_emails: ::Array[String]?, auto_collection: bool?, + auto_issuance: bool?, billing_address: Orb::AddressInput?, currency: String?, email: String?, @@ -32,6 +33,8 @@ module Orb attr_accessor auto_collection: bool? + attr_accessor auto_issuance: bool? + attr_accessor billing_address: Orb::AddressInput? attr_accessor currency: String? @@ -64,6 +67,7 @@ module Orb ?accounting_sync_configuration: Orb::NewAccountingSyncConfiguration?, ?additional_emails: ::Array[String]?, ?auto_collection: bool?, + ?auto_issuance: bool?, ?billing_address: Orb::AddressInput?, ?currency: String?, ?email: String?, @@ -85,6 +89,7 @@ module Orb accounting_sync_configuration: Orb::NewAccountingSyncConfiguration?, additional_emails: ::Array[String]?, auto_collection: bool?, + auto_issuance: bool?, billing_address: Orb::AddressInput?, currency: String?, email: String?, @@ -121,10 +126,23 @@ module Orb Orb::NewAvalaraTaxConfiguration | Orb::NewTaxJarConfiguration | Orb::NewSphereConfiguration + | Orb::CustomerUpdateByExternalIDParams::TaxConfiguration::Numeral module TaxConfiguration extend Orb::Internal::Type::Union + type numeral = { tax_exempt: bool, tax_provider: :numeral } + + class Numeral < Orb::Internal::Type::BaseModel + attr_accessor tax_exempt: bool + + attr_accessor tax_provider: :numeral + + def initialize: (tax_exempt: bool, ?tax_provider: :numeral) -> void + + def to_hash: -> { tax_exempt: bool, tax_provider: :numeral } + end + def self?.variants: -> ::Array[Orb::Models::CustomerUpdateByExternalIDParams::tax_configuration] end end diff --git a/sig/orb/models/customer_update_params.rbs b/sig/orb/models/customer_update_params.rbs index be8785bd..dcf364f6 100644 --- a/sig/orb/models/customer_update_params.rbs +++ b/sig/orb/models/customer_update_params.rbs @@ -5,6 +5,7 @@ module Orb accounting_sync_configuration: Orb::NewAccountingSyncConfiguration?, additional_emails: ::Array[String]?, auto_collection: bool?, + auto_issuance: bool?, billing_address: Orb::AddressInput?, currency: String?, email: String?, @@ -32,6 +33,8 @@ module Orb attr_accessor auto_collection: bool? + attr_accessor auto_issuance: bool? + attr_accessor billing_address: Orb::AddressInput? attr_accessor currency: String? @@ -64,6 +67,7 @@ module Orb ?accounting_sync_configuration: Orb::NewAccountingSyncConfiguration?, ?additional_emails: ::Array[String]?, ?auto_collection: bool?, + ?auto_issuance: bool?, ?billing_address: Orb::AddressInput?, ?currency: String?, ?email: String?, @@ -85,6 +89,7 @@ module Orb accounting_sync_configuration: Orb::NewAccountingSyncConfiguration?, additional_emails: ::Array[String]?, auto_collection: bool?, + auto_issuance: bool?, billing_address: Orb::AddressInput?, currency: String?, email: String?, @@ -121,10 +126,23 @@ module Orb Orb::NewAvalaraTaxConfiguration | Orb::NewTaxJarConfiguration | Orb::NewSphereConfiguration + | Orb::CustomerUpdateParams::TaxConfiguration::Numeral module TaxConfiguration extend Orb::Internal::Type::Union + type numeral = { tax_exempt: bool, tax_provider: :numeral } + + class Numeral < Orb::Internal::Type::BaseModel + attr_accessor tax_exempt: bool + + attr_accessor tax_provider: :numeral + + def initialize: (tax_exempt: bool, ?tax_provider: :numeral) -> void + + def to_hash: -> { tax_exempt: bool, tax_provider: :numeral } + end + def self?.variants: -> ::Array[Orb::Models::CustomerUpdateParams::tax_configuration] end end diff --git a/sig/orb/models/customers/balance_transaction_create_response.rbs b/sig/orb/models/customers/balance_transaction_create_response.rbs index 0ba0b624..f3c5fde5 100644 --- a/sig/orb/models/customers/balance_transaction_create_response.rbs +++ b/sig/orb/models/customers/balance_transaction_create_response.rbs @@ -72,6 +72,7 @@ module Orb | :credit_note_voided | :overpayment_refund | :external_payment + | :small_invoice_carryover module Action extend Orb::Internal::Type::Enum @@ -85,6 +86,7 @@ module Orb CREDIT_NOTE_VOIDED: :credit_note_voided OVERPAYMENT_REFUND: :overpayment_refund EXTERNAL_PAYMENT: :external_payment + SMALL_INVOICE_CARRYOVER: :small_invoice_carryover def self?.values: -> ::Array[Orb::Models::Customers::BalanceTransactionCreateResponse::action] end diff --git a/sig/orb/models/customers/balance_transaction_list_response.rbs b/sig/orb/models/customers/balance_transaction_list_response.rbs index 6886a282..a6ab4e42 100644 --- a/sig/orb/models/customers/balance_transaction_list_response.rbs +++ b/sig/orb/models/customers/balance_transaction_list_response.rbs @@ -72,6 +72,7 @@ module Orb | :credit_note_voided | :overpayment_refund | :external_payment + | :small_invoice_carryover module Action extend Orb::Internal::Type::Enum @@ -85,6 +86,7 @@ module Orb CREDIT_NOTE_VOIDED: :credit_note_voided OVERPAYMENT_REFUND: :overpayment_refund EXTERNAL_PAYMENT: :external_payment + SMALL_INVOICE_CARRYOVER: :small_invoice_carryover def self?.values: -> ::Array[Orb::Models::Customers::BalanceTransactionListResponse::action] end diff --git a/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbs b/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbs index 173d60c5..c1f06de1 100644 --- a/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbs +++ b/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbs @@ -93,6 +93,7 @@ module Orb { auto_collection: bool, net_terms: Integer?, + custom_due_date: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::custom_due_date?, invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::invoice_date?, memo: String?, require_successful_payment: bool @@ -103,6 +104,8 @@ module Orb attr_accessor net_terms: Integer? + attr_accessor custom_due_date: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::custom_due_date? + attr_accessor invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::invoice_date? attr_accessor memo: String? @@ -114,6 +117,7 @@ module Orb def initialize: ( auto_collection: bool, net_terms: Integer?, + ?custom_due_date: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::custom_due_date?, ?invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::invoice_date?, ?memo: String?, ?require_successful_payment: bool @@ -122,11 +126,20 @@ module Orb def to_hash: -> { auto_collection: bool, net_terms: Integer?, + custom_due_date: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::custom_due_date?, invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::invoice_date?, memo: String?, require_successful_payment: bool } + type custom_due_date = Date | Time + + module CustomDueDate + extend Orb::Internal::Type::Union + + def self?.variants: -> ::Array[Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::custom_due_date] + end + type invoice_date = Date | Time module InvoiceDate diff --git a/sig/orb/models/customers/credits/ledger_create_entry_params.rbs b/sig/orb/models/customers/credits/ledger_create_entry_params.rbs index db6330e5..fe99d560 100644 --- a/sig/orb/models/customers/credits/ledger_create_entry_params.rbs +++ b/sig/orb/models/customers/credits/ledger_create_entry_params.rbs @@ -93,6 +93,7 @@ module Orb { auto_collection: bool, net_terms: Integer?, + custom_due_date: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::custom_due_date?, invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::invoice_date?, memo: String?, require_successful_payment: bool @@ -103,6 +104,8 @@ module Orb attr_accessor net_terms: Integer? + attr_accessor custom_due_date: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::custom_due_date? + attr_accessor invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::invoice_date? attr_accessor memo: String? @@ -114,6 +117,7 @@ module Orb def initialize: ( auto_collection: bool, net_terms: Integer?, + ?custom_due_date: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::custom_due_date?, ?invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::invoice_date?, ?memo: String?, ?require_successful_payment: bool @@ -122,11 +126,20 @@ module Orb def to_hash: -> { auto_collection: bool, net_terms: Integer?, + custom_due_date: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::custom_due_date?, invoice_date: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::invoice_date?, memo: String?, require_successful_payment: bool } + type custom_due_date = Date | Time + + module CustomDueDate + extend Orb::Internal::Type::Union + + def self?.variants: -> ::Array[Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::custom_due_date] + end + type invoice_date = Date | Time module InvoiceDate diff --git a/sig/orb/models/invoice.rbs b/sig/orb/models/invoice.rbs index 632cb7cb..27ba22d2 100644 --- a/sig/orb/models/invoice.rbs +++ b/sig/orb/models/invoice.rbs @@ -366,6 +366,7 @@ module Orb | :credit_note_voided | :overpayment_refund | :external_payment + | :small_invoice_carryover module Action extend Orb::Internal::Type::Enum @@ -379,6 +380,7 @@ module Orb CREDIT_NOTE_VOIDED: :credit_note_voided OVERPAYMENT_REFUND: :overpayment_refund EXTERNAL_PAYMENT: :external_payment + SMALL_INVOICE_CARRYOVER: :small_invoice_carryover def self?.values: -> ::Array[Orb::Models::Invoice::CustomerBalanceTransaction::action] end @@ -558,6 +560,7 @@ module Orb created_at: Time, payment_provider: Orb::Models::Invoice::PaymentAttempt::payment_provider?, payment_provider_id: String?, + receipt_pdf: String?, succeeded: bool } @@ -572,6 +575,8 @@ module Orb attr_accessor payment_provider_id: String? + attr_accessor receipt_pdf: String? + attr_accessor succeeded: bool def initialize: ( @@ -580,6 +585,7 @@ module Orb created_at: Time, payment_provider: Orb::Models::Invoice::PaymentAttempt::payment_provider?, payment_provider_id: String?, + receipt_pdf: String?, succeeded: bool ) -> void @@ -589,6 +595,7 @@ module Orb created_at: Time, payment_provider: Orb::Models::Invoice::PaymentAttempt::payment_provider?, payment_provider_id: String?, + receipt_pdf: String?, succeeded: bool } diff --git a/sig/orb/models/invoice_create_params.rbs b/sig/orb/models/invoice_create_params.rbs index bc808c51..40908781 100644 --- a/sig/orb/models/invoice_create_params.rbs +++ b/sig/orb/models/invoice_create_params.rbs @@ -7,6 +7,7 @@ module Orb line_items: ::Array[Orb::InvoiceCreateParams::LineItem], customer_id: String?, discount: Orb::Models::discount?, + due_date: Orb::Models::InvoiceCreateParams::due_date?, external_customer_id: String?, memo: String?, metadata: ::Hash[Symbol, String?]?, @@ -29,6 +30,8 @@ module Orb attr_accessor discount: Orb::Models::discount? + attr_accessor due_date: Orb::Models::InvoiceCreateParams::due_date? + attr_accessor external_customer_id: String? attr_accessor memo: String? @@ -47,6 +50,7 @@ module Orb line_items: ::Array[Orb::InvoiceCreateParams::LineItem], ?customer_id: String?, ?discount: Orb::Models::discount?, + ?due_date: Orb::Models::InvoiceCreateParams::due_date?, ?external_customer_id: String?, ?memo: String?, ?metadata: ::Hash[Symbol, String?]?, @@ -61,6 +65,7 @@ module Orb line_items: ::Array[Orb::InvoiceCreateParams::LineItem], customer_id: String?, discount: Orb::Models::discount?, + due_date: Orb::Models::InvoiceCreateParams::due_date?, external_customer_id: String?, memo: String?, metadata: ::Hash[Symbol, String?]?, @@ -125,6 +130,14 @@ module Orb def self?.values: -> ::Array[Orb::Models::InvoiceCreateParams::LineItem::model_type] end end + + type due_date = Date | Time + + module DueDate + extend Orb::Internal::Type::Union + + def self?.variants: -> ::Array[Orb::Models::InvoiceCreateParams::due_date] + end end end end diff --git a/sig/orb/models/invoice_fetch_upcoming_response.rbs b/sig/orb/models/invoice_fetch_upcoming_response.rbs index 0f356277..8791bc62 100644 --- a/sig/orb/models/invoice_fetch_upcoming_response.rbs +++ b/sig/orb/models/invoice_fetch_upcoming_response.rbs @@ -366,6 +366,7 @@ module Orb | :credit_note_voided | :overpayment_refund | :external_payment + | :small_invoice_carryover module Action extend Orb::Internal::Type::Enum @@ -379,6 +380,7 @@ module Orb CREDIT_NOTE_VOIDED: :credit_note_voided OVERPAYMENT_REFUND: :overpayment_refund EXTERNAL_PAYMENT: :external_payment + SMALL_INVOICE_CARRYOVER: :small_invoice_carryover def self?.values: -> ::Array[Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::action] end @@ -558,6 +560,7 @@ module Orb created_at: Time, payment_provider: Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt::payment_provider?, payment_provider_id: String?, + receipt_pdf: String?, succeeded: bool } @@ -572,6 +575,8 @@ module Orb attr_accessor payment_provider_id: String? + attr_accessor receipt_pdf: String? + attr_accessor succeeded: bool def initialize: ( @@ -580,6 +585,7 @@ module Orb created_at: Time, payment_provider: Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt::payment_provider?, payment_provider_id: String?, + receipt_pdf: String?, succeeded: bool ) -> void @@ -589,6 +595,7 @@ module Orb created_at: Time, payment_provider: Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt::payment_provider?, payment_provider_id: String?, + receipt_pdf: String?, succeeded: bool } diff --git a/sig/orb/models/invoice_line_item_create_params.rbs b/sig/orb/models/invoice_line_item_create_params.rbs index 7bb49f8d..7ed8cea3 100644 --- a/sig/orb/models/invoice_line_item_create_params.rbs +++ b/sig/orb/models/invoice_line_item_create_params.rbs @@ -5,9 +5,10 @@ module Orb amount: String, end_date: Date, invoice_id: String, - name: String, quantity: Float, - start_date: Date + start_date: Date, + item_id: String?, + name: String? } & Orb::Internal::Type::request_parameters @@ -21,19 +22,22 @@ module Orb attr_accessor invoice_id: String - attr_accessor name: String - attr_accessor quantity: Float attr_accessor start_date: Date + attr_accessor item_id: String? + + attr_accessor name: String? + def initialize: ( amount: String, end_date: Date, invoice_id: String, - name: String, quantity: Float, start_date: Date, + ?item_id: String?, + ?name: String?, ?request_options: Orb::request_opts ) -> void @@ -41,9 +45,10 @@ module Orb amount: String, end_date: Date, invoice_id: String, - name: String, quantity: Float, start_date: Date, + item_id: String?, + name: String?, request_options: Orb::RequestOptions } end diff --git a/sig/orb/models/invoice_update_params.rbs b/sig/orb/models/invoice_update_params.rbs index 8ee43dca..60560f55 100644 --- a/sig/orb/models/invoice_update_params.rbs +++ b/sig/orb/models/invoice_update_params.rbs @@ -1,24 +1,44 @@ module Orb module Models type invoice_update_params = - { metadata: ::Hash[Symbol, String?]? } + { + due_date: Orb::Models::InvoiceUpdateParams::due_date?, + metadata: ::Hash[Symbol, String?]?, + net_terms: Integer? + } & Orb::Internal::Type::request_parameters class InvoiceUpdateParams < Orb::Internal::Type::BaseModel extend Orb::Internal::Type::RequestParameters::Converter include Orb::Internal::Type::RequestParameters + attr_accessor due_date: Orb::Models::InvoiceUpdateParams::due_date? + attr_accessor metadata: ::Hash[Symbol, String?]? + attr_accessor net_terms: Integer? + def initialize: ( + ?due_date: Orb::Models::InvoiceUpdateParams::due_date?, ?metadata: ::Hash[Symbol, String?]?, + ?net_terms: Integer?, ?request_options: Orb::request_opts ) -> void def to_hash: -> { + due_date: Orb::Models::InvoiceUpdateParams::due_date?, metadata: ::Hash[Symbol, String?]?, + net_terms: Integer?, request_options: Orb::RequestOptions } + + type due_date = Date | Time + + module DueDate + extend Orb::Internal::Type::Union + + def self?.variants: -> ::Array[Orb::Models::InvoiceUpdateParams::due_date] + end end end end diff --git a/sig/orb/models/item.rbs b/sig/orb/models/item.rbs index b869dcab..5e548ea8 100644 --- a/sig/orb/models/item.rbs +++ b/sig/orb/models/item.rbs @@ -6,7 +6,8 @@ module Orb created_at: Time, external_connections: ::Array[Orb::Item::ExternalConnection], metadata: ::Hash[Symbol, String], - name: String + name: String, + archived_at: Time? } class Item < Orb::Internal::Type::BaseModel @@ -20,12 +21,15 @@ module Orb attr_accessor name: String + attr_accessor archived_at: Time? + def initialize: ( id: String, created_at: Time, external_connections: ::Array[Orb::Item::ExternalConnection], metadata: ::Hash[Symbol, String], - name: String + name: String, + ?archived_at: Time? ) -> void def to_hash: -> { @@ -33,7 +37,8 @@ module Orb created_at: Time, external_connections: ::Array[Orb::Item::ExternalConnection], metadata: ::Hash[Symbol, String], - name: String + name: String, + archived_at: Time? } type external_connection = @@ -65,6 +70,7 @@ module Orb | :taxjar | :avalara | :anrok + | :numeral module ExternalConnectionName extend Orb::Internal::Type::Enum @@ -76,6 +82,7 @@ module Orb TAXJAR: :taxjar AVALARA: :avalara ANROK: :anrok + NUMERAL: :numeral def self?.values: -> ::Array[Orb::Models::Item::ExternalConnection::external_connection_name] end diff --git a/sig/orb/models/item_update_params.rbs b/sig/orb/models/item_update_params.rbs index bb25c824..036dddb5 100644 --- a/sig/orb/models/item_update_params.rbs +++ b/sig/orb/models/item_update_params.rbs @@ -61,6 +61,7 @@ module Orb | :taxjar | :avalara | :anrok + | :numeral module ExternalConnectionName extend Orb::Internal::Type::Enum @@ -72,6 +73,7 @@ module Orb TAXJAR: :taxjar AVALARA: :avalara ANROK: :anrok + NUMERAL: :numeral def self?.values: -> ::Array[Orb::Models::ItemUpdateParams::ExternalConnection::external_connection_name] end diff --git a/sig/orb/models/matrix_sub_line_item.rbs b/sig/orb/models/matrix_sub_line_item.rbs index 5d45f66c..929696e3 100644 --- a/sig/orb/models/matrix_sub_line_item.rbs +++ b/sig/orb/models/matrix_sub_line_item.rbs @@ -7,7 +7,8 @@ module Orb matrix_config: Orb::SubLineItemMatrixConfig, name: String, quantity: Float, - type: Orb::Models::MatrixSubLineItem::type_ + type: Orb::Models::MatrixSubLineItem::type_, + scaled_quantity: Float? } class MatrixSubLineItem < Orb::Internal::Type::BaseModel @@ -23,13 +24,16 @@ module Orb attr_accessor type: Orb::Models::MatrixSubLineItem::type_ + attr_accessor scaled_quantity: Float? + def initialize: ( amount: String, grouping: Orb::SubLineItemGrouping?, matrix_config: Orb::SubLineItemMatrixConfig, name: String, quantity: Float, - type: Orb::Models::MatrixSubLineItem::type_ + type: Orb::Models::MatrixSubLineItem::type_, + ?scaled_quantity: Float? ) -> void def to_hash: -> { @@ -38,7 +42,8 @@ module Orb matrix_config: Orb::SubLineItemMatrixConfig, name: String, quantity: Float, - type: Orb::Models::MatrixSubLineItem::type_ + type: Orb::Models::MatrixSubLineItem::type_, + scaled_quantity: Float? } type type_ = :matrix diff --git a/sig/orb/models/matrix_with_allocation_config.rbs b/sig/orb/models/matrix_with_allocation_config.rbs index b98e9014..23561e24 100644 --- a/sig/orb/models/matrix_with_allocation_config.rbs +++ b/sig/orb/models/matrix_with_allocation_config.rbs @@ -2,34 +2,53 @@ module Orb module Models type matrix_with_allocation_config = { - allocation: Float, + allocation: String, default_unit_amount: String, dimensions: ::Array[String?], - matrix_values: ::Array[Orb::MatrixValue] + matrix_values: ::Array[Orb::MatrixWithAllocationConfig::MatrixValue] } class MatrixWithAllocationConfig < Orb::Internal::Type::BaseModel - attr_accessor allocation: Float + attr_accessor allocation: String attr_accessor default_unit_amount: String attr_accessor dimensions: ::Array[String?] - attr_accessor matrix_values: ::Array[Orb::MatrixValue] + attr_accessor matrix_values: ::Array[Orb::MatrixWithAllocationConfig::MatrixValue] def initialize: ( - allocation: Float, + allocation: String, default_unit_amount: String, dimensions: ::Array[String?], - matrix_values: ::Array[Orb::MatrixValue] + matrix_values: ::Array[Orb::MatrixWithAllocationConfig::MatrixValue] ) -> void def to_hash: -> { - allocation: Float, + allocation: String, default_unit_amount: String, dimensions: ::Array[String?], - matrix_values: ::Array[Orb::MatrixValue] + matrix_values: ::Array[Orb::MatrixWithAllocationConfig::MatrixValue] } + + type matrix_value = + { dimension_values: ::Array[String?], unit_amount: String } + + class MatrixValue < Orb::Internal::Type::BaseModel + attr_accessor dimension_values: ::Array[String?] + + attr_accessor unit_amount: String + + def initialize: ( + dimension_values: ::Array[String?], + unit_amount: String + ) -> void + + def to_hash: -> { + dimension_values: ::Array[String?], + unit_amount: String + } + end end end end diff --git a/sig/orb/models/new_floating_bps_price.rbs b/sig/orb/models/new_floating_bps_price.rbs deleted file mode 100644 index 13d1d977..00000000 --- a/sig/orb/models/new_floating_bps_price.rbs +++ /dev/null @@ -1,135 +0,0 @@ -module Orb - module Models - type new_floating_bps_price = - { - bps_config: Orb::BPSConfig, - cadence: Orb::Models::NewFloatingBPSPrice::cadence, - currency: String, - item_id: String, - model_type: Orb::Models::NewFloatingBPSPrice::model_type, - name: String, - billable_metric_id: String?, - billed_in_advance: bool?, - billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewFloatingBPSPrice::conversion_rate_config?, - dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoice_grouping_key: String?, - invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - metadata: ::Hash[Symbol, String?]? - } - - class NewFloatingBPSPrice < Orb::Internal::Type::BaseModel - attr_accessor bps_config: Orb::BPSConfig - - attr_accessor cadence: Orb::Models::NewFloatingBPSPrice::cadence - - attr_accessor currency: String - - attr_accessor item_id: String - - attr_accessor model_type: Orb::Models::NewFloatingBPSPrice::model_type - - attr_accessor name: String - - attr_accessor billable_metric_id: String? - - attr_accessor billed_in_advance: bool? - - attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? - - attr_accessor conversion_rate: Float? - - attr_accessor conversion_rate_config: Orb::Models::NewFloatingBPSPrice::conversion_rate_config? - - attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? - - attr_accessor external_price_id: String? - - attr_accessor fixed_price_quantity: Float? - - attr_accessor invoice_grouping_key: String? - - attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? - - attr_accessor metadata: ::Hash[Symbol, String?]? - - def initialize: ( - bps_config: Orb::BPSConfig, - cadence: Orb::Models::NewFloatingBPSPrice::cadence, - currency: String, - item_id: String, - model_type: Orb::Models::NewFloatingBPSPrice::model_type, - name: String, - ?billable_metric_id: String?, - ?billed_in_advance: bool?, - ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - ?conversion_rate: Float?, - ?conversion_rate_config: Orb::Models::NewFloatingBPSPrice::conversion_rate_config?, - ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - ?external_price_id: String?, - ?fixed_price_quantity: Float?, - ?invoice_grouping_key: String?, - ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - ?metadata: ::Hash[Symbol, String?]? - ) -> void - - def to_hash: -> { - bps_config: Orb::BPSConfig, - cadence: Orb::Models::NewFloatingBPSPrice::cadence, - currency: String, - item_id: String, - model_type: Orb::Models::NewFloatingBPSPrice::model_type, - name: String, - billable_metric_id: String?, - billed_in_advance: bool?, - billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewFloatingBPSPrice::conversion_rate_config?, - dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoice_grouping_key: String?, - invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - metadata: ::Hash[Symbol, String?]? - } - - type cadence = - :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom - - module Cadence - extend Orb::Internal::Type::Enum - - ANNUAL: :annual - SEMI_ANNUAL: :semi_annual - MONTHLY: :monthly - QUARTERLY: :quarterly - ONE_TIME: :one_time - CUSTOM: :custom - - def self?.values: -> ::Array[Orb::Models::NewFloatingBPSPrice::cadence] - end - - type model_type = :bps - - module ModelType - extend Orb::Internal::Type::Enum - - BPS: :bps - - def self?.values: -> ::Array[Orb::Models::NewFloatingBPSPrice::model_type] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewFloatingBPSPrice::conversion_rate_config] - end - end - end -end diff --git a/sig/orb/models/new_floating_bulk_bps_price.rbs b/sig/orb/models/new_floating_bulk_bps_price.rbs deleted file mode 100644 index 5115bf64..00000000 --- a/sig/orb/models/new_floating_bulk_bps_price.rbs +++ /dev/null @@ -1,135 +0,0 @@ -module Orb - module Models - type new_floating_bulk_bps_price = - { - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::Models::NewFloatingBulkBPSPrice::cadence, - currency: String, - item_id: String, - model_type: Orb::Models::NewFloatingBulkBPSPrice::model_type, - name: String, - billable_metric_id: String?, - billed_in_advance: bool?, - billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewFloatingBulkBPSPrice::conversion_rate_config?, - dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoice_grouping_key: String?, - invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - metadata: ::Hash[Symbol, String?]? - } - - class NewFloatingBulkBPSPrice < Orb::Internal::Type::BaseModel - attr_accessor bulk_bps_config: Orb::BulkBPSConfig - - attr_accessor cadence: Orb::Models::NewFloatingBulkBPSPrice::cadence - - attr_accessor currency: String - - attr_accessor item_id: String - - attr_accessor model_type: Orb::Models::NewFloatingBulkBPSPrice::model_type - - attr_accessor name: String - - attr_accessor billable_metric_id: String? - - attr_accessor billed_in_advance: bool? - - attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? - - attr_accessor conversion_rate: Float? - - attr_accessor conversion_rate_config: Orb::Models::NewFloatingBulkBPSPrice::conversion_rate_config? - - attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? - - attr_accessor external_price_id: String? - - attr_accessor fixed_price_quantity: Float? - - attr_accessor invoice_grouping_key: String? - - attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? - - attr_accessor metadata: ::Hash[Symbol, String?]? - - def initialize: ( - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::Models::NewFloatingBulkBPSPrice::cadence, - currency: String, - item_id: String, - model_type: Orb::Models::NewFloatingBulkBPSPrice::model_type, - name: String, - ?billable_metric_id: String?, - ?billed_in_advance: bool?, - ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - ?conversion_rate: Float?, - ?conversion_rate_config: Orb::Models::NewFloatingBulkBPSPrice::conversion_rate_config?, - ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - ?external_price_id: String?, - ?fixed_price_quantity: Float?, - ?invoice_grouping_key: String?, - ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - ?metadata: ::Hash[Symbol, String?]? - ) -> void - - def to_hash: -> { - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::Models::NewFloatingBulkBPSPrice::cadence, - currency: String, - item_id: String, - model_type: Orb::Models::NewFloatingBulkBPSPrice::model_type, - name: String, - billable_metric_id: String?, - billed_in_advance: bool?, - billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewFloatingBulkBPSPrice::conversion_rate_config?, - dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoice_grouping_key: String?, - invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - metadata: ::Hash[Symbol, String?]? - } - - type cadence = - :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom - - module Cadence - extend Orb::Internal::Type::Enum - - ANNUAL: :annual - SEMI_ANNUAL: :semi_annual - MONTHLY: :monthly - QUARTERLY: :quarterly - ONE_TIME: :one_time - CUSTOM: :custom - - def self?.values: -> ::Array[Orb::Models::NewFloatingBulkBPSPrice::cadence] - end - - type model_type = :bulk_bps - - module ModelType - extend Orb::Internal::Type::Enum - - BULK_BPS: :bulk_bps - - def self?.values: -> ::Array[Orb::Models::NewFloatingBulkBPSPrice::model_type] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewFloatingBulkBPSPrice::conversion_rate_config] - end - end - end -end diff --git a/sig/orb/models/new_floating_bulk_price.rbs b/sig/orb/models/new_floating_bulk_price.rbs index 30182652..7157bb89 100644 --- a/sig/orb/models/new_floating_bulk_price.rbs +++ b/sig/orb/models/new_floating_bulk_price.rbs @@ -121,15 +121,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingBulkPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewFloatingBulkPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_floating_bulk_with_proration_price.rbs b/sig/orb/models/new_floating_bulk_with_proration_price.rbs index 534ef280..b794a695 100644 --- a/sig/orb/models/new_floating_bulk_with_proration_price.rbs +++ b/sig/orb/models/new_floating_bulk_with_proration_price.rbs @@ -2,7 +2,7 @@ module Orb module Models type new_floating_bulk_with_proration_price = { - bulk_with_proration_config: ::Hash[Symbol, top], + bulk_with_proration_config: Orb::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig, cadence: Orb::Models::NewFloatingBulkWithProrationPrice::cadence, currency: String, item_id: String, @@ -22,7 +22,7 @@ module Orb } class NewFloatingBulkWithProrationPrice < Orb::Internal::Type::BaseModel - attr_accessor bulk_with_proration_config: ::Hash[Symbol, top] + attr_accessor bulk_with_proration_config: Orb::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig attr_accessor cadence: Orb::Models::NewFloatingBulkWithProrationPrice::cadence @@ -57,7 +57,7 @@ module Orb attr_accessor metadata: ::Hash[Symbol, String?]? def initialize: ( - bulk_with_proration_config: ::Hash[Symbol, top], + bulk_with_proration_config: Orb::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig, cadence: Orb::Models::NewFloatingBulkWithProrationPrice::cadence, currency: String, item_id: String, @@ -77,7 +77,7 @@ module Orb ) -> void def to_hash: -> { - bulk_with_proration_config: ::Hash[Symbol, top], + bulk_with_proration_config: Orb::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig, cadence: Orb::Models::NewFloatingBulkWithProrationPrice::cadence, currency: String, item_id: String, @@ -96,6 +96,38 @@ module Orb metadata: ::Hash[Symbol, String?]? } + type bulk_with_proration_config = + { + tiers: ::Array[Orb::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig::Tier] + } + + class BulkWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig::Tier] + + def initialize: ( + tiers: ::Array[Orb::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig::Tier] + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::NewFloatingBulkWithProrationPrice::BulkWithProrationConfig::Tier] + } + + type tier = { unit_amount: String, tier_lower_bound: String? } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor unit_amount: String + + attr_accessor tier_lower_bound: String? + + def initialize: ( + unit_amount: String, + ?tier_lower_bound: String? + ) -> void + + def to_hash: -> { unit_amount: String, tier_lower_bound: String? } + end + end + type cadence = :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom @@ -121,15 +153,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingBulkWithProrationPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewFloatingBulkWithProrationPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_floating_cumulative_grouped_bulk_price.rbs b/sig/orb/models/new_floating_cumulative_grouped_bulk_price.rbs index 919119e0..1b777c95 100644 --- a/sig/orb/models/new_floating_cumulative_grouped_bulk_price.rbs +++ b/sig/orb/models/new_floating_cumulative_grouped_bulk_price.rbs @@ -3,7 +3,7 @@ module Orb type new_floating_cumulative_grouped_bulk_price = { cadence: Orb::Models::NewFloatingCumulativeGroupedBulkPrice::cadence, - cumulative_grouped_bulk_config: ::Hash[Symbol, top], + cumulative_grouped_bulk_config: Orb::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig, currency: String, item_id: String, model_type: Orb::Models::NewFloatingCumulativeGroupedBulkPrice::model_type, @@ -24,7 +24,7 @@ module Orb class NewFloatingCumulativeGroupedBulkPrice < Orb::Internal::Type::BaseModel attr_accessor cadence: Orb::Models::NewFloatingCumulativeGroupedBulkPrice::cadence - attr_accessor cumulative_grouped_bulk_config: ::Hash[Symbol, top] + attr_accessor cumulative_grouped_bulk_config: Orb::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig attr_accessor currency: String @@ -58,7 +58,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewFloatingCumulativeGroupedBulkPrice::cadence, - cumulative_grouped_bulk_config: ::Hash[Symbol, top], + cumulative_grouped_bulk_config: Orb::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig, currency: String, item_id: String, model_type: Orb::Models::NewFloatingCumulativeGroupedBulkPrice::model_type, @@ -78,7 +78,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewFloatingCumulativeGroupedBulkPrice::cadence, - cumulative_grouped_bulk_config: ::Hash[Symbol, top], + cumulative_grouped_bulk_config: Orb::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig, currency: String, item_id: String, model_type: Orb::Models::NewFloatingCumulativeGroupedBulkPrice::model_type, @@ -112,6 +112,55 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingCumulativeGroupedBulkPrice::cadence] end + type cumulative_grouped_bulk_config = + { + dimension_values: ::Array[Orb::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue], + group: String + } + + class CumulativeGroupedBulkConfig < Orb::Internal::Type::BaseModel + attr_accessor dimension_values: ::Array[Orb::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue] + + attr_accessor group: String + + def initialize: ( + dimension_values: ::Array[Orb::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue], + group: String + ) -> void + + def to_hash: -> { + dimension_values: ::Array[Orb::NewFloatingCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue], + group: String + } + + type dimension_value = + { + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + } + + class DimensionValue < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + } + end + end + type model_type = :cumulative_grouped_bulk module ModelType @@ -121,15 +170,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingCumulativeGroupedBulkPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewFloatingCumulativeGroupedBulkPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_floating_grouped_allocation_price.rbs b/sig/orb/models/new_floating_grouped_allocation_price.rbs index 11b71b8c..97db577b 100644 --- a/sig/orb/models/new_floating_grouped_allocation_price.rbs +++ b/sig/orb/models/new_floating_grouped_allocation_price.rbs @@ -4,7 +4,7 @@ module Orb { cadence: Orb::Models::NewFloatingGroupedAllocationPrice::cadence, currency: String, - grouped_allocation_config: ::Hash[Symbol, top], + grouped_allocation_config: Orb::NewFloatingGroupedAllocationPrice::GroupedAllocationConfig, item_id: String, model_type: Orb::Models::NewFloatingGroupedAllocationPrice::model_type, name: String, @@ -26,7 +26,7 @@ module Orb attr_accessor currency: String - attr_accessor grouped_allocation_config: ::Hash[Symbol, top] + attr_accessor grouped_allocation_config: Orb::NewFloatingGroupedAllocationPrice::GroupedAllocationConfig attr_accessor item_id: String @@ -59,7 +59,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewFloatingGroupedAllocationPrice::cadence, currency: String, - grouped_allocation_config: ::Hash[Symbol, top], + grouped_allocation_config: Orb::NewFloatingGroupedAllocationPrice::GroupedAllocationConfig, item_id: String, model_type: Orb::Models::NewFloatingGroupedAllocationPrice::model_type, name: String, @@ -79,7 +79,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewFloatingGroupedAllocationPrice::cadence, currency: String, - grouped_allocation_config: ::Hash[Symbol, top], + grouped_allocation_config: Orb::NewFloatingGroupedAllocationPrice::GroupedAllocationConfig, item_id: String, model_type: Orb::Models::NewFloatingGroupedAllocationPrice::model_type, name: String, @@ -112,6 +112,29 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingGroupedAllocationPrice::cadence] end + type grouped_allocation_config = + { allocation: String, grouping_key: String, overage_unit_rate: String } + + class GroupedAllocationConfig < Orb::Internal::Type::BaseModel + attr_accessor allocation: String + + attr_accessor grouping_key: String + + attr_accessor overage_unit_rate: String + + def initialize: ( + allocation: String, + grouping_key: String, + overage_unit_rate: String + ) -> void + + def to_hash: -> { + allocation: String, + grouping_key: String, + overage_unit_rate: String + } + end + type model_type = :grouped_allocation module ModelType @@ -121,15 +144,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingGroupedAllocationPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewFloatingGroupedAllocationPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_floating_grouped_tiered_package_price.rbs b/sig/orb/models/new_floating_grouped_tiered_package_price.rbs index b1b5ad3f..5b1333f8 100644 --- a/sig/orb/models/new_floating_grouped_tiered_package_price.rbs +++ b/sig/orb/models/new_floating_grouped_tiered_package_price.rbs @@ -4,7 +4,7 @@ module Orb { cadence: Orb::Models::NewFloatingGroupedTieredPackagePrice::cadence, currency: String, - grouped_tiered_package_config: ::Hash[Symbol, top], + grouped_tiered_package_config: Orb::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig, item_id: String, model_type: Orb::Models::NewFloatingGroupedTieredPackagePrice::model_type, name: String, @@ -26,7 +26,7 @@ module Orb attr_accessor currency: String - attr_accessor grouped_tiered_package_config: ::Hash[Symbol, top] + attr_accessor grouped_tiered_package_config: Orb::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig attr_accessor item_id: String @@ -59,7 +59,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewFloatingGroupedTieredPackagePrice::cadence, currency: String, - grouped_tiered_package_config: ::Hash[Symbol, top], + grouped_tiered_package_config: Orb::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig, item_id: String, model_type: Orb::Models::NewFloatingGroupedTieredPackagePrice::model_type, name: String, @@ -79,7 +79,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewFloatingGroupedTieredPackagePrice::cadence, currency: String, - grouped_tiered_package_config: ::Hash[Symbol, top], + grouped_tiered_package_config: Orb::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig, item_id: String, model_type: Orb::Models::NewFloatingGroupedTieredPackagePrice::model_type, name: String, @@ -112,6 +112,45 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingGroupedTieredPackagePrice::cadence] end + type grouped_tiered_package_config = + { + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier] + } + + class GroupedTieredPackageConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor package_size: String + + attr_accessor tiers: ::Array[Orb::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier] + + def initialize: ( + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier] + ) -> void + + def to_hash: -> { + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::NewFloatingGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier] + } + + type tier = { per_unit: String, tier_lower_bound: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor per_unit: String + + attr_accessor tier_lower_bound: String + + def initialize: (per_unit: String, tier_lower_bound: String) -> void + + def to_hash: -> { per_unit: String, tier_lower_bound: String } + end + end + type model_type = :grouped_tiered_package module ModelType @@ -121,15 +160,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingGroupedTieredPackagePrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewFloatingGroupedTieredPackagePrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_floating_grouped_tiered_price.rbs b/sig/orb/models/new_floating_grouped_tiered_price.rbs index 32063aac..d383e172 100644 --- a/sig/orb/models/new_floating_grouped_tiered_price.rbs +++ b/sig/orb/models/new_floating_grouped_tiered_price.rbs @@ -4,7 +4,7 @@ module Orb { cadence: Orb::Models::NewFloatingGroupedTieredPrice::cadence, currency: String, - grouped_tiered_config: ::Hash[Symbol, top], + grouped_tiered_config: Orb::NewFloatingGroupedTieredPrice::GroupedTieredConfig, item_id: String, model_type: Orb::Models::NewFloatingGroupedTieredPrice::model_type, name: String, @@ -26,7 +26,7 @@ module Orb attr_accessor currency: String - attr_accessor grouped_tiered_config: ::Hash[Symbol, top] + attr_accessor grouped_tiered_config: Orb::NewFloatingGroupedTieredPrice::GroupedTieredConfig attr_accessor item_id: String @@ -59,7 +59,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewFloatingGroupedTieredPrice::cadence, currency: String, - grouped_tiered_config: ::Hash[Symbol, top], + grouped_tiered_config: Orb::NewFloatingGroupedTieredPrice::GroupedTieredConfig, item_id: String, model_type: Orb::Models::NewFloatingGroupedTieredPrice::model_type, name: String, @@ -79,7 +79,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewFloatingGroupedTieredPrice::cadence, currency: String, - grouped_tiered_config: ::Hash[Symbol, top], + grouped_tiered_config: Orb::NewFloatingGroupedTieredPrice::GroupedTieredConfig, item_id: String, model_type: Orb::Models::NewFloatingGroupedTieredPrice::model_type, name: String, @@ -112,6 +112,43 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingGroupedTieredPrice::cadence] end + type grouped_tiered_config = + { + grouping_key: String, + tiers: ::Array[Orb::NewFloatingGroupedTieredPrice::GroupedTieredConfig::Tier] + } + + class GroupedTieredConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor tiers: ::Array[Orb::NewFloatingGroupedTieredPrice::GroupedTieredConfig::Tier] + + def initialize: ( + grouping_key: String, + tiers: ::Array[Orb::NewFloatingGroupedTieredPrice::GroupedTieredConfig::Tier] + ) -> void + + def to_hash: -> { + grouping_key: String, + tiers: ::Array[Orb::NewFloatingGroupedTieredPrice::GroupedTieredConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { tier_lower_bound: String, unit_amount: String } + end + end + type model_type = :grouped_tiered module ModelType @@ -121,15 +158,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingGroupedTieredPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewFloatingGroupedTieredPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_floating_grouped_with_metered_minimum_price.rbs b/sig/orb/models/new_floating_grouped_with_metered_minimum_price.rbs index 1e3d200d..c73da75e 100644 --- a/sig/orb/models/new_floating_grouped_with_metered_minimum_price.rbs +++ b/sig/orb/models/new_floating_grouped_with_metered_minimum_price.rbs @@ -4,7 +4,7 @@ module Orb { cadence: Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice::cadence, currency: String, - grouped_with_metered_minimum_config: ::Hash[Symbol, top], + grouped_with_metered_minimum_config: Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig, item_id: String, model_type: Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice::model_type, name: String, @@ -26,7 +26,7 @@ module Orb attr_accessor currency: String - attr_accessor grouped_with_metered_minimum_config: ::Hash[Symbol, top] + attr_accessor grouped_with_metered_minimum_config: Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig attr_accessor item_id: String @@ -59,7 +59,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice::cadence, currency: String, - grouped_with_metered_minimum_config: ::Hash[Symbol, top], + grouped_with_metered_minimum_config: Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig, item_id: String, model_type: Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice::model_type, name: String, @@ -79,7 +79,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice::cadence, currency: String, - grouped_with_metered_minimum_config: ::Hash[Symbol, top], + grouped_with_metered_minimum_config: Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig, item_id: String, model_type: Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice::model_type, name: String, @@ -112,6 +112,75 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice::cadence] end + type grouped_with_metered_minimum_config = + { + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: ::Array[Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor], + scaling_key: String, + unit_amounts: ::Array[Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount] + } + + class GroupedWithMeteredMinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor minimum_unit_amount: String + + attr_accessor pricing_key: String + + attr_accessor scaling_factors: ::Array[Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor] + + attr_accessor scaling_key: String + + attr_accessor unit_amounts: ::Array[Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount] + + def initialize: ( + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: ::Array[Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor], + scaling_key: String, + unit_amounts: ::Array[Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount] + ) -> void + + def to_hash: -> { + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: ::Array[Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor], + scaling_key: String, + unit_amounts: ::Array[Orb::NewFloatingGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount] + } + + type scaling_factor = { scaling_factor: String, scaling_value: String } + + class ScalingFactor < Orb::Internal::Type::BaseModel + attr_accessor scaling_factor: String + + attr_accessor scaling_value: String + + def initialize: ( + scaling_factor: String, + scaling_value: String + ) -> void + + def to_hash: -> { scaling_factor: String, scaling_value: String } + end + + type unit_amount = { pricing_value: String, unit_amount: String } + + class UnitAmount < Orb::Internal::Type::BaseModel + attr_accessor pricing_value: String + + attr_accessor unit_amount: String + + def initialize: (pricing_value: String, unit_amount: String) -> void + + def to_hash: -> { pricing_value: String, unit_amount: String } + end + end + type model_type = :grouped_with_metered_minimum module ModelType @@ -121,15 +190,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewFloatingGroupedWithMeteredMinimumPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_floating_grouped_with_prorated_minimum_price.rbs b/sig/orb/models/new_floating_grouped_with_prorated_minimum_price.rbs index 25754c91..d6a63b8c 100644 --- a/sig/orb/models/new_floating_grouped_with_prorated_minimum_price.rbs +++ b/sig/orb/models/new_floating_grouped_with_prorated_minimum_price.rbs @@ -4,7 +4,7 @@ module Orb { cadence: Orb::Models::NewFloatingGroupedWithProratedMinimumPrice::cadence, currency: String, - grouped_with_prorated_minimum_config: ::Hash[Symbol, top], + grouped_with_prorated_minimum_config: Orb::NewFloatingGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig, item_id: String, model_type: Orb::Models::NewFloatingGroupedWithProratedMinimumPrice::model_type, name: String, @@ -26,7 +26,7 @@ module Orb attr_accessor currency: String - attr_accessor grouped_with_prorated_minimum_config: ::Hash[Symbol, top] + attr_accessor grouped_with_prorated_minimum_config: Orb::NewFloatingGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig attr_accessor item_id: String @@ -59,7 +59,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewFloatingGroupedWithProratedMinimumPrice::cadence, currency: String, - grouped_with_prorated_minimum_config: ::Hash[Symbol, top], + grouped_with_prorated_minimum_config: Orb::NewFloatingGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig, item_id: String, model_type: Orb::Models::NewFloatingGroupedWithProratedMinimumPrice::model_type, name: String, @@ -79,7 +79,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewFloatingGroupedWithProratedMinimumPrice::cadence, currency: String, - grouped_with_prorated_minimum_config: ::Hash[Symbol, top], + grouped_with_prorated_minimum_config: Orb::NewFloatingGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig, item_id: String, model_type: Orb::Models::NewFloatingGroupedWithProratedMinimumPrice::model_type, name: String, @@ -112,6 +112,29 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingGroupedWithProratedMinimumPrice::cadence] end + type grouped_with_prorated_minimum_config = + { grouping_key: String, minimum: String, unit_rate: String } + + class GroupedWithProratedMinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor minimum: String + + attr_accessor unit_rate: String + + def initialize: ( + grouping_key: String, + minimum: String, + unit_rate: String + ) -> void + + def to_hash: -> { + grouping_key: String, + minimum: String, + unit_rate: String + } + end + type model_type = :grouped_with_prorated_minimum module ModelType @@ -121,15 +144,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingGroupedWithProratedMinimumPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewFloatingGroupedWithProratedMinimumPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_floating_matrix_price.rbs b/sig/orb/models/new_floating_matrix_price.rbs index 3d7cd249..4af0d538 100644 --- a/sig/orb/models/new_floating_matrix_price.rbs +++ b/sig/orb/models/new_floating_matrix_price.rbs @@ -121,15 +121,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingMatrixPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewFloatingMatrixPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_floating_matrix_with_allocation_price.rbs b/sig/orb/models/new_floating_matrix_with_allocation_price.rbs index eabe70d6..5028578f 100644 --- a/sig/orb/models/new_floating_matrix_with_allocation_price.rbs +++ b/sig/orb/models/new_floating_matrix_with_allocation_price.rbs @@ -121,15 +121,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingMatrixWithAllocationPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewFloatingMatrixWithAllocationPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_floating_matrix_with_display_name_price.rbs b/sig/orb/models/new_floating_matrix_with_display_name_price.rbs index 0190cd4d..6e125ae4 100644 --- a/sig/orb/models/new_floating_matrix_with_display_name_price.rbs +++ b/sig/orb/models/new_floating_matrix_with_display_name_price.rbs @@ -5,7 +5,7 @@ module Orb cadence: Orb::Models::NewFloatingMatrixWithDisplayNamePrice::cadence, currency: String, item_id: String, - matrix_with_display_name_config: ::Hash[Symbol, top], + matrix_with_display_name_config: Orb::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig, model_type: Orb::Models::NewFloatingMatrixWithDisplayNamePrice::model_type, name: String, billable_metric_id: String?, @@ -28,7 +28,7 @@ module Orb attr_accessor item_id: String - attr_accessor matrix_with_display_name_config: ::Hash[Symbol, top] + attr_accessor matrix_with_display_name_config: Orb::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig attr_accessor model_type: Orb::Models::NewFloatingMatrixWithDisplayNamePrice::model_type @@ -60,7 +60,7 @@ module Orb cadence: Orb::Models::NewFloatingMatrixWithDisplayNamePrice::cadence, currency: String, item_id: String, - matrix_with_display_name_config: ::Hash[Symbol, top], + matrix_with_display_name_config: Orb::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig, model_type: Orb::Models::NewFloatingMatrixWithDisplayNamePrice::model_type, name: String, ?billable_metric_id: String?, @@ -80,7 +80,7 @@ module Orb cadence: Orb::Models::NewFloatingMatrixWithDisplayNamePrice::cadence, currency: String, item_id: String, - matrix_with_display_name_config: ::Hash[Symbol, top], + matrix_with_display_name_config: Orb::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig, model_type: Orb::Models::NewFloatingMatrixWithDisplayNamePrice::model_type, name: String, billable_metric_id: String?, @@ -112,6 +112,51 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingMatrixWithDisplayNamePrice::cadence] end + type matrix_with_display_name_config = + { + dimension: String, + unit_amounts: ::Array[Orb::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount] + } + + class MatrixWithDisplayNameConfig < Orb::Internal::Type::BaseModel + attr_accessor dimension: String + + attr_accessor unit_amounts: ::Array[Orb::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount] + + def initialize: ( + dimension: String, + unit_amounts: ::Array[Orb::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount] + ) -> void + + def to_hash: -> { + dimension: String, + unit_amounts: ::Array[Orb::NewFloatingMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount] + } + + type unit_amount = + { dimension_value: String, display_name: String, unit_amount: String } + + class UnitAmount < Orb::Internal::Type::BaseModel + attr_accessor dimension_value: String + + attr_accessor display_name: String + + attr_accessor unit_amount: String + + def initialize: ( + dimension_value: String, + display_name: String, + unit_amount: String + ) -> void + + def to_hash: -> { + dimension_value: String, + display_name: String, + unit_amount: String + } + end + end + type model_type = :matrix_with_display_name module ModelType @@ -121,15 +166,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingMatrixWithDisplayNamePrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewFloatingMatrixWithDisplayNamePrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_floating_max_group_tiered_package_price.rbs b/sig/orb/models/new_floating_max_group_tiered_package_price.rbs index 23177add..df63d55a 100644 --- a/sig/orb/models/new_floating_max_group_tiered_package_price.rbs +++ b/sig/orb/models/new_floating_max_group_tiered_package_price.rbs @@ -5,7 +5,7 @@ module Orb cadence: Orb::Models::NewFloatingMaxGroupTieredPackagePrice::cadence, currency: String, item_id: String, - max_group_tiered_package_config: ::Hash[Symbol, top], + max_group_tiered_package_config: Orb::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig, model_type: Orb::Models::NewFloatingMaxGroupTieredPackagePrice::model_type, name: String, billable_metric_id: String?, @@ -28,7 +28,7 @@ module Orb attr_accessor item_id: String - attr_accessor max_group_tiered_package_config: ::Hash[Symbol, top] + attr_accessor max_group_tiered_package_config: Orb::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig attr_accessor model_type: Orb::Models::NewFloatingMaxGroupTieredPackagePrice::model_type @@ -60,7 +60,7 @@ module Orb cadence: Orb::Models::NewFloatingMaxGroupTieredPackagePrice::cadence, currency: String, item_id: String, - max_group_tiered_package_config: ::Hash[Symbol, top], + max_group_tiered_package_config: Orb::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig, model_type: Orb::Models::NewFloatingMaxGroupTieredPackagePrice::model_type, name: String, ?billable_metric_id: String?, @@ -80,7 +80,7 @@ module Orb cadence: Orb::Models::NewFloatingMaxGroupTieredPackagePrice::cadence, currency: String, item_id: String, - max_group_tiered_package_config: ::Hash[Symbol, top], + max_group_tiered_package_config: Orb::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig, model_type: Orb::Models::NewFloatingMaxGroupTieredPackagePrice::model_type, name: String, billable_metric_id: String?, @@ -112,6 +112,48 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingMaxGroupTieredPackagePrice::cadence] end + type max_group_tiered_package_config = + { + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier] + } + + class MaxGroupTieredPackageConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor package_size: String + + attr_accessor tiers: ::Array[Orb::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier] + + def initialize: ( + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier] + ) -> void + + def to_hash: -> { + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::NewFloatingMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { tier_lower_bound: String, unit_amount: String } + end + end + type model_type = :max_group_tiered_package module ModelType @@ -121,15 +163,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingMaxGroupTieredPackagePrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewFloatingMaxGroupTieredPackagePrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_floating_tiered_bps_price.rbs b/sig/orb/models/new_floating_minimum_composite_price.rbs similarity index 59% rename from sig/orb/models/new_floating_tiered_bps_price.rbs rename to sig/orb/models/new_floating_minimum_composite_price.rbs index a64b4f6b..d04467ad 100644 --- a/sig/orb/models/new_floating_tiered_bps_price.rbs +++ b/sig/orb/models/new_floating_minimum_composite_price.rbs @@ -1,18 +1,18 @@ module Orb module Models - type new_floating_tiered_bps_price = + type new_floating_minimum_composite_price = { - cadence: Orb::Models::NewFloatingTieredBPSPrice::cadence, + cadence: Orb::Models::NewFloatingMinimumCompositePrice::cadence, currency: String, item_id: String, - model_type: Orb::Models::NewFloatingTieredBPSPrice::model_type, + minimum_config: Orb::NewFloatingMinimumCompositePrice::MinimumConfig, + model_type: Orb::Models::NewFloatingMinimumCompositePrice::model_type, name: String, - tiered_bps_config: Orb::TieredBPSConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewFloatingTieredBPSPrice::conversion_rate_config?, + conversion_rate_config: Orb::Models::NewFloatingMinimumCompositePrice::conversion_rate_config?, dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, external_price_id: String?, fixed_price_quantity: Float?, @@ -21,18 +21,18 @@ module Orb metadata: ::Hash[Symbol, String?]? } - class NewFloatingTieredBPSPrice < Orb::Internal::Type::BaseModel - attr_accessor cadence: Orb::Models::NewFloatingTieredBPSPrice::cadence + class NewFloatingMinimumCompositePrice < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::NewFloatingMinimumCompositePrice::cadence attr_accessor currency: String attr_accessor item_id: String - attr_accessor model_type: Orb::Models::NewFloatingTieredBPSPrice::model_type + attr_accessor minimum_config: Orb::NewFloatingMinimumCompositePrice::MinimumConfig - attr_accessor name: String + attr_accessor model_type: Orb::Models::NewFloatingMinimumCompositePrice::model_type - attr_accessor tiered_bps_config: Orb::TieredBPSConfig + attr_accessor name: String attr_accessor billable_metric_id: String? @@ -42,7 +42,7 @@ module Orb attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::NewFloatingTieredBPSPrice::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::NewFloatingMinimumCompositePrice::conversion_rate_config? attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? @@ -57,17 +57,17 @@ module Orb attr_accessor metadata: ::Hash[Symbol, String?]? def initialize: ( - cadence: Orb::Models::NewFloatingTieredBPSPrice::cadence, + cadence: Orb::Models::NewFloatingMinimumCompositePrice::cadence, currency: String, item_id: String, - model_type: Orb::Models::NewFloatingTieredBPSPrice::model_type, + minimum_config: Orb::NewFloatingMinimumCompositePrice::MinimumConfig, + model_type: Orb::Models::NewFloatingMinimumCompositePrice::model_type, name: String, - tiered_bps_config: Orb::TieredBPSConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, ?conversion_rate: Float?, - ?conversion_rate_config: Orb::Models::NewFloatingTieredBPSPrice::conversion_rate_config?, + ?conversion_rate_config: Orb::Models::NewFloatingMinimumCompositePrice::conversion_rate_config?, ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, ?external_price_id: String?, ?fixed_price_quantity: Float?, @@ -77,17 +77,17 @@ module Orb ) -> void def to_hash: -> { - cadence: Orb::Models::NewFloatingTieredBPSPrice::cadence, + cadence: Orb::Models::NewFloatingMinimumCompositePrice::cadence, currency: String, item_id: String, - model_type: Orb::Models::NewFloatingTieredBPSPrice::model_type, + minimum_config: Orb::NewFloatingMinimumCompositePrice::MinimumConfig, + model_type: Orb::Models::NewFloatingMinimumCompositePrice::model_type, name: String, - tiered_bps_config: Orb::TieredBPSConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewFloatingTieredBPSPrice::conversion_rate_config?, + conversion_rate_config: Orb::Models::NewFloatingMinimumCompositePrice::conversion_rate_config?, dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, external_price_id: String?, fixed_price_quantity: Float?, @@ -109,26 +109,31 @@ module Orb ONE_TIME: :one_time CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::NewFloatingTieredBPSPrice::cadence] + def self?.values: -> ::Array[Orb::Models::NewFloatingMinimumCompositePrice::cadence] end - type model_type = :tiered_bps + type minimum_config = { minimum_amount: String, prorated: bool } - module ModelType - extend Orb::Internal::Type::Enum + class MinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor minimum_amount: String + + attr_reader prorated: bool? - TIERED_BPS: :tiered_bps + def prorated=: (bool) -> bool - def self?.values: -> ::Array[Orb::Models::NewFloatingTieredBPSPrice::model_type] + def initialize: (minimum_amount: String, ?prorated: bool) -> void + + def to_hash: -> { minimum_amount: String, prorated: bool } end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type model_type = :minimum + + module ModelType + extend Orb::Internal::Type::Enum - module ConversionRateConfig - extend Orb::Internal::Type::Union + MINIMUM: :minimum - def self?.variants: -> ::Array[Orb::Models::NewFloatingTieredBPSPrice::conversion_rate_config] + def self?.values: -> ::Array[Orb::Models::NewFloatingMinimumCompositePrice::model_type] end end end diff --git a/sig/orb/models/new_floating_package_price.rbs b/sig/orb/models/new_floating_package_price.rbs index d3bb7235..689344db 100644 --- a/sig/orb/models/new_floating_package_price.rbs +++ b/sig/orb/models/new_floating_package_price.rbs @@ -121,15 +121,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingPackagePrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewFloatingPackagePrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_floating_package_with_allocation_price.rbs b/sig/orb/models/new_floating_package_with_allocation_price.rbs index 9e2da1e9..38e9e79c 100644 --- a/sig/orb/models/new_floating_package_with_allocation_price.rbs +++ b/sig/orb/models/new_floating_package_with_allocation_price.rbs @@ -7,7 +7,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingPackageWithAllocationPrice::model_type, name: String, - package_with_allocation_config: ::Hash[Symbol, top], + package_with_allocation_config: Orb::NewFloatingPackageWithAllocationPrice::PackageWithAllocationConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -32,7 +32,7 @@ module Orb attr_accessor name: String - attr_accessor package_with_allocation_config: ::Hash[Symbol, top] + attr_accessor package_with_allocation_config: Orb::NewFloatingPackageWithAllocationPrice::PackageWithAllocationConfig attr_accessor billable_metric_id: String? @@ -62,7 +62,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingPackageWithAllocationPrice::model_type, name: String, - package_with_allocation_config: ::Hash[Symbol, top], + package_with_allocation_config: Orb::NewFloatingPackageWithAllocationPrice::PackageWithAllocationConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -82,7 +82,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingPackageWithAllocationPrice::model_type, name: String, - package_with_allocation_config: ::Hash[Symbol, top], + package_with_allocation_config: Orb::NewFloatingPackageWithAllocationPrice::PackageWithAllocationConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -122,13 +122,27 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingPackageWithAllocationPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type package_with_allocation_config = + { allocation: String, package_amount: String, package_size: String } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class PackageWithAllocationConfig < Orb::Internal::Type::BaseModel + attr_accessor allocation: String - def self?.variants: -> ::Array[Orb::Models::NewFloatingPackageWithAllocationPrice::conversion_rate_config] + attr_accessor package_amount: String + + attr_accessor package_size: String + + def initialize: ( + allocation: String, + package_amount: String, + package_size: String + ) -> void + + def to_hash: -> { + allocation: String, + package_amount: String, + package_size: String + } end end end diff --git a/sig/orb/models/new_floating_scalable_matrix_with_tiered_pricing_price.rbs b/sig/orb/models/new_floating_scalable_matrix_with_tiered_pricing_price.rbs index 02c38bcb..742e1185 100644 --- a/sig/orb/models/new_floating_scalable_matrix_with_tiered_pricing_price.rbs +++ b/sig/orb/models/new_floating_scalable_matrix_with_tiered_pricing_price.rbs @@ -7,7 +7,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice::model_type, name: String, - scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_tiered_pricing_config: Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -32,7 +32,7 @@ module Orb attr_accessor name: String - attr_accessor scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top] + attr_accessor scalable_matrix_with_tiered_pricing_config: Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig attr_accessor billable_metric_id: String? @@ -62,7 +62,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice::model_type, name: String, - scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_tiered_pricing_config: Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -82,7 +82,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice::model_type, name: String, - scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_tiered_pricing_config: Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -122,13 +122,78 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type scalable_matrix_with_tiered_pricing_config = + { + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor], + tiers: ::Array[Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier], + second_dimension: String? + } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class ScalableMatrixWithTieredPricingConfig < Orb::Internal::Type::BaseModel + attr_accessor first_dimension: String - def self?.variants: -> ::Array[Orb::Models::NewFloatingScalableMatrixWithTieredPricingPrice::conversion_rate_config] + attr_accessor matrix_scaling_factors: ::Array[Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor] + + attr_accessor tiers: ::Array[Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier] + + attr_accessor second_dimension: String? + + def initialize: ( + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor], + tiers: ::Array[Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier], + ?second_dimension: String? + ) -> void + + def to_hash: -> { + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor], + tiers: ::Array[Orb::NewFloatingScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier], + second_dimension: String? + } + + type matrix_scaling_factor = + { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: String? + } + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + attr_accessor first_dimension_value: String + + attr_accessor scaling_factor: String + + attr_accessor second_dimension_value: String? + + def initialize: ( + first_dimension_value: String, + scaling_factor: String, + ?second_dimension_value: String? + ) -> void + + def to_hash: -> { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: String? + } + end + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { tier_lower_bound: String, unit_amount: String } + end end end end diff --git a/sig/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rbs b/sig/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rbs index f931afae..b5a7e0e7 100644 --- a/sig/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rbs +++ b/sig/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rbs @@ -7,7 +7,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice::model_type, name: String, - scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_unit_pricing_config: Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -32,7 +32,7 @@ module Orb attr_accessor name: String - attr_accessor scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top] + attr_accessor scalable_matrix_with_unit_pricing_config: Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig attr_accessor billable_metric_id: String? @@ -62,7 +62,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice::model_type, name: String, - scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_unit_pricing_config: Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -82,7 +82,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice::model_type, name: String, - scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_unit_pricing_config: Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -122,13 +122,68 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewFloatingScalableMatrixWithUnitPricingPrice::conversion_rate_config] + type scalable_matrix_with_unit_pricing_config = + { + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor], + unit_price: String, + prorate: bool?, + second_dimension: String? + } + + class ScalableMatrixWithUnitPricingConfig < Orb::Internal::Type::BaseModel + attr_accessor first_dimension: String + + attr_accessor matrix_scaling_factors: ::Array[Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor] + + attr_accessor unit_price: String + + attr_accessor prorate: bool? + + attr_accessor second_dimension: String? + + def initialize: ( + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor], + unit_price: String, + ?prorate: bool?, + ?second_dimension: String? + ) -> void + + def to_hash: -> { + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::NewFloatingScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor], + unit_price: String, + prorate: bool?, + second_dimension: String? + } + + type matrix_scaling_factor = + { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: String? + } + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + attr_accessor first_dimension_value: String + + attr_accessor scaling_factor: String + + attr_accessor second_dimension_value: String? + + def initialize: ( + first_dimension_value: String, + scaling_factor: String, + ?second_dimension_value: String? + ) -> void + + def to_hash: -> { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: String? + } + end end end end diff --git a/sig/orb/models/new_floating_threshold_total_amount_price.rbs b/sig/orb/models/new_floating_threshold_total_amount_price.rbs index bf2c848f..ba2994eb 100644 --- a/sig/orb/models/new_floating_threshold_total_amount_price.rbs +++ b/sig/orb/models/new_floating_threshold_total_amount_price.rbs @@ -7,7 +7,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingThresholdTotalAmountPrice::model_type, name: String, - threshold_total_amount_config: ::Hash[Symbol, top], + threshold_total_amount_config: Orb::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -32,7 +32,7 @@ module Orb attr_accessor name: String - attr_accessor threshold_total_amount_config: ::Hash[Symbol, top] + attr_accessor threshold_total_amount_config: Orb::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig attr_accessor billable_metric_id: String? @@ -62,7 +62,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingThresholdTotalAmountPrice::model_type, name: String, - threshold_total_amount_config: ::Hash[Symbol, top], + threshold_total_amount_config: Orb::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -82,7 +82,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingThresholdTotalAmountPrice::model_type, name: String, - threshold_total_amount_config: ::Hash[Symbol, top], + threshold_total_amount_config: Orb::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -122,13 +122,38 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingThresholdTotalAmountPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type threshold_total_amount_config = + { + consumption_table: ::Array[Orb::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable], + prorate: bool? + } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class ThresholdTotalAmountConfig < Orb::Internal::Type::BaseModel + attr_accessor consumption_table: ::Array[Orb::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable] - def self?.variants: -> ::Array[Orb::Models::NewFloatingThresholdTotalAmountPrice::conversion_rate_config] + attr_accessor prorate: bool? + + def initialize: ( + consumption_table: ::Array[Orb::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable], + ?prorate: bool? + ) -> void + + def to_hash: -> { + consumption_table: ::Array[Orb::NewFloatingThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable], + prorate: bool? + } + + type consumption_table = { threshold: String, total_amount: String } + + class ConsumptionTable < Orb::Internal::Type::BaseModel + attr_accessor threshold: String + + attr_accessor total_amount: String + + def initialize: (threshold: String, total_amount: String) -> void + + def to_hash: -> { threshold: String, total_amount: String } + end end end end diff --git a/sig/orb/models/new_floating_tiered_package_price.rbs b/sig/orb/models/new_floating_tiered_package_price.rbs index 289ce9d7..be2fe79f 100644 --- a/sig/orb/models/new_floating_tiered_package_price.rbs +++ b/sig/orb/models/new_floating_tiered_package_price.rbs @@ -7,7 +7,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingTieredPackagePrice::model_type, name: String, - tiered_package_config: ::Hash[Symbol, top], + tiered_package_config: Orb::NewFloatingTieredPackagePrice::TieredPackageConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -32,7 +32,7 @@ module Orb attr_accessor name: String - attr_accessor tiered_package_config: ::Hash[Symbol, top] + attr_accessor tiered_package_config: Orb::NewFloatingTieredPackagePrice::TieredPackageConfig attr_accessor billable_metric_id: String? @@ -62,7 +62,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingTieredPackagePrice::model_type, name: String, - tiered_package_config: ::Hash[Symbol, top], + tiered_package_config: Orb::NewFloatingTieredPackagePrice::TieredPackageConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -82,7 +82,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingTieredPackagePrice::model_type, name: String, - tiered_package_config: ::Hash[Symbol, top], + tiered_package_config: Orb::NewFloatingTieredPackagePrice::TieredPackageConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -122,13 +122,38 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingTieredPackagePrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type tiered_package_config = + { + package_size: String, + tiers: ::Array[Orb::NewFloatingTieredPackagePrice::TieredPackageConfig::Tier] + } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class TieredPackageConfig < Orb::Internal::Type::BaseModel + attr_accessor package_size: String - def self?.variants: -> ::Array[Orb::Models::NewFloatingTieredPackagePrice::conversion_rate_config] + attr_accessor tiers: ::Array[Orb::NewFloatingTieredPackagePrice::TieredPackageConfig::Tier] + + def initialize: ( + package_size: String, + tiers: ::Array[Orb::NewFloatingTieredPackagePrice::TieredPackageConfig::Tier] + ) -> void + + def to_hash: -> { + package_size: String, + tiers: ::Array[Orb::NewFloatingTieredPackagePrice::TieredPackageConfig::Tier] + } + + type tier = { per_unit: String, tier_lower_bound: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor per_unit: String + + attr_accessor tier_lower_bound: String + + def initialize: (per_unit: String, tier_lower_bound: String) -> void + + def to_hash: -> { per_unit: String, tier_lower_bound: String } + end end end end diff --git a/sig/orb/models/new_floating_tiered_package_with_minimum_price.rbs b/sig/orb/models/new_floating_tiered_package_with_minimum_price.rbs index b598308e..bd2f1d9e 100644 --- a/sig/orb/models/new_floating_tiered_package_with_minimum_price.rbs +++ b/sig/orb/models/new_floating_tiered_package_with_minimum_price.rbs @@ -7,7 +7,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingTieredPackageWithMinimumPrice::model_type, name: String, - tiered_package_with_minimum_config: ::Hash[Symbol, top], + tiered_package_with_minimum_config: Orb::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -32,7 +32,7 @@ module Orb attr_accessor name: String - attr_accessor tiered_package_with_minimum_config: ::Hash[Symbol, top] + attr_accessor tiered_package_with_minimum_config: Orb::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig attr_accessor billable_metric_id: String? @@ -62,7 +62,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingTieredPackageWithMinimumPrice::model_type, name: String, - tiered_package_with_minimum_config: ::Hash[Symbol, top], + tiered_package_with_minimum_config: Orb::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -82,7 +82,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingTieredPackageWithMinimumPrice::model_type, name: String, - tiered_package_with_minimum_config: ::Hash[Symbol, top], + tiered_package_with_minimum_config: Orb::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -122,13 +122,49 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingTieredPackageWithMinimumPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type tiered_package_with_minimum_config = + { + package_size: Float, + tiers: ::Array[Orb::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier] + } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class TieredPackageWithMinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor package_size: Float - def self?.variants: -> ::Array[Orb::Models::NewFloatingTieredPackageWithMinimumPrice::conversion_rate_config] + attr_accessor tiers: ::Array[Orb::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier] + + def initialize: ( + package_size: Float, + tiers: ::Array[Orb::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier] + ) -> void + + def to_hash: -> { + package_size: Float, + tiers: ::Array[Orb::NewFloatingTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier] + } + + type tier = + { minimum_amount: String, per_unit: String, tier_lower_bound: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor minimum_amount: String + + attr_accessor per_unit: String + + attr_accessor tier_lower_bound: String + + def initialize: ( + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + ) -> void + + def to_hash: -> { + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + } + end end end end diff --git a/sig/orb/models/new_floating_tiered_price.rbs b/sig/orb/models/new_floating_tiered_price.rbs index acd5a852..4eb29ae3 100644 --- a/sig/orb/models/new_floating_tiered_price.rbs +++ b/sig/orb/models/new_floating_tiered_price.rbs @@ -121,15 +121,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingTieredPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewFloatingTieredPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_floating_tiered_with_minimum_price.rbs b/sig/orb/models/new_floating_tiered_with_minimum_price.rbs index c48c399e..5762b023 100644 --- a/sig/orb/models/new_floating_tiered_with_minimum_price.rbs +++ b/sig/orb/models/new_floating_tiered_with_minimum_price.rbs @@ -7,7 +7,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingTieredWithMinimumPrice::model_type, name: String, - tiered_with_minimum_config: ::Hash[Symbol, top], + tiered_with_minimum_config: Orb::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -32,7 +32,7 @@ module Orb attr_accessor name: String - attr_accessor tiered_with_minimum_config: ::Hash[Symbol, top] + attr_accessor tiered_with_minimum_config: Orb::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig attr_accessor billable_metric_id: String? @@ -62,7 +62,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingTieredWithMinimumPrice::model_type, name: String, - tiered_with_minimum_config: ::Hash[Symbol, top], + tiered_with_minimum_config: Orb::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -82,7 +82,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingTieredWithMinimumPrice::model_type, name: String, - tiered_with_minimum_config: ::Hash[Symbol, top], + tiered_with_minimum_config: Orb::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -122,13 +122,62 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingTieredWithMinimumPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type tiered_with_minimum_config = + { + tiers: ::Array[Orb::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig::Tier], + hide_zero_amount_tiers: bool, + prorate: bool + } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class TieredWithMinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig::Tier] - def self?.variants: -> ::Array[Orb::Models::NewFloatingTieredWithMinimumPrice::conversion_rate_config] + attr_reader hide_zero_amount_tiers: bool? + + def hide_zero_amount_tiers=: (bool) -> bool + + attr_reader prorate: bool? + + def prorate=: (bool) -> bool + + def initialize: ( + tiers: ::Array[Orb::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig::Tier], + ?hide_zero_amount_tiers: bool, + ?prorate: bool + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::NewFloatingTieredWithMinimumPrice::TieredWithMinimumConfig::Tier], + hide_zero_amount_tiers: bool, + prorate: bool + } + + type tier = + { + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor minimum_amount: String + + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + } + end end end end diff --git a/sig/orb/models/new_floating_tiered_with_proration_price.rbs b/sig/orb/models/new_floating_tiered_with_proration_price.rbs index 44a82463..358ae429 100644 --- a/sig/orb/models/new_floating_tiered_with_proration_price.rbs +++ b/sig/orb/models/new_floating_tiered_with_proration_price.rbs @@ -7,7 +7,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingTieredWithProrationPrice::model_type, name: String, - tiered_with_proration_config: ::Hash[Symbol, top], + tiered_with_proration_config: Orb::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -32,7 +32,7 @@ module Orb attr_accessor name: String - attr_accessor tiered_with_proration_config: ::Hash[Symbol, top] + attr_accessor tiered_with_proration_config: Orb::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig attr_accessor billable_metric_id: String? @@ -62,7 +62,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingTieredWithProrationPrice::model_type, name: String, - tiered_with_proration_config: ::Hash[Symbol, top], + tiered_with_proration_config: Orb::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -82,7 +82,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingTieredWithProrationPrice::model_type, name: String, - tiered_with_proration_config: ::Hash[Symbol, top], + tiered_with_proration_config: Orb::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -122,13 +122,36 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingTieredWithProrationPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type tiered_with_proration_config = + { + tiers: ::Array[Orb::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig::Tier] + } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig::Tier] - def self?.variants: -> ::Array[Orb::Models::NewFloatingTieredWithProrationPrice::conversion_rate_config] + def initialize: ( + tiers: ::Array[Orb::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig::Tier] + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::NewFloatingTieredWithProrationPrice::TieredWithProrationConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { tier_lower_bound: String, unit_amount: String } + end end end end diff --git a/sig/orb/models/new_floating_unit_price.rbs b/sig/orb/models/new_floating_unit_price.rbs index 45df1655..89b173d3 100644 --- a/sig/orb/models/new_floating_unit_price.rbs +++ b/sig/orb/models/new_floating_unit_price.rbs @@ -121,15 +121,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingUnitPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewFloatingUnitPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_floating_unit_with_percent_price.rbs b/sig/orb/models/new_floating_unit_with_percent_price.rbs index 829a465a..3bec0ecf 100644 --- a/sig/orb/models/new_floating_unit_with_percent_price.rbs +++ b/sig/orb/models/new_floating_unit_with_percent_price.rbs @@ -7,7 +7,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingUnitWithPercentPrice::model_type, name: String, - unit_with_percent_config: ::Hash[Symbol, top], + unit_with_percent_config: Orb::NewFloatingUnitWithPercentPrice::UnitWithPercentConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -32,7 +32,7 @@ module Orb attr_accessor name: String - attr_accessor unit_with_percent_config: ::Hash[Symbol, top] + attr_accessor unit_with_percent_config: Orb::NewFloatingUnitWithPercentPrice::UnitWithPercentConfig attr_accessor billable_metric_id: String? @@ -62,7 +62,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingUnitWithPercentPrice::model_type, name: String, - unit_with_percent_config: ::Hash[Symbol, top], + unit_with_percent_config: Orb::NewFloatingUnitWithPercentPrice::UnitWithPercentConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -82,7 +82,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingUnitWithPercentPrice::model_type, name: String, - unit_with_percent_config: ::Hash[Symbol, top], + unit_with_percent_config: Orb::NewFloatingUnitWithPercentPrice::UnitWithPercentConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -122,13 +122,16 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingUnitWithPercentPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type unit_with_percent_config = { percent: String, unit_amount: String } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class UnitWithPercentConfig < Orb::Internal::Type::BaseModel + attr_accessor percent: String - def self?.variants: -> ::Array[Orb::Models::NewFloatingUnitWithPercentPrice::conversion_rate_config] + attr_accessor unit_amount: String + + def initialize: (percent: String, unit_amount: String) -> void + + def to_hash: -> { percent: String, unit_amount: String } end end end diff --git a/sig/orb/models/new_floating_unit_with_proration_price.rbs b/sig/orb/models/new_floating_unit_with_proration_price.rbs index e4e332c7..cca9ed37 100644 --- a/sig/orb/models/new_floating_unit_with_proration_price.rbs +++ b/sig/orb/models/new_floating_unit_with_proration_price.rbs @@ -7,7 +7,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingUnitWithProrationPrice::model_type, name: String, - unit_with_proration_config: ::Hash[Symbol, top], + unit_with_proration_config: Orb::NewFloatingUnitWithProrationPrice::UnitWithProrationConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -32,7 +32,7 @@ module Orb attr_accessor name: String - attr_accessor unit_with_proration_config: ::Hash[Symbol, top] + attr_accessor unit_with_proration_config: Orb::NewFloatingUnitWithProrationPrice::UnitWithProrationConfig attr_accessor billable_metric_id: String? @@ -62,7 +62,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingUnitWithProrationPrice::model_type, name: String, - unit_with_proration_config: ::Hash[Symbol, top], + unit_with_proration_config: Orb::NewFloatingUnitWithProrationPrice::UnitWithProrationConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -82,7 +82,7 @@ module Orb item_id: String, model_type: Orb::Models::NewFloatingUnitWithProrationPrice::model_type, name: String, - unit_with_proration_config: ::Hash[Symbol, top], + unit_with_proration_config: Orb::NewFloatingUnitWithProrationPrice::UnitWithProrationConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -122,13 +122,14 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewFloatingUnitWithProrationPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type unit_with_proration_config = { unit_amount: String } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class UnitWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor unit_amount: String - def self?.variants: -> ::Array[Orb::Models::NewFloatingUnitWithProrationPrice::conversion_rate_config] + def initialize: (unit_amount: String) -> void + + def to_hash: -> { unit_amount: String } end end end diff --git a/sig/orb/models/new_plan_bps_price.rbs b/sig/orb/models/new_plan_bps_price.rbs deleted file mode 100644 index 6e03b519..00000000 --- a/sig/orb/models/new_plan_bps_price.rbs +++ /dev/null @@ -1,140 +0,0 @@ -module Orb - module Models - type new_plan_bps_price = - { - bps_config: Orb::BPSConfig, - cadence: Orb::Models::NewPlanBPSPrice::cadence, - item_id: String, - model_type: Orb::Models::NewPlanBPSPrice::model_type, - name: String, - billable_metric_id: String?, - billed_in_advance: bool?, - billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewPlanBPSPrice::conversion_rate_config?, - currency: String?, - dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoice_grouping_key: String?, - invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - metadata: ::Hash[Symbol, String?]?, - reference_id: String? - } - - class NewPlanBPSPrice < Orb::Internal::Type::BaseModel - attr_accessor bps_config: Orb::BPSConfig - - attr_accessor cadence: Orb::Models::NewPlanBPSPrice::cadence - - attr_accessor item_id: String - - attr_accessor model_type: Orb::Models::NewPlanBPSPrice::model_type - - attr_accessor name: String - - attr_accessor billable_metric_id: String? - - attr_accessor billed_in_advance: bool? - - attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? - - attr_accessor conversion_rate: Float? - - attr_accessor conversion_rate_config: Orb::Models::NewPlanBPSPrice::conversion_rate_config? - - attr_accessor currency: String? - - attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? - - attr_accessor external_price_id: String? - - attr_accessor fixed_price_quantity: Float? - - attr_accessor invoice_grouping_key: String? - - attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? - - attr_accessor metadata: ::Hash[Symbol, String?]? - - attr_accessor reference_id: String? - - def initialize: ( - bps_config: Orb::BPSConfig, - cadence: Orb::Models::NewPlanBPSPrice::cadence, - item_id: String, - model_type: Orb::Models::NewPlanBPSPrice::model_type, - name: String, - ?billable_metric_id: String?, - ?billed_in_advance: bool?, - ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - ?conversion_rate: Float?, - ?conversion_rate_config: Orb::Models::NewPlanBPSPrice::conversion_rate_config?, - ?currency: String?, - ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - ?external_price_id: String?, - ?fixed_price_quantity: Float?, - ?invoice_grouping_key: String?, - ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - ?metadata: ::Hash[Symbol, String?]?, - ?reference_id: String? - ) -> void - - def to_hash: -> { - bps_config: Orb::BPSConfig, - cadence: Orb::Models::NewPlanBPSPrice::cadence, - item_id: String, - model_type: Orb::Models::NewPlanBPSPrice::model_type, - name: String, - billable_metric_id: String?, - billed_in_advance: bool?, - billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewPlanBPSPrice::conversion_rate_config?, - currency: String?, - dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoice_grouping_key: String?, - invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - metadata: ::Hash[Symbol, String?]?, - reference_id: String? - } - - type cadence = - :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom - - module Cadence - extend Orb::Internal::Type::Enum - - ANNUAL: :annual - SEMI_ANNUAL: :semi_annual - MONTHLY: :monthly - QUARTERLY: :quarterly - ONE_TIME: :one_time - CUSTOM: :custom - - def self?.values: -> ::Array[Orb::Models::NewPlanBPSPrice::cadence] - end - - type model_type = :bps - - module ModelType - extend Orb::Internal::Type::Enum - - BPS: :bps - - def self?.values: -> ::Array[Orb::Models::NewPlanBPSPrice::model_type] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewPlanBPSPrice::conversion_rate_config] - end - end - end -end diff --git a/sig/orb/models/new_plan_bulk_bps_price.rbs b/sig/orb/models/new_plan_bulk_bps_price.rbs deleted file mode 100644 index 7a2b6ecb..00000000 --- a/sig/orb/models/new_plan_bulk_bps_price.rbs +++ /dev/null @@ -1,140 +0,0 @@ -module Orb - module Models - type new_plan_bulk_bps_price = - { - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::Models::NewPlanBulkBPSPrice::cadence, - item_id: String, - model_type: Orb::Models::NewPlanBulkBPSPrice::model_type, - name: String, - billable_metric_id: String?, - billed_in_advance: bool?, - billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewPlanBulkBPSPrice::conversion_rate_config?, - currency: String?, - dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoice_grouping_key: String?, - invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - metadata: ::Hash[Symbol, String?]?, - reference_id: String? - } - - class NewPlanBulkBPSPrice < Orb::Internal::Type::BaseModel - attr_accessor bulk_bps_config: Orb::BulkBPSConfig - - attr_accessor cadence: Orb::Models::NewPlanBulkBPSPrice::cadence - - attr_accessor item_id: String - - attr_accessor model_type: Orb::Models::NewPlanBulkBPSPrice::model_type - - attr_accessor name: String - - attr_accessor billable_metric_id: String? - - attr_accessor billed_in_advance: bool? - - attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? - - attr_accessor conversion_rate: Float? - - attr_accessor conversion_rate_config: Orb::Models::NewPlanBulkBPSPrice::conversion_rate_config? - - attr_accessor currency: String? - - attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? - - attr_accessor external_price_id: String? - - attr_accessor fixed_price_quantity: Float? - - attr_accessor invoice_grouping_key: String? - - attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? - - attr_accessor metadata: ::Hash[Symbol, String?]? - - attr_accessor reference_id: String? - - def initialize: ( - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::Models::NewPlanBulkBPSPrice::cadence, - item_id: String, - model_type: Orb::Models::NewPlanBulkBPSPrice::model_type, - name: String, - ?billable_metric_id: String?, - ?billed_in_advance: bool?, - ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - ?conversion_rate: Float?, - ?conversion_rate_config: Orb::Models::NewPlanBulkBPSPrice::conversion_rate_config?, - ?currency: String?, - ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - ?external_price_id: String?, - ?fixed_price_quantity: Float?, - ?invoice_grouping_key: String?, - ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - ?metadata: ::Hash[Symbol, String?]?, - ?reference_id: String? - ) -> void - - def to_hash: -> { - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::Models::NewPlanBulkBPSPrice::cadence, - item_id: String, - model_type: Orb::Models::NewPlanBulkBPSPrice::model_type, - name: String, - billable_metric_id: String?, - billed_in_advance: bool?, - billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewPlanBulkBPSPrice::conversion_rate_config?, - currency: String?, - dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoice_grouping_key: String?, - invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - metadata: ::Hash[Symbol, String?]?, - reference_id: String? - } - - type cadence = - :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom - - module Cadence - extend Orb::Internal::Type::Enum - - ANNUAL: :annual - SEMI_ANNUAL: :semi_annual - MONTHLY: :monthly - QUARTERLY: :quarterly - ONE_TIME: :one_time - CUSTOM: :custom - - def self?.values: -> ::Array[Orb::Models::NewPlanBulkBPSPrice::cadence] - end - - type model_type = :bulk_bps - - module ModelType - extend Orb::Internal::Type::Enum - - BULK_BPS: :bulk_bps - - def self?.values: -> ::Array[Orb::Models::NewPlanBulkBPSPrice::model_type] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewPlanBulkBPSPrice::conversion_rate_config] - end - end - end -end diff --git a/sig/orb/models/new_plan_bulk_price.rbs b/sig/orb/models/new_plan_bulk_price.rbs index ecd688b2..2d5ffc3e 100644 --- a/sig/orb/models/new_plan_bulk_price.rbs +++ b/sig/orb/models/new_plan_bulk_price.rbs @@ -126,15 +126,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanBulkPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewPlanBulkPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_plan_bulk_with_proration_price.rbs b/sig/orb/models/new_plan_bulk_with_proration_price.rbs index 3077e93b..3526f1d6 100644 --- a/sig/orb/models/new_plan_bulk_with_proration_price.rbs +++ b/sig/orb/models/new_plan_bulk_with_proration_price.rbs @@ -2,7 +2,7 @@ module Orb module Models type new_plan_bulk_with_proration_price = { - bulk_with_proration_config: ::Hash[Symbol, top], + bulk_with_proration_config: Orb::NewPlanBulkWithProrationPrice::BulkWithProrationConfig, cadence: Orb::Models::NewPlanBulkWithProrationPrice::cadence, item_id: String, model_type: Orb::Models::NewPlanBulkWithProrationPrice::model_type, @@ -23,7 +23,7 @@ module Orb } class NewPlanBulkWithProrationPrice < Orb::Internal::Type::BaseModel - attr_accessor bulk_with_proration_config: ::Hash[Symbol, top] + attr_accessor bulk_with_proration_config: Orb::NewPlanBulkWithProrationPrice::BulkWithProrationConfig attr_accessor cadence: Orb::Models::NewPlanBulkWithProrationPrice::cadence @@ -60,7 +60,7 @@ module Orb attr_accessor reference_id: String? def initialize: ( - bulk_with_proration_config: ::Hash[Symbol, top], + bulk_with_proration_config: Orb::NewPlanBulkWithProrationPrice::BulkWithProrationConfig, cadence: Orb::Models::NewPlanBulkWithProrationPrice::cadence, item_id: String, model_type: Orb::Models::NewPlanBulkWithProrationPrice::model_type, @@ -81,7 +81,7 @@ module Orb ) -> void def to_hash: -> { - bulk_with_proration_config: ::Hash[Symbol, top], + bulk_with_proration_config: Orb::NewPlanBulkWithProrationPrice::BulkWithProrationConfig, cadence: Orb::Models::NewPlanBulkWithProrationPrice::cadence, item_id: String, model_type: Orb::Models::NewPlanBulkWithProrationPrice::model_type, @@ -101,6 +101,38 @@ module Orb reference_id: String? } + type bulk_with_proration_config = + { + tiers: ::Array[Orb::NewPlanBulkWithProrationPrice::BulkWithProrationConfig::Tier] + } + + class BulkWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::NewPlanBulkWithProrationPrice::BulkWithProrationConfig::Tier] + + def initialize: ( + tiers: ::Array[Orb::NewPlanBulkWithProrationPrice::BulkWithProrationConfig::Tier] + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::NewPlanBulkWithProrationPrice::BulkWithProrationConfig::Tier] + } + + type tier = { unit_amount: String, tier_lower_bound: String? } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor unit_amount: String + + attr_accessor tier_lower_bound: String? + + def initialize: ( + unit_amount: String, + ?tier_lower_bound: String? + ) -> void + + def to_hash: -> { unit_amount: String, tier_lower_bound: String? } + end + end + type cadence = :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom @@ -126,15 +158,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanBulkWithProrationPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewPlanBulkWithProrationPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_plan_cumulative_grouped_bulk_price.rbs b/sig/orb/models/new_plan_cumulative_grouped_bulk_price.rbs index 2b57bb19..0d6d5295 100644 --- a/sig/orb/models/new_plan_cumulative_grouped_bulk_price.rbs +++ b/sig/orb/models/new_plan_cumulative_grouped_bulk_price.rbs @@ -3,7 +3,7 @@ module Orb type new_plan_cumulative_grouped_bulk_price = { cadence: Orb::Models::NewPlanCumulativeGroupedBulkPrice::cadence, - cumulative_grouped_bulk_config: ::Hash[Symbol, top], + cumulative_grouped_bulk_config: Orb::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig, item_id: String, model_type: Orb::Models::NewPlanCumulativeGroupedBulkPrice::model_type, name: String, @@ -25,7 +25,7 @@ module Orb class NewPlanCumulativeGroupedBulkPrice < Orb::Internal::Type::BaseModel attr_accessor cadence: Orb::Models::NewPlanCumulativeGroupedBulkPrice::cadence - attr_accessor cumulative_grouped_bulk_config: ::Hash[Symbol, top] + attr_accessor cumulative_grouped_bulk_config: Orb::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig attr_accessor item_id: String @@ -61,7 +61,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewPlanCumulativeGroupedBulkPrice::cadence, - cumulative_grouped_bulk_config: ::Hash[Symbol, top], + cumulative_grouped_bulk_config: Orb::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig, item_id: String, model_type: Orb::Models::NewPlanCumulativeGroupedBulkPrice::model_type, name: String, @@ -82,7 +82,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewPlanCumulativeGroupedBulkPrice::cadence, - cumulative_grouped_bulk_config: ::Hash[Symbol, top], + cumulative_grouped_bulk_config: Orb::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig, item_id: String, model_type: Orb::Models::NewPlanCumulativeGroupedBulkPrice::model_type, name: String, @@ -117,6 +117,55 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanCumulativeGroupedBulkPrice::cadence] end + type cumulative_grouped_bulk_config = + { + dimension_values: ::Array[Orb::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue], + group: String + } + + class CumulativeGroupedBulkConfig < Orb::Internal::Type::BaseModel + attr_accessor dimension_values: ::Array[Orb::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue] + + attr_accessor group: String + + def initialize: ( + dimension_values: ::Array[Orb::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue], + group: String + ) -> void + + def to_hash: -> { + dimension_values: ::Array[Orb::NewPlanCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue], + group: String + } + + type dimension_value = + { + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + } + + class DimensionValue < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + } + end + end + type model_type = :cumulative_grouped_bulk module ModelType @@ -126,15 +175,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanCumulativeGroupedBulkPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewPlanCumulativeGroupedBulkPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_plan_grouped_allocation_price.rbs b/sig/orb/models/new_plan_grouped_allocation_price.rbs index a1d3ad45..3d79bdda 100644 --- a/sig/orb/models/new_plan_grouped_allocation_price.rbs +++ b/sig/orb/models/new_plan_grouped_allocation_price.rbs @@ -3,7 +3,7 @@ module Orb type new_plan_grouped_allocation_price = { cadence: Orb::Models::NewPlanGroupedAllocationPrice::cadence, - grouped_allocation_config: ::Hash[Symbol, top], + grouped_allocation_config: Orb::NewPlanGroupedAllocationPrice::GroupedAllocationConfig, item_id: String, model_type: Orb::Models::NewPlanGroupedAllocationPrice::model_type, name: String, @@ -25,7 +25,7 @@ module Orb class NewPlanGroupedAllocationPrice < Orb::Internal::Type::BaseModel attr_accessor cadence: Orb::Models::NewPlanGroupedAllocationPrice::cadence - attr_accessor grouped_allocation_config: ::Hash[Symbol, top] + attr_accessor grouped_allocation_config: Orb::NewPlanGroupedAllocationPrice::GroupedAllocationConfig attr_accessor item_id: String @@ -61,7 +61,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewPlanGroupedAllocationPrice::cadence, - grouped_allocation_config: ::Hash[Symbol, top], + grouped_allocation_config: Orb::NewPlanGroupedAllocationPrice::GroupedAllocationConfig, item_id: String, model_type: Orb::Models::NewPlanGroupedAllocationPrice::model_type, name: String, @@ -82,7 +82,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewPlanGroupedAllocationPrice::cadence, - grouped_allocation_config: ::Hash[Symbol, top], + grouped_allocation_config: Orb::NewPlanGroupedAllocationPrice::GroupedAllocationConfig, item_id: String, model_type: Orb::Models::NewPlanGroupedAllocationPrice::model_type, name: String, @@ -117,6 +117,29 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanGroupedAllocationPrice::cadence] end + type grouped_allocation_config = + { allocation: String, grouping_key: String, overage_unit_rate: String } + + class GroupedAllocationConfig < Orb::Internal::Type::BaseModel + attr_accessor allocation: String + + attr_accessor grouping_key: String + + attr_accessor overage_unit_rate: String + + def initialize: ( + allocation: String, + grouping_key: String, + overage_unit_rate: String + ) -> void + + def to_hash: -> { + allocation: String, + grouping_key: String, + overage_unit_rate: String + } + end + type model_type = :grouped_allocation module ModelType @@ -126,15 +149,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanGroupedAllocationPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewPlanGroupedAllocationPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_plan_grouped_tiered_package_price.rbs b/sig/orb/models/new_plan_grouped_tiered_package_price.rbs index 9b6e8ab0..3be1c57f 100644 --- a/sig/orb/models/new_plan_grouped_tiered_package_price.rbs +++ b/sig/orb/models/new_plan_grouped_tiered_package_price.rbs @@ -3,7 +3,7 @@ module Orb type new_plan_grouped_tiered_package_price = { cadence: Orb::Models::NewPlanGroupedTieredPackagePrice::cadence, - grouped_tiered_package_config: ::Hash[Symbol, top], + grouped_tiered_package_config: Orb::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig, item_id: String, model_type: Orb::Models::NewPlanGroupedTieredPackagePrice::model_type, name: String, @@ -25,7 +25,7 @@ module Orb class NewPlanGroupedTieredPackagePrice < Orb::Internal::Type::BaseModel attr_accessor cadence: Orb::Models::NewPlanGroupedTieredPackagePrice::cadence - attr_accessor grouped_tiered_package_config: ::Hash[Symbol, top] + attr_accessor grouped_tiered_package_config: Orb::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig attr_accessor item_id: String @@ -61,7 +61,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewPlanGroupedTieredPackagePrice::cadence, - grouped_tiered_package_config: ::Hash[Symbol, top], + grouped_tiered_package_config: Orb::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig, item_id: String, model_type: Orb::Models::NewPlanGroupedTieredPackagePrice::model_type, name: String, @@ -82,7 +82,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewPlanGroupedTieredPackagePrice::cadence, - grouped_tiered_package_config: ::Hash[Symbol, top], + grouped_tiered_package_config: Orb::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig, item_id: String, model_type: Orb::Models::NewPlanGroupedTieredPackagePrice::model_type, name: String, @@ -117,6 +117,45 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanGroupedTieredPackagePrice::cadence] end + type grouped_tiered_package_config = + { + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier] + } + + class GroupedTieredPackageConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor package_size: String + + attr_accessor tiers: ::Array[Orb::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier] + + def initialize: ( + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier] + ) -> void + + def to_hash: -> { + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::NewPlanGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier] + } + + type tier = { per_unit: String, tier_lower_bound: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor per_unit: String + + attr_accessor tier_lower_bound: String + + def initialize: (per_unit: String, tier_lower_bound: String) -> void + + def to_hash: -> { per_unit: String, tier_lower_bound: String } + end + end + type model_type = :grouped_tiered_package module ModelType @@ -126,15 +165,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanGroupedTieredPackagePrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewPlanGroupedTieredPackagePrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_plan_grouped_tiered_price.rbs b/sig/orb/models/new_plan_grouped_tiered_price.rbs index c08369b5..2dd7bc36 100644 --- a/sig/orb/models/new_plan_grouped_tiered_price.rbs +++ b/sig/orb/models/new_plan_grouped_tiered_price.rbs @@ -3,7 +3,7 @@ module Orb type new_plan_grouped_tiered_price = { cadence: Orb::Models::NewPlanGroupedTieredPrice::cadence, - grouped_tiered_config: ::Hash[Symbol, top], + grouped_tiered_config: Orb::NewPlanGroupedTieredPrice::GroupedTieredConfig, item_id: String, model_type: Orb::Models::NewPlanGroupedTieredPrice::model_type, name: String, @@ -25,7 +25,7 @@ module Orb class NewPlanGroupedTieredPrice < Orb::Internal::Type::BaseModel attr_accessor cadence: Orb::Models::NewPlanGroupedTieredPrice::cadence - attr_accessor grouped_tiered_config: ::Hash[Symbol, top] + attr_accessor grouped_tiered_config: Orb::NewPlanGroupedTieredPrice::GroupedTieredConfig attr_accessor item_id: String @@ -61,7 +61,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewPlanGroupedTieredPrice::cadence, - grouped_tiered_config: ::Hash[Symbol, top], + grouped_tiered_config: Orb::NewPlanGroupedTieredPrice::GroupedTieredConfig, item_id: String, model_type: Orb::Models::NewPlanGroupedTieredPrice::model_type, name: String, @@ -82,7 +82,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewPlanGroupedTieredPrice::cadence, - grouped_tiered_config: ::Hash[Symbol, top], + grouped_tiered_config: Orb::NewPlanGroupedTieredPrice::GroupedTieredConfig, item_id: String, model_type: Orb::Models::NewPlanGroupedTieredPrice::model_type, name: String, @@ -117,6 +117,43 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanGroupedTieredPrice::cadence] end + type grouped_tiered_config = + { + grouping_key: String, + tiers: ::Array[Orb::NewPlanGroupedTieredPrice::GroupedTieredConfig::Tier] + } + + class GroupedTieredConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor tiers: ::Array[Orb::NewPlanGroupedTieredPrice::GroupedTieredConfig::Tier] + + def initialize: ( + grouping_key: String, + tiers: ::Array[Orb::NewPlanGroupedTieredPrice::GroupedTieredConfig::Tier] + ) -> void + + def to_hash: -> { + grouping_key: String, + tiers: ::Array[Orb::NewPlanGroupedTieredPrice::GroupedTieredConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { tier_lower_bound: String, unit_amount: String } + end + end + type model_type = :grouped_tiered module ModelType @@ -126,15 +163,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanGroupedTieredPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewPlanGroupedTieredPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_plan_grouped_with_metered_minimum_price.rbs b/sig/orb/models/new_plan_grouped_with_metered_minimum_price.rbs index 865f6354..3afe61fc 100644 --- a/sig/orb/models/new_plan_grouped_with_metered_minimum_price.rbs +++ b/sig/orb/models/new_plan_grouped_with_metered_minimum_price.rbs @@ -3,7 +3,7 @@ module Orb type new_plan_grouped_with_metered_minimum_price = { cadence: Orb::Models::NewPlanGroupedWithMeteredMinimumPrice::cadence, - grouped_with_metered_minimum_config: ::Hash[Symbol, top], + grouped_with_metered_minimum_config: Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig, item_id: String, model_type: Orb::Models::NewPlanGroupedWithMeteredMinimumPrice::model_type, name: String, @@ -25,7 +25,7 @@ module Orb class NewPlanGroupedWithMeteredMinimumPrice < Orb::Internal::Type::BaseModel attr_accessor cadence: Orb::Models::NewPlanGroupedWithMeteredMinimumPrice::cadence - attr_accessor grouped_with_metered_minimum_config: ::Hash[Symbol, top] + attr_accessor grouped_with_metered_minimum_config: Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig attr_accessor item_id: String @@ -61,7 +61,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewPlanGroupedWithMeteredMinimumPrice::cadence, - grouped_with_metered_minimum_config: ::Hash[Symbol, top], + grouped_with_metered_minimum_config: Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig, item_id: String, model_type: Orb::Models::NewPlanGroupedWithMeteredMinimumPrice::model_type, name: String, @@ -82,7 +82,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewPlanGroupedWithMeteredMinimumPrice::cadence, - grouped_with_metered_minimum_config: ::Hash[Symbol, top], + grouped_with_metered_minimum_config: Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig, item_id: String, model_type: Orb::Models::NewPlanGroupedWithMeteredMinimumPrice::model_type, name: String, @@ -117,6 +117,75 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanGroupedWithMeteredMinimumPrice::cadence] end + type grouped_with_metered_minimum_config = + { + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: ::Array[Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor], + scaling_key: String, + unit_amounts: ::Array[Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount] + } + + class GroupedWithMeteredMinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor minimum_unit_amount: String + + attr_accessor pricing_key: String + + attr_accessor scaling_factors: ::Array[Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor] + + attr_accessor scaling_key: String + + attr_accessor unit_amounts: ::Array[Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount] + + def initialize: ( + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: ::Array[Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor], + scaling_key: String, + unit_amounts: ::Array[Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount] + ) -> void + + def to_hash: -> { + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: ::Array[Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor], + scaling_key: String, + unit_amounts: ::Array[Orb::NewPlanGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount] + } + + type scaling_factor = { scaling_factor: String, scaling_value: String } + + class ScalingFactor < Orb::Internal::Type::BaseModel + attr_accessor scaling_factor: String + + attr_accessor scaling_value: String + + def initialize: ( + scaling_factor: String, + scaling_value: String + ) -> void + + def to_hash: -> { scaling_factor: String, scaling_value: String } + end + + type unit_amount = { pricing_value: String, unit_amount: String } + + class UnitAmount < Orb::Internal::Type::BaseModel + attr_accessor pricing_value: String + + attr_accessor unit_amount: String + + def initialize: (pricing_value: String, unit_amount: String) -> void + + def to_hash: -> { pricing_value: String, unit_amount: String } + end + end + type model_type = :grouped_with_metered_minimum module ModelType @@ -126,15 +195,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanGroupedWithMeteredMinimumPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewPlanGroupedWithMeteredMinimumPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_plan_grouped_with_prorated_minimum_price.rbs b/sig/orb/models/new_plan_grouped_with_prorated_minimum_price.rbs index 5972a64b..1308da07 100644 --- a/sig/orb/models/new_plan_grouped_with_prorated_minimum_price.rbs +++ b/sig/orb/models/new_plan_grouped_with_prorated_minimum_price.rbs @@ -3,7 +3,7 @@ module Orb type new_plan_grouped_with_prorated_minimum_price = { cadence: Orb::Models::NewPlanGroupedWithProratedMinimumPrice::cadence, - grouped_with_prorated_minimum_config: ::Hash[Symbol, top], + grouped_with_prorated_minimum_config: Orb::NewPlanGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig, item_id: String, model_type: Orb::Models::NewPlanGroupedWithProratedMinimumPrice::model_type, name: String, @@ -25,7 +25,7 @@ module Orb class NewPlanGroupedWithProratedMinimumPrice < Orb::Internal::Type::BaseModel attr_accessor cadence: Orb::Models::NewPlanGroupedWithProratedMinimumPrice::cadence - attr_accessor grouped_with_prorated_minimum_config: ::Hash[Symbol, top] + attr_accessor grouped_with_prorated_minimum_config: Orb::NewPlanGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig attr_accessor item_id: String @@ -61,7 +61,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewPlanGroupedWithProratedMinimumPrice::cadence, - grouped_with_prorated_minimum_config: ::Hash[Symbol, top], + grouped_with_prorated_minimum_config: Orb::NewPlanGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig, item_id: String, model_type: Orb::Models::NewPlanGroupedWithProratedMinimumPrice::model_type, name: String, @@ -82,7 +82,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewPlanGroupedWithProratedMinimumPrice::cadence, - grouped_with_prorated_minimum_config: ::Hash[Symbol, top], + grouped_with_prorated_minimum_config: Orb::NewPlanGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig, item_id: String, model_type: Orb::Models::NewPlanGroupedWithProratedMinimumPrice::model_type, name: String, @@ -117,6 +117,29 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanGroupedWithProratedMinimumPrice::cadence] end + type grouped_with_prorated_minimum_config = + { grouping_key: String, minimum: String, unit_rate: String } + + class GroupedWithProratedMinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor minimum: String + + attr_accessor unit_rate: String + + def initialize: ( + grouping_key: String, + minimum: String, + unit_rate: String + ) -> void + + def to_hash: -> { + grouping_key: String, + minimum: String, + unit_rate: String + } + end + type model_type = :grouped_with_prorated_minimum module ModelType @@ -126,15 +149,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanGroupedWithProratedMinimumPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewPlanGroupedWithProratedMinimumPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_plan_matrix_price.rbs b/sig/orb/models/new_plan_matrix_price.rbs index 55a77581..c95c952e 100644 --- a/sig/orb/models/new_plan_matrix_price.rbs +++ b/sig/orb/models/new_plan_matrix_price.rbs @@ -126,15 +126,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanMatrixPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewPlanMatrixPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_plan_matrix_with_allocation_price.rbs b/sig/orb/models/new_plan_matrix_with_allocation_price.rbs index dd5241a3..678fa49d 100644 --- a/sig/orb/models/new_plan_matrix_with_allocation_price.rbs +++ b/sig/orb/models/new_plan_matrix_with_allocation_price.rbs @@ -126,15 +126,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanMatrixWithAllocationPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewPlanMatrixWithAllocationPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_plan_matrix_with_display_name_price.rbs b/sig/orb/models/new_plan_matrix_with_display_name_price.rbs index 41354bdd..a498f6cc 100644 --- a/sig/orb/models/new_plan_matrix_with_display_name_price.rbs +++ b/sig/orb/models/new_plan_matrix_with_display_name_price.rbs @@ -4,7 +4,7 @@ module Orb { cadence: Orb::Models::NewPlanMatrixWithDisplayNamePrice::cadence, item_id: String, - matrix_with_display_name_config: ::Hash[Symbol, top], + matrix_with_display_name_config: Orb::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig, model_type: Orb::Models::NewPlanMatrixWithDisplayNamePrice::model_type, name: String, billable_metric_id: String?, @@ -27,7 +27,7 @@ module Orb attr_accessor item_id: String - attr_accessor matrix_with_display_name_config: ::Hash[Symbol, top] + attr_accessor matrix_with_display_name_config: Orb::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig attr_accessor model_type: Orb::Models::NewPlanMatrixWithDisplayNamePrice::model_type @@ -62,7 +62,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewPlanMatrixWithDisplayNamePrice::cadence, item_id: String, - matrix_with_display_name_config: ::Hash[Symbol, top], + matrix_with_display_name_config: Orb::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig, model_type: Orb::Models::NewPlanMatrixWithDisplayNamePrice::model_type, name: String, ?billable_metric_id: String?, @@ -83,7 +83,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewPlanMatrixWithDisplayNamePrice::cadence, item_id: String, - matrix_with_display_name_config: ::Hash[Symbol, top], + matrix_with_display_name_config: Orb::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig, model_type: Orb::Models::NewPlanMatrixWithDisplayNamePrice::model_type, name: String, billable_metric_id: String?, @@ -117,6 +117,51 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanMatrixWithDisplayNamePrice::cadence] end + type matrix_with_display_name_config = + { + dimension: String, + unit_amounts: ::Array[Orb::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount] + } + + class MatrixWithDisplayNameConfig < Orb::Internal::Type::BaseModel + attr_accessor dimension: String + + attr_accessor unit_amounts: ::Array[Orb::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount] + + def initialize: ( + dimension: String, + unit_amounts: ::Array[Orb::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount] + ) -> void + + def to_hash: -> { + dimension: String, + unit_amounts: ::Array[Orb::NewPlanMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount] + } + + type unit_amount = + { dimension_value: String, display_name: String, unit_amount: String } + + class UnitAmount < Orb::Internal::Type::BaseModel + attr_accessor dimension_value: String + + attr_accessor display_name: String + + attr_accessor unit_amount: String + + def initialize: ( + dimension_value: String, + display_name: String, + unit_amount: String + ) -> void + + def to_hash: -> { + dimension_value: String, + display_name: String, + unit_amount: String + } + end + end + type model_type = :matrix_with_display_name module ModelType @@ -126,15 +171,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanMatrixWithDisplayNamePrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewPlanMatrixWithDisplayNamePrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_plan_max_group_tiered_package_price.rbs b/sig/orb/models/new_plan_max_group_tiered_package_price.rbs index f68a6dbe..8ff7c96c 100644 --- a/sig/orb/models/new_plan_max_group_tiered_package_price.rbs +++ b/sig/orb/models/new_plan_max_group_tiered_package_price.rbs @@ -4,7 +4,7 @@ module Orb { cadence: Orb::Models::NewPlanMaxGroupTieredPackagePrice::cadence, item_id: String, - max_group_tiered_package_config: ::Hash[Symbol, top], + max_group_tiered_package_config: Orb::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig, model_type: Orb::Models::NewPlanMaxGroupTieredPackagePrice::model_type, name: String, billable_metric_id: String?, @@ -27,7 +27,7 @@ module Orb attr_accessor item_id: String - attr_accessor max_group_tiered_package_config: ::Hash[Symbol, top] + attr_accessor max_group_tiered_package_config: Orb::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig attr_accessor model_type: Orb::Models::NewPlanMaxGroupTieredPackagePrice::model_type @@ -62,7 +62,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewPlanMaxGroupTieredPackagePrice::cadence, item_id: String, - max_group_tiered_package_config: ::Hash[Symbol, top], + max_group_tiered_package_config: Orb::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig, model_type: Orb::Models::NewPlanMaxGroupTieredPackagePrice::model_type, name: String, ?billable_metric_id: String?, @@ -83,7 +83,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewPlanMaxGroupTieredPackagePrice::cadence, item_id: String, - max_group_tiered_package_config: ::Hash[Symbol, top], + max_group_tiered_package_config: Orb::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig, model_type: Orb::Models::NewPlanMaxGroupTieredPackagePrice::model_type, name: String, billable_metric_id: String?, @@ -117,6 +117,48 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanMaxGroupTieredPackagePrice::cadence] end + type max_group_tiered_package_config = + { + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier] + } + + class MaxGroupTieredPackageConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor package_size: String + + attr_accessor tiers: ::Array[Orb::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier] + + def initialize: ( + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier] + ) -> void + + def to_hash: -> { + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::NewPlanMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { tier_lower_bound: String, unit_amount: String } + end + end + type model_type = :max_group_tiered_package module ModelType @@ -126,15 +168,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanMaxGroupTieredPackagePrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewPlanMaxGroupTieredPackagePrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_plan_tiered_bps_price.rbs b/sig/orb/models/new_plan_minimum_composite_price.rbs similarity index 61% rename from sig/orb/models/new_plan_tiered_bps_price.rbs rename to sig/orb/models/new_plan_minimum_composite_price.rbs index b7080f5a..70ad0603 100644 --- a/sig/orb/models/new_plan_tiered_bps_price.rbs +++ b/sig/orb/models/new_plan_minimum_composite_price.rbs @@ -1,17 +1,17 @@ module Orb module Models - type new_plan_tiered_bps_price = + type new_plan_minimum_composite_price = { - cadence: Orb::Models::NewPlanTieredBPSPrice::cadence, + cadence: Orb::Models::NewPlanMinimumCompositePrice::cadence, item_id: String, - model_type: Orb::Models::NewPlanTieredBPSPrice::model_type, + minimum_config: Orb::NewPlanMinimumCompositePrice::MinimumConfig, + model_type: Orb::Models::NewPlanMinimumCompositePrice::model_type, name: String, - tiered_bps_config: Orb::TieredBPSConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewPlanTieredBPSPrice::conversion_rate_config?, + conversion_rate_config: Orb::Models::NewPlanMinimumCompositePrice::conversion_rate_config?, currency: String?, dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, external_price_id: String?, @@ -22,16 +22,16 @@ module Orb reference_id: String? } - class NewPlanTieredBPSPrice < Orb::Internal::Type::BaseModel - attr_accessor cadence: Orb::Models::NewPlanTieredBPSPrice::cadence + class NewPlanMinimumCompositePrice < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::NewPlanMinimumCompositePrice::cadence attr_accessor item_id: String - attr_accessor model_type: Orb::Models::NewPlanTieredBPSPrice::model_type + attr_accessor minimum_config: Orb::NewPlanMinimumCompositePrice::MinimumConfig - attr_accessor name: String + attr_accessor model_type: Orb::Models::NewPlanMinimumCompositePrice::model_type - attr_accessor tiered_bps_config: Orb::TieredBPSConfig + attr_accessor name: String attr_accessor billable_metric_id: String? @@ -41,7 +41,7 @@ module Orb attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::NewPlanTieredBPSPrice::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::NewPlanMinimumCompositePrice::conversion_rate_config? attr_accessor currency: String? @@ -60,16 +60,16 @@ module Orb attr_accessor reference_id: String? def initialize: ( - cadence: Orb::Models::NewPlanTieredBPSPrice::cadence, + cadence: Orb::Models::NewPlanMinimumCompositePrice::cadence, item_id: String, - model_type: Orb::Models::NewPlanTieredBPSPrice::model_type, + minimum_config: Orb::NewPlanMinimumCompositePrice::MinimumConfig, + model_type: Orb::Models::NewPlanMinimumCompositePrice::model_type, name: String, - tiered_bps_config: Orb::TieredBPSConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, ?conversion_rate: Float?, - ?conversion_rate_config: Orb::Models::NewPlanTieredBPSPrice::conversion_rate_config?, + ?conversion_rate_config: Orb::Models::NewPlanMinimumCompositePrice::conversion_rate_config?, ?currency: String?, ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, ?external_price_id: String?, @@ -81,16 +81,16 @@ module Orb ) -> void def to_hash: -> { - cadence: Orb::Models::NewPlanTieredBPSPrice::cadence, + cadence: Orb::Models::NewPlanMinimumCompositePrice::cadence, item_id: String, - model_type: Orb::Models::NewPlanTieredBPSPrice::model_type, + minimum_config: Orb::NewPlanMinimumCompositePrice::MinimumConfig, + model_type: Orb::Models::NewPlanMinimumCompositePrice::model_type, name: String, - tiered_bps_config: Orb::TieredBPSConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewPlanTieredBPSPrice::conversion_rate_config?, + conversion_rate_config: Orb::Models::NewPlanMinimumCompositePrice::conversion_rate_config?, currency: String?, dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, external_price_id: String?, @@ -114,26 +114,31 @@ module Orb ONE_TIME: :one_time CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::NewPlanTieredBPSPrice::cadence] + def self?.values: -> ::Array[Orb::Models::NewPlanMinimumCompositePrice::cadence] end - type model_type = :tiered_bps + type minimum_config = { minimum_amount: String, prorated: bool } - module ModelType - extend Orb::Internal::Type::Enum + class MinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor minimum_amount: String + + attr_reader prorated: bool? - TIERED_BPS: :tiered_bps + def prorated=: (bool) -> bool - def self?.values: -> ::Array[Orb::Models::NewPlanTieredBPSPrice::model_type] + def initialize: (minimum_amount: String, ?prorated: bool) -> void + + def to_hash: -> { minimum_amount: String, prorated: bool } end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type model_type = :minimum + + module ModelType + extend Orb::Internal::Type::Enum - module ConversionRateConfig - extend Orb::Internal::Type::Union + MINIMUM: :minimum - def self?.variants: -> ::Array[Orb::Models::NewPlanTieredBPSPrice::conversion_rate_config] + def self?.values: -> ::Array[Orb::Models::NewPlanMinimumCompositePrice::model_type] end end end diff --git a/sig/orb/models/new_plan_package_price.rbs b/sig/orb/models/new_plan_package_price.rbs index 7308833b..a190c2f4 100644 --- a/sig/orb/models/new_plan_package_price.rbs +++ b/sig/orb/models/new_plan_package_price.rbs @@ -126,15 +126,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanPackagePrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewPlanPackagePrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_plan_package_with_allocation_price.rbs b/sig/orb/models/new_plan_package_with_allocation_price.rbs index 79a6cd89..c4f816a1 100644 --- a/sig/orb/models/new_plan_package_with_allocation_price.rbs +++ b/sig/orb/models/new_plan_package_with_allocation_price.rbs @@ -6,7 +6,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanPackageWithAllocationPrice::model_type, name: String, - package_with_allocation_config: ::Hash[Symbol, top], + package_with_allocation_config: Orb::NewPlanPackageWithAllocationPrice::PackageWithAllocationConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -31,7 +31,7 @@ module Orb attr_accessor name: String - attr_accessor package_with_allocation_config: ::Hash[Symbol, top] + attr_accessor package_with_allocation_config: Orb::NewPlanPackageWithAllocationPrice::PackageWithAllocationConfig attr_accessor billable_metric_id: String? @@ -64,7 +64,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanPackageWithAllocationPrice::model_type, name: String, - package_with_allocation_config: ::Hash[Symbol, top], + package_with_allocation_config: Orb::NewPlanPackageWithAllocationPrice::PackageWithAllocationConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -85,7 +85,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanPackageWithAllocationPrice::model_type, name: String, - package_with_allocation_config: ::Hash[Symbol, top], + package_with_allocation_config: Orb::NewPlanPackageWithAllocationPrice::PackageWithAllocationConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -127,13 +127,27 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanPackageWithAllocationPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type package_with_allocation_config = + { allocation: String, package_amount: String, package_size: String } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class PackageWithAllocationConfig < Orb::Internal::Type::BaseModel + attr_accessor allocation: String - def self?.variants: -> ::Array[Orb::Models::NewPlanPackageWithAllocationPrice::conversion_rate_config] + attr_accessor package_amount: String + + attr_accessor package_size: String + + def initialize: ( + allocation: String, + package_amount: String, + package_size: String + ) -> void + + def to_hash: -> { + allocation: String, + package_amount: String, + package_size: String + } end end end diff --git a/sig/orb/models/new_plan_scalable_matrix_with_tiered_pricing_price.rbs b/sig/orb/models/new_plan_scalable_matrix_with_tiered_pricing_price.rbs index c4603f1b..08b5f738 100644 --- a/sig/orb/models/new_plan_scalable_matrix_with_tiered_pricing_price.rbs +++ b/sig/orb/models/new_plan_scalable_matrix_with_tiered_pricing_price.rbs @@ -6,7 +6,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice::model_type, name: String, - scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_tiered_pricing_config: Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -31,7 +31,7 @@ module Orb attr_accessor name: String - attr_accessor scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top] + attr_accessor scalable_matrix_with_tiered_pricing_config: Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig attr_accessor billable_metric_id: String? @@ -64,7 +64,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice::model_type, name: String, - scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_tiered_pricing_config: Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -85,7 +85,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice::model_type, name: String, - scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_tiered_pricing_config: Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -127,13 +127,78 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type scalable_matrix_with_tiered_pricing_config = + { + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor], + tiers: ::Array[Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier], + second_dimension: String? + } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class ScalableMatrixWithTieredPricingConfig < Orb::Internal::Type::BaseModel + attr_accessor first_dimension: String - def self?.variants: -> ::Array[Orb::Models::NewPlanScalableMatrixWithTieredPricingPrice::conversion_rate_config] + attr_accessor matrix_scaling_factors: ::Array[Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor] + + attr_accessor tiers: ::Array[Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier] + + attr_accessor second_dimension: String? + + def initialize: ( + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor], + tiers: ::Array[Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier], + ?second_dimension: String? + ) -> void + + def to_hash: -> { + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor], + tiers: ::Array[Orb::NewPlanScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier], + second_dimension: String? + } + + type matrix_scaling_factor = + { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: String? + } + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + attr_accessor first_dimension_value: String + + attr_accessor scaling_factor: String + + attr_accessor second_dimension_value: String? + + def initialize: ( + first_dimension_value: String, + scaling_factor: String, + ?second_dimension_value: String? + ) -> void + + def to_hash: -> { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: String? + } + end + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { tier_lower_bound: String, unit_amount: String } + end end end end diff --git a/sig/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rbs b/sig/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rbs index 980362da..f48c4826 100644 --- a/sig/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rbs +++ b/sig/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rbs @@ -6,7 +6,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice::model_type, name: String, - scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_unit_pricing_config: Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -31,7 +31,7 @@ module Orb attr_accessor name: String - attr_accessor scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top] + attr_accessor scalable_matrix_with_unit_pricing_config: Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig attr_accessor billable_metric_id: String? @@ -64,7 +64,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice::model_type, name: String, - scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_unit_pricing_config: Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -85,7 +85,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice::model_type, name: String, - scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_unit_pricing_config: Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -127,13 +127,68 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewPlanScalableMatrixWithUnitPricingPrice::conversion_rate_config] + type scalable_matrix_with_unit_pricing_config = + { + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor], + unit_price: String, + prorate: bool?, + second_dimension: String? + } + + class ScalableMatrixWithUnitPricingConfig < Orb::Internal::Type::BaseModel + attr_accessor first_dimension: String + + attr_accessor matrix_scaling_factors: ::Array[Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor] + + attr_accessor unit_price: String + + attr_accessor prorate: bool? + + attr_accessor second_dimension: String? + + def initialize: ( + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor], + unit_price: String, + ?prorate: bool?, + ?second_dimension: String? + ) -> void + + def to_hash: -> { + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::NewPlanScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor], + unit_price: String, + prorate: bool?, + second_dimension: String? + } + + type matrix_scaling_factor = + { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: String? + } + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + attr_accessor first_dimension_value: String + + attr_accessor scaling_factor: String + + attr_accessor second_dimension_value: String? + + def initialize: ( + first_dimension_value: String, + scaling_factor: String, + ?second_dimension_value: String? + ) -> void + + def to_hash: -> { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: String? + } + end end end end diff --git a/sig/orb/models/new_plan_threshold_total_amount_price.rbs b/sig/orb/models/new_plan_threshold_total_amount_price.rbs index 607d527e..a04a39fa 100644 --- a/sig/orb/models/new_plan_threshold_total_amount_price.rbs +++ b/sig/orb/models/new_plan_threshold_total_amount_price.rbs @@ -6,7 +6,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanThresholdTotalAmountPrice::model_type, name: String, - threshold_total_amount_config: ::Hash[Symbol, top], + threshold_total_amount_config: Orb::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -31,7 +31,7 @@ module Orb attr_accessor name: String - attr_accessor threshold_total_amount_config: ::Hash[Symbol, top] + attr_accessor threshold_total_amount_config: Orb::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig attr_accessor billable_metric_id: String? @@ -64,7 +64,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanThresholdTotalAmountPrice::model_type, name: String, - threshold_total_amount_config: ::Hash[Symbol, top], + threshold_total_amount_config: Orb::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -85,7 +85,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanThresholdTotalAmountPrice::model_type, name: String, - threshold_total_amount_config: ::Hash[Symbol, top], + threshold_total_amount_config: Orb::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -127,13 +127,38 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanThresholdTotalAmountPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type threshold_total_amount_config = + { + consumption_table: ::Array[Orb::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable], + prorate: bool? + } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class ThresholdTotalAmountConfig < Orb::Internal::Type::BaseModel + attr_accessor consumption_table: ::Array[Orb::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable] - def self?.variants: -> ::Array[Orb::Models::NewPlanThresholdTotalAmountPrice::conversion_rate_config] + attr_accessor prorate: bool? + + def initialize: ( + consumption_table: ::Array[Orb::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable], + ?prorate: bool? + ) -> void + + def to_hash: -> { + consumption_table: ::Array[Orb::NewPlanThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable], + prorate: bool? + } + + type consumption_table = { threshold: String, total_amount: String } + + class ConsumptionTable < Orb::Internal::Type::BaseModel + attr_accessor threshold: String + + attr_accessor total_amount: String + + def initialize: (threshold: String, total_amount: String) -> void + + def to_hash: -> { threshold: String, total_amount: String } + end end end end diff --git a/sig/orb/models/new_plan_tier_with_proration_price.rbs b/sig/orb/models/new_plan_tier_with_proration_price.rbs deleted file mode 100644 index 5906107d..00000000 --- a/sig/orb/models/new_plan_tier_with_proration_price.rbs +++ /dev/null @@ -1,140 +0,0 @@ -module Orb - module Models - type new_plan_tier_with_proration_price = - { - cadence: Orb::Models::NewPlanTierWithProrationPrice::cadence, - item_id: String, - model_type: Orb::Models::NewPlanTierWithProrationPrice::model_type, - name: String, - tiered_with_proration_config: ::Hash[Symbol, top], - billable_metric_id: String?, - billed_in_advance: bool?, - billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewPlanTierWithProrationPrice::conversion_rate_config?, - currency: String?, - dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoice_grouping_key: String?, - invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - metadata: ::Hash[Symbol, String?]?, - reference_id: String? - } - - class NewPlanTierWithProrationPrice < Orb::Internal::Type::BaseModel - attr_accessor cadence: Orb::Models::NewPlanTierWithProrationPrice::cadence - - attr_accessor item_id: String - - attr_accessor model_type: Orb::Models::NewPlanTierWithProrationPrice::model_type - - attr_accessor name: String - - attr_accessor tiered_with_proration_config: ::Hash[Symbol, top] - - attr_accessor billable_metric_id: String? - - attr_accessor billed_in_advance: bool? - - attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? - - attr_accessor conversion_rate: Float? - - attr_accessor conversion_rate_config: Orb::Models::NewPlanTierWithProrationPrice::conversion_rate_config? - - attr_accessor currency: String? - - attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? - - attr_accessor external_price_id: String? - - attr_accessor fixed_price_quantity: Float? - - attr_accessor invoice_grouping_key: String? - - attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? - - attr_accessor metadata: ::Hash[Symbol, String?]? - - attr_accessor reference_id: String? - - def initialize: ( - cadence: Orb::Models::NewPlanTierWithProrationPrice::cadence, - item_id: String, - model_type: Orb::Models::NewPlanTierWithProrationPrice::model_type, - name: String, - tiered_with_proration_config: ::Hash[Symbol, top], - ?billable_metric_id: String?, - ?billed_in_advance: bool?, - ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - ?conversion_rate: Float?, - ?conversion_rate_config: Orb::Models::NewPlanTierWithProrationPrice::conversion_rate_config?, - ?currency: String?, - ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - ?external_price_id: String?, - ?fixed_price_quantity: Float?, - ?invoice_grouping_key: String?, - ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - ?metadata: ::Hash[Symbol, String?]?, - ?reference_id: String? - ) -> void - - def to_hash: -> { - cadence: Orb::Models::NewPlanTierWithProrationPrice::cadence, - item_id: String, - model_type: Orb::Models::NewPlanTierWithProrationPrice::model_type, - name: String, - tiered_with_proration_config: ::Hash[Symbol, top], - billable_metric_id: String?, - billed_in_advance: bool?, - billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewPlanTierWithProrationPrice::conversion_rate_config?, - currency: String?, - dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoice_grouping_key: String?, - invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - metadata: ::Hash[Symbol, String?]?, - reference_id: String? - } - - type cadence = - :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom - - module Cadence - extend Orb::Internal::Type::Enum - - ANNUAL: :annual - SEMI_ANNUAL: :semi_annual - MONTHLY: :monthly - QUARTERLY: :quarterly - ONE_TIME: :one_time - CUSTOM: :custom - - def self?.values: -> ::Array[Orb::Models::NewPlanTierWithProrationPrice::cadence] - end - - type model_type = :tiered_with_proration - - module ModelType - extend Orb::Internal::Type::Enum - - TIERED_WITH_PRORATION: :tiered_with_proration - - def self?.values: -> ::Array[Orb::Models::NewPlanTierWithProrationPrice::model_type] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewPlanTierWithProrationPrice::conversion_rate_config] - end - end - end -end diff --git a/sig/orb/models/new_plan_tiered_package_price.rbs b/sig/orb/models/new_plan_tiered_package_price.rbs index 98bdeb0a..5bdd5140 100644 --- a/sig/orb/models/new_plan_tiered_package_price.rbs +++ b/sig/orb/models/new_plan_tiered_package_price.rbs @@ -6,7 +6,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanTieredPackagePrice::model_type, name: String, - tiered_package_config: ::Hash[Symbol, top], + tiered_package_config: Orb::NewPlanTieredPackagePrice::TieredPackageConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -31,7 +31,7 @@ module Orb attr_accessor name: String - attr_accessor tiered_package_config: ::Hash[Symbol, top] + attr_accessor tiered_package_config: Orb::NewPlanTieredPackagePrice::TieredPackageConfig attr_accessor billable_metric_id: String? @@ -64,7 +64,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanTieredPackagePrice::model_type, name: String, - tiered_package_config: ::Hash[Symbol, top], + tiered_package_config: Orb::NewPlanTieredPackagePrice::TieredPackageConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -85,7 +85,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanTieredPackagePrice::model_type, name: String, - tiered_package_config: ::Hash[Symbol, top], + tiered_package_config: Orb::NewPlanTieredPackagePrice::TieredPackageConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -127,13 +127,38 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanTieredPackagePrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type tiered_package_config = + { + package_size: String, + tiers: ::Array[Orb::NewPlanTieredPackagePrice::TieredPackageConfig::Tier] + } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class TieredPackageConfig < Orb::Internal::Type::BaseModel + attr_accessor package_size: String - def self?.variants: -> ::Array[Orb::Models::NewPlanTieredPackagePrice::conversion_rate_config] + attr_accessor tiers: ::Array[Orb::NewPlanTieredPackagePrice::TieredPackageConfig::Tier] + + def initialize: ( + package_size: String, + tiers: ::Array[Orb::NewPlanTieredPackagePrice::TieredPackageConfig::Tier] + ) -> void + + def to_hash: -> { + package_size: String, + tiers: ::Array[Orb::NewPlanTieredPackagePrice::TieredPackageConfig::Tier] + } + + type tier = { per_unit: String, tier_lower_bound: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor per_unit: String + + attr_accessor tier_lower_bound: String + + def initialize: (per_unit: String, tier_lower_bound: String) -> void + + def to_hash: -> { per_unit: String, tier_lower_bound: String } + end end end end diff --git a/sig/orb/models/new_plan_tiered_package_with_minimum_price.rbs b/sig/orb/models/new_plan_tiered_package_with_minimum_price.rbs index c57dd914..ff418ccd 100644 --- a/sig/orb/models/new_plan_tiered_package_with_minimum_price.rbs +++ b/sig/orb/models/new_plan_tiered_package_with_minimum_price.rbs @@ -6,7 +6,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanTieredPackageWithMinimumPrice::model_type, name: String, - tiered_package_with_minimum_config: ::Hash[Symbol, top], + tiered_package_with_minimum_config: Orb::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -31,7 +31,7 @@ module Orb attr_accessor name: String - attr_accessor tiered_package_with_minimum_config: ::Hash[Symbol, top] + attr_accessor tiered_package_with_minimum_config: Orb::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig attr_accessor billable_metric_id: String? @@ -64,7 +64,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanTieredPackageWithMinimumPrice::model_type, name: String, - tiered_package_with_minimum_config: ::Hash[Symbol, top], + tiered_package_with_minimum_config: Orb::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -85,7 +85,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanTieredPackageWithMinimumPrice::model_type, name: String, - tiered_package_with_minimum_config: ::Hash[Symbol, top], + tiered_package_with_minimum_config: Orb::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -127,13 +127,49 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanTieredPackageWithMinimumPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type tiered_package_with_minimum_config = + { + package_size: Float, + tiers: ::Array[Orb::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier] + } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class TieredPackageWithMinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor package_size: Float - def self?.variants: -> ::Array[Orb::Models::NewPlanTieredPackageWithMinimumPrice::conversion_rate_config] + attr_accessor tiers: ::Array[Orb::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier] + + def initialize: ( + package_size: Float, + tiers: ::Array[Orb::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier] + ) -> void + + def to_hash: -> { + package_size: Float, + tiers: ::Array[Orb::NewPlanTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier] + } + + type tier = + { minimum_amount: String, per_unit: String, tier_lower_bound: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor minimum_amount: String + + attr_accessor per_unit: String + + attr_accessor tier_lower_bound: String + + def initialize: ( + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + ) -> void + + def to_hash: -> { + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + } + end end end end diff --git a/sig/orb/models/new_plan_tiered_price.rbs b/sig/orb/models/new_plan_tiered_price.rbs index 73400ade..f86e530f 100644 --- a/sig/orb/models/new_plan_tiered_price.rbs +++ b/sig/orb/models/new_plan_tiered_price.rbs @@ -126,15 +126,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanTieredPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewPlanTieredPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_plan_tiered_with_minimum_price.rbs b/sig/orb/models/new_plan_tiered_with_minimum_price.rbs index 1bc1c173..72d2cf49 100644 --- a/sig/orb/models/new_plan_tiered_with_minimum_price.rbs +++ b/sig/orb/models/new_plan_tiered_with_minimum_price.rbs @@ -6,7 +6,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanTieredWithMinimumPrice::model_type, name: String, - tiered_with_minimum_config: ::Hash[Symbol, top], + tiered_with_minimum_config: Orb::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -31,7 +31,7 @@ module Orb attr_accessor name: String - attr_accessor tiered_with_minimum_config: ::Hash[Symbol, top] + attr_accessor tiered_with_minimum_config: Orb::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig attr_accessor billable_metric_id: String? @@ -64,7 +64,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanTieredWithMinimumPrice::model_type, name: String, - tiered_with_minimum_config: ::Hash[Symbol, top], + tiered_with_minimum_config: Orb::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -85,7 +85,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanTieredWithMinimumPrice::model_type, name: String, - tiered_with_minimum_config: ::Hash[Symbol, top], + tiered_with_minimum_config: Orb::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -127,13 +127,62 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanTieredWithMinimumPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type tiered_with_minimum_config = + { + tiers: ::Array[Orb::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig::Tier], + hide_zero_amount_tiers: bool, + prorate: bool + } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class TieredWithMinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig::Tier] - def self?.variants: -> ::Array[Orb::Models::NewPlanTieredWithMinimumPrice::conversion_rate_config] + attr_reader hide_zero_amount_tiers: bool? + + def hide_zero_amount_tiers=: (bool) -> bool + + attr_reader prorate: bool? + + def prorate=: (bool) -> bool + + def initialize: ( + tiers: ::Array[Orb::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig::Tier], + ?hide_zero_amount_tiers: bool, + ?prorate: bool + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::NewPlanTieredWithMinimumPrice::TieredWithMinimumConfig::Tier], + hide_zero_amount_tiers: bool, + prorate: bool + } + + type tier = + { + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor minimum_amount: String + + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + } + end end end end diff --git a/sig/orb/models/new_plan_unit_price.rbs b/sig/orb/models/new_plan_unit_price.rbs index 0a187a8d..69767bc8 100644 --- a/sig/orb/models/new_plan_unit_price.rbs +++ b/sig/orb/models/new_plan_unit_price.rbs @@ -126,15 +126,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanUnitPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewPlanUnitPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_plan_unit_with_percent_price.rbs b/sig/orb/models/new_plan_unit_with_percent_price.rbs index 60ae0b43..e461b467 100644 --- a/sig/orb/models/new_plan_unit_with_percent_price.rbs +++ b/sig/orb/models/new_plan_unit_with_percent_price.rbs @@ -6,7 +6,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanUnitWithPercentPrice::model_type, name: String, - unit_with_percent_config: ::Hash[Symbol, top], + unit_with_percent_config: Orb::NewPlanUnitWithPercentPrice::UnitWithPercentConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -31,7 +31,7 @@ module Orb attr_accessor name: String - attr_accessor unit_with_percent_config: ::Hash[Symbol, top] + attr_accessor unit_with_percent_config: Orb::NewPlanUnitWithPercentPrice::UnitWithPercentConfig attr_accessor billable_metric_id: String? @@ -64,7 +64,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanUnitWithPercentPrice::model_type, name: String, - unit_with_percent_config: ::Hash[Symbol, top], + unit_with_percent_config: Orb::NewPlanUnitWithPercentPrice::UnitWithPercentConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -85,7 +85,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanUnitWithPercentPrice::model_type, name: String, - unit_with_percent_config: ::Hash[Symbol, top], + unit_with_percent_config: Orb::NewPlanUnitWithPercentPrice::UnitWithPercentConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -127,13 +127,16 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanUnitWithPercentPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type unit_with_percent_config = { percent: String, unit_amount: String } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class UnitWithPercentConfig < Orb::Internal::Type::BaseModel + attr_accessor percent: String - def self?.variants: -> ::Array[Orb::Models::NewPlanUnitWithPercentPrice::conversion_rate_config] + attr_accessor unit_amount: String + + def initialize: (percent: String, unit_amount: String) -> void + + def to_hash: -> { percent: String, unit_amount: String } end end end diff --git a/sig/orb/models/new_plan_unit_with_proration_price.rbs b/sig/orb/models/new_plan_unit_with_proration_price.rbs index 68eb7519..234b05c2 100644 --- a/sig/orb/models/new_plan_unit_with_proration_price.rbs +++ b/sig/orb/models/new_plan_unit_with_proration_price.rbs @@ -6,7 +6,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanUnitWithProrationPrice::model_type, name: String, - unit_with_proration_config: ::Hash[Symbol, top], + unit_with_proration_config: Orb::NewPlanUnitWithProrationPrice::UnitWithProrationConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -31,7 +31,7 @@ module Orb attr_accessor name: String - attr_accessor unit_with_proration_config: ::Hash[Symbol, top] + attr_accessor unit_with_proration_config: Orb::NewPlanUnitWithProrationPrice::UnitWithProrationConfig attr_accessor billable_metric_id: String? @@ -64,7 +64,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanUnitWithProrationPrice::model_type, name: String, - unit_with_proration_config: ::Hash[Symbol, top], + unit_with_proration_config: Orb::NewPlanUnitWithProrationPrice::UnitWithProrationConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -85,7 +85,7 @@ module Orb item_id: String, model_type: Orb::Models::NewPlanUnitWithProrationPrice::model_type, name: String, - unit_with_proration_config: ::Hash[Symbol, top], + unit_with_proration_config: Orb::NewPlanUnitWithProrationPrice::UnitWithProrationConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -127,13 +127,14 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewPlanUnitWithProrationPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type unit_with_proration_config = { unit_amount: String } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class UnitWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor unit_amount: String - def self?.variants: -> ::Array[Orb::Models::NewPlanUnitWithProrationPrice::conversion_rate_config] + def initialize: (unit_amount: String) -> void + + def to_hash: -> { unit_amount: String } end end end diff --git a/sig/orb/models/new_subscription_bulk_bps_price.rbs b/sig/orb/models/new_subscription_bulk_bps_price.rbs deleted file mode 100644 index 22a47edc..00000000 --- a/sig/orb/models/new_subscription_bulk_bps_price.rbs +++ /dev/null @@ -1,140 +0,0 @@ -module Orb - module Models - type new_subscription_bulk_bps_price = - { - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::Models::NewSubscriptionBulkBPSPrice::cadence, - item_id: String, - model_type: Orb::Models::NewSubscriptionBulkBPSPrice::model_type, - name: String, - billable_metric_id: String?, - billed_in_advance: bool?, - billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewSubscriptionBulkBPSPrice::conversion_rate_config?, - currency: String?, - dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoice_grouping_key: String?, - invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - metadata: ::Hash[Symbol, String?]?, - reference_id: String? - } - - class NewSubscriptionBulkBPSPrice < Orb::Internal::Type::BaseModel - attr_accessor bulk_bps_config: Orb::BulkBPSConfig - - attr_accessor cadence: Orb::Models::NewSubscriptionBulkBPSPrice::cadence - - attr_accessor item_id: String - - attr_accessor model_type: Orb::Models::NewSubscriptionBulkBPSPrice::model_type - - attr_accessor name: String - - attr_accessor billable_metric_id: String? - - attr_accessor billed_in_advance: bool? - - attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? - - attr_accessor conversion_rate: Float? - - attr_accessor conversion_rate_config: Orb::Models::NewSubscriptionBulkBPSPrice::conversion_rate_config? - - attr_accessor currency: String? - - attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? - - attr_accessor external_price_id: String? - - attr_accessor fixed_price_quantity: Float? - - attr_accessor invoice_grouping_key: String? - - attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? - - attr_accessor metadata: ::Hash[Symbol, String?]? - - attr_accessor reference_id: String? - - def initialize: ( - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::Models::NewSubscriptionBulkBPSPrice::cadence, - item_id: String, - model_type: Orb::Models::NewSubscriptionBulkBPSPrice::model_type, - name: String, - ?billable_metric_id: String?, - ?billed_in_advance: bool?, - ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - ?conversion_rate: Float?, - ?conversion_rate_config: Orb::Models::NewSubscriptionBulkBPSPrice::conversion_rate_config?, - ?currency: String?, - ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - ?external_price_id: String?, - ?fixed_price_quantity: Float?, - ?invoice_grouping_key: String?, - ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - ?metadata: ::Hash[Symbol, String?]?, - ?reference_id: String? - ) -> void - - def to_hash: -> { - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::Models::NewSubscriptionBulkBPSPrice::cadence, - item_id: String, - model_type: Orb::Models::NewSubscriptionBulkBPSPrice::model_type, - name: String, - billable_metric_id: String?, - billed_in_advance: bool?, - billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewSubscriptionBulkBPSPrice::conversion_rate_config?, - currency: String?, - dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoice_grouping_key: String?, - invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - metadata: ::Hash[Symbol, String?]?, - reference_id: String? - } - - type cadence = - :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom - - module Cadence - extend Orb::Internal::Type::Enum - - ANNUAL: :annual - SEMI_ANNUAL: :semi_annual - MONTHLY: :monthly - QUARTERLY: :quarterly - ONE_TIME: :one_time - CUSTOM: :custom - - def self?.values: -> ::Array[Orb::Models::NewSubscriptionBulkBPSPrice::cadence] - end - - type model_type = :bulk_bps - - module ModelType - extend Orb::Internal::Type::Enum - - BULK_BPS: :bulk_bps - - def self?.values: -> ::Array[Orb::Models::NewSubscriptionBulkBPSPrice::model_type] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionBulkBPSPrice::conversion_rate_config] - end - end - end -end diff --git a/sig/orb/models/new_subscription_bulk_price.rbs b/sig/orb/models/new_subscription_bulk_price.rbs index eac192d2..5e3b1d4d 100644 --- a/sig/orb/models/new_subscription_bulk_price.rbs +++ b/sig/orb/models/new_subscription_bulk_price.rbs @@ -126,15 +126,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionBulkPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionBulkPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_subscription_bulk_with_proration_price.rbs b/sig/orb/models/new_subscription_bulk_with_proration_price.rbs index 0506e2c9..0ccfa07b 100644 --- a/sig/orb/models/new_subscription_bulk_with_proration_price.rbs +++ b/sig/orb/models/new_subscription_bulk_with_proration_price.rbs @@ -2,7 +2,7 @@ module Orb module Models type new_subscription_bulk_with_proration_price = { - bulk_with_proration_config: ::Hash[Symbol, top], + bulk_with_proration_config: Orb::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig, cadence: Orb::Models::NewSubscriptionBulkWithProrationPrice::cadence, item_id: String, model_type: Orb::Models::NewSubscriptionBulkWithProrationPrice::model_type, @@ -23,7 +23,7 @@ module Orb } class NewSubscriptionBulkWithProrationPrice < Orb::Internal::Type::BaseModel - attr_accessor bulk_with_proration_config: ::Hash[Symbol, top] + attr_accessor bulk_with_proration_config: Orb::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig attr_accessor cadence: Orb::Models::NewSubscriptionBulkWithProrationPrice::cadence @@ -60,7 +60,7 @@ module Orb attr_accessor reference_id: String? def initialize: ( - bulk_with_proration_config: ::Hash[Symbol, top], + bulk_with_proration_config: Orb::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig, cadence: Orb::Models::NewSubscriptionBulkWithProrationPrice::cadence, item_id: String, model_type: Orb::Models::NewSubscriptionBulkWithProrationPrice::model_type, @@ -81,7 +81,7 @@ module Orb ) -> void def to_hash: -> { - bulk_with_proration_config: ::Hash[Symbol, top], + bulk_with_proration_config: Orb::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig, cadence: Orb::Models::NewSubscriptionBulkWithProrationPrice::cadence, item_id: String, model_type: Orb::Models::NewSubscriptionBulkWithProrationPrice::model_type, @@ -101,6 +101,38 @@ module Orb reference_id: String? } + type bulk_with_proration_config = + { + tiers: ::Array[Orb::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig::Tier] + } + + class BulkWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig::Tier] + + def initialize: ( + tiers: ::Array[Orb::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig::Tier] + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::NewSubscriptionBulkWithProrationPrice::BulkWithProrationConfig::Tier] + } + + type tier = { unit_amount: String, tier_lower_bound: String? } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor unit_amount: String + + attr_accessor tier_lower_bound: String? + + def initialize: ( + unit_amount: String, + ?tier_lower_bound: String? + ) -> void + + def to_hash: -> { unit_amount: String, tier_lower_bound: String? } + end + end + type cadence = :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom @@ -126,15 +158,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionBulkWithProrationPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionBulkWithProrationPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_subscription_cumulative_grouped_bulk_price.rbs b/sig/orb/models/new_subscription_cumulative_grouped_bulk_price.rbs index 57172ea2..86642817 100644 --- a/sig/orb/models/new_subscription_cumulative_grouped_bulk_price.rbs +++ b/sig/orb/models/new_subscription_cumulative_grouped_bulk_price.rbs @@ -3,7 +3,7 @@ module Orb type new_subscription_cumulative_grouped_bulk_price = { cadence: Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice::cadence, - cumulative_grouped_bulk_config: ::Hash[Symbol, top], + cumulative_grouped_bulk_config: Orb::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig, item_id: String, model_type: Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice::model_type, name: String, @@ -25,7 +25,7 @@ module Orb class NewSubscriptionCumulativeGroupedBulkPrice < Orb::Internal::Type::BaseModel attr_accessor cadence: Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice::cadence - attr_accessor cumulative_grouped_bulk_config: ::Hash[Symbol, top] + attr_accessor cumulative_grouped_bulk_config: Orb::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig attr_accessor item_id: String @@ -61,7 +61,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice::cadence, - cumulative_grouped_bulk_config: ::Hash[Symbol, top], + cumulative_grouped_bulk_config: Orb::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig, item_id: String, model_type: Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice::model_type, name: String, @@ -82,7 +82,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice::cadence, - cumulative_grouped_bulk_config: ::Hash[Symbol, top], + cumulative_grouped_bulk_config: Orb::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig, item_id: String, model_type: Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice::model_type, name: String, @@ -117,6 +117,55 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice::cadence] end + type cumulative_grouped_bulk_config = + { + dimension_values: ::Array[Orb::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue], + group: String + } + + class CumulativeGroupedBulkConfig < Orb::Internal::Type::BaseModel + attr_accessor dimension_values: ::Array[Orb::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue] + + attr_accessor group: String + + def initialize: ( + dimension_values: ::Array[Orb::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue], + group: String + ) -> void + + def to_hash: -> { + dimension_values: ::Array[Orb::NewSubscriptionCumulativeGroupedBulkPrice::CumulativeGroupedBulkConfig::DimensionValue], + group: String + } + + type dimension_value = + { + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + } + + class DimensionValue < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + } + end + end + type model_type = :cumulative_grouped_bulk module ModelType @@ -126,15 +175,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionCumulativeGroupedBulkPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_subscription_grouped_allocation_price.rbs b/sig/orb/models/new_subscription_grouped_allocation_price.rbs index 1e1f6018..8a6e8055 100644 --- a/sig/orb/models/new_subscription_grouped_allocation_price.rbs +++ b/sig/orb/models/new_subscription_grouped_allocation_price.rbs @@ -3,7 +3,7 @@ module Orb type new_subscription_grouped_allocation_price = { cadence: Orb::Models::NewSubscriptionGroupedAllocationPrice::cadence, - grouped_allocation_config: ::Hash[Symbol, top], + grouped_allocation_config: Orb::NewSubscriptionGroupedAllocationPrice::GroupedAllocationConfig, item_id: String, model_type: Orb::Models::NewSubscriptionGroupedAllocationPrice::model_type, name: String, @@ -25,7 +25,7 @@ module Orb class NewSubscriptionGroupedAllocationPrice < Orb::Internal::Type::BaseModel attr_accessor cadence: Orb::Models::NewSubscriptionGroupedAllocationPrice::cadence - attr_accessor grouped_allocation_config: ::Hash[Symbol, top] + attr_accessor grouped_allocation_config: Orb::NewSubscriptionGroupedAllocationPrice::GroupedAllocationConfig attr_accessor item_id: String @@ -61,7 +61,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewSubscriptionGroupedAllocationPrice::cadence, - grouped_allocation_config: ::Hash[Symbol, top], + grouped_allocation_config: Orb::NewSubscriptionGroupedAllocationPrice::GroupedAllocationConfig, item_id: String, model_type: Orb::Models::NewSubscriptionGroupedAllocationPrice::model_type, name: String, @@ -82,7 +82,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewSubscriptionGroupedAllocationPrice::cadence, - grouped_allocation_config: ::Hash[Symbol, top], + grouped_allocation_config: Orb::NewSubscriptionGroupedAllocationPrice::GroupedAllocationConfig, item_id: String, model_type: Orb::Models::NewSubscriptionGroupedAllocationPrice::model_type, name: String, @@ -117,6 +117,29 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionGroupedAllocationPrice::cadence] end + type grouped_allocation_config = + { allocation: String, grouping_key: String, overage_unit_rate: String } + + class GroupedAllocationConfig < Orb::Internal::Type::BaseModel + attr_accessor allocation: String + + attr_accessor grouping_key: String + + attr_accessor overage_unit_rate: String + + def initialize: ( + allocation: String, + grouping_key: String, + overage_unit_rate: String + ) -> void + + def to_hash: -> { + allocation: String, + grouping_key: String, + overage_unit_rate: String + } + end + type model_type = :grouped_allocation module ModelType @@ -126,15 +149,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionGroupedAllocationPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionGroupedAllocationPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_subscription_grouped_tiered_package_price.rbs b/sig/orb/models/new_subscription_grouped_tiered_package_price.rbs index 7799b636..b70770d3 100644 --- a/sig/orb/models/new_subscription_grouped_tiered_package_price.rbs +++ b/sig/orb/models/new_subscription_grouped_tiered_package_price.rbs @@ -3,7 +3,7 @@ module Orb type new_subscription_grouped_tiered_package_price = { cadence: Orb::Models::NewSubscriptionGroupedTieredPackagePrice::cadence, - grouped_tiered_package_config: ::Hash[Symbol, top], + grouped_tiered_package_config: Orb::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig, item_id: String, model_type: Orb::Models::NewSubscriptionGroupedTieredPackagePrice::model_type, name: String, @@ -25,7 +25,7 @@ module Orb class NewSubscriptionGroupedTieredPackagePrice < Orb::Internal::Type::BaseModel attr_accessor cadence: Orb::Models::NewSubscriptionGroupedTieredPackagePrice::cadence - attr_accessor grouped_tiered_package_config: ::Hash[Symbol, top] + attr_accessor grouped_tiered_package_config: Orb::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig attr_accessor item_id: String @@ -61,7 +61,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewSubscriptionGroupedTieredPackagePrice::cadence, - grouped_tiered_package_config: ::Hash[Symbol, top], + grouped_tiered_package_config: Orb::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig, item_id: String, model_type: Orb::Models::NewSubscriptionGroupedTieredPackagePrice::model_type, name: String, @@ -82,7 +82,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewSubscriptionGroupedTieredPackagePrice::cadence, - grouped_tiered_package_config: ::Hash[Symbol, top], + grouped_tiered_package_config: Orb::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig, item_id: String, model_type: Orb::Models::NewSubscriptionGroupedTieredPackagePrice::model_type, name: String, @@ -117,6 +117,45 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionGroupedTieredPackagePrice::cadence] end + type grouped_tiered_package_config = + { + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier] + } + + class GroupedTieredPackageConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor package_size: String + + attr_accessor tiers: ::Array[Orb::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier] + + def initialize: ( + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier] + ) -> void + + def to_hash: -> { + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::NewSubscriptionGroupedTieredPackagePrice::GroupedTieredPackageConfig::Tier] + } + + type tier = { per_unit: String, tier_lower_bound: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor per_unit: String + + attr_accessor tier_lower_bound: String + + def initialize: (per_unit: String, tier_lower_bound: String) -> void + + def to_hash: -> { per_unit: String, tier_lower_bound: String } + end + end + type model_type = :grouped_tiered_package module ModelType @@ -126,15 +165,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionGroupedTieredPackagePrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionGroupedTieredPackagePrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_subscription_grouped_tiered_price.rbs b/sig/orb/models/new_subscription_grouped_tiered_price.rbs index a8b65d3a..195adbbb 100644 --- a/sig/orb/models/new_subscription_grouped_tiered_price.rbs +++ b/sig/orb/models/new_subscription_grouped_tiered_price.rbs @@ -3,7 +3,7 @@ module Orb type new_subscription_grouped_tiered_price = { cadence: Orb::Models::NewSubscriptionGroupedTieredPrice::cadence, - grouped_tiered_config: ::Hash[Symbol, top], + grouped_tiered_config: Orb::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig, item_id: String, model_type: Orb::Models::NewSubscriptionGroupedTieredPrice::model_type, name: String, @@ -25,7 +25,7 @@ module Orb class NewSubscriptionGroupedTieredPrice < Orb::Internal::Type::BaseModel attr_accessor cadence: Orb::Models::NewSubscriptionGroupedTieredPrice::cadence - attr_accessor grouped_tiered_config: ::Hash[Symbol, top] + attr_accessor grouped_tiered_config: Orb::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig attr_accessor item_id: String @@ -61,7 +61,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewSubscriptionGroupedTieredPrice::cadence, - grouped_tiered_config: ::Hash[Symbol, top], + grouped_tiered_config: Orb::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig, item_id: String, model_type: Orb::Models::NewSubscriptionGroupedTieredPrice::model_type, name: String, @@ -82,7 +82,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewSubscriptionGroupedTieredPrice::cadence, - grouped_tiered_config: ::Hash[Symbol, top], + grouped_tiered_config: Orb::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig, item_id: String, model_type: Orb::Models::NewSubscriptionGroupedTieredPrice::model_type, name: String, @@ -117,6 +117,43 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionGroupedTieredPrice::cadence] end + type grouped_tiered_config = + { + grouping_key: String, + tiers: ::Array[Orb::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig::Tier] + } + + class GroupedTieredConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor tiers: ::Array[Orb::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig::Tier] + + def initialize: ( + grouping_key: String, + tiers: ::Array[Orb::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig::Tier] + ) -> void + + def to_hash: -> { + grouping_key: String, + tiers: ::Array[Orb::NewSubscriptionGroupedTieredPrice::GroupedTieredConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { tier_lower_bound: String, unit_amount: String } + end + end + type model_type = :grouped_tiered module ModelType @@ -126,15 +163,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionGroupedTieredPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionGroupedTieredPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_subscription_grouped_with_metered_minimum_price.rbs b/sig/orb/models/new_subscription_grouped_with_metered_minimum_price.rbs index 0bd8990a..5004f315 100644 --- a/sig/orb/models/new_subscription_grouped_with_metered_minimum_price.rbs +++ b/sig/orb/models/new_subscription_grouped_with_metered_minimum_price.rbs @@ -3,7 +3,7 @@ module Orb type new_subscription_grouped_with_metered_minimum_price = { cadence: Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice::cadence, - grouped_with_metered_minimum_config: ::Hash[Symbol, top], + grouped_with_metered_minimum_config: Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig, item_id: String, model_type: Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice::model_type, name: String, @@ -25,7 +25,7 @@ module Orb class NewSubscriptionGroupedWithMeteredMinimumPrice < Orb::Internal::Type::BaseModel attr_accessor cadence: Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice::cadence - attr_accessor grouped_with_metered_minimum_config: ::Hash[Symbol, top] + attr_accessor grouped_with_metered_minimum_config: Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig attr_accessor item_id: String @@ -61,7 +61,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice::cadence, - grouped_with_metered_minimum_config: ::Hash[Symbol, top], + grouped_with_metered_minimum_config: Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig, item_id: String, model_type: Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice::model_type, name: String, @@ -82,7 +82,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice::cadence, - grouped_with_metered_minimum_config: ::Hash[Symbol, top], + grouped_with_metered_minimum_config: Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig, item_id: String, model_type: Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice::model_type, name: String, @@ -117,6 +117,75 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice::cadence] end + type grouped_with_metered_minimum_config = + { + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: ::Array[Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor], + scaling_key: String, + unit_amounts: ::Array[Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount] + } + + class GroupedWithMeteredMinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor minimum_unit_amount: String + + attr_accessor pricing_key: String + + attr_accessor scaling_factors: ::Array[Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor] + + attr_accessor scaling_key: String + + attr_accessor unit_amounts: ::Array[Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount] + + def initialize: ( + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: ::Array[Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor], + scaling_key: String, + unit_amounts: ::Array[Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount] + ) -> void + + def to_hash: -> { + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: ::Array[Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::ScalingFactor], + scaling_key: String, + unit_amounts: ::Array[Orb::NewSubscriptionGroupedWithMeteredMinimumPrice::GroupedWithMeteredMinimumConfig::UnitAmount] + } + + type scaling_factor = { scaling_factor: String, scaling_value: String } + + class ScalingFactor < Orb::Internal::Type::BaseModel + attr_accessor scaling_factor: String + + attr_accessor scaling_value: String + + def initialize: ( + scaling_factor: String, + scaling_value: String + ) -> void + + def to_hash: -> { scaling_factor: String, scaling_value: String } + end + + type unit_amount = { pricing_value: String, unit_amount: String } + + class UnitAmount < Orb::Internal::Type::BaseModel + attr_accessor pricing_value: String + + attr_accessor unit_amount: String + + def initialize: (pricing_value: String, unit_amount: String) -> void + + def to_hash: -> { pricing_value: String, unit_amount: String } + end + end + type model_type = :grouped_with_metered_minimum module ModelType @@ -126,15 +195,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionGroupedWithMeteredMinimumPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_subscription_grouped_with_prorated_minimum_price.rbs b/sig/orb/models/new_subscription_grouped_with_prorated_minimum_price.rbs index c60b64bf..f970dc9e 100644 --- a/sig/orb/models/new_subscription_grouped_with_prorated_minimum_price.rbs +++ b/sig/orb/models/new_subscription_grouped_with_prorated_minimum_price.rbs @@ -3,7 +3,7 @@ module Orb type new_subscription_grouped_with_prorated_minimum_price = { cadence: Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice::cadence, - grouped_with_prorated_minimum_config: ::Hash[Symbol, top], + grouped_with_prorated_minimum_config: Orb::NewSubscriptionGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig, item_id: String, model_type: Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice::model_type, name: String, @@ -25,7 +25,7 @@ module Orb class NewSubscriptionGroupedWithProratedMinimumPrice < Orb::Internal::Type::BaseModel attr_accessor cadence: Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice::cadence - attr_accessor grouped_with_prorated_minimum_config: ::Hash[Symbol, top] + attr_accessor grouped_with_prorated_minimum_config: Orb::NewSubscriptionGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig attr_accessor item_id: String @@ -61,7 +61,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice::cadence, - grouped_with_prorated_minimum_config: ::Hash[Symbol, top], + grouped_with_prorated_minimum_config: Orb::NewSubscriptionGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig, item_id: String, model_type: Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice::model_type, name: String, @@ -82,7 +82,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice::cadence, - grouped_with_prorated_minimum_config: ::Hash[Symbol, top], + grouped_with_prorated_minimum_config: Orb::NewSubscriptionGroupedWithProratedMinimumPrice::GroupedWithProratedMinimumConfig, item_id: String, model_type: Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice::model_type, name: String, @@ -117,6 +117,29 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice::cadence] end + type grouped_with_prorated_minimum_config = + { grouping_key: String, minimum: String, unit_rate: String } + + class GroupedWithProratedMinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor minimum: String + + attr_accessor unit_rate: String + + def initialize: ( + grouping_key: String, + minimum: String, + unit_rate: String + ) -> void + + def to_hash: -> { + grouping_key: String, + minimum: String, + unit_rate: String + } + end + type model_type = :grouped_with_prorated_minimum module ModelType @@ -126,15 +149,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionGroupedWithProratedMinimumPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_subscription_matrix_price.rbs b/sig/orb/models/new_subscription_matrix_price.rbs index 4ceb967d..5bcf49b1 100644 --- a/sig/orb/models/new_subscription_matrix_price.rbs +++ b/sig/orb/models/new_subscription_matrix_price.rbs @@ -126,15 +126,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionMatrixPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionMatrixPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_subscription_matrix_with_allocation_price.rbs b/sig/orb/models/new_subscription_matrix_with_allocation_price.rbs index cd2b14a8..26237a63 100644 --- a/sig/orb/models/new_subscription_matrix_with_allocation_price.rbs +++ b/sig/orb/models/new_subscription_matrix_with_allocation_price.rbs @@ -126,15 +126,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionMatrixWithAllocationPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionMatrixWithAllocationPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_subscription_matrix_with_display_name_price.rbs b/sig/orb/models/new_subscription_matrix_with_display_name_price.rbs index bd483deb..b45726e2 100644 --- a/sig/orb/models/new_subscription_matrix_with_display_name_price.rbs +++ b/sig/orb/models/new_subscription_matrix_with_display_name_price.rbs @@ -4,7 +4,7 @@ module Orb { cadence: Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice::cadence, item_id: String, - matrix_with_display_name_config: ::Hash[Symbol, top], + matrix_with_display_name_config: Orb::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig, model_type: Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice::model_type, name: String, billable_metric_id: String?, @@ -27,7 +27,7 @@ module Orb attr_accessor item_id: String - attr_accessor matrix_with_display_name_config: ::Hash[Symbol, top] + attr_accessor matrix_with_display_name_config: Orb::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig attr_accessor model_type: Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice::model_type @@ -62,7 +62,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice::cadence, item_id: String, - matrix_with_display_name_config: ::Hash[Symbol, top], + matrix_with_display_name_config: Orb::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig, model_type: Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice::model_type, name: String, ?billable_metric_id: String?, @@ -83,7 +83,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice::cadence, item_id: String, - matrix_with_display_name_config: ::Hash[Symbol, top], + matrix_with_display_name_config: Orb::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig, model_type: Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice::model_type, name: String, billable_metric_id: String?, @@ -117,6 +117,51 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice::cadence] end + type matrix_with_display_name_config = + { + dimension: String, + unit_amounts: ::Array[Orb::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount] + } + + class MatrixWithDisplayNameConfig < Orb::Internal::Type::BaseModel + attr_accessor dimension: String + + attr_accessor unit_amounts: ::Array[Orb::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount] + + def initialize: ( + dimension: String, + unit_amounts: ::Array[Orb::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount] + ) -> void + + def to_hash: -> { + dimension: String, + unit_amounts: ::Array[Orb::NewSubscriptionMatrixWithDisplayNamePrice::MatrixWithDisplayNameConfig::UnitAmount] + } + + type unit_amount = + { dimension_value: String, display_name: String, unit_amount: String } + + class UnitAmount < Orb::Internal::Type::BaseModel + attr_accessor dimension_value: String + + attr_accessor display_name: String + + attr_accessor unit_amount: String + + def initialize: ( + dimension_value: String, + display_name: String, + unit_amount: String + ) -> void + + def to_hash: -> { + dimension_value: String, + display_name: String, + unit_amount: String + } + end + end + type model_type = :matrix_with_display_name module ModelType @@ -126,15 +171,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionMatrixWithDisplayNamePrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_subscription_max_group_tiered_package_price.rbs b/sig/orb/models/new_subscription_max_group_tiered_package_price.rbs index ee1938b1..3ae0a5d3 100644 --- a/sig/orb/models/new_subscription_max_group_tiered_package_price.rbs +++ b/sig/orb/models/new_subscription_max_group_tiered_package_price.rbs @@ -4,7 +4,7 @@ module Orb { cadence: Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice::cadence, item_id: String, - max_group_tiered_package_config: ::Hash[Symbol, top], + max_group_tiered_package_config: Orb::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig, model_type: Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice::model_type, name: String, billable_metric_id: String?, @@ -27,7 +27,7 @@ module Orb attr_accessor item_id: String - attr_accessor max_group_tiered_package_config: ::Hash[Symbol, top] + attr_accessor max_group_tiered_package_config: Orb::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig attr_accessor model_type: Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice::model_type @@ -62,7 +62,7 @@ module Orb def initialize: ( cadence: Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice::cadence, item_id: String, - max_group_tiered_package_config: ::Hash[Symbol, top], + max_group_tiered_package_config: Orb::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig, model_type: Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice::model_type, name: String, ?billable_metric_id: String?, @@ -83,7 +83,7 @@ module Orb def to_hash: -> { cadence: Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice::cadence, item_id: String, - max_group_tiered_package_config: ::Hash[Symbol, top], + max_group_tiered_package_config: Orb::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig, model_type: Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice::model_type, name: String, billable_metric_id: String?, @@ -117,6 +117,48 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice::cadence] end + type max_group_tiered_package_config = + { + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier] + } + + class MaxGroupTieredPackageConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor package_size: String + + attr_accessor tiers: ::Array[Orb::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier] + + def initialize: ( + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier] + ) -> void + + def to_hash: -> { + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::NewSubscriptionMaxGroupTieredPackagePrice::MaxGroupTieredPackageConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { tier_lower_bound: String, unit_amount: String } + end + end + type model_type = :max_group_tiered_package module ModelType @@ -126,15 +168,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionMaxGroupTieredPackagePrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_subscription_bps_price.rbs b/sig/orb/models/new_subscription_minimum_composite_price.rbs similarity index 62% rename from sig/orb/models/new_subscription_bps_price.rbs rename to sig/orb/models/new_subscription_minimum_composite_price.rbs index eaf3e84b..358466ed 100644 --- a/sig/orb/models/new_subscription_bps_price.rbs +++ b/sig/orb/models/new_subscription_minimum_composite_price.rbs @@ -1,17 +1,17 @@ module Orb module Models - type new_subscription_bps_price = + type new_subscription_minimum_composite_price = { - bps_config: Orb::BPSConfig, - cadence: Orb::Models::NewSubscriptionBPSPrice::cadence, + cadence: Orb::Models::NewSubscriptionMinimumCompositePrice::cadence, item_id: String, - model_type: Orb::Models::NewSubscriptionBPSPrice::model_type, + minimum_config: Orb::NewSubscriptionMinimumCompositePrice::MinimumConfig, + model_type: Orb::Models::NewSubscriptionMinimumCompositePrice::model_type, name: String, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewSubscriptionBPSPrice::conversion_rate_config?, + conversion_rate_config: Orb::Models::NewSubscriptionMinimumCompositePrice::conversion_rate_config?, currency: String?, dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, external_price_id: String?, @@ -22,14 +22,14 @@ module Orb reference_id: String? } - class NewSubscriptionBPSPrice < Orb::Internal::Type::BaseModel - attr_accessor bps_config: Orb::BPSConfig - - attr_accessor cadence: Orb::Models::NewSubscriptionBPSPrice::cadence + class NewSubscriptionMinimumCompositePrice < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::NewSubscriptionMinimumCompositePrice::cadence attr_accessor item_id: String - attr_accessor model_type: Orb::Models::NewSubscriptionBPSPrice::model_type + attr_accessor minimum_config: Orb::NewSubscriptionMinimumCompositePrice::MinimumConfig + + attr_accessor model_type: Orb::Models::NewSubscriptionMinimumCompositePrice::model_type attr_accessor name: String @@ -41,7 +41,7 @@ module Orb attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::NewSubscriptionBPSPrice::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::NewSubscriptionMinimumCompositePrice::conversion_rate_config? attr_accessor currency: String? @@ -60,16 +60,16 @@ module Orb attr_accessor reference_id: String? def initialize: ( - bps_config: Orb::BPSConfig, - cadence: Orb::Models::NewSubscriptionBPSPrice::cadence, + cadence: Orb::Models::NewSubscriptionMinimumCompositePrice::cadence, item_id: String, - model_type: Orb::Models::NewSubscriptionBPSPrice::model_type, + minimum_config: Orb::NewSubscriptionMinimumCompositePrice::MinimumConfig, + model_type: Orb::Models::NewSubscriptionMinimumCompositePrice::model_type, name: String, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, ?conversion_rate: Float?, - ?conversion_rate_config: Orb::Models::NewSubscriptionBPSPrice::conversion_rate_config?, + ?conversion_rate_config: Orb::Models::NewSubscriptionMinimumCompositePrice::conversion_rate_config?, ?currency: String?, ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, ?external_price_id: String?, @@ -81,16 +81,16 @@ module Orb ) -> void def to_hash: -> { - bps_config: Orb::BPSConfig, - cadence: Orb::Models::NewSubscriptionBPSPrice::cadence, + cadence: Orb::Models::NewSubscriptionMinimumCompositePrice::cadence, item_id: String, - model_type: Orb::Models::NewSubscriptionBPSPrice::model_type, + minimum_config: Orb::NewSubscriptionMinimumCompositePrice::MinimumConfig, + model_type: Orb::Models::NewSubscriptionMinimumCompositePrice::model_type, name: String, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewSubscriptionBPSPrice::conversion_rate_config?, + conversion_rate_config: Orb::Models::NewSubscriptionMinimumCompositePrice::conversion_rate_config?, currency: String?, dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, external_price_id: String?, @@ -114,26 +114,31 @@ module Orb ONE_TIME: :one_time CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::NewSubscriptionBPSPrice::cadence] + def self?.values: -> ::Array[Orb::Models::NewSubscriptionMinimumCompositePrice::cadence] end - type model_type = :bps + type minimum_config = { minimum_amount: String, prorated: bool } - module ModelType - extend Orb::Internal::Type::Enum + class MinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor minimum_amount: String + + attr_reader prorated: bool? - BPS: :bps + def prorated=: (bool) -> bool - def self?.values: -> ::Array[Orb::Models::NewSubscriptionBPSPrice::model_type] + def initialize: (minimum_amount: String, ?prorated: bool) -> void + + def to_hash: -> { minimum_amount: String, prorated: bool } end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type model_type = :minimum + + module ModelType + extend Orb::Internal::Type::Enum - module ConversionRateConfig - extend Orb::Internal::Type::Union + MINIMUM: :minimum - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionBPSPrice::conversion_rate_config] + def self?.values: -> ::Array[Orb::Models::NewSubscriptionMinimumCompositePrice::model_type] end end end diff --git a/sig/orb/models/new_subscription_package_price.rbs b/sig/orb/models/new_subscription_package_price.rbs index 466e9dc9..2ec1b84c 100644 --- a/sig/orb/models/new_subscription_package_price.rbs +++ b/sig/orb/models/new_subscription_package_price.rbs @@ -126,15 +126,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionPackagePrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionPackagePrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_subscription_package_with_allocation_price.rbs b/sig/orb/models/new_subscription_package_with_allocation_price.rbs index b888865c..d92baccb 100644 --- a/sig/orb/models/new_subscription_package_with_allocation_price.rbs +++ b/sig/orb/models/new_subscription_package_with_allocation_price.rbs @@ -6,7 +6,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionPackageWithAllocationPrice::model_type, name: String, - package_with_allocation_config: ::Hash[Symbol, top], + package_with_allocation_config: Orb::NewSubscriptionPackageWithAllocationPrice::PackageWithAllocationConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -31,7 +31,7 @@ module Orb attr_accessor name: String - attr_accessor package_with_allocation_config: ::Hash[Symbol, top] + attr_accessor package_with_allocation_config: Orb::NewSubscriptionPackageWithAllocationPrice::PackageWithAllocationConfig attr_accessor billable_metric_id: String? @@ -64,7 +64,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionPackageWithAllocationPrice::model_type, name: String, - package_with_allocation_config: ::Hash[Symbol, top], + package_with_allocation_config: Orb::NewSubscriptionPackageWithAllocationPrice::PackageWithAllocationConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -85,7 +85,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionPackageWithAllocationPrice::model_type, name: String, - package_with_allocation_config: ::Hash[Symbol, top], + package_with_allocation_config: Orb::NewSubscriptionPackageWithAllocationPrice::PackageWithAllocationConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -127,13 +127,27 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionPackageWithAllocationPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type package_with_allocation_config = + { allocation: String, package_amount: String, package_size: String } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class PackageWithAllocationConfig < Orb::Internal::Type::BaseModel + attr_accessor allocation: String - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionPackageWithAllocationPrice::conversion_rate_config] + attr_accessor package_amount: String + + attr_accessor package_size: String + + def initialize: ( + allocation: String, + package_amount: String, + package_size: String + ) -> void + + def to_hash: -> { + allocation: String, + package_amount: String, + package_size: String + } end end end diff --git a/sig/orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rbs b/sig/orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rbs index 593f4ebf..13aa74ef 100644 --- a/sig/orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rbs +++ b/sig/orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rbs @@ -6,7 +6,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice::model_type, name: String, - scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_tiered_pricing_config: Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -31,7 +31,7 @@ module Orb attr_accessor name: String - attr_accessor scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top] + attr_accessor scalable_matrix_with_tiered_pricing_config: Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig attr_accessor billable_metric_id: String? @@ -64,7 +64,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice::model_type, name: String, - scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_tiered_pricing_config: Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -85,7 +85,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice::model_type, name: String, - scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_tiered_pricing_config: Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -127,13 +127,78 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type scalable_matrix_with_tiered_pricing_config = + { + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor], + tiers: ::Array[Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier], + second_dimension: String? + } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class ScalableMatrixWithTieredPricingConfig < Orb::Internal::Type::BaseModel + attr_accessor first_dimension: String - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionScalableMatrixWithTieredPricingPrice::conversion_rate_config] + attr_accessor matrix_scaling_factors: ::Array[Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor] + + attr_accessor tiers: ::Array[Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier] + + attr_accessor second_dimension: String? + + def initialize: ( + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor], + tiers: ::Array[Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier], + ?second_dimension: String? + ) -> void + + def to_hash: -> { + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor], + tiers: ::Array[Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice::ScalableMatrixWithTieredPricingConfig::Tier], + second_dimension: String? + } + + type matrix_scaling_factor = + { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: String? + } + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + attr_accessor first_dimension_value: String + + attr_accessor scaling_factor: String + + attr_accessor second_dimension_value: String? + + def initialize: ( + first_dimension_value: String, + scaling_factor: String, + ?second_dimension_value: String? + ) -> void + + def to_hash: -> { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: String? + } + end + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { tier_lower_bound: String, unit_amount: String } + end end end end diff --git a/sig/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rbs b/sig/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rbs index 7d44c1e4..57af58b7 100644 --- a/sig/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rbs +++ b/sig/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rbs @@ -6,7 +6,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice::model_type, name: String, - scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_unit_pricing_config: Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -31,7 +31,7 @@ module Orb attr_accessor name: String - attr_accessor scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top] + attr_accessor scalable_matrix_with_unit_pricing_config: Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig attr_accessor billable_metric_id: String? @@ -64,7 +64,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice::model_type, name: String, - scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_unit_pricing_config: Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -85,7 +85,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice::model_type, name: String, - scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_unit_pricing_config: Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -127,13 +127,68 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionScalableMatrixWithUnitPricingPrice::conversion_rate_config] + type scalable_matrix_with_unit_pricing_config = + { + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor], + unit_price: String, + prorate: bool?, + second_dimension: String? + } + + class ScalableMatrixWithUnitPricingConfig < Orb::Internal::Type::BaseModel + attr_accessor first_dimension: String + + attr_accessor matrix_scaling_factors: ::Array[Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor] + + attr_accessor unit_price: String + + attr_accessor prorate: bool? + + attr_accessor second_dimension: String? + + def initialize: ( + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor], + unit_price: String, + ?prorate: bool?, + ?second_dimension: String? + ) -> void + + def to_hash: -> { + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor], + unit_price: String, + prorate: bool?, + second_dimension: String? + } + + type matrix_scaling_factor = + { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: String? + } + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + attr_accessor first_dimension_value: String + + attr_accessor scaling_factor: String + + attr_accessor second_dimension_value: String? + + def initialize: ( + first_dimension_value: String, + scaling_factor: String, + ?second_dimension_value: String? + ) -> void + + def to_hash: -> { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: String? + } + end end end end diff --git a/sig/orb/models/new_subscription_threshold_total_amount_price.rbs b/sig/orb/models/new_subscription_threshold_total_amount_price.rbs index 1978f825..a5dc9847 100644 --- a/sig/orb/models/new_subscription_threshold_total_amount_price.rbs +++ b/sig/orb/models/new_subscription_threshold_total_amount_price.rbs @@ -6,7 +6,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionThresholdTotalAmountPrice::model_type, name: String, - threshold_total_amount_config: ::Hash[Symbol, top], + threshold_total_amount_config: Orb::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -31,7 +31,7 @@ module Orb attr_accessor name: String - attr_accessor threshold_total_amount_config: ::Hash[Symbol, top] + attr_accessor threshold_total_amount_config: Orb::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig attr_accessor billable_metric_id: String? @@ -64,7 +64,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionThresholdTotalAmountPrice::model_type, name: String, - threshold_total_amount_config: ::Hash[Symbol, top], + threshold_total_amount_config: Orb::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -85,7 +85,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionThresholdTotalAmountPrice::model_type, name: String, - threshold_total_amount_config: ::Hash[Symbol, top], + threshold_total_amount_config: Orb::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -127,13 +127,38 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionThresholdTotalAmountPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type threshold_total_amount_config = + { + consumption_table: ::Array[Orb::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable], + prorate: bool? + } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class ThresholdTotalAmountConfig < Orb::Internal::Type::BaseModel + attr_accessor consumption_table: ::Array[Orb::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable] - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionThresholdTotalAmountPrice::conversion_rate_config] + attr_accessor prorate: bool? + + def initialize: ( + consumption_table: ::Array[Orb::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable], + ?prorate: bool? + ) -> void + + def to_hash: -> { + consumption_table: ::Array[Orb::NewSubscriptionThresholdTotalAmountPrice::ThresholdTotalAmountConfig::ConsumptionTable], + prorate: bool? + } + + type consumption_table = { threshold: String, total_amount: String } + + class ConsumptionTable < Orb::Internal::Type::BaseModel + attr_accessor threshold: String + + attr_accessor total_amount: String + + def initialize: (threshold: String, total_amount: String) -> void + + def to_hash: -> { threshold: String, total_amount: String } + end end end end diff --git a/sig/orb/models/new_subscription_tier_with_proration_price.rbs b/sig/orb/models/new_subscription_tier_with_proration_price.rbs deleted file mode 100644 index dd856f8e..00000000 --- a/sig/orb/models/new_subscription_tier_with_proration_price.rbs +++ /dev/null @@ -1,140 +0,0 @@ -module Orb - module Models - type new_subscription_tier_with_proration_price = - { - cadence: Orb::Models::NewSubscriptionTierWithProrationPrice::cadence, - item_id: String, - model_type: Orb::Models::NewSubscriptionTierWithProrationPrice::model_type, - name: String, - tiered_with_proration_config: ::Hash[Symbol, top], - billable_metric_id: String?, - billed_in_advance: bool?, - billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewSubscriptionTierWithProrationPrice::conversion_rate_config?, - currency: String?, - dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoice_grouping_key: String?, - invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - metadata: ::Hash[Symbol, String?]?, - reference_id: String? - } - - class NewSubscriptionTierWithProrationPrice < Orb::Internal::Type::BaseModel - attr_accessor cadence: Orb::Models::NewSubscriptionTierWithProrationPrice::cadence - - attr_accessor item_id: String - - attr_accessor model_type: Orb::Models::NewSubscriptionTierWithProrationPrice::model_type - - attr_accessor name: String - - attr_accessor tiered_with_proration_config: ::Hash[Symbol, top] - - attr_accessor billable_metric_id: String? - - attr_accessor billed_in_advance: bool? - - attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? - - attr_accessor conversion_rate: Float? - - attr_accessor conversion_rate_config: Orb::Models::NewSubscriptionTierWithProrationPrice::conversion_rate_config? - - attr_accessor currency: String? - - attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? - - attr_accessor external_price_id: String? - - attr_accessor fixed_price_quantity: Float? - - attr_accessor invoice_grouping_key: String? - - attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? - - attr_accessor metadata: ::Hash[Symbol, String?]? - - attr_accessor reference_id: String? - - def initialize: ( - cadence: Orb::Models::NewSubscriptionTierWithProrationPrice::cadence, - item_id: String, - model_type: Orb::Models::NewSubscriptionTierWithProrationPrice::model_type, - name: String, - tiered_with_proration_config: ::Hash[Symbol, top], - ?billable_metric_id: String?, - ?billed_in_advance: bool?, - ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - ?conversion_rate: Float?, - ?conversion_rate_config: Orb::Models::NewSubscriptionTierWithProrationPrice::conversion_rate_config?, - ?currency: String?, - ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - ?external_price_id: String?, - ?fixed_price_quantity: Float?, - ?invoice_grouping_key: String?, - ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - ?metadata: ::Hash[Symbol, String?]?, - ?reference_id: String? - ) -> void - - def to_hash: -> { - cadence: Orb::Models::NewSubscriptionTierWithProrationPrice::cadence, - item_id: String, - model_type: Orb::Models::NewSubscriptionTierWithProrationPrice::model_type, - name: String, - tiered_with_proration_config: ::Hash[Symbol, top], - billable_metric_id: String?, - billed_in_advance: bool?, - billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewSubscriptionTierWithProrationPrice::conversion_rate_config?, - currency: String?, - dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoice_grouping_key: String?, - invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - metadata: ::Hash[Symbol, String?]?, - reference_id: String? - } - - type cadence = - :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom - - module Cadence - extend Orb::Internal::Type::Enum - - ANNUAL: :annual - SEMI_ANNUAL: :semi_annual - MONTHLY: :monthly - QUARTERLY: :quarterly - ONE_TIME: :one_time - CUSTOM: :custom - - def self?.values: -> ::Array[Orb::Models::NewSubscriptionTierWithProrationPrice::cadence] - end - - type model_type = :tiered_with_proration - - module ModelType - extend Orb::Internal::Type::Enum - - TIERED_WITH_PRORATION: :tiered_with_proration - - def self?.values: -> ::Array[Orb::Models::NewSubscriptionTierWithProrationPrice::model_type] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionTierWithProrationPrice::conversion_rate_config] - end - end - end -end diff --git a/sig/orb/models/new_subscription_tiered_bps_price.rbs b/sig/orb/models/new_subscription_tiered_bps_price.rbs deleted file mode 100644 index 3d83e73d..00000000 --- a/sig/orb/models/new_subscription_tiered_bps_price.rbs +++ /dev/null @@ -1,140 +0,0 @@ -module Orb - module Models - type new_subscription_tiered_bps_price = - { - cadence: Orb::Models::NewSubscriptionTieredBPSPrice::cadence, - item_id: String, - model_type: Orb::Models::NewSubscriptionTieredBPSPrice::model_type, - name: String, - tiered_bps_config: Orb::TieredBPSConfig, - billable_metric_id: String?, - billed_in_advance: bool?, - billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewSubscriptionTieredBPSPrice::conversion_rate_config?, - currency: String?, - dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoice_grouping_key: String?, - invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - metadata: ::Hash[Symbol, String?]?, - reference_id: String? - } - - class NewSubscriptionTieredBPSPrice < Orb::Internal::Type::BaseModel - attr_accessor cadence: Orb::Models::NewSubscriptionTieredBPSPrice::cadence - - attr_accessor item_id: String - - attr_accessor model_type: Orb::Models::NewSubscriptionTieredBPSPrice::model_type - - attr_accessor name: String - - attr_accessor tiered_bps_config: Orb::TieredBPSConfig - - attr_accessor billable_metric_id: String? - - attr_accessor billed_in_advance: bool? - - attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? - - attr_accessor conversion_rate: Float? - - attr_accessor conversion_rate_config: Orb::Models::NewSubscriptionTieredBPSPrice::conversion_rate_config? - - attr_accessor currency: String? - - attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? - - attr_accessor external_price_id: String? - - attr_accessor fixed_price_quantity: Float? - - attr_accessor invoice_grouping_key: String? - - attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? - - attr_accessor metadata: ::Hash[Symbol, String?]? - - attr_accessor reference_id: String? - - def initialize: ( - cadence: Orb::Models::NewSubscriptionTieredBPSPrice::cadence, - item_id: String, - model_type: Orb::Models::NewSubscriptionTieredBPSPrice::model_type, - name: String, - tiered_bps_config: Orb::TieredBPSConfig, - ?billable_metric_id: String?, - ?billed_in_advance: bool?, - ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - ?conversion_rate: Float?, - ?conversion_rate_config: Orb::Models::NewSubscriptionTieredBPSPrice::conversion_rate_config?, - ?currency: String?, - ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - ?external_price_id: String?, - ?fixed_price_quantity: Float?, - ?invoice_grouping_key: String?, - ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - ?metadata: ::Hash[Symbol, String?]?, - ?reference_id: String? - ) -> void - - def to_hash: -> { - cadence: Orb::Models::NewSubscriptionTieredBPSPrice::cadence, - item_id: String, - model_type: Orb::Models::NewSubscriptionTieredBPSPrice::model_type, - name: String, - tiered_bps_config: Orb::TieredBPSConfig, - billable_metric_id: String?, - billed_in_advance: bool?, - billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::NewSubscriptionTieredBPSPrice::conversion_rate_config?, - currency: String?, - dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoice_grouping_key: String?, - invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, - metadata: ::Hash[Symbol, String?]?, - reference_id: String? - } - - type cadence = - :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom - - module Cadence - extend Orb::Internal::Type::Enum - - ANNUAL: :annual - SEMI_ANNUAL: :semi_annual - MONTHLY: :monthly - QUARTERLY: :quarterly - ONE_TIME: :one_time - CUSTOM: :custom - - def self?.values: -> ::Array[Orb::Models::NewSubscriptionTieredBPSPrice::cadence] - end - - type model_type = :tiered_bps - - module ModelType - extend Orb::Internal::Type::Enum - - TIERED_BPS: :tiered_bps - - def self?.values: -> ::Array[Orb::Models::NewSubscriptionTieredBPSPrice::model_type] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionTieredBPSPrice::conversion_rate_config] - end - end - end -end diff --git a/sig/orb/models/new_subscription_tiered_package_price.rbs b/sig/orb/models/new_subscription_tiered_package_price.rbs index e10b2e81..6344ca18 100644 --- a/sig/orb/models/new_subscription_tiered_package_price.rbs +++ b/sig/orb/models/new_subscription_tiered_package_price.rbs @@ -6,7 +6,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionTieredPackagePrice::model_type, name: String, - tiered_package_config: ::Hash[Symbol, top], + tiered_package_config: Orb::NewSubscriptionTieredPackagePrice::TieredPackageConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -31,7 +31,7 @@ module Orb attr_accessor name: String - attr_accessor tiered_package_config: ::Hash[Symbol, top] + attr_accessor tiered_package_config: Orb::NewSubscriptionTieredPackagePrice::TieredPackageConfig attr_accessor billable_metric_id: String? @@ -64,7 +64,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionTieredPackagePrice::model_type, name: String, - tiered_package_config: ::Hash[Symbol, top], + tiered_package_config: Orb::NewSubscriptionTieredPackagePrice::TieredPackageConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -85,7 +85,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionTieredPackagePrice::model_type, name: String, - tiered_package_config: ::Hash[Symbol, top], + tiered_package_config: Orb::NewSubscriptionTieredPackagePrice::TieredPackageConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -127,13 +127,38 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionTieredPackagePrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type tiered_package_config = + { + package_size: String, + tiers: ::Array[Orb::NewSubscriptionTieredPackagePrice::TieredPackageConfig::Tier] + } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class TieredPackageConfig < Orb::Internal::Type::BaseModel + attr_accessor package_size: String - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionTieredPackagePrice::conversion_rate_config] + attr_accessor tiers: ::Array[Orb::NewSubscriptionTieredPackagePrice::TieredPackageConfig::Tier] + + def initialize: ( + package_size: String, + tiers: ::Array[Orb::NewSubscriptionTieredPackagePrice::TieredPackageConfig::Tier] + ) -> void + + def to_hash: -> { + package_size: String, + tiers: ::Array[Orb::NewSubscriptionTieredPackagePrice::TieredPackageConfig::Tier] + } + + type tier = { per_unit: String, tier_lower_bound: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor per_unit: String + + attr_accessor tier_lower_bound: String + + def initialize: (per_unit: String, tier_lower_bound: String) -> void + + def to_hash: -> { per_unit: String, tier_lower_bound: String } + end end end end diff --git a/sig/orb/models/new_subscription_tiered_package_with_minimum_price.rbs b/sig/orb/models/new_subscription_tiered_package_with_minimum_price.rbs index 0000c932..1bbf61ea 100644 --- a/sig/orb/models/new_subscription_tiered_package_with_minimum_price.rbs +++ b/sig/orb/models/new_subscription_tiered_package_with_minimum_price.rbs @@ -6,7 +6,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice::model_type, name: String, - tiered_package_with_minimum_config: ::Hash[Symbol, top], + tiered_package_with_minimum_config: Orb::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -31,7 +31,7 @@ module Orb attr_accessor name: String - attr_accessor tiered_package_with_minimum_config: ::Hash[Symbol, top] + attr_accessor tiered_package_with_minimum_config: Orb::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig attr_accessor billable_metric_id: String? @@ -64,7 +64,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice::model_type, name: String, - tiered_package_with_minimum_config: ::Hash[Symbol, top], + tiered_package_with_minimum_config: Orb::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -85,7 +85,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice::model_type, name: String, - tiered_package_with_minimum_config: ::Hash[Symbol, top], + tiered_package_with_minimum_config: Orb::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -127,13 +127,49 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type tiered_package_with_minimum_config = + { + package_size: Float, + tiers: ::Array[Orb::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier] + } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class TieredPackageWithMinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor package_size: Float - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionTieredPackageWithMinimumPrice::conversion_rate_config] + attr_accessor tiers: ::Array[Orb::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier] + + def initialize: ( + package_size: Float, + tiers: ::Array[Orb::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier] + ) -> void + + def to_hash: -> { + package_size: Float, + tiers: ::Array[Orb::NewSubscriptionTieredPackageWithMinimumPrice::TieredPackageWithMinimumConfig::Tier] + } + + type tier = + { minimum_amount: String, per_unit: String, tier_lower_bound: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor minimum_amount: String + + attr_accessor per_unit: String + + attr_accessor tier_lower_bound: String + + def initialize: ( + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + ) -> void + + def to_hash: -> { + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + } + end end end end diff --git a/sig/orb/models/new_subscription_tiered_price.rbs b/sig/orb/models/new_subscription_tiered_price.rbs index 3c7383b6..489c663f 100644 --- a/sig/orb/models/new_subscription_tiered_price.rbs +++ b/sig/orb/models/new_subscription_tiered_price.rbs @@ -126,15 +126,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionTieredPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionTieredPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_subscription_tiered_with_minimum_price.rbs b/sig/orb/models/new_subscription_tiered_with_minimum_price.rbs index f93a3750..0e0d91f8 100644 --- a/sig/orb/models/new_subscription_tiered_with_minimum_price.rbs +++ b/sig/orb/models/new_subscription_tiered_with_minimum_price.rbs @@ -6,7 +6,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionTieredWithMinimumPrice::model_type, name: String, - tiered_with_minimum_config: ::Hash[Symbol, top], + tiered_with_minimum_config: Orb::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -31,7 +31,7 @@ module Orb attr_accessor name: String - attr_accessor tiered_with_minimum_config: ::Hash[Symbol, top] + attr_accessor tiered_with_minimum_config: Orb::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig attr_accessor billable_metric_id: String? @@ -64,7 +64,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionTieredWithMinimumPrice::model_type, name: String, - tiered_with_minimum_config: ::Hash[Symbol, top], + tiered_with_minimum_config: Orb::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -85,7 +85,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionTieredWithMinimumPrice::model_type, name: String, - tiered_with_minimum_config: ::Hash[Symbol, top], + tiered_with_minimum_config: Orb::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -127,13 +127,62 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionTieredWithMinimumPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type tiered_with_minimum_config = + { + tiers: ::Array[Orb::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig::Tier], + hide_zero_amount_tiers: bool, + prorate: bool + } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class TieredWithMinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig::Tier] - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionTieredWithMinimumPrice::conversion_rate_config] + attr_reader hide_zero_amount_tiers: bool? + + def hide_zero_amount_tiers=: (bool) -> bool + + attr_reader prorate: bool? + + def prorate=: (bool) -> bool + + def initialize: ( + tiers: ::Array[Orb::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig::Tier], + ?hide_zero_amount_tiers: bool, + ?prorate: bool + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::NewSubscriptionTieredWithMinimumPrice::TieredWithMinimumConfig::Tier], + hide_zero_amount_tiers: bool, + prorate: bool + } + + type tier = + { + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor minimum_amount: String + + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + } + end end end end diff --git a/sig/orb/models/new_subscription_unit_price.rbs b/sig/orb/models/new_subscription_unit_price.rbs index 3dbc16bd..6f377c98 100644 --- a/sig/orb/models/new_subscription_unit_price.rbs +++ b/sig/orb/models/new_subscription_unit_price.rbs @@ -126,15 +126,6 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionUnitPrice::model_type] end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionUnitPrice::conversion_rate_config] - end end end end diff --git a/sig/orb/models/new_subscription_unit_with_percent_price.rbs b/sig/orb/models/new_subscription_unit_with_percent_price.rbs index c6d3599b..ddb8aa7e 100644 --- a/sig/orb/models/new_subscription_unit_with_percent_price.rbs +++ b/sig/orb/models/new_subscription_unit_with_percent_price.rbs @@ -6,7 +6,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionUnitWithPercentPrice::model_type, name: String, - unit_with_percent_config: ::Hash[Symbol, top], + unit_with_percent_config: Orb::NewSubscriptionUnitWithPercentPrice::UnitWithPercentConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -31,7 +31,7 @@ module Orb attr_accessor name: String - attr_accessor unit_with_percent_config: ::Hash[Symbol, top] + attr_accessor unit_with_percent_config: Orb::NewSubscriptionUnitWithPercentPrice::UnitWithPercentConfig attr_accessor billable_metric_id: String? @@ -64,7 +64,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionUnitWithPercentPrice::model_type, name: String, - unit_with_percent_config: ::Hash[Symbol, top], + unit_with_percent_config: Orb::NewSubscriptionUnitWithPercentPrice::UnitWithPercentConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -85,7 +85,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionUnitWithPercentPrice::model_type, name: String, - unit_with_percent_config: ::Hash[Symbol, top], + unit_with_percent_config: Orb::NewSubscriptionUnitWithPercentPrice::UnitWithPercentConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -127,13 +127,16 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionUnitWithPercentPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type unit_with_percent_config = { percent: String, unit_amount: String } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class UnitWithPercentConfig < Orb::Internal::Type::BaseModel + attr_accessor percent: String - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionUnitWithPercentPrice::conversion_rate_config] + attr_accessor unit_amount: String + + def initialize: (percent: String, unit_amount: String) -> void + + def to_hash: -> { percent: String, unit_amount: String } end end end diff --git a/sig/orb/models/new_subscription_unit_with_proration_price.rbs b/sig/orb/models/new_subscription_unit_with_proration_price.rbs index 28fb03c9..316f64f9 100644 --- a/sig/orb/models/new_subscription_unit_with_proration_price.rbs +++ b/sig/orb/models/new_subscription_unit_with_proration_price.rbs @@ -6,7 +6,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionUnitWithProrationPrice::model_type, name: String, - unit_with_proration_config: ::Hash[Symbol, top], + unit_with_proration_config: Orb::NewSubscriptionUnitWithProrationPrice::UnitWithProrationConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -31,7 +31,7 @@ module Orb attr_accessor name: String - attr_accessor unit_with_proration_config: ::Hash[Symbol, top] + attr_accessor unit_with_proration_config: Orb::NewSubscriptionUnitWithProrationPrice::UnitWithProrationConfig attr_accessor billable_metric_id: String? @@ -64,7 +64,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionUnitWithProrationPrice::model_type, name: String, - unit_with_proration_config: ::Hash[Symbol, top], + unit_with_proration_config: Orb::NewSubscriptionUnitWithProrationPrice::UnitWithProrationConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -85,7 +85,7 @@ module Orb item_id: String, model_type: Orb::Models::NewSubscriptionUnitWithProrationPrice::model_type, name: String, - unit_with_proration_config: ::Hash[Symbol, top], + unit_with_proration_config: Orb::NewSubscriptionUnitWithProrationPrice::UnitWithProrationConfig, billable_metric_id: String?, billed_in_advance: bool?, billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -127,13 +127,14 @@ module Orb def self?.values: -> ::Array[Orb::Models::NewSubscriptionUnitWithProrationPrice::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type unit_with_proration_config = { unit_amount: String } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class UnitWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor unit_amount: String - def self?.variants: -> ::Array[Orb::Models::NewSubscriptionUnitWithProrationPrice::conversion_rate_config] + def initialize: (unit_amount: String) -> void + + def to_hash: -> { unit_amount: String } end end end diff --git a/sig/orb/models/plan_create_params.rbs b/sig/orb/models/plan_create_params.rbs index 63093ad3..1cc48591 100644 --- a/sig/orb/models/plan_create_params.rbs +++ b/sig/orb/models/plan_create_params.rbs @@ -99,37 +99,623 @@ module Orb type price = Orb::NewPlanUnitPrice - | Orb::NewPlanPackagePrice - | Orb::NewPlanMatrixPrice | Orb::NewPlanTieredPrice - | Orb::NewPlanTieredBPSPrice - | Orb::NewPlanBPSPrice - | Orb::NewPlanBulkBPSPrice | Orb::NewPlanBulkPrice + | Orb::NewPlanPackagePrice + | Orb::NewPlanMatrixPrice | Orb::NewPlanThresholdTotalAmountPrice | Orb::NewPlanTieredPackagePrice | Orb::NewPlanTieredWithMinimumPrice - | Orb::NewPlanUnitWithPercentPrice + | Orb::NewPlanGroupedTieredPrice + | Orb::NewPlanTieredPackageWithMinimumPrice | Orb::NewPlanPackageWithAllocationPrice - | Orb::NewPlanTierWithProrationPrice + | Orb::NewPlanUnitWithPercentPrice + | Orb::NewPlanMatrixWithAllocationPrice + | Orb::PlanCreateParams::Price::Price::TieredWithProration | Orb::NewPlanUnitWithProrationPrice | Orb::NewPlanGroupedAllocationPrice + | Orb::NewPlanBulkWithProrationPrice | Orb::NewPlanGroupedWithProratedMinimumPrice | Orb::NewPlanGroupedWithMeteredMinimumPrice + | Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds | Orb::NewPlanMatrixWithDisplayNamePrice - | Orb::NewPlanBulkWithProrationPrice | Orb::NewPlanGroupedTieredPackagePrice | Orb::NewPlanMaxGroupTieredPackagePrice | Orb::NewPlanScalableMatrixWithUnitPricingPrice | Orb::NewPlanScalableMatrixWithTieredPricingPrice | Orb::NewPlanCumulativeGroupedBulkPrice - | Orb::NewPlanTieredPackageWithMinimumPrice - | Orb::NewPlanMatrixWithAllocationPrice - | Orb::NewPlanGroupedTieredPrice + | Orb::NewPlanMinimumCompositePrice + | Orb::PlanCreateParams::Price::Price::Percent + | Orb::PlanCreateParams::Price::Price::EventOutput module Price extend Orb::Internal::Type::Union + type tiered_with_proration = + { + cadence: Orb::Models::PlanCreateParams::Price::Price::TieredWithProration::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Orb::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::PlanCreateParams::Price::Price::TieredWithProration::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class TieredWithProration < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::Price::TieredWithProration::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_proration + + attr_accessor name: String + + attr_accessor tiered_with_proration_config: Orb::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::PlanCreateParams::Price::Price::TieredWithProration::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::PlanCreateParams::Price::Price::TieredWithProration::cadence, + item_id: String, + name: String, + tiered_with_proration_config: Orb::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::PlanCreateParams::Price::Price::TieredWithProration::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :tiered_with_proration + ) -> void + + def to_hash: -> { + cadence: Orb::Models::PlanCreateParams::Price::Price::TieredWithProration::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Orb::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::PlanCreateParams::Price::Price::TieredWithProration::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::PlanCreateParams::Price::Price::TieredWithProration::cadence] + end + + type tiered_with_proration_config = + { + tiers: ::Array[Orb::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig::Tier] + } + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig::Tier] + + def initialize: ( + tiers: ::Array[Orb::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig::Tier] + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::PlanCreateParams::Price::Price::TieredWithProration::TieredWithProrationConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { + tier_lower_bound: String, + unit_amount: String + } + end + end + end + + type grouped_with_min_max_thresholds = + { + cadence: Orb::Models::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::cadence + + attr_accessor grouped_with_min_max_thresholds_config: Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_with_min_max_thresholds + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :grouped_with_min_max_thresholds + ) -> void + + def to_hash: -> { + cadence: Orb::Models::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::PlanCreateParams::Price::Price::GroupedWithMinMaxThresholds::cadence] + end + + type grouped_with_min_max_thresholds_config = + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor maximum_charge: String + + attr_accessor minimum_charge: String + + attr_accessor per_unit_rate: String + + def initialize: ( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ) -> void + + def to_hash: -> { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + end + end + + type percent = + { + cadence: Orb::Models::PlanCreateParams::Price::Price::Percent::cadence, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::PlanCreateParams::Price::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::PlanCreateParams::Price::Price::Percent::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class Percent < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::Price::Percent::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :percent + + attr_accessor name: String + + attr_accessor percent_config: Orb::PlanCreateParams::Price::Price::Percent::PercentConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::PlanCreateParams::Price::Price::Percent::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::PlanCreateParams::Price::Price::Percent::cadence, + item_id: String, + name: String, + percent_config: Orb::PlanCreateParams::Price::Price::Percent::PercentConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::PlanCreateParams::Price::Price::Percent::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :percent + ) -> void + + def to_hash: -> { + cadence: Orb::Models::PlanCreateParams::Price::Price::Percent::cadence, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::PlanCreateParams::Price::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::PlanCreateParams::Price::Price::Percent::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::PlanCreateParams::Price::Price::Percent::cadence] + end + + type percent_config = { percent: Float } + + class PercentConfig < Orb::Internal::Type::BaseModel + attr_accessor percent: Float + + def initialize: (percent: Float) -> void + + def to_hash: -> { percent: Float } + end + end + + type event_output = + { + cadence: Orb::Models::PlanCreateParams::Price::Price::EventOutput::cadence, + event_output_config: Orb::PlanCreateParams::Price::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::PlanCreateParams::Price::Price::EventOutput::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class EventOutput < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::Price::EventOutput::cadence + + attr_accessor event_output_config: Orb::PlanCreateParams::Price::Price::EventOutput::EventOutputConfig + + attr_accessor item_id: String + + attr_accessor model_type: :event_output + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::PlanCreateParams::Price::Price::EventOutput::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::PlanCreateParams::Price::Price::EventOutput::cadence, + event_output_config: Orb::PlanCreateParams::Price::Price::EventOutput::EventOutputConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::PlanCreateParams::Price::Price::EventOutput::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :event_output + ) -> void + + def to_hash: -> { + cadence: Orb::Models::PlanCreateParams::Price::Price::EventOutput::cadence, + event_output_config: Orb::PlanCreateParams::Price::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::PlanCreateParams::Price::Price::EventOutput::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::PlanCreateParams::Price::Price::EventOutput::cadence] + end + + type event_output_config = + { unit_rating_key: String, grouping_key: String? } + + class EventOutputConfig < Orb::Internal::Type::BaseModel + attr_accessor unit_rating_key: String + + attr_accessor grouping_key: String? + + def initialize: ( + unit_rating_key: String, + ?grouping_key: String? + ) -> void + + def to_hash: -> { unit_rating_key: String, grouping_key: String? } + end + end + def self?.variants: -> ::Array[Orb::Models::PlanCreateParams::Price::price] end end diff --git a/sig/orb/models/price.rbs b/sig/orb/models/price.rbs index b2e86566..bf8a40d1 100644 --- a/sig/orb/models/price.rbs +++ b/sig/orb/models/price.rbs @@ -2,17 +2,14 @@ module Orb module Models type price = Orb::Price::Unit - | Orb::Price::Package - | Orb::Price::Matrix | Orb::Price::Tiered - | Orb::Price::TieredBPS - | Orb::Price::BPS - | Orb::Price::BulkBPS | Orb::Price::Bulk + | Orb::Price::Package + | Orb::Price::Matrix | Orb::Price::ThresholdTotalAmount | Orb::Price::TieredPackage - | Orb::Price::GroupedTiered | Orb::Price::TieredWithMinimum + | Orb::Price::GroupedTiered | Orb::Price::TieredPackageWithMinimum | Orb::Price::PackageWithAllocation | Orb::Price::UnitWithPercent @@ -20,16 +17,19 @@ module Orb | Orb::Price::TieredWithProration | Orb::Price::UnitWithProration | Orb::Price::GroupedAllocation + | Orb::Price::BulkWithProration | Orb::Price::GroupedWithProratedMinimum | Orb::Price::GroupedWithMeteredMinimum + | Orb::Price::GroupedWithMinMaxThresholds | Orb::Price::MatrixWithDisplayName - | Orb::Price::BulkWithProration | Orb::Price::GroupedTieredPackage | Orb::Price::MaxGroupTieredPackage | Orb::Price::ScalableMatrixWithUnitPricing | Orb::Price::ScalableMatrixWithTieredPricing | Orb::Price::CumulativeGroupedBulk - | Orb::Price::GroupedWithMinMaxThresholds + | Orb::Price::Minimum + | Orb::Price::Percent + | Orb::Price::EventOutput module Price extend Orb::Internal::Type::Union @@ -39,7 +39,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Models::Price::Unit::billing_mode, cadence: Orb::Models::Price::Unit::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, conversion_rate_config: Orb::Models::Price::Unit::conversion_rate_config?, created_at: Time, @@ -71,8 +73,12 @@ module Orb attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration + attr_accessor billing_mode: Orb::Models::Price::Unit::billing_mode + attr_accessor cadence: Orb::Models::Price::Unit::cadence + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? + attr_accessor conversion_rate: Float? attr_accessor conversion_rate_config: Orb::Models::Price::Unit::conversion_rate_config? @@ -121,7 +127,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Models::Price::Unit::billing_mode, cadence: Orb::Models::Price::Unit::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, conversion_rate_config: Orb::Models::Price::Unit::conversion_rate_config?, created_at: Time, @@ -150,7 +158,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Models::Price::Unit::billing_mode, cadence: Orb::Models::Price::Unit::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, conversion_rate_config: Orb::Models::Price::Unit::conversion_rate_config?, created_at: Time, @@ -175,6 +185,17 @@ module Orb dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::Unit::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -191,35 +212,29 @@ module Orb def self?.values: -> ::Array[Orb::Models::Price::Unit::cadence] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::Unit::conversion_rate_config] - end - - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price def self?.values: -> ::Array[Orb::Models::Price::Unit::price_type] end end - type package = + type tiered = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::Package::cadence, + billing_mode: Orb::Models::Price::Tiered::billing_mode, + cadence: Orb::Models::Price::Tiered::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::Package::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::Tiered::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -233,27 +248,31 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :package, + model_type: :tiered, name: String, - package_config: Orb::PackageConfig, plan_phase_order: Integer?, - price_type: Orb::Models::Price::Package::price_type, + price_type: Orb::Models::Price::Tiered::price_type, replaces_price_id: String?, + tiered_config: Orb::TieredConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class Package < Orb::Internal::Type::BaseModel + class Tiered < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::Package::cadence + attr_accessor billing_mode: Orb::Models::Price::Tiered::billing_mode + + attr_accessor cadence: Orb::Models::Price::Tiered::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::Package::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::Tiered::conversion_rate_config? attr_accessor created_at: Time @@ -281,27 +300,29 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :package + attr_accessor model_type: :tiered attr_accessor name: String - attr_accessor package_config: Orb::PackageConfig - attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::Package::price_type + attr_accessor price_type: Orb::Models::Price::Tiered::price_type attr_accessor replaces_price_id: String? + attr_accessor tiered_config: Orb::TieredConfig + attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? def initialize: ( id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::Package::cadence, + billing_mode: Orb::Models::Price::Tiered::billing_mode, + cadence: Orb::Models::Price::Tiered::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::Package::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::Tiered::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -316,21 +337,23 @@ module Orb minimum: Orb::Minimum?, minimum_amount: String?, name: String, - package_config: Orb::PackageConfig, plan_phase_order: Integer?, - price_type: Orb::Models::Price::Package::price_type, + price_type: Orb::Models::Price::Tiered::price_type, replaces_price_id: String?, + tiered_config: Orb::TieredConfig, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :package + ?model_type: :tiered ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::Package::cadence, + billing_mode: Orb::Models::Price::Tiered::billing_mode, + cadence: Orb::Models::Price::Tiered::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::Package::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::Tiered::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -344,15 +367,26 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :package, + model_type: :tiered, name: String, - package_config: Orb::PackageConfig, plan_phase_order: Integer?, - price_type: Orb::Models::Price::Package::price_type, + price_type: Orb::Models::Price::Tiered::price_type, replaces_price_id: String?, + tiered_config: Orb::TieredConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::Tiered::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -366,38 +400,33 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::Package::cadence] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::Package::conversion_rate_config] + def self?.values: -> ::Array[Orb::Models::Price::Tiered::cadence] end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::Package::price_type] + def self?.values: -> ::Array[Orb::Models::Price::Tiered::price_type] end end - type matrix = + type bulk = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::Matrix::cadence, + billing_mode: Orb::Models::Price::Bulk::billing_mode, + bulk_config: Orb::BulkConfig, + cadence: Orb::Models::Price::Bulk::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::Matrix::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::Bulk::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -406,32 +435,37 @@ module Orb fixed_price_quantity: Float?, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, - matrix_config: Orb::MatrixConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :matrix, + model_type: :bulk, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::Matrix::price_type, + price_type: Orb::Models::Price::Bulk::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class Matrix < Orb::Internal::Type::BaseModel + class Bulk < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::Matrix::cadence + attr_accessor billing_mode: Orb::Models::Price::Bulk::billing_mode + + attr_accessor bulk_config: Orb::BulkConfig + + attr_accessor cadence: Orb::Models::Price::Bulk::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::Matrix::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::Bulk::conversion_rate_config? attr_accessor created_at: Time @@ -449,8 +483,6 @@ module Orb attr_accessor item: Orb::ItemSlim - attr_accessor matrix_config: Orb::MatrixConfig - attr_accessor maximum: Orb::Maximum? attr_accessor maximum_amount: String? @@ -461,13 +493,13 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :matrix + attr_accessor model_type: :bulk attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::Matrix::price_type + attr_accessor price_type: Orb::Models::Price::Bulk::price_type attr_accessor replaces_price_id: String? @@ -477,9 +509,12 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::Matrix::cadence, + billing_mode: Orb::Models::Price::Bulk::billing_mode, + bulk_config: Orb::BulkConfig, + cadence: Orb::Models::Price::Bulk::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::Matrix::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::Bulk::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -488,7 +523,6 @@ module Orb fixed_price_quantity: Float?, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, - matrix_config: Orb::MatrixConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], @@ -496,19 +530,22 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::Matrix::price_type, + price_type: Orb::Models::Price::Bulk::price_type, replaces_price_id: String?, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :matrix + ?model_type: :bulk ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::Matrix::cadence, + billing_mode: Orb::Models::Price::Bulk::billing_mode, + bulk_config: Orb::BulkConfig, + cadence: Orb::Models::Price::Bulk::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::Matrix::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::Bulk::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -517,20 +554,30 @@ module Orb fixed_price_quantity: Float?, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, - matrix_config: Orb::MatrixConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :matrix, + model_type: :bulk, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::Matrix::price_type, + price_type: Orb::Models::Price::Bulk::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::Bulk::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -544,38 +591,32 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::Matrix::cadence] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::Matrix::conversion_rate_config] + def self?.values: -> ::Array[Orb::Models::Price::Bulk::cadence] end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::Matrix::price_type] + def self?.values: -> ::Array[Orb::Models::Price::Bulk::price_type] end end - type tiered = + type package = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::Tiered::cadence, + billing_mode: Orb::Models::Price::Package::billing_mode, + cadence: Orb::Models::Price::Package::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::Tiered::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::Package::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -589,27 +630,31 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :tiered, + model_type: :package, name: String, + package_config: Orb::PackageConfig, plan_phase_order: Integer?, - price_type: Orb::Models::Price::Tiered::price_type, + price_type: Orb::Models::Price::Package::price_type, replaces_price_id: String?, - tiered_config: Orb::TieredConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class Tiered < Orb::Internal::Type::BaseModel + class Package < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::Tiered::cadence + attr_accessor billing_mode: Orb::Models::Price::Package::billing_mode + + attr_accessor cadence: Orb::Models::Price::Package::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::Tiered::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::Package::conversion_rate_config? attr_accessor created_at: Time @@ -637,27 +682,29 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :tiered + attr_accessor model_type: :package attr_accessor name: String + attr_accessor package_config: Orb::PackageConfig + attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::Tiered::price_type + attr_accessor price_type: Orb::Models::Price::Package::price_type attr_accessor replaces_price_id: String? - attr_accessor tiered_config: Orb::TieredConfig - attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? def initialize: ( id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::Tiered::cadence, + billing_mode: Orb::Models::Price::Package::billing_mode, + cadence: Orb::Models::Price::Package::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::Tiered::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::Package::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -672,21 +719,23 @@ module Orb minimum: Orb::Minimum?, minimum_amount: String?, name: String, + package_config: Orb::PackageConfig, plan_phase_order: Integer?, - price_type: Orb::Models::Price::Tiered::price_type, + price_type: Orb::Models::Price::Package::price_type, replaces_price_id: String?, - tiered_config: Orb::TieredConfig, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :tiered + ?model_type: :package ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::Tiered::cadence, + billing_mode: Orb::Models::Price::Package::billing_mode, + cadence: Orb::Models::Price::Package::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::Tiered::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::Package::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -700,15 +749,26 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :tiered, + model_type: :package, name: String, + package_config: Orb::PackageConfig, plan_phase_order: Integer?, - price_type: Orb::Models::Price::Tiered::price_type, + price_type: Orb::Models::Price::Package::price_type, replaces_price_id: String?, - tiered_config: Orb::TieredConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::Package::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -722,38 +782,32 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::Tiered::cadence] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::Tiered::conversion_rate_config] + def self?.values: -> ::Array[Orb::Models::Price::Package::cadence] end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::Tiered::price_type] + def self?.values: -> ::Array[Orb::Models::Price::Package::price_type] end end - type tiered_bps = + type matrix = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::TieredBPS::cadence, + billing_mode: Orb::Models::Price::Matrix::billing_mode, + cadence: Orb::Models::Price::Matrix::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::TieredBPS::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::Matrix::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -762,32 +816,36 @@ module Orb fixed_price_quantity: Float?, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, + matrix_config: Orb::MatrixConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :tiered_bps, + model_type: :matrix, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::TieredBPS::price_type, + price_type: Orb::Models::Price::Matrix::price_type, replaces_price_id: String?, - tiered_bps_config: Orb::TieredBPSConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class TieredBPS < Orb::Internal::Type::BaseModel + class Matrix < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::TieredBPS::cadence + attr_accessor billing_mode: Orb::Models::Price::Matrix::billing_mode + + attr_accessor cadence: Orb::Models::Price::Matrix::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::TieredBPS::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::Matrix::conversion_rate_config? attr_accessor created_at: Time @@ -805,6 +863,8 @@ module Orb attr_accessor item: Orb::ItemSlim + attr_accessor matrix_config: Orb::MatrixConfig + attr_accessor maximum: Orb::Maximum? attr_accessor maximum_amount: String? @@ -815,27 +875,27 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :tiered_bps + attr_accessor model_type: :matrix attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::TieredBPS::price_type + attr_accessor price_type: Orb::Models::Price::Matrix::price_type attr_accessor replaces_price_id: String? - attr_accessor tiered_bps_config: Orb::TieredBPSConfig - attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? def initialize: ( id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::TieredBPS::cadence, + billing_mode: Orb::Models::Price::Matrix::billing_mode, + cadence: Orb::Models::Price::Matrix::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::TieredBPS::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::Matrix::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -844,6 +904,7 @@ module Orb fixed_price_quantity: Float?, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, + matrix_config: Orb::MatrixConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], @@ -851,20 +912,21 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::TieredBPS::price_type, + price_type: Orb::Models::Price::Matrix::price_type, replaces_price_id: String?, - tiered_bps_config: Orb::TieredBPSConfig, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :tiered_bps + ?model_type: :matrix ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::TieredBPS::cadence, + billing_mode: Orb::Models::Price::Matrix::billing_mode, + cadence: Orb::Models::Price::Matrix::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::TieredBPS::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::Matrix::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -873,20 +935,31 @@ module Orb fixed_price_quantity: Float?, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, + matrix_config: Orb::MatrixConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :tiered_bps, + model_type: :matrix, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::TieredBPS::price_type, + price_type: Orb::Models::Price::Matrix::price_type, replaces_price_id: String?, - tiered_bps_config: Orb::TieredBPSConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::Matrix::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -900,39 +973,32 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::TieredBPS::cadence] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::TieredBPS::conversion_rate_config] + def self?.values: -> ::Array[Orb::Models::Price::Matrix::cadence] end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::TieredBPS::price_type] + def self?.values: -> ::Array[Orb::Models::Price::Matrix::price_type] end end - type bps = + type threshold_total_amount = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bps_config: Orb::BPSConfig, - cadence: Orb::Models::Price::BPS::cadence, + billing_mode: Orb::Models::Price::ThresholdTotalAmount::billing_mode, + cadence: Orb::Models::Price::ThresholdTotalAmount::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::BPS::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::ThresholdTotalAmount::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -946,28 +1012,31 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :bps, + model_type: :threshold_total_amount, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::BPS::price_type, + price_type: Orb::Models::Price::ThresholdTotalAmount::price_type, replaces_price_id: String?, + threshold_total_amount_config: Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class BPS < Orb::Internal::Type::BaseModel + class ThresholdTotalAmount < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor bps_config: Orb::BPSConfig + attr_accessor billing_mode: Orb::Models::Price::ThresholdTotalAmount::billing_mode - attr_accessor cadence: Orb::Models::Price::BPS::cadence + attr_accessor cadence: Orb::Models::Price::ThresholdTotalAmount::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::BPS::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::ThresholdTotalAmount::conversion_rate_config? attr_accessor created_at: Time @@ -995,26 +1064,29 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :bps + attr_accessor model_type: :threshold_total_amount attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::BPS::price_type + attr_accessor price_type: Orb::Models::Price::ThresholdTotalAmount::price_type attr_accessor replaces_price_id: String? + attr_accessor threshold_total_amount_config: Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig + attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? def initialize: ( id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bps_config: Orb::BPSConfig, - cadence: Orb::Models::Price::BPS::cadence, + billing_mode: Orb::Models::Price::ThresholdTotalAmount::billing_mode, + cadence: Orb::Models::Price::ThresholdTotalAmount::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::BPS::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::ThresholdTotalAmount::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -1030,20 +1102,22 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::BPS::price_type, + price_type: Orb::Models::Price::ThresholdTotalAmount::price_type, replaces_price_id: String?, + threshold_total_amount_config: Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :bps + ?model_type: :threshold_total_amount ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bps_config: Orb::BPSConfig, - cadence: Orb::Models::Price::BPS::cadence, + billing_mode: Orb::Models::Price::ThresholdTotalAmount::billing_mode, + cadence: Orb::Models::Price::ThresholdTotalAmount::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::BPS::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::ThresholdTotalAmount::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -1057,14 +1131,26 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :bps, + model_type: :threshold_total_amount, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::BPS::price_type, + price_type: Orb::Models::Price::ThresholdTotalAmount::price_type, replaces_price_id: String?, + threshold_total_amount_config: Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::ThresholdTotalAmount::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -1078,39 +1164,66 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::BPS::cadence] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::BPS::conversion_rate_config] + def self?.values: -> ::Array[Orb::Models::Price::ThresholdTotalAmount::cadence] end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price + + def self?.values: -> ::Array[Orb::Models::Price::ThresholdTotalAmount::price_type] + end + + type threshold_total_amount_config = + { + consumption_table: ::Array[Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig::ConsumptionTable], + prorate: bool? + } + + class ThresholdTotalAmountConfig < Orb::Internal::Type::BaseModel + attr_accessor consumption_table: ::Array[Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig::ConsumptionTable] + + attr_accessor prorate: bool? + + def initialize: ( + consumption_table: ::Array[Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig::ConsumptionTable], + ?prorate: bool? + ) -> void + + def to_hash: -> { + consumption_table: ::Array[Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig::ConsumptionTable], + prorate: bool? + } + + type consumption_table = { threshold: String, total_amount: String } + + class ConsumptionTable < Orb::Internal::Type::BaseModel + attr_accessor threshold: String + + attr_accessor total_amount: String - def self?.values: -> ::Array[Orb::Models::Price::BPS::price_type] + def initialize: (threshold: String, total_amount: String) -> void + + def to_hash: -> { threshold: String, total_amount: String } + end end end - type bulk_bps = + type tiered_package = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::Models::Price::BulkBPS::cadence, + billing_mode: Orb::Models::Price::TieredPackage::billing_mode, + cadence: Orb::Models::Price::TieredPackage::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::BulkBPS::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::TieredPackage::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -1124,28 +1237,31 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :bulk_bps, + model_type: :tiered_package, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::BulkBPS::price_type, + price_type: Orb::Models::Price::TieredPackage::price_type, replaces_price_id: String?, + tiered_package_config: Orb::Price::TieredPackage::TieredPackageConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class BulkBPS < Orb::Internal::Type::BaseModel + class TieredPackage < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor bulk_bps_config: Orb::BulkBPSConfig + attr_accessor billing_mode: Orb::Models::Price::TieredPackage::billing_mode + + attr_accessor cadence: Orb::Models::Price::TieredPackage::cadence - attr_accessor cadence: Orb::Models::Price::BulkBPS::cadence + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::BulkBPS::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::TieredPackage::conversion_rate_config? attr_accessor created_at: Time @@ -1173,26 +1289,29 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :bulk_bps + attr_accessor model_type: :tiered_package attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::BulkBPS::price_type + attr_accessor price_type: Orb::Models::Price::TieredPackage::price_type attr_accessor replaces_price_id: String? + attr_accessor tiered_package_config: Orb::Price::TieredPackage::TieredPackageConfig + attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? def initialize: ( id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::Models::Price::BulkBPS::cadence, + billing_mode: Orb::Models::Price::TieredPackage::billing_mode, + cadence: Orb::Models::Price::TieredPackage::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::BulkBPS::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::TieredPackage::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -1208,20 +1327,22 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::BulkBPS::price_type, + price_type: Orb::Models::Price::TieredPackage::price_type, replaces_price_id: String?, + tiered_package_config: Orb::Price::TieredPackage::TieredPackageConfig, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :bulk_bps + ?model_type: :tiered_package ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::Models::Price::BulkBPS::cadence, + billing_mode: Orb::Models::Price::TieredPackage::billing_mode, + cadence: Orb::Models::Price::TieredPackage::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::BulkBPS::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::TieredPackage::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -1235,14 +1356,26 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :bulk_bps, + model_type: :tiered_package, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::BulkBPS::price_type, + price_type: Orb::Models::Price::TieredPackage::price_type, replaces_price_id: String?, + tiered_package_config: Orb::Price::TieredPackage::TieredPackageConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::TieredPackage::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -1256,39 +1389,66 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::BulkBPS::cadence] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::BulkBPS::conversion_rate_config] + def self?.values: -> ::Array[Orb::Models::Price::TieredPackage::cadence] end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::BulkBPS::price_type] + def self?.values: -> ::Array[Orb::Models::Price::TieredPackage::price_type] + end + + type tiered_package_config = + { + package_size: String, + tiers: ::Array[Orb::Price::TieredPackage::TieredPackageConfig::Tier] + } + + class TieredPackageConfig < Orb::Internal::Type::BaseModel + attr_accessor package_size: String + + attr_accessor tiers: ::Array[Orb::Price::TieredPackage::TieredPackageConfig::Tier] + + def initialize: ( + package_size: String, + tiers: ::Array[Orb::Price::TieredPackage::TieredPackageConfig::Tier] + ) -> void + + def to_hash: -> { + package_size: String, + tiers: ::Array[Orb::Price::TieredPackage::TieredPackageConfig::Tier] + } + + type tier = { per_unit: String, tier_lower_bound: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor per_unit: String + + attr_accessor tier_lower_bound: String + + def initialize: (per_unit: String, tier_lower_bound: String) -> void + + def to_hash: -> { per_unit: String, tier_lower_bound: String } + end end end - type bulk = + type tiered_with_minimum = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_config: Orb::BulkConfig, - cadence: Orb::Models::Price::Bulk::cadence, + billing_mode: Orb::Models::Price::TieredWithMinimum::billing_mode, + cadence: Orb::Models::Price::TieredWithMinimum::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::Bulk::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::TieredWithMinimum::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -1302,28 +1462,31 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :bulk, + model_type: :tiered_with_minimum, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::Bulk::price_type, + price_type: Orb::Models::Price::TieredWithMinimum::price_type, replaces_price_id: String?, + tiered_with_minimum_config: Orb::Price::TieredWithMinimum::TieredWithMinimumConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class Bulk < Orb::Internal::Type::BaseModel + class TieredWithMinimum < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor bulk_config: Orb::BulkConfig + attr_accessor billing_mode: Orb::Models::Price::TieredWithMinimum::billing_mode - attr_accessor cadence: Orb::Models::Price::Bulk::cadence + attr_accessor cadence: Orb::Models::Price::TieredWithMinimum::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::Bulk::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::TieredWithMinimum::conversion_rate_config? attr_accessor created_at: Time @@ -1351,26 +1514,29 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :bulk + attr_accessor model_type: :tiered_with_minimum attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::Bulk::price_type + attr_accessor price_type: Orb::Models::Price::TieredWithMinimum::price_type attr_accessor replaces_price_id: String? + attr_accessor tiered_with_minimum_config: Orb::Price::TieredWithMinimum::TieredWithMinimumConfig + attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? def initialize: ( id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_config: Orb::BulkConfig, - cadence: Orb::Models::Price::Bulk::cadence, + billing_mode: Orb::Models::Price::TieredWithMinimum::billing_mode, + cadence: Orb::Models::Price::TieredWithMinimum::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::Bulk::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::TieredWithMinimum::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -1386,20 +1552,22 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::Bulk::price_type, + price_type: Orb::Models::Price::TieredWithMinimum::price_type, replaces_price_id: String?, + tiered_with_minimum_config: Orb::Price::TieredWithMinimum::TieredWithMinimumConfig, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :bulk + ?model_type: :tiered_with_minimum ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_config: Orb::BulkConfig, - cadence: Orb::Models::Price::Bulk::cadence, + billing_mode: Orb::Models::Price::TieredWithMinimum::billing_mode, + cadence: Orb::Models::Price::TieredWithMinimum::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::Bulk::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::TieredWithMinimum::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -1413,14 +1581,26 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :bulk, + model_type: :tiered_with_minimum, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::Bulk::price_type, + price_type: Orb::Models::Price::TieredWithMinimum::price_type, replaces_price_id: String?, + tiered_with_minimum_config: Orb::Price::TieredWithMinimum::TieredWithMinimumConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::TieredWithMinimum::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -1434,44 +1614,97 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::Bulk::cadence] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::Bulk::conversion_rate_config] + def self?.values: -> ::Array[Orb::Models::Price::TieredWithMinimum::cadence] end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::Bulk::price_type] + def self?.values: -> ::Array[Orb::Models::Price::TieredWithMinimum::price_type] + end + + type tiered_with_minimum_config = + { + tiers: ::Array[Orb::Price::TieredWithMinimum::TieredWithMinimumConfig::Tier], + hide_zero_amount_tiers: bool, + prorate: bool + } + + class TieredWithMinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::Price::TieredWithMinimum::TieredWithMinimumConfig::Tier] + + attr_reader hide_zero_amount_tiers: bool? + + def hide_zero_amount_tiers=: (bool) -> bool + + attr_reader prorate: bool? + + def prorate=: (bool) -> bool + + def initialize: ( + tiers: ::Array[Orb::Price::TieredWithMinimum::TieredWithMinimumConfig::Tier], + ?hide_zero_amount_tiers: bool, + ?prorate: bool + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::Price::TieredWithMinimum::TieredWithMinimumConfig::Tier], + hide_zero_amount_tiers: bool, + prorate: bool + } + + type tier = + { + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor minimum_amount: String + + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + } + end end end - type threshold_total_amount = + type grouped_tiered = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::ThresholdTotalAmount::cadence, + billing_mode: Orb::Models::Price::GroupedTiered::billing_mode, + cadence: Orb::Models::Price::GroupedTiered::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::ThresholdTotalAmount::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::GroupedTiered::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, + grouped_tiered_config: Orb::Price::GroupedTiered::GroupedTieredConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -1479,27 +1712,30 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :threshold_total_amount, + model_type: :grouped_tiered, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::ThresholdTotalAmount::price_type, + price_type: Orb::Models::Price::GroupedTiered::price_type, replaces_price_id: String?, - threshold_total_amount_config: ::Hash[Symbol, top], dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class ThresholdTotalAmount < Orb::Internal::Type::BaseModel + class GroupedTiered < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::ThresholdTotalAmount::cadence + attr_accessor billing_mode: Orb::Models::Price::GroupedTiered::billing_mode + + attr_accessor cadence: Orb::Models::Price::GroupedTiered::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::ThresholdTotalAmount::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::GroupedTiered::conversion_rate_config? attr_accessor created_at: Time @@ -1513,6 +1749,8 @@ module Orb attr_accessor fixed_price_quantity: Float? + attr_accessor grouped_tiered_config: Orb::Price::GroupedTiered::GroupedTieredConfig + attr_accessor invoicing_cycle_configuration: Orb::BillingCycleConfiguration? attr_accessor item: Orb::ItemSlim @@ -1527,33 +1765,34 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :threshold_total_amount + attr_accessor model_type: :grouped_tiered attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::ThresholdTotalAmount::price_type + attr_accessor price_type: Orb::Models::Price::GroupedTiered::price_type attr_accessor replaces_price_id: String? - attr_accessor threshold_total_amount_config: ::Hash[Symbol, top] - attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? def initialize: ( id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::ThresholdTotalAmount::cadence, + billing_mode: Orb::Models::Price::GroupedTiered::billing_mode, + cadence: Orb::Models::Price::GroupedTiered::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::ThresholdTotalAmount::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::GroupedTiered::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, + grouped_tiered_config: Orb::Price::GroupedTiered::GroupedTieredConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -1563,26 +1802,28 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::ThresholdTotalAmount::price_type, + price_type: Orb::Models::Price::GroupedTiered::price_type, replaces_price_id: String?, - threshold_total_amount_config: ::Hash[Symbol, top], ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :threshold_total_amount + ?model_type: :grouped_tiered ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::ThresholdTotalAmount::cadence, + billing_mode: Orb::Models::Price::GroupedTiered::billing_mode, + cadence: Orb::Models::Price::GroupedTiered::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::ThresholdTotalAmount::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::GroupedTiered::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, + grouped_tiered_config: Orb::Price::GroupedTiered::GroupedTieredConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -1590,15 +1831,25 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :threshold_total_amount, + model_type: :grouped_tiered, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::ThresholdTotalAmount::price_type, + price_type: Orb::Models::Price::GroupedTiered::price_type, replaces_price_id: String?, - threshold_total_amount_config: ::Hash[Symbol, top], dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::GroupedTiered::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -1612,38 +1863,69 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::ThresholdTotalAmount::cadence] + def self?.values: -> ::Array[Orb::Models::Price::GroupedTiered::cadence] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type grouped_tiered_config = + { + grouping_key: String, + tiers: ::Array[Orb::Price::GroupedTiered::GroupedTieredConfig::Tier] + } + + class GroupedTieredConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor tiers: ::Array[Orb::Price::GroupedTiered::GroupedTieredConfig::Tier] + + def initialize: ( + grouping_key: String, + tiers: ::Array[Orb::Price::GroupedTiered::GroupedTieredConfig::Tier] + ) -> void + + def to_hash: -> { + grouping_key: String, + tiers: ::Array[Orb::Price::GroupedTiered::GroupedTieredConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String - def self?.variants: -> ::Array[Orb::Models::Price::ThresholdTotalAmount::conversion_rate_config] + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { tier_lower_bound: String, unit_amount: String } + end end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::ThresholdTotalAmount::price_type] + def self?.values: -> ::Array[Orb::Models::Price::GroupedTiered::price_type] end end - type tiered_package = + type tiered_package_with_minimum = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::TieredPackage::cadence, + billing_mode: Orb::Models::Price::TieredPackageWithMinimum::billing_mode, + cadence: Orb::Models::Price::TieredPackageWithMinimum::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::TieredPackage::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::TieredPackageWithMinimum::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -1657,27 +1939,31 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :tiered_package, + model_type: :tiered_package_with_minimum, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::TieredPackage::price_type, + price_type: Orb::Models::Price::TieredPackageWithMinimum::price_type, replaces_price_id: String?, - tiered_package_config: ::Hash[Symbol, top], + tiered_package_with_minimum_config: Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class TieredPackage < Orb::Internal::Type::BaseModel + class TieredPackageWithMinimum < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::TieredPackage::cadence + attr_accessor billing_mode: Orb::Models::Price::TieredPackageWithMinimum::billing_mode + + attr_accessor cadence: Orb::Models::Price::TieredPackageWithMinimum::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::TieredPackage::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::TieredPackageWithMinimum::conversion_rate_config? attr_accessor created_at: Time @@ -1705,17 +1991,17 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :tiered_package + attr_accessor model_type: :tiered_package_with_minimum attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::TieredPackage::price_type + attr_accessor price_type: Orb::Models::Price::TieredPackageWithMinimum::price_type attr_accessor replaces_price_id: String? - attr_accessor tiered_package_config: ::Hash[Symbol, top] + attr_accessor tiered_package_with_minimum_config: Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? @@ -1723,9 +2009,11 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::TieredPackage::cadence, + billing_mode: Orb::Models::Price::TieredPackageWithMinimum::billing_mode, + cadence: Orb::Models::Price::TieredPackageWithMinimum::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::TieredPackage::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::TieredPackageWithMinimum::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -1741,20 +2029,22 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::TieredPackage::price_type, + price_type: Orb::Models::Price::TieredPackageWithMinimum::price_type, replaces_price_id: String?, - tiered_package_config: ::Hash[Symbol, top], + tiered_package_with_minimum_config: Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :tiered_package + ?model_type: :tiered_package_with_minimum ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::TieredPackage::cadence, + billing_mode: Orb::Models::Price::TieredPackageWithMinimum::billing_mode, + cadence: Orb::Models::Price::TieredPackageWithMinimum::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::TieredPackage::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::TieredPackageWithMinimum::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -1768,15 +2058,26 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :tiered_package, + model_type: :tiered_package_with_minimum, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::TieredPackage::price_type, + price_type: Orb::Models::Price::TieredPackageWithMinimum::price_type, replaces_price_id: String?, - tiered_package_config: ::Hash[Symbol, top], + tiered_package_with_minimum_config: Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::TieredPackageWithMinimum::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -1790,45 +2091,87 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::TieredPackage::cadence] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::TieredPackage::conversion_rate_config] + def self?.values: -> ::Array[Orb::Models::Price::TieredPackageWithMinimum::cadence] end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::TieredPackage::price_type] + def self?.values: -> ::Array[Orb::Models::Price::TieredPackageWithMinimum::price_type] + end + + type tiered_package_with_minimum_config = + { + package_size: Float, + tiers: ::Array[Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig::Tier] + } + + class TieredPackageWithMinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor package_size: Float + + attr_accessor tiers: ::Array[Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig::Tier] + + def initialize: ( + package_size: Float, + tiers: ::Array[Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig::Tier] + ) -> void + + def to_hash: -> { + package_size: Float, + tiers: ::Array[Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig::Tier] + } + + type tier = + { + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor minimum_amount: String + + attr_accessor per_unit: String + + attr_accessor tier_lower_bound: String + + def initialize: ( + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + ) -> void + + def to_hash: -> { + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + } + end end end - type grouped_tiered = + type package_with_allocation = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedTiered::cadence, + billing_mode: Orb::Models::Price::PackageWithAllocation::billing_mode, + cadence: Orb::Models::Price::PackageWithAllocation::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::GroupedTiered::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::PackageWithAllocation::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_tiered_config: ::Hash[Symbol, top], invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -1836,26 +2179,31 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :grouped_tiered, + model_type: :package_with_allocation, name: String, + package_with_allocation_config: Orb::Price::PackageWithAllocation::PackageWithAllocationConfig, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedTiered::price_type, + price_type: Orb::Models::Price::PackageWithAllocation::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class GroupedTiered < Orb::Internal::Type::BaseModel + class PackageWithAllocation < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::GroupedTiered::cadence + attr_accessor billing_mode: Orb::Models::Price::PackageWithAllocation::billing_mode + + attr_accessor cadence: Orb::Models::Price::PackageWithAllocation::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::GroupedTiered::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::PackageWithAllocation::conversion_rate_config? attr_accessor created_at: Time @@ -1869,8 +2217,6 @@ module Orb attr_accessor fixed_price_quantity: Float? - attr_accessor grouped_tiered_config: ::Hash[Symbol, top] - attr_accessor invoicing_cycle_configuration: Orb::BillingCycleConfiguration? attr_accessor item: Orb::ItemSlim @@ -1885,13 +2231,15 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :grouped_tiered + attr_accessor model_type: :package_with_allocation attr_accessor name: String + attr_accessor package_with_allocation_config: Orb::Price::PackageWithAllocation::PackageWithAllocationConfig + attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::GroupedTiered::price_type + attr_accessor price_type: Orb::Models::Price::PackageWithAllocation::price_type attr_accessor replaces_price_id: String? @@ -1901,16 +2249,17 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedTiered::cadence, + billing_mode: Orb::Models::Price::PackageWithAllocation::billing_mode, + cadence: Orb::Models::Price::PackageWithAllocation::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::GroupedTiered::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::PackageWithAllocation::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_tiered_config: ::Hash[Symbol, top], invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -1919,27 +2268,29 @@ module Orb minimum: Orb::Minimum?, minimum_amount: String?, name: String, + package_with_allocation_config: Orb::Price::PackageWithAllocation::PackageWithAllocationConfig, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedTiered::price_type, + price_type: Orb::Models::Price::PackageWithAllocation::price_type, replaces_price_id: String?, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :grouped_tiered + ?model_type: :package_with_allocation ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedTiered::cadence, + billing_mode: Orb::Models::Price::PackageWithAllocation::billing_mode, + cadence: Orb::Models::Price::PackageWithAllocation::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::GroupedTiered::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::PackageWithAllocation::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_tiered_config: ::Hash[Symbol, top], invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -1947,14 +2298,26 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :grouped_tiered, + model_type: :package_with_allocation, name: String, + package_with_allocation_config: Orb::Price::PackageWithAllocation::PackageWithAllocationConfig, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedTiered::price_type, + price_type: Orb::Models::Price::PackageWithAllocation::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::PackageWithAllocation::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -1968,38 +2331,55 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::GroupedTiered::cadence] + def self?.values: -> ::Array[Orb::Models::Price::PackageWithAllocation::cadence] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type package_with_allocation_config = + { allocation: String, package_amount: String, package_size: String } + + class PackageWithAllocationConfig < Orb::Internal::Type::BaseModel + attr_accessor allocation: String + + attr_accessor package_amount: String - module ConversionRateConfig - extend Orb::Internal::Type::Union + attr_accessor package_size: String - def self?.variants: -> ::Array[Orb::Models::Price::GroupedTiered::conversion_rate_config] + def initialize: ( + allocation: String, + package_amount: String, + package_size: String + ) -> void + + def to_hash: -> { + allocation: String, + package_amount: String, + package_size: String + } end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::GroupedTiered::price_type] + def self?.values: -> ::Array[Orb::Models::Price::PackageWithAllocation::price_type] end end - type tiered_with_minimum = + type unit_with_percent = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::TieredWithMinimum::cadence, + billing_mode: Orb::Models::Price::UnitWithPercent::billing_mode, + cadence: Orb::Models::Price::UnitWithPercent::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::TieredWithMinimum::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::UnitWithPercent::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -2013,27 +2393,31 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :tiered_with_minimum, + model_type: :unit_with_percent, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::TieredWithMinimum::price_type, + price_type: Orb::Models::Price::UnitWithPercent::price_type, replaces_price_id: String?, - tiered_with_minimum_config: ::Hash[Symbol, top], + unit_with_percent_config: Orb::Price::UnitWithPercent::UnitWithPercentConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class TieredWithMinimum < Orb::Internal::Type::BaseModel + class UnitWithPercent < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::TieredWithMinimum::cadence + attr_accessor billing_mode: Orb::Models::Price::UnitWithPercent::billing_mode + + attr_accessor cadence: Orb::Models::Price::UnitWithPercent::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::TieredWithMinimum::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::UnitWithPercent::conversion_rate_config? attr_accessor created_at: Time @@ -2061,17 +2445,17 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :tiered_with_minimum + attr_accessor model_type: :unit_with_percent attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::TieredWithMinimum::price_type + attr_accessor price_type: Orb::Models::Price::UnitWithPercent::price_type attr_accessor replaces_price_id: String? - attr_accessor tiered_with_minimum_config: ::Hash[Symbol, top] + attr_accessor unit_with_percent_config: Orb::Price::UnitWithPercent::UnitWithPercentConfig attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? @@ -2079,9 +2463,11 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::TieredWithMinimum::cadence, + billing_mode: Orb::Models::Price::UnitWithPercent::billing_mode, + cadence: Orb::Models::Price::UnitWithPercent::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::TieredWithMinimum::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::UnitWithPercent::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -2097,20 +2483,22 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::TieredWithMinimum::price_type, + price_type: Orb::Models::Price::UnitWithPercent::price_type, replaces_price_id: String?, - tiered_with_minimum_config: ::Hash[Symbol, top], + unit_with_percent_config: Orb::Price::UnitWithPercent::UnitWithPercentConfig, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :tiered_with_minimum + ?model_type: :unit_with_percent ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::TieredWithMinimum::cadence, + billing_mode: Orb::Models::Price::UnitWithPercent::billing_mode, + cadence: Orb::Models::Price::UnitWithPercent::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::TieredWithMinimum::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::UnitWithPercent::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -2124,15 +2512,26 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :tiered_with_minimum, + model_type: :unit_with_percent, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::TieredWithMinimum::price_type, + price_type: Orb::Models::Price::UnitWithPercent::price_type, replaces_price_id: String?, - tiered_with_minimum_config: ::Hash[Symbol, top], + unit_with_percent_config: Orb::Price::UnitWithPercent::UnitWithPercentConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::UnitWithPercent::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -2146,38 +2545,44 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::TieredWithMinimum::cadence] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::TieredWithMinimum::conversion_rate_config] + def self?.values: -> ::Array[Orb::Models::Price::UnitWithPercent::cadence] end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::TieredWithMinimum::price_type] + def self?.values: -> ::Array[Orb::Models::Price::UnitWithPercent::price_type] + end + + type unit_with_percent_config = { percent: String, unit_amount: String } + + class UnitWithPercentConfig < Orb::Internal::Type::BaseModel + attr_accessor percent: String + + attr_accessor unit_amount: String + + def initialize: (percent: String, unit_amount: String) -> void + + def to_hash: -> { percent: String, unit_amount: String } end end - type tiered_package_with_minimum = + type matrix_with_allocation = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::TieredPackageWithMinimum::cadence, + billing_mode: Orb::Models::Price::MatrixWithAllocation::billing_mode, + cadence: Orb::Models::Price::MatrixWithAllocation::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::TieredPackageWithMinimum::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::MatrixWithAllocation::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -2186,32 +2591,36 @@ module Orb fixed_price_quantity: Float?, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, + matrix_with_allocation_config: Orb::MatrixWithAllocationConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :tiered_package_with_minimum, + model_type: :matrix_with_allocation, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::TieredPackageWithMinimum::price_type, + price_type: Orb::Models::Price::MatrixWithAllocation::price_type, replaces_price_id: String?, - tiered_package_with_minimum_config: ::Hash[Symbol, top], dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class TieredPackageWithMinimum < Orb::Internal::Type::BaseModel + class MatrixWithAllocation < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::TieredPackageWithMinimum::cadence + attr_accessor billing_mode: Orb::Models::Price::MatrixWithAllocation::billing_mode + + attr_accessor cadence: Orb::Models::Price::MatrixWithAllocation::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::TieredPackageWithMinimum::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::MatrixWithAllocation::conversion_rate_config? attr_accessor created_at: Time @@ -2229,6 +2638,8 @@ module Orb attr_accessor item: Orb::ItemSlim + attr_accessor matrix_with_allocation_config: Orb::MatrixWithAllocationConfig + attr_accessor maximum: Orb::Maximum? attr_accessor maximum_amount: String? @@ -2239,27 +2650,27 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :tiered_package_with_minimum + attr_accessor model_type: :matrix_with_allocation attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::TieredPackageWithMinimum::price_type + attr_accessor price_type: Orb::Models::Price::MatrixWithAllocation::price_type attr_accessor replaces_price_id: String? - attr_accessor tiered_package_with_minimum_config: ::Hash[Symbol, top] - attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? def initialize: ( id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::TieredPackageWithMinimum::cadence, + billing_mode: Orb::Models::Price::MatrixWithAllocation::billing_mode, + cadence: Orb::Models::Price::MatrixWithAllocation::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::TieredPackageWithMinimum::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::MatrixWithAllocation::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -2268,6 +2679,7 @@ module Orb fixed_price_quantity: Float?, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, + matrix_with_allocation_config: Orb::MatrixWithAllocationConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], @@ -2275,20 +2687,21 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::TieredPackageWithMinimum::price_type, + price_type: Orb::Models::Price::MatrixWithAllocation::price_type, replaces_price_id: String?, - tiered_package_with_minimum_config: ::Hash[Symbol, top], ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :tiered_package_with_minimum + ?model_type: :matrix_with_allocation ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::TieredPackageWithMinimum::cadence, + billing_mode: Orb::Models::Price::MatrixWithAllocation::billing_mode, + cadence: Orb::Models::Price::MatrixWithAllocation::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::TieredPackageWithMinimum::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::MatrixWithAllocation::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -2297,20 +2710,31 @@ module Orb fixed_price_quantity: Float?, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, + matrix_with_allocation_config: Orb::MatrixWithAllocationConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :tiered_package_with_minimum, + model_type: :matrix_with_allocation, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::TieredPackageWithMinimum::price_type, + price_type: Orb::Models::Price::MatrixWithAllocation::price_type, replaces_price_id: String?, - tiered_package_with_minimum_config: ::Hash[Symbol, top], dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::MatrixWithAllocation::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -2324,38 +2748,32 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::TieredPackageWithMinimum::cadence] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::TieredPackageWithMinimum::conversion_rate_config] + def self?.values: -> ::Array[Orb::Models::Price::MatrixWithAllocation::cadence] end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::TieredPackageWithMinimum::price_type] + def self?.values: -> ::Array[Orb::Models::Price::MatrixWithAllocation::price_type] end end - type package_with_allocation = + type tiered_with_proration = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::PackageWithAllocation::cadence, + billing_mode: Orb::Models::Price::TieredWithProration::billing_mode, + cadence: Orb::Models::Price::TieredWithProration::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::PackageWithAllocation::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::TieredWithProration::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -2369,27 +2787,31 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :package_with_allocation, + model_type: :tiered_with_proration, name: String, - package_with_allocation_config: ::Hash[Symbol, top], plan_phase_order: Integer?, - price_type: Orb::Models::Price::PackageWithAllocation::price_type, + price_type: Orb::Models::Price::TieredWithProration::price_type, replaces_price_id: String?, + tiered_with_proration_config: Orb::Price::TieredWithProration::TieredWithProrationConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class PackageWithAllocation < Orb::Internal::Type::BaseModel + class TieredWithProration < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::PackageWithAllocation::cadence + attr_accessor billing_mode: Orb::Models::Price::TieredWithProration::billing_mode + + attr_accessor cadence: Orb::Models::Price::TieredWithProration::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::PackageWithAllocation::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::TieredWithProration::conversion_rate_config? attr_accessor created_at: Time @@ -2417,27 +2839,29 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :package_with_allocation + attr_accessor model_type: :tiered_with_proration attr_accessor name: String - attr_accessor package_with_allocation_config: ::Hash[Symbol, top] - attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::PackageWithAllocation::price_type + attr_accessor price_type: Orb::Models::Price::TieredWithProration::price_type attr_accessor replaces_price_id: String? + attr_accessor tiered_with_proration_config: Orb::Price::TieredWithProration::TieredWithProrationConfig + attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? def initialize: ( id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::PackageWithAllocation::cadence, + billing_mode: Orb::Models::Price::TieredWithProration::billing_mode, + cadence: Orb::Models::Price::TieredWithProration::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::PackageWithAllocation::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::TieredWithProration::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -2452,21 +2876,23 @@ module Orb minimum: Orb::Minimum?, minimum_amount: String?, name: String, - package_with_allocation_config: ::Hash[Symbol, top], plan_phase_order: Integer?, - price_type: Orb::Models::Price::PackageWithAllocation::price_type, + price_type: Orb::Models::Price::TieredWithProration::price_type, replaces_price_id: String?, + tiered_with_proration_config: Orb::Price::TieredWithProration::TieredWithProrationConfig, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :package_with_allocation + ?model_type: :tiered_with_proration ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::PackageWithAllocation::cadence, + billing_mode: Orb::Models::Price::TieredWithProration::billing_mode, + cadence: Orb::Models::Price::TieredWithProration::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::PackageWithAllocation::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::TieredWithProration::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -2480,15 +2906,26 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :package_with_allocation, + model_type: :tiered_with_proration, name: String, - package_with_allocation_config: ::Hash[Symbol, top], plan_phase_order: Integer?, - price_type: Orb::Models::Price::PackageWithAllocation::price_type, + price_type: Orb::Models::Price::TieredWithProration::price_type, replaces_price_id: String?, + tiered_with_proration_config: Orb::Price::TieredWithProration::TieredWithProrationConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::TieredWithProration::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -2502,38 +2939,64 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::PackageWithAllocation::cadence] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::PackageWithAllocation::conversion_rate_config] + def self?.values: -> ::Array[Orb::Models::Price::TieredWithProration::cadence] end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::PackageWithAllocation::price_type] + def self?.values: -> ::Array[Orb::Models::Price::TieredWithProration::price_type] + end + + type tiered_with_proration_config = + { + tiers: ::Array[Orb::Price::TieredWithProration::TieredWithProrationConfig::Tier] + } + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::Price::TieredWithProration::TieredWithProrationConfig::Tier] + + def initialize: ( + tiers: ::Array[Orb::Price::TieredWithProration::TieredWithProrationConfig::Tier] + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::Price::TieredWithProration::TieredWithProrationConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { tier_lower_bound: String, unit_amount: String } + end end end - type unit_with_percent = + type unit_with_proration = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::UnitWithPercent::cadence, + billing_mode: Orb::Models::Price::UnitWithProration::billing_mode, + cadence: Orb::Models::Price::UnitWithProration::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::UnitWithPercent::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::UnitWithProration::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -2547,27 +3010,31 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :unit_with_percent, + model_type: :unit_with_proration, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::UnitWithPercent::price_type, + price_type: Orb::Models::Price::UnitWithProration::price_type, replaces_price_id: String?, - unit_with_percent_config: ::Hash[Symbol, top], + unit_with_proration_config: Orb::Price::UnitWithProration::UnitWithProrationConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class UnitWithPercent < Orb::Internal::Type::BaseModel + class UnitWithProration < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::UnitWithPercent::cadence + attr_accessor billing_mode: Orb::Models::Price::UnitWithProration::billing_mode + + attr_accessor cadence: Orb::Models::Price::UnitWithProration::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::UnitWithPercent::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::UnitWithProration::conversion_rate_config? attr_accessor created_at: Time @@ -2595,17 +3062,17 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :unit_with_percent + attr_accessor model_type: :unit_with_proration attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::UnitWithPercent::price_type + attr_accessor price_type: Orb::Models::Price::UnitWithProration::price_type attr_accessor replaces_price_id: String? - attr_accessor unit_with_percent_config: ::Hash[Symbol, top] + attr_accessor unit_with_proration_config: Orb::Price::UnitWithProration::UnitWithProrationConfig attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? @@ -2613,9 +3080,11 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::UnitWithPercent::cadence, + billing_mode: Orb::Models::Price::UnitWithProration::billing_mode, + cadence: Orb::Models::Price::UnitWithProration::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::UnitWithPercent::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::UnitWithProration::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -2631,20 +3100,22 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::UnitWithPercent::price_type, + price_type: Orb::Models::Price::UnitWithProration::price_type, replaces_price_id: String?, - unit_with_percent_config: ::Hash[Symbol, top], + unit_with_proration_config: Orb::Price::UnitWithProration::UnitWithProrationConfig, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :unit_with_percent + ?model_type: :unit_with_proration ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::UnitWithPercent::cadence, + billing_mode: Orb::Models::Price::UnitWithProration::billing_mode, + cadence: Orb::Models::Price::UnitWithProration::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::UnitWithPercent::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::UnitWithProration::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -2658,15 +3129,26 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :unit_with_percent, + model_type: :unit_with_proration, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::UnitWithPercent::price_type, + price_type: Orb::Models::Price::UnitWithProration::price_type, replaces_price_id: String?, - unit_with_percent_config: ::Hash[Symbol, top], + unit_with_proration_config: Orb::Price::UnitWithProration::UnitWithProrationConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::UnitWithProration::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -2680,72 +3162,80 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::UnitWithPercent::cadence] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::UnitWithPercent::conversion_rate_config] + def self?.values: -> ::Array[Orb::Models::Price::UnitWithProration::cadence] end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::UnitWithPercent::price_type] + def self?.values: -> ::Array[Orb::Models::Price::UnitWithProration::price_type] + end + + type unit_with_proration_config = { unit_amount: String } + + class UnitWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor unit_amount: String + + def initialize: (unit_amount: String) -> void + + def to_hash: -> { unit_amount: String } end end - type matrix_with_allocation = + type grouped_allocation = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::MatrixWithAllocation::cadence, + billing_mode: Orb::Models::Price::GroupedAllocation::billing_mode, + cadence: Orb::Models::Price::GroupedAllocation::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::MatrixWithAllocation::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::GroupedAllocation::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, + grouped_allocation_config: Orb::Price::GroupedAllocation::GroupedAllocationConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, - matrix_with_allocation_config: Orb::MatrixWithAllocationConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :matrix_with_allocation, + model_type: :grouped_allocation, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::MatrixWithAllocation::price_type, + price_type: Orb::Models::Price::GroupedAllocation::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class MatrixWithAllocation < Orb::Internal::Type::BaseModel + class GroupedAllocation < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::MatrixWithAllocation::cadence + attr_accessor billing_mode: Orb::Models::Price::GroupedAllocation::billing_mode + + attr_accessor cadence: Orb::Models::Price::GroupedAllocation::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::MatrixWithAllocation::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::GroupedAllocation::conversion_rate_config? attr_accessor created_at: Time @@ -2759,12 +3249,12 @@ module Orb attr_accessor fixed_price_quantity: Float? + attr_accessor grouped_allocation_config: Orb::Price::GroupedAllocation::GroupedAllocationConfig + attr_accessor invoicing_cycle_configuration: Orb::BillingCycleConfiguration? attr_accessor item: Orb::ItemSlim - attr_accessor matrix_with_allocation_config: Orb::MatrixWithAllocationConfig - attr_accessor maximum: Orb::Maximum? attr_accessor maximum_amount: String? @@ -2775,13 +3265,13 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :matrix_with_allocation + attr_accessor model_type: :grouped_allocation attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::MatrixWithAllocation::price_type + attr_accessor price_type: Orb::Models::Price::GroupedAllocation::price_type attr_accessor replaces_price_id: String? @@ -2791,18 +3281,20 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::MatrixWithAllocation::cadence, + billing_mode: Orb::Models::Price::GroupedAllocation::billing_mode, + cadence: Orb::Models::Price::GroupedAllocation::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::MatrixWithAllocation::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::GroupedAllocation::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, + grouped_allocation_config: Orb::Price::GroupedAllocation::GroupedAllocationConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, - matrix_with_allocation_config: Orb::MatrixWithAllocationConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], @@ -2810,41 +3302,54 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::MatrixWithAllocation::price_type, + price_type: Orb::Models::Price::GroupedAllocation::price_type, replaces_price_id: String?, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :matrix_with_allocation + ?model_type: :grouped_allocation ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::MatrixWithAllocation::cadence, + billing_mode: Orb::Models::Price::GroupedAllocation::billing_mode, + cadence: Orb::Models::Price::GroupedAllocation::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::MatrixWithAllocation::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::GroupedAllocation::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, + grouped_allocation_config: Orb::Price::GroupedAllocation::GroupedAllocationConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, - matrix_with_allocation_config: Orb::MatrixWithAllocationConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :matrix_with_allocation, + model_type: :grouped_allocation, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::MatrixWithAllocation::price_type, + price_type: Orb::Models::Price::GroupedAllocation::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::GroupedAllocation::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -2858,38 +3363,60 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::MatrixWithAllocation::cadence] + def self?.values: -> ::Array[Orb::Models::Price::GroupedAllocation::cadence] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type grouped_allocation_config = + { + allocation: String, + grouping_key: String, + overage_unit_rate: String + } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class GroupedAllocationConfig < Orb::Internal::Type::BaseModel + attr_accessor allocation: String - def self?.variants: -> ::Array[Orb::Models::Price::MatrixWithAllocation::conversion_rate_config] + attr_accessor grouping_key: String + + attr_accessor overage_unit_rate: String + + def initialize: ( + allocation: String, + grouping_key: String, + overage_unit_rate: String + ) -> void + + def to_hash: -> { + allocation: String, + grouping_key: String, + overage_unit_rate: String + } end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::MatrixWithAllocation::price_type] + def self?.values: -> ::Array[Orb::Models::Price::GroupedAllocation::price_type] end end - type tiered_with_proration = + type bulk_with_proration = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::TieredWithProration::cadence, + billing_mode: Orb::Models::Price::BulkWithProration::billing_mode, + bulk_with_proration_config: Orb::Price::BulkWithProration::BulkWithProrationConfig, + cadence: Orb::Models::Price::BulkWithProration::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::TieredWithProration::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::BulkWithProration::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -2903,27 +3430,32 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :tiered_with_proration, + model_type: :bulk_with_proration, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::TieredWithProration::price_type, + price_type: Orb::Models::Price::BulkWithProration::price_type, replaces_price_id: String?, - tiered_with_proration_config: ::Hash[Symbol, top], dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class TieredWithProration < Orb::Internal::Type::BaseModel + class BulkWithProration < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::TieredWithProration::cadence + attr_accessor billing_mode: Orb::Models::Price::BulkWithProration::billing_mode + + attr_accessor bulk_with_proration_config: Orb::Price::BulkWithProration::BulkWithProrationConfig + + attr_accessor cadence: Orb::Models::Price::BulkWithProration::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::TieredWithProration::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::BulkWithProration::conversion_rate_config? attr_accessor created_at: Time @@ -2951,27 +3483,28 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :tiered_with_proration + attr_accessor model_type: :bulk_with_proration attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::TieredWithProration::price_type + attr_accessor price_type: Orb::Models::Price::BulkWithProration::price_type attr_accessor replaces_price_id: String? - attr_accessor tiered_with_proration_config: ::Hash[Symbol, top] - attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? def initialize: ( id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::TieredWithProration::cadence, + billing_mode: Orb::Models::Price::BulkWithProration::billing_mode, + bulk_with_proration_config: Orb::Price::BulkWithProration::BulkWithProrationConfig, + cadence: Orb::Models::Price::BulkWithProration::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::TieredWithProration::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::BulkWithProration::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -2987,20 +3520,22 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::TieredWithProration::price_type, + price_type: Orb::Models::Price::BulkWithProration::price_type, replaces_price_id: String?, - tiered_with_proration_config: ::Hash[Symbol, top], ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :tiered_with_proration + ?model_type: :bulk_with_proration ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::TieredWithProration::cadence, + billing_mode: Orb::Models::Price::BulkWithProration::billing_mode, + bulk_with_proration_config: Orb::Price::BulkWithProration::BulkWithProrationConfig, + cadence: Orb::Models::Price::BulkWithProration::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::TieredWithProration::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::BulkWithProration::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -3014,15 +3549,57 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :tiered_with_proration, + model_type: :bulk_with_proration, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::TieredWithProration::price_type, + price_type: Orb::Models::Price::BulkWithProration::price_type, replaces_price_id: String?, - tiered_with_proration_config: ::Hash[Symbol, top], dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::BulkWithProration::billing_mode] + end + + type bulk_with_proration_config = + { + tiers: ::Array[Orb::Price::BulkWithProration::BulkWithProrationConfig::Tier] + } + + class BulkWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::Price::BulkWithProration::BulkWithProrationConfig::Tier] + + def initialize: ( + tiers: ::Array[Orb::Price::BulkWithProration::BulkWithProrationConfig::Tier] + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::Price::BulkWithProration::BulkWithProrationConfig::Tier] + } + + type tier = { unit_amount: String, tier_lower_bound: String? } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor unit_amount: String + + attr_accessor tier_lower_bound: String? + + def initialize: ( + unit_amount: String, + ?tier_lower_bound: String? + ) -> void + + def to_hash: -> { unit_amount: String, tier_lower_bound: String? } + end + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -3036,44 +3613,39 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::TieredWithProration::cadence] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::TieredWithProration::conversion_rate_config] + def self?.values: -> ::Array[Orb::Models::Price::BulkWithProration::cadence] end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::TieredWithProration::price_type] + def self?.values: -> ::Array[Orb::Models::Price::BulkWithProration::price_type] end end - type unit_with_proration = + type grouped_with_prorated_minimum = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::UnitWithProration::cadence, + billing_mode: Orb::Models::Price::GroupedWithProratedMinimum::billing_mode, + cadence: Orb::Models::Price::GroupedWithProratedMinimum::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::UnitWithProration::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::GroupedWithProratedMinimum::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, + grouped_with_prorated_minimum_config: Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -3081,27 +3653,30 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :unit_with_proration, + model_type: :grouped_with_prorated_minimum, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::UnitWithProration::price_type, + price_type: Orb::Models::Price::GroupedWithProratedMinimum::price_type, replaces_price_id: String?, - unit_with_proration_config: ::Hash[Symbol, top], dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class UnitWithProration < Orb::Internal::Type::BaseModel + class GroupedWithProratedMinimum < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::UnitWithProration::cadence + attr_accessor billing_mode: Orb::Models::Price::GroupedWithProratedMinimum::billing_mode + + attr_accessor cadence: Orb::Models::Price::GroupedWithProratedMinimum::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::UnitWithProration::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::GroupedWithProratedMinimum::conversion_rate_config? attr_accessor created_at: Time @@ -3115,6 +3690,8 @@ module Orb attr_accessor fixed_price_quantity: Float? + attr_accessor grouped_with_prorated_minimum_config: Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig + attr_accessor invoicing_cycle_configuration: Orb::BillingCycleConfiguration? attr_accessor item: Orb::ItemSlim @@ -3129,33 +3706,34 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :unit_with_proration + attr_accessor model_type: :grouped_with_prorated_minimum attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::UnitWithProration::price_type + attr_accessor price_type: Orb::Models::Price::GroupedWithProratedMinimum::price_type attr_accessor replaces_price_id: String? - attr_accessor unit_with_proration_config: ::Hash[Symbol, top] - attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? def initialize: ( id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::UnitWithProration::cadence, + billing_mode: Orb::Models::Price::GroupedWithProratedMinimum::billing_mode, + cadence: Orb::Models::Price::GroupedWithProratedMinimum::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::UnitWithProration::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::GroupedWithProratedMinimum::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, + grouped_with_prorated_minimum_config: Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -3165,26 +3743,28 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::UnitWithProration::price_type, + price_type: Orb::Models::Price::GroupedWithProratedMinimum::price_type, replaces_price_id: String?, - unit_with_proration_config: ::Hash[Symbol, top], ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :unit_with_proration + ?model_type: :grouped_with_prorated_minimum ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::UnitWithProration::cadence, + billing_mode: Orb::Models::Price::GroupedWithProratedMinimum::billing_mode, + cadence: Orb::Models::Price::GroupedWithProratedMinimum::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::UnitWithProration::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::GroupedWithProratedMinimum::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, + grouped_with_prorated_minimum_config: Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -3192,15 +3772,25 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :unit_with_proration, + model_type: :grouped_with_prorated_minimum, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::UnitWithProration::price_type, + price_type: Orb::Models::Price::GroupedWithProratedMinimum::price_type, replaces_price_id: String?, - unit_with_proration_config: ::Hash[Symbol, top], dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::GroupedWithProratedMinimum::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -3214,45 +3804,62 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::UnitWithProration::cadence] + def self?.values: -> ::Array[Orb::Models::Price::GroupedWithProratedMinimum::cadence] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type grouped_with_prorated_minimum_config = + { grouping_key: String, minimum: String, unit_rate: String } + + class GroupedWithProratedMinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String - module ConversionRateConfig - extend Orb::Internal::Type::Union + attr_accessor minimum: String - def self?.variants: -> ::Array[Orb::Models::Price::UnitWithProration::conversion_rate_config] + attr_accessor unit_rate: String + + def initialize: ( + grouping_key: String, + minimum: String, + unit_rate: String + ) -> void + + def to_hash: -> { + grouping_key: String, + minimum: String, + unit_rate: String + } end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::UnitWithProration::price_type] + def self?.values: -> ::Array[Orb::Models::Price::GroupedWithProratedMinimum::price_type] end end - type grouped_allocation = + type grouped_with_metered_minimum = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedAllocation::cadence, + billing_mode: Orb::Models::Price::GroupedWithMeteredMinimum::billing_mode, + cadence: Orb::Models::Price::GroupedWithMeteredMinimum::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::GroupedAllocation::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::GroupedWithMeteredMinimum::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_allocation_config: ::Hash[Symbol, top], + grouped_with_metered_minimum_config: Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -3260,26 +3867,30 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :grouped_allocation, + model_type: :grouped_with_metered_minimum, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedAllocation::price_type, + price_type: Orb::Models::Price::GroupedWithMeteredMinimum::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class GroupedAllocation < Orb::Internal::Type::BaseModel + class GroupedWithMeteredMinimum < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::GroupedAllocation::cadence + attr_accessor billing_mode: Orb::Models::Price::GroupedWithMeteredMinimum::billing_mode + + attr_accessor cadence: Orb::Models::Price::GroupedWithMeteredMinimum::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::GroupedAllocation::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::GroupedWithMeteredMinimum::conversion_rate_config? attr_accessor created_at: Time @@ -3293,7 +3904,7 @@ module Orb attr_accessor fixed_price_quantity: Float? - attr_accessor grouped_allocation_config: ::Hash[Symbol, top] + attr_accessor grouped_with_metered_minimum_config: Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig attr_accessor invoicing_cycle_configuration: Orb::BillingCycleConfiguration? @@ -3309,13 +3920,13 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :grouped_allocation + attr_accessor model_type: :grouped_with_metered_minimum attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::GroupedAllocation::price_type + attr_accessor price_type: Orb::Models::Price::GroupedWithMeteredMinimum::price_type attr_accessor replaces_price_id: String? @@ -3325,16 +3936,18 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedAllocation::cadence, + billing_mode: Orb::Models::Price::GroupedWithMeteredMinimum::billing_mode, + cadence: Orb::Models::Price::GroupedWithMeteredMinimum::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::GroupedAllocation::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::GroupedWithMeteredMinimum::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_allocation_config: ::Hash[Symbol, top], + grouped_with_metered_minimum_config: Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -3344,26 +3957,28 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedAllocation::price_type, + price_type: Orb::Models::Price::GroupedWithMeteredMinimum::price_type, replaces_price_id: String?, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :grouped_allocation + ?model_type: :grouped_with_metered_minimum ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedAllocation::cadence, + billing_mode: Orb::Models::Price::GroupedWithMeteredMinimum::billing_mode, + cadence: Orb::Models::Price::GroupedWithMeteredMinimum::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::GroupedAllocation::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::GroupedWithMeteredMinimum::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_allocation_config: ::Hash[Symbol, top], + grouped_with_metered_minimum_config: Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -3371,66 +3986,141 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :grouped_allocation, + model_type: :grouped_with_metered_minimum, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedAllocation::price_type, + price_type: Orb::Models::Price::GroupedWithMeteredMinimum::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - type cadence = - :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::GroupedWithMeteredMinimum::billing_mode] + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::Price::GroupedWithMeteredMinimum::cadence] + end + + type grouped_with_metered_minimum_config = + { + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: ::Array[Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig::ScalingFactor], + scaling_key: String, + unit_amounts: ::Array[Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig::UnitAmount] + } + + class GroupedWithMeteredMinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor minimum_unit_amount: String + + attr_accessor pricing_key: String + + attr_accessor scaling_factors: ::Array[Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig::ScalingFactor] + + attr_accessor scaling_key: String + + attr_accessor unit_amounts: ::Array[Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig::UnitAmount] + + def initialize: ( + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: ::Array[Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig::ScalingFactor], + scaling_key: String, + unit_amounts: ::Array[Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig::UnitAmount] + ) -> void + + def to_hash: -> { + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: ::Array[Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig::ScalingFactor], + scaling_key: String, + unit_amounts: ::Array[Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig::UnitAmount] + } + + type scaling_factor = + { scaling_factor: String, scaling_value: String } - module Cadence - extend Orb::Internal::Type::Enum + class ScalingFactor < Orb::Internal::Type::BaseModel + attr_accessor scaling_factor: String - ONE_TIME: :one_time - MONTHLY: :monthly - QUARTERLY: :quarterly - SEMI_ANNUAL: :semi_annual - ANNUAL: :annual - CUSTOM: :custom + attr_accessor scaling_value: String - def self?.values: -> ::Array[Orb::Models::Price::GroupedAllocation::cadence] - end + def initialize: ( + scaling_factor: String, + scaling_value: String + ) -> void - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + def to_hash: -> { scaling_factor: String, scaling_value: String } + end - module ConversionRateConfig - extend Orb::Internal::Type::Union + type unit_amount = { pricing_value: String, unit_amount: String } - def self?.variants: -> ::Array[Orb::Models::Price::GroupedAllocation::conversion_rate_config] + class UnitAmount < Orb::Internal::Type::BaseModel + attr_accessor pricing_value: String + + attr_accessor unit_amount: String + + def initialize: (pricing_value: String, unit_amount: String) -> void + + def to_hash: -> { pricing_value: String, unit_amount: String } + end end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::GroupedAllocation::price_type] + def self?.values: -> ::Array[Orb::Models::Price::GroupedWithMeteredMinimum::price_type] end end - type grouped_with_prorated_minimum = + type grouped_with_min_max_thresholds = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedWithProratedMinimum::cadence, + billing_mode: Orb::Models::Price::GroupedWithMinMaxThresholds::billing_mode, + cadence: Orb::Models::Price::GroupedWithMinMaxThresholds::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::GroupedWithProratedMinimum::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_with_prorated_minimum_config: ::Hash[Symbol, top], + grouped_with_min_max_thresholds_config: Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -3438,26 +4128,30 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :grouped_with_prorated_minimum, + model_type: :grouped_with_min_max_thresholds, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedWithProratedMinimum::price_type, + price_type: Orb::Models::Price::GroupedWithMinMaxThresholds::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class GroupedWithProratedMinimum < Orb::Internal::Type::BaseModel + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::GroupedWithProratedMinimum::cadence + attr_accessor billing_mode: Orb::Models::Price::GroupedWithMinMaxThresholds::billing_mode + + attr_accessor cadence: Orb::Models::Price::GroupedWithMinMaxThresholds::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::GroupedWithProratedMinimum::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::GroupedWithMinMaxThresholds::conversion_rate_config? attr_accessor created_at: Time @@ -3471,7 +4165,7 @@ module Orb attr_accessor fixed_price_quantity: Float? - attr_accessor grouped_with_prorated_minimum_config: ::Hash[Symbol, top] + attr_accessor grouped_with_min_max_thresholds_config: Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig attr_accessor invoicing_cycle_configuration: Orb::BillingCycleConfiguration? @@ -3487,13 +4181,13 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :grouped_with_prorated_minimum + attr_accessor model_type: :grouped_with_min_max_thresholds attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::GroupedWithProratedMinimum::price_type + attr_accessor price_type: Orb::Models::Price::GroupedWithMinMaxThresholds::price_type attr_accessor replaces_price_id: String? @@ -3503,16 +4197,18 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedWithProratedMinimum::cadence, + billing_mode: Orb::Models::Price::GroupedWithMinMaxThresholds::billing_mode, + cadence: Orb::Models::Price::GroupedWithMinMaxThresholds::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::GroupedWithProratedMinimum::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_with_prorated_minimum_config: ::Hash[Symbol, top], + grouped_with_min_max_thresholds_config: Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -3522,26 +4218,28 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedWithProratedMinimum::price_type, + price_type: Orb::Models::Price::GroupedWithMinMaxThresholds::price_type, replaces_price_id: String?, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :grouped_with_prorated_minimum + ?model_type: :grouped_with_min_max_thresholds ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedWithProratedMinimum::cadence, + billing_mode: Orb::Models::Price::GroupedWithMinMaxThresholds::billing_mode, + cadence: Orb::Models::Price::GroupedWithMinMaxThresholds::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::GroupedWithProratedMinimum::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_with_prorated_minimum_config: ::Hash[Symbol, top], + grouped_with_min_max_thresholds_config: Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -3549,14 +4247,25 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :grouped_with_prorated_minimum, + model_type: :grouped_with_min_max_thresholds, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedWithProratedMinimum::price_type, + price_type: Orb::Models::Price::GroupedWithMinMaxThresholds::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::GroupedWithMinMaxThresholds::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -3570,72 +4279,102 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::GroupedWithProratedMinimum::cadence] + def self?.values: -> ::Array[Orb::Models::Price::GroupedWithMinMaxThresholds::cadence] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type grouped_with_min_max_thresholds_config = + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String - module ConversionRateConfig - extend Orb::Internal::Type::Union + attr_accessor maximum_charge: String - def self?.variants: -> ::Array[Orb::Models::Price::GroupedWithProratedMinimum::conversion_rate_config] + attr_accessor minimum_charge: String + + attr_accessor per_unit_rate: String + + def initialize: ( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ) -> void + + def to_hash: -> { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::GroupedWithProratedMinimum::price_type] + def self?.values: -> ::Array[Orb::Models::Price::GroupedWithMinMaxThresholds::price_type] end end - type grouped_with_metered_minimum = + type matrix_with_display_name = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedWithMeteredMinimum::cadence, + billing_mode: Orb::Models::Price::MatrixWithDisplayName::billing_mode, + cadence: Orb::Models::Price::MatrixWithDisplayName::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::GroupedWithMeteredMinimum::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::MatrixWithDisplayName::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_with_metered_minimum_config: ::Hash[Symbol, top], invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, + matrix_with_display_name_config: Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :grouped_with_metered_minimum, + model_type: :matrix_with_display_name, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedWithMeteredMinimum::price_type, + price_type: Orb::Models::Price::MatrixWithDisplayName::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class GroupedWithMeteredMinimum < Orb::Internal::Type::BaseModel + class MatrixWithDisplayName < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::GroupedWithMeteredMinimum::cadence + attr_accessor billing_mode: Orb::Models::Price::MatrixWithDisplayName::billing_mode + + attr_accessor cadence: Orb::Models::Price::MatrixWithDisplayName::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::GroupedWithMeteredMinimum::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::MatrixWithDisplayName::conversion_rate_config? attr_accessor created_at: Time @@ -3649,12 +4388,12 @@ module Orb attr_accessor fixed_price_quantity: Float? - attr_accessor grouped_with_metered_minimum_config: ::Hash[Symbol, top] - attr_accessor invoicing_cycle_configuration: Orb::BillingCycleConfiguration? attr_accessor item: Orb::ItemSlim + attr_accessor matrix_with_display_name_config: Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig + attr_accessor maximum: Orb::Maximum? attr_accessor maximum_amount: String? @@ -3665,13 +4404,13 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :grouped_with_metered_minimum + attr_accessor model_type: :matrix_with_display_name attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::GroupedWithMeteredMinimum::price_type + attr_accessor price_type: Orb::Models::Price::MatrixWithDisplayName::price_type attr_accessor replaces_price_id: String? @@ -3681,18 +4420,20 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedWithMeteredMinimum::cadence, + billing_mode: Orb::Models::Price::MatrixWithDisplayName::billing_mode, + cadence: Orb::Models::Price::MatrixWithDisplayName::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::GroupedWithMeteredMinimum::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::MatrixWithDisplayName::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_with_metered_minimum_config: ::Hash[Symbol, top], invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, + matrix_with_display_name_config: Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], @@ -3700,41 +4441,54 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedWithMeteredMinimum::price_type, + price_type: Orb::Models::Price::MatrixWithDisplayName::price_type, replaces_price_id: String?, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :grouped_with_metered_minimum + ?model_type: :matrix_with_display_name ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedWithMeteredMinimum::cadence, + billing_mode: Orb::Models::Price::MatrixWithDisplayName::billing_mode, + cadence: Orb::Models::Price::MatrixWithDisplayName::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::GroupedWithMeteredMinimum::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::MatrixWithDisplayName::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_with_metered_minimum_config: ::Hash[Symbol, top], invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, + matrix_with_display_name_config: Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :grouped_with_metered_minimum, + model_type: :matrix_with_display_name, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedWithMeteredMinimum::price_type, + price_type: Orb::Models::Price::MatrixWithDisplayName::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::MatrixWithDisplayName::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -3748,72 +4502,119 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::GroupedWithMeteredMinimum::cadence] + def self?.values: -> ::Array[Orb::Models::Price::MatrixWithDisplayName::cadence] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::GroupedWithMeteredMinimum::conversion_rate_config] + type matrix_with_display_name_config = + { + dimension: String, + unit_amounts: ::Array[Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig::UnitAmount] + } + + class MatrixWithDisplayNameConfig < Orb::Internal::Type::BaseModel + attr_accessor dimension: String + + attr_accessor unit_amounts: ::Array[Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig::UnitAmount] + + def initialize: ( + dimension: String, + unit_amounts: ::Array[Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig::UnitAmount] + ) -> void + + def to_hash: -> { + dimension: String, + unit_amounts: ::Array[Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig::UnitAmount] + } + + type unit_amount = + { + dimension_value: String, + display_name: String, + unit_amount: String + } + + class UnitAmount < Orb::Internal::Type::BaseModel + attr_accessor dimension_value: String + + attr_accessor display_name: String + + attr_accessor unit_amount: String + + def initialize: ( + dimension_value: String, + display_name: String, + unit_amount: String + ) -> void + + def to_hash: -> { + dimension_value: String, + display_name: String, + unit_amount: String + } + end end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::GroupedWithMeteredMinimum::price_type] + def self?.values: -> ::Array[Orb::Models::Price::MatrixWithDisplayName::price_type] end end - type matrix_with_display_name = + type grouped_tiered_package = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::MatrixWithDisplayName::cadence, + billing_mode: Orb::Models::Price::GroupedTieredPackage::billing_mode, + cadence: Orb::Models::Price::GroupedTieredPackage::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::MatrixWithDisplayName::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::GroupedTieredPackage::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, + grouped_tiered_package_config: Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, - matrix_with_display_name_config: ::Hash[Symbol, top], maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :matrix_with_display_name, + model_type: :grouped_tiered_package, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::MatrixWithDisplayName::price_type, + price_type: Orb::Models::Price::GroupedTieredPackage::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class MatrixWithDisplayName < Orb::Internal::Type::BaseModel + class GroupedTieredPackage < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::MatrixWithDisplayName::cadence + attr_accessor billing_mode: Orb::Models::Price::GroupedTieredPackage::billing_mode + + attr_accessor cadence: Orb::Models::Price::GroupedTieredPackage::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::MatrixWithDisplayName::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::GroupedTieredPackage::conversion_rate_config? attr_accessor created_at: Time @@ -3827,12 +4628,12 @@ module Orb attr_accessor fixed_price_quantity: Float? + attr_accessor grouped_tiered_package_config: Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig + attr_accessor invoicing_cycle_configuration: Orb::BillingCycleConfiguration? attr_accessor item: Orb::ItemSlim - attr_accessor matrix_with_display_name_config: ::Hash[Symbol, top] - attr_accessor maximum: Orb::Maximum? attr_accessor maximum_amount: String? @@ -3843,13 +4644,13 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :matrix_with_display_name + attr_accessor model_type: :grouped_tiered_package attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::MatrixWithDisplayName::price_type + attr_accessor price_type: Orb::Models::Price::GroupedTieredPackage::price_type attr_accessor replaces_price_id: String? @@ -3859,18 +4660,20 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::MatrixWithDisplayName::cadence, + billing_mode: Orb::Models::Price::GroupedTieredPackage::billing_mode, + cadence: Orb::Models::Price::GroupedTieredPackage::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::MatrixWithDisplayName::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::GroupedTieredPackage::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, + grouped_tiered_package_config: Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, - matrix_with_display_name_config: ::Hash[Symbol, top], maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], @@ -3878,41 +4681,54 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::MatrixWithDisplayName::price_type, + price_type: Orb::Models::Price::GroupedTieredPackage::price_type, replaces_price_id: String?, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :matrix_with_display_name + ?model_type: :grouped_tiered_package ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::MatrixWithDisplayName::cadence, + billing_mode: Orb::Models::Price::GroupedTieredPackage::billing_mode, + cadence: Orb::Models::Price::GroupedTieredPackage::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::MatrixWithDisplayName::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::GroupedTieredPackage::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, + grouped_tiered_package_config: Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, - matrix_with_display_name_config: ::Hash[Symbol, top], maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :matrix_with_display_name, + model_type: :grouped_tiered_package, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::MatrixWithDisplayName::price_type, + price_type: Orb::Models::Price::GroupedTieredPackage::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::GroupedTieredPackage::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -3926,39 +4742,71 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::MatrixWithDisplayName::cadence] + def self?.values: -> ::Array[Orb::Models::Price::GroupedTieredPackage::cadence] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type grouped_tiered_package_config = + { + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig::Tier] + } + + class GroupedTieredPackageConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor package_size: String + + attr_accessor tiers: ::Array[Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig::Tier] + + def initialize: ( + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig::Tier] + ) -> void + + def to_hash: -> { + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig::Tier] + } + + type tier = { per_unit: String, tier_lower_bound: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor per_unit: String - module ConversionRateConfig - extend Orb::Internal::Type::Union + attr_accessor tier_lower_bound: String - def self?.variants: -> ::Array[Orb::Models::Price::MatrixWithDisplayName::conversion_rate_config] + def initialize: (per_unit: String, tier_lower_bound: String) -> void + + def to_hash: -> { per_unit: String, tier_lower_bound: String } + end end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::MatrixWithDisplayName::price_type] + def self?.values: -> ::Array[Orb::Models::Price::GroupedTieredPackage::price_type] end end - type bulk_with_proration = + type max_group_tiered_package = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_with_proration_config: ::Hash[Symbol, top], - cadence: Orb::Models::Price::BulkWithProration::cadence, + billing_mode: Orb::Models::Price::MaxGroupTieredPackage::billing_mode, + cadence: Orb::Models::Price::MaxGroupTieredPackage::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::BulkWithProration::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::MaxGroupTieredPackage::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -3967,33 +4815,36 @@ module Orb fixed_price_quantity: Float?, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, + max_group_tiered_package_config: Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :bulk_with_proration, + model_type: :max_group_tiered_package, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::BulkWithProration::price_type, + price_type: Orb::Models::Price::MaxGroupTieredPackage::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class BulkWithProration < Orb::Internal::Type::BaseModel + class MaxGroupTieredPackage < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor bulk_with_proration_config: ::Hash[Symbol, top] + attr_accessor billing_mode: Orb::Models::Price::MaxGroupTieredPackage::billing_mode - attr_accessor cadence: Orb::Models::Price::BulkWithProration::cadence + attr_accessor cadence: Orb::Models::Price::MaxGroupTieredPackage::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::BulkWithProration::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::MaxGroupTieredPackage::conversion_rate_config? attr_accessor created_at: Time @@ -4011,6 +4862,8 @@ module Orb attr_accessor item: Orb::ItemSlim + attr_accessor max_group_tiered_package_config: Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig + attr_accessor maximum: Orb::Maximum? attr_accessor maximum_amount: String? @@ -4021,13 +4874,13 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :bulk_with_proration + attr_accessor model_type: :max_group_tiered_package attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::BulkWithProration::price_type + attr_accessor price_type: Orb::Models::Price::MaxGroupTieredPackage::price_type attr_accessor replaces_price_id: String? @@ -4037,10 +4890,11 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_with_proration_config: ::Hash[Symbol, top], - cadence: Orb::Models::Price::BulkWithProration::cadence, + billing_mode: Orb::Models::Price::MaxGroupTieredPackage::billing_mode, + cadence: Orb::Models::Price::MaxGroupTieredPackage::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::BulkWithProration::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::MaxGroupTieredPackage::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -4049,6 +4903,7 @@ module Orb fixed_price_quantity: Float?, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, + max_group_tiered_package_config: Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], @@ -4056,20 +4911,21 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::BulkWithProration::price_type, + price_type: Orb::Models::Price::MaxGroupTieredPackage::price_type, replaces_price_id: String?, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :bulk_with_proration + ?model_type: :max_group_tiered_package ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_with_proration_config: ::Hash[Symbol, top], - cadence: Orb::Models::Price::BulkWithProration::cadence, + billing_mode: Orb::Models::Price::MaxGroupTieredPackage::billing_mode, + cadence: Orb::Models::Price::MaxGroupTieredPackage::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::BulkWithProration::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::MaxGroupTieredPackage::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -4078,19 +4934,31 @@ module Orb fixed_price_quantity: Float?, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, + max_group_tiered_package_config: Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :bulk_with_proration, + model_type: :max_group_tiered_package, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::BulkWithProration::price_type, + price_type: Orb::Models::Price::MaxGroupTieredPackage::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::MaxGroupTieredPackage::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -4104,45 +4972,80 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::BulkWithProration::cadence] + def self?.values: -> ::Array[Orb::Models::Price::MaxGroupTieredPackage::cadence] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type max_group_tiered_package_config = + { + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig::Tier] + } + + class MaxGroupTieredPackageConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor package_size: String + + attr_accessor tiers: ::Array[Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig::Tier] + + def initialize: ( + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig::Tier] + ) -> void + + def to_hash: -> { + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String - module ConversionRateConfig - extend Orb::Internal::Type::Union + attr_accessor unit_amount: String - def self?.variants: -> ::Array[Orb::Models::Price::BulkWithProration::conversion_rate_config] + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { tier_lower_bound: String, unit_amount: String } + end end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::BulkWithProration::price_type] + def self?.values: -> ::Array[Orb::Models::Price::MaxGroupTieredPackage::price_type] end end - type grouped_tiered_package = + type scalable_matrix_with_unit_pricing = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedTieredPackage::cadence, + billing_mode: Orb::Models::Price::ScalableMatrixWithUnitPricing::billing_mode, + cadence: Orb::Models::Price::ScalableMatrixWithUnitPricing::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::GroupedTieredPackage::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::ScalableMatrixWithUnitPricing::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_tiered_package_config: ::Hash[Symbol, top], invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -4150,26 +5053,31 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :grouped_tiered_package, + model_type: :scalable_matrix_with_unit_pricing, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedTieredPackage::price_type, + price_type: Orb::Models::Price::ScalableMatrixWithUnitPricing::price_type, replaces_price_id: String?, + scalable_matrix_with_unit_pricing_config: Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class GroupedTieredPackage < Orb::Internal::Type::BaseModel + class ScalableMatrixWithUnitPricing < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::GroupedTieredPackage::cadence + attr_accessor billing_mode: Orb::Models::Price::ScalableMatrixWithUnitPricing::billing_mode + + attr_accessor cadence: Orb::Models::Price::ScalableMatrixWithUnitPricing::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::GroupedTieredPackage::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::ScalableMatrixWithUnitPricing::conversion_rate_config? attr_accessor created_at: Time @@ -4183,8 +5091,6 @@ module Orb attr_accessor fixed_price_quantity: Float? - attr_accessor grouped_tiered_package_config: ::Hash[Symbol, top] - attr_accessor invoicing_cycle_configuration: Orb::BillingCycleConfiguration? attr_accessor item: Orb::ItemSlim @@ -4199,32 +5105,35 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :grouped_tiered_package + attr_accessor model_type: :scalable_matrix_with_unit_pricing attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::GroupedTieredPackage::price_type + attr_accessor price_type: Orb::Models::Price::ScalableMatrixWithUnitPricing::price_type attr_accessor replaces_price_id: String? + attr_accessor scalable_matrix_with_unit_pricing_config: Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig + attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? def initialize: ( id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedTieredPackage::cadence, + billing_mode: Orb::Models::Price::ScalableMatrixWithUnitPricing::billing_mode, + cadence: Orb::Models::Price::ScalableMatrixWithUnitPricing::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::GroupedTieredPackage::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::ScalableMatrixWithUnitPricing::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_tiered_package_config: ::Hash[Symbol, top], invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -4234,26 +5143,28 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedTieredPackage::price_type, + price_type: Orb::Models::Price::ScalableMatrixWithUnitPricing::price_type, replaces_price_id: String?, + scalable_matrix_with_unit_pricing_config: Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :grouped_tiered_package + ?model_type: :scalable_matrix_with_unit_pricing ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedTieredPackage::cadence, + billing_mode: Orb::Models::Price::ScalableMatrixWithUnitPricing::billing_mode, + cadence: Orb::Models::Price::ScalableMatrixWithUnitPricing::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::GroupedTieredPackage::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::ScalableMatrixWithUnitPricing::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_tiered_package_config: ::Hash[Symbol, top], invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -4261,14 +5172,26 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :grouped_tiered_package, + model_type: :scalable_matrix_with_unit_pricing, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedTieredPackage::price_type, + price_type: Orb::Models::Price::ScalableMatrixWithUnitPricing::price_type, replaces_price_id: String?, + scalable_matrix_with_unit_pricing_config: Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::ScalableMatrixWithUnitPricing::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -4282,38 +5205,96 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::GroupedTieredPackage::cadence] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::GroupedTieredPackage::conversion_rate_config] + def self?.values: -> ::Array[Orb::Models::Price::ScalableMatrixWithUnitPricing::cadence] end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::GroupedTieredPackage::price_type] + def self?.values: -> ::Array[Orb::Models::Price::ScalableMatrixWithUnitPricing::price_type] + end + + type scalable_matrix_with_unit_pricing_config = + { + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor], + unit_price: String, + prorate: bool?, + second_dimension: String? + } + + class ScalableMatrixWithUnitPricingConfig < Orb::Internal::Type::BaseModel + attr_accessor first_dimension: String + + attr_accessor matrix_scaling_factors: ::Array[Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor] + + attr_accessor unit_price: String + + attr_accessor prorate: bool? + + attr_accessor second_dimension: String? + + def initialize: ( + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor], + unit_price: String, + ?prorate: bool?, + ?second_dimension: String? + ) -> void + + def to_hash: -> { + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor], + unit_price: String, + prorate: bool?, + second_dimension: String? + } + + type matrix_scaling_factor = + { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: String? + } + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + attr_accessor first_dimension_value: String + + attr_accessor scaling_factor: String + + attr_accessor second_dimension_value: String? + + def initialize: ( + first_dimension_value: String, + scaling_factor: String, + ?second_dimension_value: String? + ) -> void + + def to_hash: -> { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: String? + } + end end end - type max_group_tiered_package = + type scalable_matrix_with_tiered_pricing = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::MaxGroupTieredPackage::cadence, + billing_mode: Orb::Models::Price::ScalableMatrixWithTieredPricing::billing_mode, + cadence: Orb::Models::Price::ScalableMatrixWithTieredPricing::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::MaxGroupTieredPackage::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::ScalableMatrixWithTieredPricing::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -4322,32 +5303,36 @@ module Orb fixed_price_quantity: Float?, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, - max_group_tiered_package_config: ::Hash[Symbol, top], maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :max_group_tiered_package, + model_type: :scalable_matrix_with_tiered_pricing, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::MaxGroupTieredPackage::price_type, + price_type: Orb::Models::Price::ScalableMatrixWithTieredPricing::price_type, replaces_price_id: String?, + scalable_matrix_with_tiered_pricing_config: Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class MaxGroupTieredPackage < Orb::Internal::Type::BaseModel + class ScalableMatrixWithTieredPricing < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::MaxGroupTieredPackage::cadence + attr_accessor billing_mode: Orb::Models::Price::ScalableMatrixWithTieredPricing::billing_mode + + attr_accessor cadence: Orb::Models::Price::ScalableMatrixWithTieredPricing::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::MaxGroupTieredPackage::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::ScalableMatrixWithTieredPricing::conversion_rate_config? attr_accessor created_at: Time @@ -4365,8 +5350,6 @@ module Orb attr_accessor item: Orb::ItemSlim - attr_accessor max_group_tiered_package_config: ::Hash[Symbol, top] - attr_accessor maximum: Orb::Maximum? attr_accessor maximum_amount: String? @@ -4377,25 +5360,29 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :max_group_tiered_package + attr_accessor model_type: :scalable_matrix_with_tiered_pricing attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::MaxGroupTieredPackage::price_type + attr_accessor price_type: Orb::Models::Price::ScalableMatrixWithTieredPricing::price_type attr_accessor replaces_price_id: String? + attr_accessor scalable_matrix_with_tiered_pricing_config: Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig + attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? def initialize: ( id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::MaxGroupTieredPackage::cadence, + billing_mode: Orb::Models::Price::ScalableMatrixWithTieredPricing::billing_mode, + cadence: Orb::Models::Price::ScalableMatrixWithTieredPricing::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::MaxGroupTieredPackage::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::ScalableMatrixWithTieredPricing::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -4404,7 +5391,6 @@ module Orb fixed_price_quantity: Float?, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, - max_group_tiered_package_config: ::Hash[Symbol, top], maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], @@ -4412,19 +5398,22 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::MaxGroupTieredPackage::price_type, + price_type: Orb::Models::Price::ScalableMatrixWithTieredPricing::price_type, replaces_price_id: String?, + scalable_matrix_with_tiered_pricing_config: Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :max_group_tiered_package + ?model_type: :scalable_matrix_with_tiered_pricing ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::MaxGroupTieredPackage::cadence, + billing_mode: Orb::Models::Price::ScalableMatrixWithTieredPricing::billing_mode, + cadence: Orb::Models::Price::ScalableMatrixWithTieredPricing::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::MaxGroupTieredPackage::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::ScalableMatrixWithTieredPricing::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -4433,20 +5422,31 @@ module Orb fixed_price_quantity: Float?, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, - max_group_tiered_package_config: ::Hash[Symbol, top], maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :max_group_tiered_package, + model_type: :scalable_matrix_with_tiered_pricing, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::MaxGroupTieredPackage::price_type, + price_type: Orb::Models::Price::ScalableMatrixWithTieredPricing::price_type, replaces_price_id: String?, + scalable_matrix_with_tiered_pricing_config: Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::ScalableMatrixWithTieredPricing::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -4460,40 +5460,109 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::MaxGroupTieredPackage::cadence] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::MaxGroupTieredPackage::conversion_rate_config] + def self?.values: -> ::Array[Orb::Models::Price::ScalableMatrixWithTieredPricing::cadence] end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::MaxGroupTieredPackage::price_type] + def self?.values: -> ::Array[Orb::Models::Price::ScalableMatrixWithTieredPricing::price_type] + end + + type scalable_matrix_with_tiered_pricing_config = + { + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor], + tiers: ::Array[Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::Tier], + second_dimension: String? + } + + class ScalableMatrixWithTieredPricingConfig < Orb::Internal::Type::BaseModel + attr_accessor first_dimension: String + + attr_accessor matrix_scaling_factors: ::Array[Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor] + + attr_accessor tiers: ::Array[Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::Tier] + + attr_accessor second_dimension: String? + + def initialize: ( + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor], + tiers: ::Array[Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::Tier], + ?second_dimension: String? + ) -> void + + def to_hash: -> { + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor], + tiers: ::Array[Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::Tier], + second_dimension: String? + } + + type matrix_scaling_factor = + { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: String? + } + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + attr_accessor first_dimension_value: String + + attr_accessor scaling_factor: String + + attr_accessor second_dimension_value: String? + + def initialize: ( + first_dimension_value: String, + scaling_factor: String, + ?second_dimension_value: String? + ) -> void + + def to_hash: -> { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: String? + } + end + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { tier_lower_bound: String, unit_amount: String } + end end end - type scalable_matrix_with_unit_pricing = + type cumulative_grouped_bulk = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::ScalableMatrixWithUnitPricing::cadence, + billing_mode: Orb::Models::Price::CumulativeGroupedBulk::billing_mode, + cadence: Orb::Models::Price::CumulativeGroupedBulk::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::ScalableMatrixWithUnitPricing::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::CumulativeGroupedBulk::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, + cumulative_grouped_bulk_config: Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig, currency: String, discount: Orb::Models::discount?, external_price_id: String?, @@ -4505,32 +5574,37 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :scalable_matrix_with_unit_pricing, + model_type: :cumulative_grouped_bulk, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::ScalableMatrixWithUnitPricing::price_type, + price_type: Orb::Models::Price::CumulativeGroupedBulk::price_type, replaces_price_id: String?, - scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top], dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class ScalableMatrixWithUnitPricing < Orb::Internal::Type::BaseModel + class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::ScalableMatrixWithUnitPricing::cadence + attr_accessor billing_mode: Orb::Models::Price::CumulativeGroupedBulk::billing_mode + + attr_accessor cadence: Orb::Models::Price::CumulativeGroupedBulk::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::ScalableMatrixWithUnitPricing::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::CumulativeGroupedBulk::conversion_rate_config? attr_accessor created_at: Time attr_accessor credit_allocation: Orb::Allocation? + attr_accessor cumulative_grouped_bulk_config: Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig + attr_accessor currency: String attr_accessor discount: Orb::Models::discount? @@ -4553,29 +5627,30 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :scalable_matrix_with_unit_pricing + attr_accessor model_type: :cumulative_grouped_bulk attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::ScalableMatrixWithUnitPricing::price_type + attr_accessor price_type: Orb::Models::Price::CumulativeGroupedBulk::price_type attr_accessor replaces_price_id: String? - attr_accessor scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top] - attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? def initialize: ( id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::ScalableMatrixWithUnitPricing::cadence, + billing_mode: Orb::Models::Price::CumulativeGroupedBulk::billing_mode, + cadence: Orb::Models::Price::CumulativeGroupedBulk::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::ScalableMatrixWithUnitPricing::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::CumulativeGroupedBulk::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, + cumulative_grouped_bulk_config: Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig, currency: String, discount: Orb::Models::discount?, external_price_id: String?, @@ -4589,22 +5664,24 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::ScalableMatrixWithUnitPricing::price_type, + price_type: Orb::Models::Price::CumulativeGroupedBulk::price_type, replaces_price_id: String?, - scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top], ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :scalable_matrix_with_unit_pricing + ?model_type: :cumulative_grouped_bulk ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::ScalableMatrixWithUnitPricing::cadence, + billing_mode: Orb::Models::Price::CumulativeGroupedBulk::billing_mode, + cadence: Orb::Models::Price::CumulativeGroupedBulk::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::ScalableMatrixWithUnitPricing::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::CumulativeGroupedBulk::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, + cumulative_grouped_bulk_config: Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig, currency: String, discount: Orb::Models::discount?, external_price_id: String?, @@ -4616,15 +5693,25 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :scalable_matrix_with_unit_pricing, + model_type: :cumulative_grouped_bulk, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::ScalableMatrixWithUnitPricing::price_type, + price_type: Orb::Models::Price::CumulativeGroupedBulk::price_type, replaces_price_id: String?, - scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top], dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::CumulativeGroupedBulk::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -4638,38 +5725,81 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::ScalableMatrixWithUnitPricing::cadence] + def self?.values: -> ::Array[Orb::Models::Price::CumulativeGroupedBulk::cadence] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::ScalableMatrixWithUnitPricing::conversion_rate_config] + type cumulative_grouped_bulk_config = + { + dimension_values: ::Array[Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig::DimensionValue], + group: String + } + + class CumulativeGroupedBulkConfig < Orb::Internal::Type::BaseModel + attr_accessor dimension_values: ::Array[Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig::DimensionValue] + + attr_accessor group: String + + def initialize: ( + dimension_values: ::Array[Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig::DimensionValue], + group: String + ) -> void + + def to_hash: -> { + dimension_values: ::Array[Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig::DimensionValue], + group: String + } + + type dimension_value = + { + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + } + + class DimensionValue < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + } + end end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::ScalableMatrixWithUnitPricing::price_type] + def self?.values: -> ::Array[Orb::Models::Price::CumulativeGroupedBulk::price_type] end end - type scalable_matrix_with_tiered_pricing = + type minimum = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::ScalableMatrixWithTieredPricing::cadence, + billing_mode: Orb::Models::Price::Minimum::billing_mode, + cadence: Orb::Models::Price::Minimum::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::ScalableMatrixWithTieredPricing::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::Minimum::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -4683,27 +5813,31 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :scalable_matrix_with_tiered_pricing, + minimum_config: Orb::Price::Minimum::MinimumConfig, + model_type: :minimum, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::ScalableMatrixWithTieredPricing::price_type, + price_type: Orb::Models::Price::Minimum::price_type, replaces_price_id: String?, - scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top], dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class ScalableMatrixWithTieredPricing < Orb::Internal::Type::BaseModel + class Minimum < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::ScalableMatrixWithTieredPricing::cadence + attr_accessor billing_mode: Orb::Models::Price::Minimum::billing_mode + + attr_accessor cadence: Orb::Models::Price::Minimum::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::ScalableMatrixWithTieredPricing::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::Minimum::conversion_rate_config? attr_accessor created_at: Time @@ -4731,27 +5865,29 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :scalable_matrix_with_tiered_pricing + attr_accessor minimum_config: Orb::Price::Minimum::MinimumConfig + + attr_accessor model_type: :minimum attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::ScalableMatrixWithTieredPricing::price_type + attr_accessor price_type: Orb::Models::Price::Minimum::price_type attr_accessor replaces_price_id: String? - attr_accessor scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top] - attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? def initialize: ( id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::ScalableMatrixWithTieredPricing::cadence, + billing_mode: Orb::Models::Price::Minimum::billing_mode, + cadence: Orb::Models::Price::Minimum::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::ScalableMatrixWithTieredPricing::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::Minimum::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -4765,22 +5901,24 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, + minimum_config: Orb::Price::Minimum::MinimumConfig, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::ScalableMatrixWithTieredPricing::price_type, + price_type: Orb::Models::Price::Minimum::price_type, replaces_price_id: String?, - scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top], ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :scalable_matrix_with_tiered_pricing + ?model_type: :minimum ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::ScalableMatrixWithTieredPricing::cadence, + billing_mode: Orb::Models::Price::Minimum::billing_mode, + cadence: Orb::Models::Price::Minimum::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::ScalableMatrixWithTieredPricing::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::Minimum::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -4794,15 +5932,26 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :scalable_matrix_with_tiered_pricing, + minimum_config: Orb::Price::Minimum::MinimumConfig, + model_type: :minimum, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::ScalableMatrixWithTieredPricing::price_type, + price_type: Orb::Models::Price::Minimum::price_type, replaces_price_id: String?, - scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top], dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::Minimum::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -4816,41 +5965,48 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::ScalableMatrixWithTieredPricing::cadence] + def self?.values: -> ::Array[Orb::Models::Price::Minimum::cadence] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type minimum_config = { minimum_amount: String, prorated: bool } + + class MinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor minimum_amount: String + + attr_reader prorated: bool? + + def prorated=: (bool) -> bool - module ConversionRateConfig - extend Orb::Internal::Type::Union + def initialize: (minimum_amount: String, ?prorated: bool) -> void - def self?.variants: -> ::Array[Orb::Models::Price::ScalableMatrixWithTieredPricing::conversion_rate_config] + def to_hash: -> { minimum_amount: String, prorated: bool } end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::ScalableMatrixWithTieredPricing::price_type] + def self?.values: -> ::Array[Orb::Models::Price::Minimum::price_type] end end - type cumulative_grouped_bulk = + type percent = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::CumulativeGroupedBulk::cadence, + billing_mode: Orb::Models::Price::Percent::billing_mode, + cadence: Orb::Models::Price::Percent::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::CumulativeGroupedBulk::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::Percent::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, - cumulative_grouped_bulk_config: ::Hash[Symbol, top], currency: String, discount: Orb::Models::discount?, external_price_id: String?, @@ -4862,33 +6018,36 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :cumulative_grouped_bulk, + model_type: :percent, name: String, + percent_config: Orb::Price::Percent::PercentConfig, plan_phase_order: Integer?, - price_type: Orb::Models::Price::CumulativeGroupedBulk::price_type, + price_type: Orb::Models::Price::Percent::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel + class Percent < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::CumulativeGroupedBulk::cadence + attr_accessor billing_mode: Orb::Models::Price::Percent::billing_mode + + attr_accessor cadence: Orb::Models::Price::Percent::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::CumulativeGroupedBulk::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::Percent::conversion_rate_config? attr_accessor created_at: Time attr_accessor credit_allocation: Orb::Allocation? - attr_accessor cumulative_grouped_bulk_config: ::Hash[Symbol, top] - attr_accessor currency: String attr_accessor discount: Orb::Models::discount? @@ -4911,13 +6070,15 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :cumulative_grouped_bulk + attr_accessor model_type: :percent attr_accessor name: String + attr_accessor percent_config: Orb::Price::Percent::PercentConfig + attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::CumulativeGroupedBulk::price_type + attr_accessor price_type: Orb::Models::Price::Percent::price_type attr_accessor replaces_price_id: String? @@ -4927,12 +6088,13 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::CumulativeGroupedBulk::cadence, + billing_mode: Orb::Models::Price::Percent::billing_mode, + cadence: Orb::Models::Price::Percent::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::CumulativeGroupedBulk::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::Percent::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, - cumulative_grouped_bulk_config: ::Hash[Symbol, top], currency: String, discount: Orb::Models::discount?, external_price_id: String?, @@ -4945,23 +6107,25 @@ module Orb minimum: Orb::Minimum?, minimum_amount: String?, name: String, + percent_config: Orb::Price::Percent::PercentConfig, plan_phase_order: Integer?, - price_type: Orb::Models::Price::CumulativeGroupedBulk::price_type, + price_type: Orb::Models::Price::Percent::price_type, replaces_price_id: String?, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :cumulative_grouped_bulk + ?model_type: :percent ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::CumulativeGroupedBulk::cadence, + billing_mode: Orb::Models::Price::Percent::billing_mode, + cadence: Orb::Models::Price::Percent::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::CumulativeGroupedBulk::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::Percent::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, - cumulative_grouped_bulk_config: ::Hash[Symbol, top], currency: String, discount: Orb::Models::discount?, external_price_id: String?, @@ -4973,14 +6137,26 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :cumulative_grouped_bulk, + model_type: :percent, name: String, + percent_config: Orb::Price::Percent::PercentConfig, plan_phase_order: Integer?, - price_type: Orb::Models::Price::CumulativeGroupedBulk::price_type, + price_type: Orb::Models::Price::Percent::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::Percent::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -4994,45 +6170,49 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::CumulativeGroupedBulk::cadence] + def self?.values: -> ::Array[Orb::Models::Price::Percent::cadence] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type percent_config = { percent: Float } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class PercentConfig < Orb::Internal::Type::BaseModel + attr_accessor percent: Float - def self?.variants: -> ::Array[Orb::Models::Price::CumulativeGroupedBulk::conversion_rate_config] + def initialize: (percent: Float) -> void + + def to_hash: -> { percent: Float } end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::CumulativeGroupedBulk::price_type] + def self?.values: -> ::Array[Orb::Models::Price::Percent::price_type] end end - type grouped_with_min_max_thresholds = + type event_output = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedWithMinMaxThresholds::cadence, + billing_mode: Orb::Models::Price::EventOutput::billing_mode, + cadence: Orb::Models::Price::EventOutput::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::EventOutput::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, + event_output_config: Orb::Price::EventOutput::EventOutputConfig, external_price_id: String?, fixed_price_quantity: Float?, - grouped_with_min_max_thresholds_config: ::Hash[Symbol, top], invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -5040,26 +6220,30 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :grouped_with_min_max_thresholds, + model_type: :event_output, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedWithMinMaxThresholds::price_type, + price_type: Orb::Models::Price::EventOutput::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + class EventOutput < Orb::Internal::Type::BaseModel attr_accessor id: String attr_accessor billable_metric: Orb::BillableMetricTiny? attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration - attr_accessor cadence: Orb::Models::Price::GroupedWithMinMaxThresholds::cadence + attr_accessor billing_mode: Orb::Models::Price::EventOutput::billing_mode + + attr_accessor cadence: Orb::Models::Price::EventOutput::cadence + + attr_accessor composite_price_filters: ::Array[Orb::TransformPriceFilter]? attr_accessor conversion_rate: Float? - attr_accessor conversion_rate_config: Orb::Models::Price::GroupedWithMinMaxThresholds::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::EventOutput::conversion_rate_config? attr_accessor created_at: Time @@ -5069,12 +6253,12 @@ module Orb attr_accessor discount: Orb::Models::discount? + attr_accessor event_output_config: Orb::Price::EventOutput::EventOutputConfig + attr_accessor external_price_id: String? attr_accessor fixed_price_quantity: Float? - attr_accessor grouped_with_min_max_thresholds_config: ::Hash[Symbol, top] - attr_accessor invoicing_cycle_configuration: Orb::BillingCycleConfiguration? attr_accessor item: Orb::ItemSlim @@ -5089,13 +6273,13 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :grouped_with_min_max_thresholds + attr_accessor model_type: :event_output attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::GroupedWithMinMaxThresholds::price_type + attr_accessor price_type: Orb::Models::Price::EventOutput::price_type attr_accessor replaces_price_id: String? @@ -5105,16 +6289,18 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedWithMinMaxThresholds::cadence, + billing_mode: Orb::Models::Price::EventOutput::billing_mode, + cadence: Orb::Models::Price::EventOutput::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::EventOutput::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, + event_output_config: Orb::Price::EventOutput::EventOutputConfig, external_price_id: String?, fixed_price_quantity: Float?, - grouped_with_min_max_thresholds_config: ::Hash[Symbol, top], invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -5124,26 +6310,28 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedWithMinMaxThresholds::price_type, + price_type: Orb::Models::Price::EventOutput::price_type, replaces_price_id: String?, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :grouped_with_min_max_thresholds + ?model_type: :event_output ) -> void def to_hash: -> { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedWithMinMaxThresholds::cadence, + billing_mode: Orb::Models::Price::EventOutput::billing_mode, + cadence: Orb::Models::Price::EventOutput::cadence, + composite_price_filters: ::Array[Orb::TransformPriceFilter]?, conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::EventOutput::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, discount: Orb::Models::discount?, + event_output_config: Orb::Price::EventOutput::EventOutputConfig, external_price_id: String?, fixed_price_quantity: Float?, - grouped_with_min_max_thresholds_config: ::Hash[Symbol, top], invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -5151,14 +6339,25 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :grouped_with_min_max_thresholds, + model_type: :event_output, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedWithMinMaxThresholds::price_type, + price_type: Orb::Models::Price::EventOutput::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } + type billing_mode = :in_advance | :in_arrear + + module BillingMode + extend Orb::Internal::Type::Enum + + IN_ADVANCE: :in_advance + IN_ARREAR: :in_arrear + + def self?.values: -> ::Array[Orb::Models::Price::EventOutput::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -5172,27 +6371,35 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::GroupedWithMinMaxThresholds::cadence] + def self?.values: -> ::Array[Orb::Models::Price::EventOutput::cadence] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type event_output_config = + { unit_rating_key: String, grouping_key: String? } + + class EventOutputConfig < Orb::Internal::Type::BaseModel + attr_accessor unit_rating_key: String - module ConversionRateConfig - extend Orb::Internal::Type::Union + attr_accessor grouping_key: String? - def self?.variants: -> ::Array[Orb::Models::Price::GroupedWithMinMaxThresholds::conversion_rate_config] + def initialize: ( + unit_rating_key: String, + ?grouping_key: String? + ) -> void + + def to_hash: -> { unit_rating_key: String, grouping_key: String? } end - type price_type = :usage_price | :fixed_price + type price_type = :usage_price | :fixed_price | :composite_price module PriceType extend Orb::Internal::Type::Enum USAGE_PRICE: :usage_price FIXED_PRICE: :fixed_price + COMPOSITE_PRICE: :composite_price - def self?.values: -> ::Array[Orb::Models::Price::GroupedWithMinMaxThresholds::price_type] + def self?.values: -> ::Array[Orb::Models::Price::EventOutput::price_type] end end diff --git a/sig/orb/models/price_create_params.rbs b/sig/orb/models/price_create_params.rbs index f036bb01..4b8357bb 100644 --- a/sig/orb/models/price_create_params.rbs +++ b/sig/orb/models/price_create_params.rbs @@ -19,33 +19,34 @@ module Orb invoice_grouping_key: String?, invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, metadata: ::Hash[Symbol, String?]?, + tiered_config: Orb::TieredConfig, + bulk_config: Orb::BulkConfig, package_config: Orb::PackageConfig, matrix_config: Orb::MatrixConfig, + threshold_total_amount_config: Orb::PriceCreateParams::ThresholdTotalAmountConfig, + tiered_package_config: Orb::PriceCreateParams::TieredPackageConfig, + tiered_with_minimum_config: Orb::PriceCreateParams::TieredWithMinimumConfig, + grouped_tiered_config: Orb::PriceCreateParams::GroupedTieredConfig, + tiered_package_with_minimum_config: Orb::PriceCreateParams::TieredPackageWithMinimumConfig, + package_with_allocation_config: Orb::PriceCreateParams::PackageWithAllocationConfig, + unit_with_percent_config: Orb::PriceCreateParams::UnitWithPercentConfig, matrix_with_allocation_config: Orb::MatrixWithAllocationConfig, - tiered_config: Orb::TieredConfig, - tiered_bps_config: Orb::TieredBPSConfig, - bps_config: Orb::BPSConfig, - bulk_bps_config: Orb::BulkBPSConfig, - bulk_config: Orb::BulkConfig, - threshold_total_amount_config: ::Hash[Symbol, top], - tiered_package_config: ::Hash[Symbol, top], - grouped_tiered_config: ::Hash[Symbol, top], - max_group_tiered_package_config: ::Hash[Symbol, top], - tiered_with_minimum_config: ::Hash[Symbol, top], - package_with_allocation_config: ::Hash[Symbol, top], - tiered_package_with_minimum_config: ::Hash[Symbol, top], - unit_with_percent_config: ::Hash[Symbol, top], - tiered_with_proration_config: ::Hash[Symbol, top], - unit_with_proration_config: ::Hash[Symbol, top], - grouped_allocation_config: ::Hash[Symbol, top], - grouped_with_prorated_minimum_config: ::Hash[Symbol, top], - grouped_with_metered_minimum_config: ::Hash[Symbol, top], - matrix_with_display_name_config: ::Hash[Symbol, top], - bulk_with_proration_config: ::Hash[Symbol, top], - grouped_tiered_package_config: ::Hash[Symbol, top], - scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top], - scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top], - cumulative_grouped_bulk_config: ::Hash[Symbol, top] + tiered_with_proration_config: Orb::PriceCreateParams::TieredWithProrationConfig, + unit_with_proration_config: Orb::PriceCreateParams::UnitWithProrationConfig, + grouped_allocation_config: Orb::PriceCreateParams::GroupedAllocationConfig, + bulk_with_proration_config: Orb::PriceCreateParams::BulkWithProrationConfig, + grouped_with_prorated_minimum_config: Orb::PriceCreateParams::GroupedWithProratedMinimumConfig, + grouped_with_metered_minimum_config: Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig, + grouped_with_min_max_thresholds_config: Orb::PriceCreateParams::GroupedWithMinMaxThresholdsConfig, + matrix_with_display_name_config: Orb::PriceCreateParams::MatrixWithDisplayNameConfig, + grouped_tiered_package_config: Orb::PriceCreateParams::GroupedTieredPackageConfig, + max_group_tiered_package_config: Orb::PriceCreateParams::MaxGroupTieredPackageConfig, + scalable_matrix_with_unit_pricing_config: Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig, + scalable_matrix_with_tiered_pricing_config: Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig, + cumulative_grouped_bulk_config: Orb::PriceCreateParams::CumulativeGroupedBulkConfig, + minimum_config: Orb::PriceCreateParams::MinimumConfig, + percent_config: Orb::PriceCreateParams::PercentConfig, + event_output_config: Orb::PriceCreateParams::EventOutputConfig } & Orb::Internal::Type::request_parameters @@ -87,59 +88,61 @@ module Orb attr_accessor metadata: ::Hash[Symbol, String?]? + attr_accessor tiered_config: Orb::TieredConfig + + attr_accessor bulk_config: Orb::BulkConfig + attr_accessor package_config: Orb::PackageConfig attr_accessor matrix_config: Orb::MatrixConfig - attr_accessor matrix_with_allocation_config: Orb::MatrixWithAllocationConfig + attr_accessor threshold_total_amount_config: Orb::PriceCreateParams::ThresholdTotalAmountConfig - attr_accessor tiered_config: Orb::TieredConfig - - attr_accessor tiered_bps_config: Orb::TieredBPSConfig + attr_accessor tiered_package_config: Orb::PriceCreateParams::TieredPackageConfig - attr_accessor bps_config: Orb::BPSConfig + attr_accessor tiered_with_minimum_config: Orb::PriceCreateParams::TieredWithMinimumConfig - attr_accessor bulk_bps_config: Orb::BulkBPSConfig + attr_accessor grouped_tiered_config: Orb::PriceCreateParams::GroupedTieredConfig - attr_accessor bulk_config: Orb::BulkConfig + attr_accessor tiered_package_with_minimum_config: Orb::PriceCreateParams::TieredPackageWithMinimumConfig - attr_accessor threshold_total_amount_config: ::Hash[Symbol, top] + attr_accessor package_with_allocation_config: Orb::PriceCreateParams::PackageWithAllocationConfig - attr_accessor tiered_package_config: ::Hash[Symbol, top] + attr_accessor unit_with_percent_config: Orb::PriceCreateParams::UnitWithPercentConfig - attr_accessor grouped_tiered_config: ::Hash[Symbol, top] + attr_accessor matrix_with_allocation_config: Orb::MatrixWithAllocationConfig - attr_accessor max_group_tiered_package_config: ::Hash[Symbol, top] + attr_accessor tiered_with_proration_config: Orb::PriceCreateParams::TieredWithProrationConfig - attr_accessor tiered_with_minimum_config: ::Hash[Symbol, top] + attr_accessor unit_with_proration_config: Orb::PriceCreateParams::UnitWithProrationConfig - attr_accessor package_with_allocation_config: ::Hash[Symbol, top] + attr_accessor grouped_allocation_config: Orb::PriceCreateParams::GroupedAllocationConfig - attr_accessor tiered_package_with_minimum_config: ::Hash[Symbol, top] + attr_accessor bulk_with_proration_config: Orb::PriceCreateParams::BulkWithProrationConfig - attr_accessor unit_with_percent_config: ::Hash[Symbol, top] + attr_accessor grouped_with_prorated_minimum_config: Orb::PriceCreateParams::GroupedWithProratedMinimumConfig - attr_accessor tiered_with_proration_config: ::Hash[Symbol, top] + attr_accessor grouped_with_metered_minimum_config: Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig - attr_accessor unit_with_proration_config: ::Hash[Symbol, top] + attr_accessor grouped_with_min_max_thresholds_config: Orb::PriceCreateParams::GroupedWithMinMaxThresholdsConfig - attr_accessor grouped_allocation_config: ::Hash[Symbol, top] + attr_accessor matrix_with_display_name_config: Orb::PriceCreateParams::MatrixWithDisplayNameConfig - attr_accessor grouped_with_prorated_minimum_config: ::Hash[Symbol, top] + attr_accessor grouped_tiered_package_config: Orb::PriceCreateParams::GroupedTieredPackageConfig - attr_accessor grouped_with_metered_minimum_config: ::Hash[Symbol, top] + attr_accessor max_group_tiered_package_config: Orb::PriceCreateParams::MaxGroupTieredPackageConfig - attr_accessor matrix_with_display_name_config: ::Hash[Symbol, top] + attr_accessor scalable_matrix_with_unit_pricing_config: Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig - attr_accessor bulk_with_proration_config: ::Hash[Symbol, top] + attr_accessor scalable_matrix_with_tiered_pricing_config: Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig - attr_accessor grouped_tiered_package_config: ::Hash[Symbol, top] + attr_accessor cumulative_grouped_bulk_config: Orb::PriceCreateParams::CumulativeGroupedBulkConfig - attr_accessor scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top] + attr_accessor minimum_config: Orb::PriceCreateParams::MinimumConfig - attr_accessor scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top] + attr_accessor percent_config: Orb::PriceCreateParams::PercentConfig - attr_accessor cumulative_grouped_bulk_config: ::Hash[Symbol, top] + attr_accessor event_output_config: Orb::PriceCreateParams::EventOutputConfig def initialize: ( cadence: Orb::Models::PriceCreateParams::cadence, @@ -148,33 +151,34 @@ module Orb model_type: Orb::Models::PriceCreateParams::model_type, name: String, unit_config: Orb::UnitConfig, + tiered_config: Orb::TieredConfig, + bulk_config: Orb::BulkConfig, package_config: Orb::PackageConfig, matrix_config: Orb::MatrixConfig, + threshold_total_amount_config: Orb::PriceCreateParams::ThresholdTotalAmountConfig, + tiered_package_config: Orb::PriceCreateParams::TieredPackageConfig, + tiered_with_minimum_config: Orb::PriceCreateParams::TieredWithMinimumConfig, + grouped_tiered_config: Orb::PriceCreateParams::GroupedTieredConfig, + tiered_package_with_minimum_config: Orb::PriceCreateParams::TieredPackageWithMinimumConfig, + package_with_allocation_config: Orb::PriceCreateParams::PackageWithAllocationConfig, + unit_with_percent_config: Orb::PriceCreateParams::UnitWithPercentConfig, matrix_with_allocation_config: Orb::MatrixWithAllocationConfig, - tiered_config: Orb::TieredConfig, - tiered_bps_config: Orb::TieredBPSConfig, - bps_config: Orb::BPSConfig, - bulk_bps_config: Orb::BulkBPSConfig, - bulk_config: Orb::BulkConfig, - threshold_total_amount_config: ::Hash[Symbol, top], - tiered_package_config: ::Hash[Symbol, top], - grouped_tiered_config: ::Hash[Symbol, top], - max_group_tiered_package_config: ::Hash[Symbol, top], - tiered_with_minimum_config: ::Hash[Symbol, top], - package_with_allocation_config: ::Hash[Symbol, top], - tiered_package_with_minimum_config: ::Hash[Symbol, top], - unit_with_percent_config: ::Hash[Symbol, top], - tiered_with_proration_config: ::Hash[Symbol, top], - unit_with_proration_config: ::Hash[Symbol, top], - grouped_allocation_config: ::Hash[Symbol, top], - grouped_with_prorated_minimum_config: ::Hash[Symbol, top], - grouped_with_metered_minimum_config: ::Hash[Symbol, top], - matrix_with_display_name_config: ::Hash[Symbol, top], - bulk_with_proration_config: ::Hash[Symbol, top], - grouped_tiered_package_config: ::Hash[Symbol, top], - scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top], - scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top], - cumulative_grouped_bulk_config: ::Hash[Symbol, top], + tiered_with_proration_config: Orb::PriceCreateParams::TieredWithProrationConfig, + unit_with_proration_config: Orb::PriceCreateParams::UnitWithProrationConfig, + grouped_allocation_config: Orb::PriceCreateParams::GroupedAllocationConfig, + bulk_with_proration_config: Orb::PriceCreateParams::BulkWithProrationConfig, + grouped_with_prorated_minimum_config: Orb::PriceCreateParams::GroupedWithProratedMinimumConfig, + grouped_with_metered_minimum_config: Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig, + grouped_with_min_max_thresholds_config: Orb::PriceCreateParams::GroupedWithMinMaxThresholdsConfig, + matrix_with_display_name_config: Orb::PriceCreateParams::MatrixWithDisplayNameConfig, + grouped_tiered_package_config: Orb::PriceCreateParams::GroupedTieredPackageConfig, + max_group_tiered_package_config: Orb::PriceCreateParams::MaxGroupTieredPackageConfig, + scalable_matrix_with_unit_pricing_config: Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig, + scalable_matrix_with_tiered_pricing_config: Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig, + cumulative_grouped_bulk_config: Orb::PriceCreateParams::CumulativeGroupedBulkConfig, + minimum_config: Orb::PriceCreateParams::MinimumConfig, + percent_config: Orb::PriceCreateParams::PercentConfig, + event_output_config: Orb::PriceCreateParams::EventOutputConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -207,33 +211,34 @@ module Orb invoice_grouping_key: String?, invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, metadata: ::Hash[Symbol, String?]?, + tiered_config: Orb::TieredConfig, + bulk_config: Orb::BulkConfig, package_config: Orb::PackageConfig, matrix_config: Orb::MatrixConfig, + threshold_total_amount_config: Orb::PriceCreateParams::ThresholdTotalAmountConfig, + tiered_package_config: Orb::PriceCreateParams::TieredPackageConfig, + tiered_with_minimum_config: Orb::PriceCreateParams::TieredWithMinimumConfig, + grouped_tiered_config: Orb::PriceCreateParams::GroupedTieredConfig, + tiered_package_with_minimum_config: Orb::PriceCreateParams::TieredPackageWithMinimumConfig, + package_with_allocation_config: Orb::PriceCreateParams::PackageWithAllocationConfig, + unit_with_percent_config: Orb::PriceCreateParams::UnitWithPercentConfig, matrix_with_allocation_config: Orb::MatrixWithAllocationConfig, - tiered_config: Orb::TieredConfig, - tiered_bps_config: Orb::TieredBPSConfig, - bps_config: Orb::BPSConfig, - bulk_bps_config: Orb::BulkBPSConfig, - bulk_config: Orb::BulkConfig, - threshold_total_amount_config: ::Hash[Symbol, top], - tiered_package_config: ::Hash[Symbol, top], - grouped_tiered_config: ::Hash[Symbol, top], - max_group_tiered_package_config: ::Hash[Symbol, top], - tiered_with_minimum_config: ::Hash[Symbol, top], - package_with_allocation_config: ::Hash[Symbol, top], - tiered_package_with_minimum_config: ::Hash[Symbol, top], - unit_with_percent_config: ::Hash[Symbol, top], - tiered_with_proration_config: ::Hash[Symbol, top], - unit_with_proration_config: ::Hash[Symbol, top], - grouped_allocation_config: ::Hash[Symbol, top], - grouped_with_prorated_minimum_config: ::Hash[Symbol, top], - grouped_with_metered_minimum_config: ::Hash[Symbol, top], - matrix_with_display_name_config: ::Hash[Symbol, top], - bulk_with_proration_config: ::Hash[Symbol, top], - grouped_tiered_package_config: ::Hash[Symbol, top], - scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top], - scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top], - cumulative_grouped_bulk_config: ::Hash[Symbol, top], + tiered_with_proration_config: Orb::PriceCreateParams::TieredWithProrationConfig, + unit_with_proration_config: Orb::PriceCreateParams::UnitWithProrationConfig, + grouped_allocation_config: Orb::PriceCreateParams::GroupedAllocationConfig, + bulk_with_proration_config: Orb::PriceCreateParams::BulkWithProrationConfig, + grouped_with_prorated_minimum_config: Orb::PriceCreateParams::GroupedWithProratedMinimumConfig, + grouped_with_metered_minimum_config: Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig, + grouped_with_min_max_thresholds_config: Orb::PriceCreateParams::GroupedWithMinMaxThresholdsConfig, + matrix_with_display_name_config: Orb::PriceCreateParams::MatrixWithDisplayNameConfig, + grouped_tiered_package_config: Orb::PriceCreateParams::GroupedTieredPackageConfig, + max_group_tiered_package_config: Orb::PriceCreateParams::MaxGroupTieredPackageConfig, + scalable_matrix_with_unit_pricing_config: Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig, + scalable_matrix_with_tiered_pricing_config: Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig, + cumulative_grouped_bulk_config: Orb::PriceCreateParams::CumulativeGroupedBulkConfig, + minimum_config: Orb::PriceCreateParams::MinimumConfig, + percent_config: Orb::PriceCreateParams::PercentConfig, + event_output_config: Orb::PriceCreateParams::EventOutputConfig, request_options: Orb::RequestOptions } @@ -253,23 +258,831 @@ module Orb def self?.values: -> ::Array[Orb::Models::PriceCreateParams::cadence] end - type model_type = :cumulative_grouped_bulk + type model_type = :event_output module ModelType extend Orb::Internal::Type::Enum - CUMULATIVE_GROUPED_BULK: :cumulative_grouped_bulk + EVENT_OUTPUT: :event_output def self?.values: -> ::Array[Orb::Models::PriceCreateParams::model_type] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + type threshold_total_amount_config = + { + consumption_table: ::Array[Orb::PriceCreateParams::ThresholdTotalAmountConfig::ConsumptionTable], + prorate: bool? + } + + class ThresholdTotalAmountConfig < Orb::Internal::Type::BaseModel + attr_accessor consumption_table: ::Array[Orb::PriceCreateParams::ThresholdTotalAmountConfig::ConsumptionTable] + + attr_accessor prorate: bool? + + def initialize: ( + consumption_table: ::Array[Orb::PriceCreateParams::ThresholdTotalAmountConfig::ConsumptionTable], + ?prorate: bool? + ) -> void + + def to_hash: -> { + consumption_table: ::Array[Orb::PriceCreateParams::ThresholdTotalAmountConfig::ConsumptionTable], + prorate: bool? + } + + type consumption_table = { threshold: String, total_amount: String } + + class ConsumptionTable < Orb::Internal::Type::BaseModel + attr_accessor threshold: String + + attr_accessor total_amount: String + + def initialize: (threshold: String, total_amount: String) -> void + + def to_hash: -> { threshold: String, total_amount: String } + end + end + + type tiered_package_config = + { + package_size: String, + tiers: ::Array[Orb::PriceCreateParams::TieredPackageConfig::Tier] + } + + class TieredPackageConfig < Orb::Internal::Type::BaseModel + attr_accessor package_size: String + + attr_accessor tiers: ::Array[Orb::PriceCreateParams::TieredPackageConfig::Tier] + + def initialize: ( + package_size: String, + tiers: ::Array[Orb::PriceCreateParams::TieredPackageConfig::Tier] + ) -> void + + def to_hash: -> { + package_size: String, + tiers: ::Array[Orb::PriceCreateParams::TieredPackageConfig::Tier] + } + + type tier = { per_unit: String, tier_lower_bound: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor per_unit: String + + attr_accessor tier_lower_bound: String + + def initialize: (per_unit: String, tier_lower_bound: String) -> void + + def to_hash: -> { per_unit: String, tier_lower_bound: String } + end + end + + type tiered_with_minimum_config = + { + tiers: ::Array[Orb::PriceCreateParams::TieredWithMinimumConfig::Tier], + hide_zero_amount_tiers: bool, + prorate: bool + } + + class TieredWithMinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::PriceCreateParams::TieredWithMinimumConfig::Tier] + + attr_reader hide_zero_amount_tiers: bool? + + def hide_zero_amount_tiers=: (bool) -> bool + + attr_reader prorate: bool? + + def prorate=: (bool) -> bool + + def initialize: ( + tiers: ::Array[Orb::PriceCreateParams::TieredWithMinimumConfig::Tier], + ?hide_zero_amount_tiers: bool, + ?prorate: bool + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::PriceCreateParams::TieredWithMinimumConfig::Tier], + hide_zero_amount_tiers: bool, + prorate: bool + } + + type tier = + { + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor minimum_amount: String + + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { + minimum_amount: String, + tier_lower_bound: String, + unit_amount: String + } + end + end + + type grouped_tiered_config = + { + grouping_key: String, + tiers: ::Array[Orb::PriceCreateParams::GroupedTieredConfig::Tier] + } + + class GroupedTieredConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor tiers: ::Array[Orb::PriceCreateParams::GroupedTieredConfig::Tier] + + def initialize: ( + grouping_key: String, + tiers: ::Array[Orb::PriceCreateParams::GroupedTieredConfig::Tier] + ) -> void + + def to_hash: -> { + grouping_key: String, + tiers: ::Array[Orb::PriceCreateParams::GroupedTieredConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { tier_lower_bound: String, unit_amount: String } + end + end + + type tiered_package_with_minimum_config = + { + package_size: Float, + tiers: ::Array[Orb::PriceCreateParams::TieredPackageWithMinimumConfig::Tier] + } + + class TieredPackageWithMinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor package_size: Float + + attr_accessor tiers: ::Array[Orb::PriceCreateParams::TieredPackageWithMinimumConfig::Tier] + + def initialize: ( + package_size: Float, + tiers: ::Array[Orb::PriceCreateParams::TieredPackageWithMinimumConfig::Tier] + ) -> void + + def to_hash: -> { + package_size: Float, + tiers: ::Array[Orb::PriceCreateParams::TieredPackageWithMinimumConfig::Tier] + } + + type tier = + { minimum_amount: String, per_unit: String, tier_lower_bound: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor minimum_amount: String + + attr_accessor per_unit: String + + attr_accessor tier_lower_bound: String + + def initialize: ( + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + ) -> void + + def to_hash: -> { + minimum_amount: String, + per_unit: String, + tier_lower_bound: String + } + end + end + + type package_with_allocation_config = + { allocation: String, package_amount: String, package_size: String } + + class PackageWithAllocationConfig < Orb::Internal::Type::BaseModel + attr_accessor allocation: String + + attr_accessor package_amount: String + + attr_accessor package_size: String + + def initialize: ( + allocation: String, + package_amount: String, + package_size: String + ) -> void + + def to_hash: -> { + allocation: String, + package_amount: String, + package_size: String + } + end + + type unit_with_percent_config = { percent: String, unit_amount: String } + + class UnitWithPercentConfig < Orb::Internal::Type::BaseModel + attr_accessor percent: String + + attr_accessor unit_amount: String + + def initialize: (percent: String, unit_amount: String) -> void + + def to_hash: -> { percent: String, unit_amount: String } + end + + type tiered_with_proration_config = + { + tiers: ::Array[Orb::PriceCreateParams::TieredWithProrationConfig::Tier] + } + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::PriceCreateParams::TieredWithProrationConfig::Tier] + + def initialize: ( + tiers: ::Array[Orb::PriceCreateParams::TieredWithProrationConfig::Tier] + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::PriceCreateParams::TieredWithProrationConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { tier_lower_bound: String, unit_amount: String } + end + end + + type unit_with_proration_config = { unit_amount: String } + + class UnitWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor unit_amount: String + + def initialize: (unit_amount: String) -> void + + def to_hash: -> { unit_amount: String } + end + + type grouped_allocation_config = + { allocation: String, grouping_key: String, overage_unit_rate: String } + + class GroupedAllocationConfig < Orb::Internal::Type::BaseModel + attr_accessor allocation: String + + attr_accessor grouping_key: String + + attr_accessor overage_unit_rate: String + + def initialize: ( + allocation: String, + grouping_key: String, + overage_unit_rate: String + ) -> void + + def to_hash: -> { + allocation: String, + grouping_key: String, + overage_unit_rate: String + } + end + + type bulk_with_proration_config = + { + tiers: ::Array[Orb::PriceCreateParams::BulkWithProrationConfig::Tier] + } + + class BulkWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::PriceCreateParams::BulkWithProrationConfig::Tier] + + def initialize: ( + tiers: ::Array[Orb::PriceCreateParams::BulkWithProrationConfig::Tier] + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::PriceCreateParams::BulkWithProrationConfig::Tier] + } + + type tier = { unit_amount: String, tier_lower_bound: String? } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor unit_amount: String + + attr_accessor tier_lower_bound: String? + + def initialize: ( + unit_amount: String, + ?tier_lower_bound: String? + ) -> void + + def to_hash: -> { unit_amount: String, tier_lower_bound: String? } + end + end + + type grouped_with_prorated_minimum_config = + { grouping_key: String, minimum: String, unit_rate: String } + + class GroupedWithProratedMinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor minimum: String + + attr_accessor unit_rate: String + + def initialize: ( + grouping_key: String, + minimum: String, + unit_rate: String + ) -> void + + def to_hash: -> { + grouping_key: String, + minimum: String, + unit_rate: String + } + end + + type grouped_with_metered_minimum_config = + { + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: ::Array[Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::ScalingFactor], + scaling_key: String, + unit_amounts: ::Array[Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::UnitAmount] + } + + class GroupedWithMeteredMinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor minimum_unit_amount: String + + attr_accessor pricing_key: String + + attr_accessor scaling_factors: ::Array[Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::ScalingFactor] + + attr_accessor scaling_key: String + + attr_accessor unit_amounts: ::Array[Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::UnitAmount] + + def initialize: ( + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: ::Array[Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::ScalingFactor], + scaling_key: String, + unit_amounts: ::Array[Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::UnitAmount] + ) -> void + + def to_hash: -> { + grouping_key: String, + minimum_unit_amount: String, + pricing_key: String, + scaling_factors: ::Array[Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::ScalingFactor], + scaling_key: String, + unit_amounts: ::Array[Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::UnitAmount] + } + + type scaling_factor = { scaling_factor: String, scaling_value: String } + + class ScalingFactor < Orb::Internal::Type::BaseModel + attr_accessor scaling_factor: String + + attr_accessor scaling_value: String + + def initialize: ( + scaling_factor: String, + scaling_value: String + ) -> void + + def to_hash: -> { scaling_factor: String, scaling_value: String } + end + + type unit_amount = { pricing_value: String, unit_amount: String } + + class UnitAmount < Orb::Internal::Type::BaseModel + attr_accessor pricing_value: String + + attr_accessor unit_amount: String + + def initialize: (pricing_value: String, unit_amount: String) -> void + + def to_hash: -> { pricing_value: String, unit_amount: String } + end + end + + type grouped_with_min_max_thresholds_config = + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor maximum_charge: String + + attr_accessor minimum_charge: String + + attr_accessor per_unit_rate: String + + def initialize: ( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ) -> void + + def to_hash: -> { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + end + + type matrix_with_display_name_config = + { + dimension: String, + unit_amounts: ::Array[Orb::PriceCreateParams::MatrixWithDisplayNameConfig::UnitAmount] + } + + class MatrixWithDisplayNameConfig < Orb::Internal::Type::BaseModel + attr_accessor dimension: String + + attr_accessor unit_amounts: ::Array[Orb::PriceCreateParams::MatrixWithDisplayNameConfig::UnitAmount] + + def initialize: ( + dimension: String, + unit_amounts: ::Array[Orb::PriceCreateParams::MatrixWithDisplayNameConfig::UnitAmount] + ) -> void + + def to_hash: -> { + dimension: String, + unit_amounts: ::Array[Orb::PriceCreateParams::MatrixWithDisplayNameConfig::UnitAmount] + } + + type unit_amount = + { dimension_value: String, display_name: String, unit_amount: String } + + class UnitAmount < Orb::Internal::Type::BaseModel + attr_accessor dimension_value: String + + attr_accessor display_name: String + + attr_accessor unit_amount: String + + def initialize: ( + dimension_value: String, + display_name: String, + unit_amount: String + ) -> void + + def to_hash: -> { + dimension_value: String, + display_name: String, + unit_amount: String + } + end + end + + type grouped_tiered_package_config = + { + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::PriceCreateParams::GroupedTieredPackageConfig::Tier] + } + + class GroupedTieredPackageConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor package_size: String + + attr_accessor tiers: ::Array[Orb::PriceCreateParams::GroupedTieredPackageConfig::Tier] + + def initialize: ( + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::PriceCreateParams::GroupedTieredPackageConfig::Tier] + ) -> void + + def to_hash: -> { + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::PriceCreateParams::GroupedTieredPackageConfig::Tier] + } + + type tier = { per_unit: String, tier_lower_bound: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor per_unit: String + + attr_accessor tier_lower_bound: String + + def initialize: (per_unit: String, tier_lower_bound: String) -> void + + def to_hash: -> { per_unit: String, tier_lower_bound: String } + end + end + + type max_group_tiered_package_config = + { + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::PriceCreateParams::MaxGroupTieredPackageConfig::Tier] + } + + class MaxGroupTieredPackageConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor package_size: String + + attr_accessor tiers: ::Array[Orb::PriceCreateParams::MaxGroupTieredPackageConfig::Tier] + + def initialize: ( + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::PriceCreateParams::MaxGroupTieredPackageConfig::Tier] + ) -> void + + def to_hash: -> { + grouping_key: String, + package_size: String, + tiers: ::Array[Orb::PriceCreateParams::MaxGroupTieredPackageConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { tier_lower_bound: String, unit_amount: String } + end + end + + type scalable_matrix_with_unit_pricing_config = + { + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor], + unit_price: String, + prorate: bool?, + second_dimension: String? + } + + class ScalableMatrixWithUnitPricingConfig < Orb::Internal::Type::BaseModel + attr_accessor first_dimension: String + + attr_accessor matrix_scaling_factors: ::Array[Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor] + + attr_accessor unit_price: String + + attr_accessor prorate: bool? + + attr_accessor second_dimension: String? + + def initialize: ( + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor], + unit_price: String, + ?prorate: bool?, + ?second_dimension: String? + ) -> void + + def to_hash: -> { + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig::MatrixScalingFactor], + unit_price: String, + prorate: bool?, + second_dimension: String? + } + + type matrix_scaling_factor = + { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: String? + } + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + attr_accessor first_dimension_value: String + + attr_accessor scaling_factor: String + + attr_accessor second_dimension_value: String? + + def initialize: ( + first_dimension_value: String, + scaling_factor: String, + ?second_dimension_value: String? + ) -> void + + def to_hash: -> { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: String? + } + end + end + + type scalable_matrix_with_tiered_pricing_config = + { + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor], + tiers: ::Array[Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::Tier], + second_dimension: String? + } + + class ScalableMatrixWithTieredPricingConfig < Orb::Internal::Type::BaseModel + attr_accessor first_dimension: String + + attr_accessor matrix_scaling_factors: ::Array[Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor] + + attr_accessor tiers: ::Array[Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::Tier] + + attr_accessor second_dimension: String? + + def initialize: ( + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor], + tiers: ::Array[Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::Tier], + ?second_dimension: String? + ) -> void + + def to_hash: -> { + first_dimension: String, + matrix_scaling_factors: ::Array[Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor], + tiers: ::Array[Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig::Tier], + second_dimension: String? + } + + type matrix_scaling_factor = + { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: String? + } + + class MatrixScalingFactor < Orb::Internal::Type::BaseModel + attr_accessor first_dimension_value: String + + attr_accessor scaling_factor: String + + attr_accessor second_dimension_value: String? + + def initialize: ( + first_dimension_value: String, + scaling_factor: String, + ?second_dimension_value: String? + ) -> void + + def to_hash: -> { + first_dimension_value: String, + scaling_factor: String, + second_dimension_value: String? + } + end + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { tier_lower_bound: String, unit_amount: String } + end + end + + type cumulative_grouped_bulk_config = + { + dimension_values: ::Array[Orb::PriceCreateParams::CumulativeGroupedBulkConfig::DimensionValue], + group: String + } + + class CumulativeGroupedBulkConfig < Orb::Internal::Type::BaseModel + attr_accessor dimension_values: ::Array[Orb::PriceCreateParams::CumulativeGroupedBulkConfig::DimensionValue] + + attr_accessor group: String + + def initialize: ( + dimension_values: ::Array[Orb::PriceCreateParams::CumulativeGroupedBulkConfig::DimensionValue], + group: String + ) -> void + + def to_hash: -> { + dimension_values: ::Array[Orb::PriceCreateParams::CumulativeGroupedBulkConfig::DimensionValue], + group: String + } + + type dimension_value = + { + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + } + + class DimensionValue < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { + grouping_key: String, + tier_lower_bound: String, + unit_amount: String + } + end + end + + type minimum_config = { minimum_amount: String, prorated: bool } + + class MinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor minimum_amount: String + + attr_reader prorated: bool? + + def prorated=: (bool) -> bool + + def initialize: (minimum_amount: String, ?prorated: bool) -> void + + def to_hash: -> { minimum_amount: String, prorated: bool } + end + + type percent_config = { percent: Float } + + class PercentConfig < Orb::Internal::Type::BaseModel + attr_accessor percent: Float + + def initialize: (percent: Float) -> void + + def to_hash: -> { percent: Float } + end + + type event_output_config = + { unit_rating_key: String, grouping_key: String? } + + class EventOutputConfig < Orb::Internal::Type::BaseModel + attr_accessor unit_rating_key: String + + attr_accessor grouping_key: String? - module ConversionRateConfig - extend Orb::Internal::Type::Union + def initialize: ( + unit_rating_key: String, + ?grouping_key: String? + ) -> void - def self?.variants: -> ::Array[Orb::Models::PriceCreateParams::conversion_rate_config] + def to_hash: -> { unit_rating_key: String, grouping_key: String? } end end end diff --git a/sig/orb/models/price_evaluate_multiple_params.rbs b/sig/orb/models/price_evaluate_multiple_params.rbs index 5db2f9eb..183511f6 100644 --- a/sig/orb/models/price_evaluate_multiple_params.rbs +++ b/sig/orb/models/price_evaluate_multiple_params.rbs @@ -86,37 +86,450 @@ module Orb type price = Orb::NewFloatingUnitPrice - | Orb::NewFloatingPackagePrice - | Orb::NewFloatingMatrixPrice - | Orb::NewFloatingMatrixWithAllocationPrice | Orb::NewFloatingTieredPrice - | Orb::NewFloatingTieredBPSPrice - | Orb::NewFloatingBPSPrice - | Orb::NewFloatingBulkBPSPrice | Orb::NewFloatingBulkPrice + | Orb::NewFloatingPackagePrice + | Orb::NewFloatingMatrixPrice | Orb::NewFloatingThresholdTotalAmountPrice | Orb::NewFloatingTieredPackagePrice - | Orb::NewFloatingGroupedTieredPrice - | Orb::NewFloatingMaxGroupTieredPackagePrice | Orb::NewFloatingTieredWithMinimumPrice - | Orb::NewFloatingPackageWithAllocationPrice + | Orb::NewFloatingGroupedTieredPrice | Orb::NewFloatingTieredPackageWithMinimumPrice + | Orb::NewFloatingPackageWithAllocationPrice | Orb::NewFloatingUnitWithPercentPrice + | Orb::NewFloatingMatrixWithAllocationPrice | Orb::NewFloatingTieredWithProrationPrice | Orb::NewFloatingUnitWithProrationPrice | Orb::NewFloatingGroupedAllocationPrice + | Orb::NewFloatingBulkWithProrationPrice | Orb::NewFloatingGroupedWithProratedMinimumPrice | Orb::NewFloatingGroupedWithMeteredMinimumPrice + | Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds | Orb::NewFloatingMatrixWithDisplayNamePrice - | Orb::NewFloatingBulkWithProrationPrice | Orb::NewFloatingGroupedTieredPackagePrice + | Orb::NewFloatingMaxGroupTieredPackagePrice | Orb::NewFloatingScalableMatrixWithUnitPricingPrice | Orb::NewFloatingScalableMatrixWithTieredPricingPrice | Orb::NewFloatingCumulativeGroupedBulkPrice + | Orb::NewFloatingMinimumCompositePrice + | Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent + | Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput module Price extend Orb::Internal::Type::Union + type grouped_with_min_max_thresholds = + { + cadence: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::cadence, + currency: String, + grouped_with_min_max_thresholds_config: Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]? + } + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::cadence + + attr_accessor currency: String + + attr_accessor grouped_with_min_max_thresholds_config: Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_with_min_max_thresholds + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::conversion_rate_config? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + def initialize: ( + cadence: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::cadence, + currency: String, + grouped_with_min_max_thresholds_config: Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?model_type: :grouped_with_min_max_thresholds + ) -> void + + def to_hash: -> { + cadence: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::cadence, + currency: String, + grouped_with_min_max_thresholds_config: Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::cadence] + end + + type grouped_with_min_max_thresholds_config = + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor maximum_charge: String + + attr_accessor minimum_charge: String + + attr_accessor per_unit_rate: String + + def initialize: ( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ) -> void + + def to_hash: -> { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + end + end + + type percent = + { + cadence: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::cadence, + currency: String, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::conversion_rate_config?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]? + } + + class Percent < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :percent + + attr_accessor name: String + + attr_accessor percent_config: Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::PercentConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::conversion_rate_config? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + def initialize: ( + cadence: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::cadence, + currency: String, + item_id: String, + name: String, + percent_config: Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::PercentConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::conversion_rate_config?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?model_type: :percent + ) -> void + + def to_hash: -> { + cadence: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::cadence, + currency: String, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::conversion_rate_config?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::Percent::cadence] + end + + type percent_config = { percent: Float } + + class PercentConfig < Orb::Internal::Type::BaseModel + attr_accessor percent: Float + + def initialize: (percent: Float) -> void + + def to_hash: -> { percent: Float } + end + end + + type event_output = + { + cadence: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::cadence, + currency: String, + event_output_config: Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::conversion_rate_config?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]? + } + + class EventOutput < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::cadence + + attr_accessor currency: String + + attr_accessor event_output_config: Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::EventOutputConfig + + attr_accessor item_id: String + + attr_accessor model_type: :event_output + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::conversion_rate_config? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + def initialize: ( + cadence: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::cadence, + currency: String, + event_output_config: Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::EventOutputConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::conversion_rate_config?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?model_type: :event_output + ) -> void + + def to_hash: -> { + cadence: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::cadence, + currency: String, + event_output_config: Orb::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::conversion_rate_config?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::Price::EventOutput::cadence] + end + + type event_output_config = + { unit_rating_key: String, grouping_key: String? } + + class EventOutputConfig < Orb::Internal::Type::BaseModel + attr_accessor unit_rating_key: String + + attr_accessor grouping_key: String? + + def initialize: ( + unit_rating_key: String, + ?grouping_key: String? + ) -> void + + def to_hash: -> { unit_rating_key: String, grouping_key: String? } + end + end + def self?.variants: -> ::Array[Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation::price] end end diff --git a/sig/orb/models/price_evaluate_preview_events_params.rbs b/sig/orb/models/price_evaluate_preview_events_params.rbs index f09395bb..fc63953f 100644 --- a/sig/orb/models/price_evaluate_preview_events_params.rbs +++ b/sig/orb/models/price_evaluate_preview_events_params.rbs @@ -132,37 +132,450 @@ module Orb type price = Orb::NewFloatingUnitPrice - | Orb::NewFloatingPackagePrice - | Orb::NewFloatingMatrixPrice - | Orb::NewFloatingMatrixWithAllocationPrice | Orb::NewFloatingTieredPrice - | Orb::NewFloatingTieredBPSPrice - | Orb::NewFloatingBPSPrice - | Orb::NewFloatingBulkBPSPrice | Orb::NewFloatingBulkPrice + | Orb::NewFloatingPackagePrice + | Orb::NewFloatingMatrixPrice | Orb::NewFloatingThresholdTotalAmountPrice | Orb::NewFloatingTieredPackagePrice - | Orb::NewFloatingGroupedTieredPrice - | Orb::NewFloatingMaxGroupTieredPackagePrice | Orb::NewFloatingTieredWithMinimumPrice - | Orb::NewFloatingPackageWithAllocationPrice + | Orb::NewFloatingGroupedTieredPrice | Orb::NewFloatingTieredPackageWithMinimumPrice + | Orb::NewFloatingPackageWithAllocationPrice | Orb::NewFloatingUnitWithPercentPrice + | Orb::NewFloatingMatrixWithAllocationPrice | Orb::NewFloatingTieredWithProrationPrice | Orb::NewFloatingUnitWithProrationPrice | Orb::NewFloatingGroupedAllocationPrice + | Orb::NewFloatingBulkWithProrationPrice | Orb::NewFloatingGroupedWithProratedMinimumPrice | Orb::NewFloatingGroupedWithMeteredMinimumPrice + | Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds | Orb::NewFloatingMatrixWithDisplayNamePrice - | Orb::NewFloatingBulkWithProrationPrice | Orb::NewFloatingGroupedTieredPackagePrice + | Orb::NewFloatingMaxGroupTieredPackagePrice | Orb::NewFloatingScalableMatrixWithUnitPricingPrice | Orb::NewFloatingScalableMatrixWithTieredPricingPrice | Orb::NewFloatingCumulativeGroupedBulkPrice + | Orb::NewFloatingMinimumCompositePrice + | Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent + | Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput module Price extend Orb::Internal::Type::Union + type grouped_with_min_max_thresholds = + { + cadence: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::cadence, + currency: String, + grouped_with_min_max_thresholds_config: Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]? + } + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::cadence + + attr_accessor currency: String + + attr_accessor grouped_with_min_max_thresholds_config: Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_with_min_max_thresholds + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::conversion_rate_config? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + def initialize: ( + cadence: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::cadence, + currency: String, + grouped_with_min_max_thresholds_config: Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?model_type: :grouped_with_min_max_thresholds + ) -> void + + def to_hash: -> { + cadence: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::cadence, + currency: String, + grouped_with_min_max_thresholds_config: Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::GroupedWithMinMaxThresholds::cadence] + end + + type grouped_with_min_max_thresholds_config = + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor maximum_charge: String + + attr_accessor minimum_charge: String + + attr_accessor per_unit_rate: String + + def initialize: ( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ) -> void + + def to_hash: -> { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + end + end + + type percent = + { + cadence: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::cadence, + currency: String, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::conversion_rate_config?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]? + } + + class Percent < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :percent + + attr_accessor name: String + + attr_accessor percent_config: Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::PercentConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::conversion_rate_config? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + def initialize: ( + cadence: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::cadence, + currency: String, + item_id: String, + name: String, + percent_config: Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::PercentConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::conversion_rate_config?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?model_type: :percent + ) -> void + + def to_hash: -> { + cadence: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::cadence, + currency: String, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::conversion_rate_config?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::Percent::cadence] + end + + type percent_config = { percent: Float } + + class PercentConfig < Orb::Internal::Type::BaseModel + attr_accessor percent: Float + + def initialize: (percent: Float) -> void + + def to_hash: -> { percent: Float } + end + end + + type event_output = + { + cadence: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::cadence, + currency: String, + event_output_config: Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::conversion_rate_config?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]? + } + + class EventOutput < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::cadence + + attr_accessor currency: String + + attr_accessor event_output_config: Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::EventOutputConfig + + attr_accessor item_id: String + + attr_accessor model_type: :event_output + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::conversion_rate_config? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + def initialize: ( + cadence: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::cadence, + currency: String, + event_output_config: Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::EventOutputConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::conversion_rate_config?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?model_type: :event_output + ) -> void + + def to_hash: -> { + cadence: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::cadence, + currency: String, + event_output_config: Orb::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::conversion_rate_config?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::Price::EventOutput::cadence] + end + + type event_output_config = + { unit_rating_key: String, grouping_key: String? } + + class EventOutputConfig < Orb::Internal::Type::BaseModel + attr_accessor unit_rating_key: String + + attr_accessor grouping_key: String? + + def initialize: ( + unit_rating_key: String, + ?grouping_key: String? + ) -> void + + def to_hash: -> { unit_rating_key: String, grouping_key: String? } + end + end + def self?.variants: -> ::Array[Orb::Models::PriceEvaluatePreviewEventsParams::PriceEvaluation::price] end end diff --git a/sig/orb/models/subscription_change_apply_params.rbs b/sig/orb/models/subscription_change_apply_params.rbs index 2391cf0c..10559337 100644 --- a/sig/orb/models/subscription_change_apply_params.rbs +++ b/sig/orb/models/subscription_change_apply_params.rbs @@ -1,7 +1,11 @@ module Orb module Models type subscription_change_apply_params = - { description: String?, previously_collected_amount: String? } + { + description: String?, + mark_as_paid: bool?, + previously_collected_amount: String? + } & Orb::Internal::Type::request_parameters class SubscriptionChangeApplyParams < Orb::Internal::Type::BaseModel @@ -10,16 +14,20 @@ module Orb attr_accessor description: String? + attr_accessor mark_as_paid: bool? + attr_accessor previously_collected_amount: String? def initialize: ( ?description: String?, + ?mark_as_paid: bool?, ?previously_collected_amount: String?, ?request_options: Orb::request_opts ) -> void def to_hash: -> { description: String?, + mark_as_paid: bool?, previously_collected_amount: String?, request_options: Orb::RequestOptions } diff --git a/sig/orb/models/subscription_create_params.rbs b/sig/orb/models/subscription_create_params.rbs index 3e8d737c..1f417841 100644 --- a/sig/orb/models/subscription_create_params.rbs +++ b/sig/orb/models/subscription_create_params.rbs @@ -292,37 +292,623 @@ module Orb type price = Orb::NewSubscriptionUnitPrice - | Orb::NewSubscriptionPackagePrice - | Orb::NewSubscriptionMatrixPrice | Orb::NewSubscriptionTieredPrice - | Orb::NewSubscriptionTieredBPSPrice - | Orb::NewSubscriptionBPSPrice - | Orb::NewSubscriptionBulkBPSPrice | Orb::NewSubscriptionBulkPrice + | Orb::NewSubscriptionPackagePrice + | Orb::NewSubscriptionMatrixPrice | Orb::NewSubscriptionThresholdTotalAmountPrice | Orb::NewSubscriptionTieredPackagePrice | Orb::NewSubscriptionTieredWithMinimumPrice - | Orb::NewSubscriptionUnitWithPercentPrice + | Orb::NewSubscriptionGroupedTieredPrice + | Orb::NewSubscriptionTieredPackageWithMinimumPrice | Orb::NewSubscriptionPackageWithAllocationPrice - | Orb::NewSubscriptionTierWithProrationPrice + | Orb::NewSubscriptionUnitWithPercentPrice + | Orb::NewSubscriptionMatrixWithAllocationPrice + | Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration | Orb::NewSubscriptionUnitWithProrationPrice | Orb::NewSubscriptionGroupedAllocationPrice - | Orb::NewSubscriptionGroupedWithProratedMinimumPrice | Orb::NewSubscriptionBulkWithProrationPrice - | Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice - | Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice - | Orb::NewSubscriptionCumulativeGroupedBulkPrice - | Orb::NewSubscriptionMaxGroupTieredPackagePrice + | Orb::NewSubscriptionGroupedWithProratedMinimumPrice | Orb::NewSubscriptionGroupedWithMeteredMinimumPrice + | Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds | Orb::NewSubscriptionMatrixWithDisplayNamePrice | Orb::NewSubscriptionGroupedTieredPackagePrice - | Orb::NewSubscriptionMatrixWithAllocationPrice - | Orb::NewSubscriptionTieredPackageWithMinimumPrice - | Orb::NewSubscriptionGroupedTieredPrice + | Orb::NewSubscriptionMaxGroupTieredPackagePrice + | Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice + | Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice + | Orb::NewSubscriptionCumulativeGroupedBulkPrice + | Orb::NewSubscriptionMinimumCompositePrice + | Orb::SubscriptionCreateParams::AddPrice::Price::Percent + | Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput module Price extend Orb::Internal::Type::Union + type tiered_with_proration = + { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class TieredWithProration < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_proration + + attr_accessor name: String + + attr_accessor tiered_with_proration_config: Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::cadence, + item_id: String, + name: String, + tiered_with_proration_config: Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :tiered_with_proration + ) -> void + + def to_hash: -> { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::cadence] + end + + type tiered_with_proration_config = + { + tiers: ::Array[Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + } + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + + def initialize: ( + tiers: ::Array[Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { + tier_lower_bound: String, + unit_amount: String + } + end + end + end + + type grouped_with_min_max_thresholds = + { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::cadence + + attr_accessor grouped_with_min_max_thresholds_config: Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_with_min_max_thresholds + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :grouped_with_min_max_thresholds + ) -> void + + def to_hash: -> { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::GroupedWithMinMaxThresholds::cadence] + end + + type grouped_with_min_max_thresholds_config = + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor maximum_charge: String + + attr_accessor minimum_charge: String + + attr_accessor per_unit_rate: String + + def initialize: ( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ) -> void + + def to_hash: -> { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + end + end + + type percent = + { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::Percent::cadence, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::SubscriptionCreateParams::AddPrice::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::Percent::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class Percent < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::Percent::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :percent + + attr_accessor name: String + + attr_accessor percent_config: Orb::SubscriptionCreateParams::AddPrice::Price::Percent::PercentConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::Percent::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::Percent::cadence, + item_id: String, + name: String, + percent_config: Orb::SubscriptionCreateParams::AddPrice::Price::Percent::PercentConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::Percent::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :percent + ) -> void + + def to_hash: -> { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::Percent::cadence, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::SubscriptionCreateParams::AddPrice::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::Percent::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::Percent::cadence] + end + + type percent_config = { percent: Float } + + class PercentConfig < Orb::Internal::Type::BaseModel + attr_accessor percent: Float + + def initialize: (percent: Float) -> void + + def to_hash: -> { percent: Float } + end + end + + type event_output = + { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::EventOutput::cadence, + event_output_config: Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::EventOutput::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class EventOutput < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::EventOutput::cadence + + attr_accessor event_output_config: Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::EventOutputConfig + + attr_accessor item_id: String + + attr_accessor model_type: :event_output + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::EventOutput::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::EventOutput::cadence, + event_output_config: Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::EventOutputConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::EventOutput::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :event_output + ) -> void + + def to_hash: -> { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::EventOutput::cadence, + event_output_config: Orb::SubscriptionCreateParams::AddPrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::EventOutput::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::EventOutput::cadence] + end + + type event_output_config = + { unit_rating_key: String, grouping_key: String? } + + class EventOutputConfig < Orb::Internal::Type::BaseModel + attr_accessor unit_rating_key: String + + attr_accessor grouping_key: String? + + def initialize: ( + unit_rating_key: String, + ?grouping_key: String? + ) -> void + + def to_hash: -> { unit_rating_key: String, grouping_key: String? } + end + end + def self?.variants: -> ::Array[Orb::Models::SubscriptionCreateParams::AddPrice::price] end end @@ -457,37 +1043,623 @@ module Orb type price = Orb::NewSubscriptionUnitPrice - | Orb::NewSubscriptionPackagePrice - | Orb::NewSubscriptionMatrixPrice | Orb::NewSubscriptionTieredPrice - | Orb::NewSubscriptionTieredBPSPrice - | Orb::NewSubscriptionBPSPrice - | Orb::NewSubscriptionBulkBPSPrice | Orb::NewSubscriptionBulkPrice + | Orb::NewSubscriptionPackagePrice + | Orb::NewSubscriptionMatrixPrice | Orb::NewSubscriptionThresholdTotalAmountPrice | Orb::NewSubscriptionTieredPackagePrice | Orb::NewSubscriptionTieredWithMinimumPrice - | Orb::NewSubscriptionUnitWithPercentPrice + | Orb::NewSubscriptionGroupedTieredPrice + | Orb::NewSubscriptionTieredPackageWithMinimumPrice | Orb::NewSubscriptionPackageWithAllocationPrice - | Orb::NewSubscriptionTierWithProrationPrice + | Orb::NewSubscriptionUnitWithPercentPrice + | Orb::NewSubscriptionMatrixWithAllocationPrice + | Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration | Orb::NewSubscriptionUnitWithProrationPrice | Orb::NewSubscriptionGroupedAllocationPrice - | Orb::NewSubscriptionGroupedWithProratedMinimumPrice | Orb::NewSubscriptionBulkWithProrationPrice - | Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice - | Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice - | Orb::NewSubscriptionCumulativeGroupedBulkPrice - | Orb::NewSubscriptionMaxGroupTieredPackagePrice + | Orb::NewSubscriptionGroupedWithProratedMinimumPrice | Orb::NewSubscriptionGroupedWithMeteredMinimumPrice + | Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds | Orb::NewSubscriptionMatrixWithDisplayNamePrice | Orb::NewSubscriptionGroupedTieredPackagePrice - | Orb::NewSubscriptionMatrixWithAllocationPrice - | Orb::NewSubscriptionTieredPackageWithMinimumPrice - | Orb::NewSubscriptionGroupedTieredPrice + | Orb::NewSubscriptionMaxGroupTieredPackagePrice + | Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice + | Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice + | Orb::NewSubscriptionCumulativeGroupedBulkPrice + | Orb::NewSubscriptionMinimumCompositePrice + | Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent + | Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput module Price extend Orb::Internal::Type::Union + type tiered_with_proration = + { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class TieredWithProration < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_proration + + attr_accessor name: String + + attr_accessor tiered_with_proration_config: Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::cadence, + item_id: String, + name: String, + tiered_with_proration_config: Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :tiered_with_proration + ) -> void + + def to_hash: -> { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::cadence] + end + + type tiered_with_proration_config = + { + tiers: ::Array[Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + } + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + + def initialize: ( + tiers: ::Array[Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::SubscriptionCreateParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { + tier_lower_bound: String, + unit_amount: String + } + end + end + end + + type grouped_with_min_max_thresholds = + { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::cadence + + attr_accessor grouped_with_min_max_thresholds_config: Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_with_min_max_thresholds + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :grouped_with_min_max_thresholds + ) -> void + + def to_hash: -> { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::cadence] + end + + type grouped_with_min_max_thresholds_config = + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor maximum_charge: String + + attr_accessor minimum_charge: String + + attr_accessor per_unit_rate: String + + def initialize: ( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ) -> void + + def to_hash: -> { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + end + end + + type percent = + { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Percent::cadence, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Percent::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class Percent < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Percent::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :percent + + attr_accessor name: String + + attr_accessor percent_config: Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::PercentConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Percent::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Percent::cadence, + item_id: String, + name: String, + percent_config: Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::PercentConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Percent::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :percent + ) -> void + + def to_hash: -> { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Percent::cadence, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::SubscriptionCreateParams::ReplacePrice::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Percent::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Percent::cadence] + end + + type percent_config = { percent: Float } + + class PercentConfig < Orb::Internal::Type::BaseModel + attr_accessor percent: Float + + def initialize: (percent: Float) -> void + + def to_hash: -> { percent: Float } + end + end + + type event_output = + { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::cadence, + event_output_config: Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class EventOutput < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::cadence + + attr_accessor event_output_config: Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::EventOutputConfig + + attr_accessor item_id: String + + attr_accessor model_type: :event_output + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::cadence, + event_output_config: Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::EventOutputConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :event_output + ) -> void + + def to_hash: -> { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::cadence, + event_output_config: Orb::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::EventOutput::cadence] + end + + type event_output_config = + { unit_rating_key: String, grouping_key: String? } + + class EventOutputConfig < Orb::Internal::Type::BaseModel + attr_accessor unit_rating_key: String + + attr_accessor grouping_key: String? + + def initialize: ( + unit_rating_key: String, + ?grouping_key: String? + ) -> void + + def to_hash: -> { unit_rating_key: String, grouping_key: String? } + end + end + def self?.variants: -> ::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::price] end end diff --git a/sig/orb/models/subscription_list_params.rbs b/sig/orb/models/subscription_list_params.rbs index 1f189e63..95f015c4 100644 --- a/sig/orb/models/subscription_list_params.rbs +++ b/sig/orb/models/subscription_list_params.rbs @@ -9,7 +9,9 @@ module Orb cursor: String?, customer_id: ::Array[String]?, external_customer_id: ::Array[String]?, + external_plan_id: String?, limit: Integer, + plan_id: String?, status: Orb::Models::SubscriptionListParams::status? } & Orb::Internal::Type::request_parameters @@ -32,10 +34,14 @@ module Orb attr_accessor external_customer_id: ::Array[String]? + attr_accessor external_plan_id: String? + attr_reader limit: Integer? def limit=: (Integer) -> Integer + attr_accessor plan_id: String? + attr_accessor status: Orb::Models::SubscriptionListParams::status? def initialize: ( @@ -46,7 +52,9 @@ module Orb ?cursor: String?, ?customer_id: ::Array[String]?, ?external_customer_id: ::Array[String]?, + ?external_plan_id: String?, ?limit: Integer, + ?plan_id: String?, ?status: Orb::Models::SubscriptionListParams::status?, ?request_options: Orb::request_opts ) -> void @@ -59,7 +67,9 @@ module Orb cursor: String?, customer_id: ::Array[String]?, external_customer_id: ::Array[String]?, + external_plan_id: String?, limit: Integer, + plan_id: String?, status: Orb::Models::SubscriptionListParams::status?, request_options: Orb::RequestOptions } diff --git a/sig/orb/models/subscription_price_intervals_params.rbs b/sig/orb/models/subscription_price_intervals_params.rbs index 5bdb95ec..fe061f89 100644 --- a/sig/orb/models/subscription_price_intervals_params.rbs +++ b/sig/orb/models/subscription_price_intervals_params.rbs @@ -220,67 +220,493 @@ module Orb type price = Orb::NewFloatingUnitPrice - | Orb::NewFloatingPackagePrice - | Orb::NewFloatingMatrixPrice - | Orb::NewFloatingMatrixWithAllocationPrice | Orb::NewFloatingTieredPrice - | Orb::NewFloatingTieredBPSPrice - | Orb::NewFloatingBPSPrice - | Orb::NewFloatingBulkBPSPrice | Orb::NewFloatingBulkPrice + | Orb::NewFloatingPackagePrice + | Orb::NewFloatingMatrixPrice | Orb::NewFloatingThresholdTotalAmountPrice | Orb::NewFloatingTieredPackagePrice - | Orb::NewFloatingGroupedTieredPrice - | Orb::NewFloatingMaxGroupTieredPackagePrice | Orb::NewFloatingTieredWithMinimumPrice - | Orb::NewFloatingPackageWithAllocationPrice + | Orb::NewFloatingGroupedTieredPrice | Orb::NewFloatingTieredPackageWithMinimumPrice + | Orb::NewFloatingPackageWithAllocationPrice | Orb::NewFloatingUnitWithPercentPrice + | Orb::NewFloatingMatrixWithAllocationPrice | Orb::NewFloatingTieredWithProrationPrice | Orb::NewFloatingUnitWithProrationPrice | Orb::NewFloatingGroupedAllocationPrice + | Orb::NewFloatingBulkWithProrationPrice | Orb::NewFloatingGroupedWithProratedMinimumPrice | Orb::NewFloatingGroupedWithMeteredMinimumPrice + | Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds | Orb::NewFloatingMatrixWithDisplayNamePrice - | Orb::NewFloatingBulkWithProrationPrice | Orb::NewFloatingGroupedTieredPackagePrice + | Orb::NewFloatingMaxGroupTieredPackagePrice | Orb::NewFloatingScalableMatrixWithUnitPricingPrice | Orb::NewFloatingScalableMatrixWithTieredPricingPrice | Orb::NewFloatingCumulativeGroupedBulkPrice + | Orb::NewFloatingMinimumCompositePrice + | Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent + | Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput module Price extend Orb::Internal::Type::Union + type grouped_with_min_max_thresholds = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::cadence, + currency: String, + grouped_with_min_max_thresholds_config: Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]? + } + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::cadence + + attr_accessor currency: String + + attr_accessor grouped_with_min_max_thresholds_config: Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_with_min_max_thresholds + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::conversion_rate_config? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + def initialize: ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::cadence, + currency: String, + grouped_with_min_max_thresholds_config: Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?model_type: :grouped_with_min_max_thresholds + ) -> void + + def to_hash: -> { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::cadence, + currency: String, + grouped_with_min_max_thresholds_config: Orb::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::GroupedWithMinMaxThresholds::cadence] + end + + type grouped_with_min_max_thresholds_config = + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor maximum_charge: String + + attr_accessor minimum_charge: String + + attr_accessor per_unit_rate: String + + def initialize: ( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ) -> void + + def to_hash: -> { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + end + end + + type percent = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Percent::cadence, + currency: String, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Percent::conversion_rate_config?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]? + } + + class Percent < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Percent::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :percent + + attr_accessor name: String + + attr_accessor percent_config: Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Percent::conversion_rate_config? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + def initialize: ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Percent::cadence, + currency: String, + item_id: String, + name: String, + percent_config: Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Percent::conversion_rate_config?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?model_type: :percent + ) -> void + + def to_hash: -> { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Percent::cadence, + currency: String, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Percent::conversion_rate_config?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Percent::cadence] + end + + type percent_config = { percent: Float } + + class PercentConfig < Orb::Internal::Type::BaseModel + attr_accessor percent: Float + + def initialize: (percent: Float) -> void + + def to_hash: -> { percent: Float } + end + end + + type event_output = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::cadence, + currency: String, + event_output_config: Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::conversion_rate_config?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]? + } + + class EventOutput < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::cadence + + attr_accessor currency: String + + attr_accessor event_output_config: Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig + + attr_accessor item_id: String + + attr_accessor model_type: :event_output + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::conversion_rate_config? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + def initialize: ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::cadence, + currency: String, + event_output_config: Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::conversion_rate_config?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?model_type: :event_output + ) -> void + + def to_hash: -> { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::cadence, + currency: String, + event_output_config: Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::conversion_rate_config?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::cadence] + end + + type event_output_config = + { unit_rating_key: String, grouping_key: String? } + + class EventOutputConfig < Orb::Internal::Type::BaseModel + attr_accessor unit_rating_key: String + + attr_accessor grouping_key: String? + + def initialize: ( + unit_rating_key: String, + ?grouping_key: String? + ) -> void + + def to_hash: -> { unit_rating_key: String, grouping_key: String? } + end + end + def self?.variants: -> ::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::price] end end type add_adjustment = { - adjustment: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::adjustment, start_date: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::start_date, + adjustment: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::adjustment?, + adjustment_id: String?, end_date: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::end_date? } class AddAdjustment < Orb::Internal::Type::BaseModel - attr_accessor adjustment: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::adjustment - attr_accessor start_date: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::start_date + attr_accessor adjustment: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::adjustment? + + attr_accessor adjustment_id: String? + attr_accessor end_date: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::end_date? def initialize: ( - adjustment: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::adjustment, start_date: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::start_date, + ?adjustment: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::adjustment?, + ?adjustment_id: String?, ?end_date: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::end_date? ) -> void def to_hash: -> { - adjustment: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::adjustment, start_date: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::start_date, + adjustment: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::adjustment?, + adjustment_id: String?, end_date: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::end_date? } + type start_date = Time | Orb::Models::billing_cycle_relative_date + + module StartDate + extend Orb::Internal::Type::Union + + def self?.variants: -> ::Array[Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::start_date] + end + type adjustment = Orb::NewPercentageDiscount | Orb::NewUsageDiscount @@ -294,14 +720,6 @@ module Orb def self?.variants: -> ::Array[Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::adjustment] end - type start_date = Time | Orb::Models::billing_cycle_relative_date - - module StartDate - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::start_date] - end - type end_date = Time | Orb::Models::billing_cycle_relative_date module EndDate diff --git a/sig/orb/models/subscription_schedule_plan_change_params.rbs b/sig/orb/models/subscription_schedule_plan_change_params.rbs index fc40d254..b34ff03e 100644 --- a/sig/orb/models/subscription_schedule_plan_change_params.rbs +++ b/sig/orb/models/subscription_schedule_plan_change_params.rbs @@ -268,37 +268,623 @@ module Orb type price = Orb::NewSubscriptionUnitPrice - | Orb::NewSubscriptionPackagePrice - | Orb::NewSubscriptionMatrixPrice | Orb::NewSubscriptionTieredPrice - | Orb::NewSubscriptionTieredBPSPrice - | Orb::NewSubscriptionBPSPrice - | Orb::NewSubscriptionBulkBPSPrice | Orb::NewSubscriptionBulkPrice + | Orb::NewSubscriptionPackagePrice + | Orb::NewSubscriptionMatrixPrice | Orb::NewSubscriptionThresholdTotalAmountPrice | Orb::NewSubscriptionTieredPackagePrice | Orb::NewSubscriptionTieredWithMinimumPrice - | Orb::NewSubscriptionUnitWithPercentPrice + | Orb::NewSubscriptionGroupedTieredPrice + | Orb::NewSubscriptionTieredPackageWithMinimumPrice | Orb::NewSubscriptionPackageWithAllocationPrice - | Orb::NewSubscriptionTierWithProrationPrice + | Orb::NewSubscriptionUnitWithPercentPrice + | Orb::NewSubscriptionMatrixWithAllocationPrice + | Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration | Orb::NewSubscriptionUnitWithProrationPrice | Orb::NewSubscriptionGroupedAllocationPrice - | Orb::NewSubscriptionGroupedWithProratedMinimumPrice | Orb::NewSubscriptionBulkWithProrationPrice - | Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice - | Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice - | Orb::NewSubscriptionCumulativeGroupedBulkPrice - | Orb::NewSubscriptionMaxGroupTieredPackagePrice + | Orb::NewSubscriptionGroupedWithProratedMinimumPrice | Orb::NewSubscriptionGroupedWithMeteredMinimumPrice + | Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds | Orb::NewSubscriptionMatrixWithDisplayNamePrice | Orb::NewSubscriptionGroupedTieredPackagePrice - | Orb::NewSubscriptionMatrixWithAllocationPrice - | Orb::NewSubscriptionTieredPackageWithMinimumPrice - | Orb::NewSubscriptionGroupedTieredPrice + | Orb::NewSubscriptionMaxGroupTieredPackagePrice + | Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice + | Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice + | Orb::NewSubscriptionCumulativeGroupedBulkPrice + | Orb::NewSubscriptionMinimumCompositePrice + | Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent + | Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput module Price extend Orb::Internal::Type::Union + type tiered_with_proration = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class TieredWithProration < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_proration + + attr_accessor name: String + + attr_accessor tiered_with_proration_config: Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::cadence, + item_id: String, + name: String, + tiered_with_proration_config: Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :tiered_with_proration + ) -> void + + def to_hash: -> { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::cadence] + end + + type tiered_with_proration_config = + { + tiers: ::Array[Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + } + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + + def initialize: ( + tiers: ::Array[Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { + tier_lower_bound: String, + unit_amount: String + } + end + end + end + + type grouped_with_min_max_thresholds = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::cadence + + attr_accessor grouped_with_min_max_thresholds_config: Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_with_min_max_thresholds + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :grouped_with_min_max_thresholds + ) -> void + + def to_hash: -> { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::GroupedWithMinMaxThresholds::cadence] + end + + type grouped_with_min_max_thresholds_config = + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor maximum_charge: String + + attr_accessor minimum_charge: String + + attr_accessor per_unit_rate: String + + def initialize: ( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ) -> void + + def to_hash: -> { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + end + end + + type percent = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::cadence, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class Percent < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :percent + + attr_accessor name: String + + attr_accessor percent_config: Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::PercentConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::cadence, + item_id: String, + name: String, + percent_config: Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::PercentConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :percent + ) -> void + + def to_hash: -> { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::cadence, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Percent::cadence] + end + + type percent_config = { percent: Float } + + class PercentConfig < Orb::Internal::Type::BaseModel + attr_accessor percent: Float + + def initialize: (percent: Float) -> void + + def to_hash: -> { percent: Float } + end + end + + type event_output = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::cadence, + event_output_config: Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class EventOutput < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::cadence + + attr_accessor event_output_config: Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::EventOutputConfig + + attr_accessor item_id: String + + attr_accessor model_type: :event_output + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::cadence, + event_output_config: Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::EventOutputConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :event_output + ) -> void + + def to_hash: -> { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::cadence, + event_output_config: Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::EventOutput::cadence] + end + + type event_output_config = + { unit_rating_key: String, grouping_key: String? } + + class EventOutputConfig < Orb::Internal::Type::BaseModel + attr_accessor unit_rating_key: String + + attr_accessor grouping_key: String? + + def initialize: ( + unit_rating_key: String, + ?grouping_key: String? + ) -> void + + def to_hash: -> { unit_rating_key: String, grouping_key: String? } + end + end + def self?.variants: -> ::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::price] end end @@ -434,37 +1020,623 @@ module Orb type price = Orb::NewSubscriptionUnitPrice - | Orb::NewSubscriptionPackagePrice - | Orb::NewSubscriptionMatrixPrice | Orb::NewSubscriptionTieredPrice - | Orb::NewSubscriptionTieredBPSPrice - | Orb::NewSubscriptionBPSPrice - | Orb::NewSubscriptionBulkBPSPrice | Orb::NewSubscriptionBulkPrice + | Orb::NewSubscriptionPackagePrice + | Orb::NewSubscriptionMatrixPrice | Orb::NewSubscriptionThresholdTotalAmountPrice | Orb::NewSubscriptionTieredPackagePrice | Orb::NewSubscriptionTieredWithMinimumPrice - | Orb::NewSubscriptionUnitWithPercentPrice + | Orb::NewSubscriptionGroupedTieredPrice + | Orb::NewSubscriptionTieredPackageWithMinimumPrice | Orb::NewSubscriptionPackageWithAllocationPrice - | Orb::NewSubscriptionTierWithProrationPrice + | Orb::NewSubscriptionUnitWithPercentPrice + | Orb::NewSubscriptionMatrixWithAllocationPrice + | Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration | Orb::NewSubscriptionUnitWithProrationPrice | Orb::NewSubscriptionGroupedAllocationPrice - | Orb::NewSubscriptionGroupedWithProratedMinimumPrice | Orb::NewSubscriptionBulkWithProrationPrice - | Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice - | Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice - | Orb::NewSubscriptionCumulativeGroupedBulkPrice - | Orb::NewSubscriptionMaxGroupTieredPackagePrice + | Orb::NewSubscriptionGroupedWithProratedMinimumPrice | Orb::NewSubscriptionGroupedWithMeteredMinimumPrice + | Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds | Orb::NewSubscriptionMatrixWithDisplayNamePrice | Orb::NewSubscriptionGroupedTieredPackagePrice - | Orb::NewSubscriptionMatrixWithAllocationPrice - | Orb::NewSubscriptionTieredPackageWithMinimumPrice - | Orb::NewSubscriptionGroupedTieredPrice + | Orb::NewSubscriptionMaxGroupTieredPackagePrice + | Orb::NewSubscriptionScalableMatrixWithUnitPricingPrice + | Orb::NewSubscriptionScalableMatrixWithTieredPricingPrice + | Orb::NewSubscriptionCumulativeGroupedBulkPrice + | Orb::NewSubscriptionMinimumCompositePrice + | Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent + | Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput module Price extend Orb::Internal::Type::Union + type tiered_with_proration = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class TieredWithProration < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_proration + + attr_accessor name: String + + attr_accessor tiered_with_proration_config: Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::cadence, + item_id: String, + name: String, + tiered_with_proration_config: Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :tiered_with_proration + ) -> void + + def to_hash: -> { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::cadence] + end + + type tiered_with_proration_config = + { + tiers: ::Array[Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + } + + class TieredWithProrationConfig < Orb::Internal::Type::BaseModel + attr_accessor tiers: ::Array[Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + + def initialize: ( + tiers: ::Array[Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + ) -> void + + def to_hash: -> { + tiers: ::Array[Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::TieredWithProration::TieredWithProrationConfig::Tier] + } + + type tier = { tier_lower_bound: String, unit_amount: String } + + class Tier < Orb::Internal::Type::BaseModel + attr_accessor tier_lower_bound: String + + attr_accessor unit_amount: String + + def initialize: ( + tier_lower_bound: String, + unit_amount: String + ) -> void + + def to_hash: -> { + tier_lower_bound: String, + unit_amount: String + } + end + end + end + + type grouped_with_min_max_thresholds = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::cadence + + attr_accessor grouped_with_min_max_thresholds_config: Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_with_min_max_thresholds + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :grouped_with_min_max_thresholds + ) -> void + + def to_hash: -> { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::cadence, + grouped_with_min_max_thresholds_config: Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, + item_id: String, + model_type: :grouped_with_min_max_thresholds, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::GroupedWithMinMaxThresholds::cadence] + end + + type grouped_with_min_max_thresholds_config = + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String + + attr_accessor maximum_charge: String + + attr_accessor minimum_charge: String + + attr_accessor per_unit_rate: String + + def initialize: ( + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + ) -> void + + def to_hash: -> { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } + end + end + + type percent = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::cadence, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class Percent < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :percent + + attr_accessor name: String + + attr_accessor percent_config: Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::PercentConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::cadence, + item_id: String, + name: String, + percent_config: Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::PercentConfig, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :percent + ) -> void + + def to_hash: -> { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::cadence, + item_id: String, + model_type: :percent, + name: String, + percent_config: Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::PercentConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Percent::cadence] + end + + type percent_config = { percent: Float } + + class PercentConfig < Orb::Internal::Type::BaseModel + attr_accessor percent: Float + + def initialize: (percent: Float) -> void + + def to_hash: -> { percent: Float } + end + end + + type event_output = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::cadence, + event_output_config: Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + class EventOutput < Orb::Internal::Type::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::cadence + + attr_accessor event_output_config: Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::EventOutputConfig + + attr_accessor item_id: String + + attr_accessor model_type: :event_output + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::conversion_rate_config? + + attr_accessor currency: String? + + attr_accessor dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration? + + attr_accessor metadata: ::Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::cadence, + event_output_config: Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::EventOutputConfig, + item_id: String, + name: String, + ?billable_metric_id: String?, + ?billed_in_advance: bool?, + ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?conversion_rate: Float?, + ?conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::conversion_rate_config?, + ?currency: String?, + ?dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + ?external_price_id: String?, + ?fixed_price_quantity: Float?, + ?invoice_grouping_key: String?, + ?invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + ?metadata: ::Hash[Symbol, String?]?, + ?reference_id: String?, + ?model_type: :event_output + ) -> void + + def to_hash: -> { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::cadence, + event_output_config: Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::EventOutputConfig, + item_id: String, + model_type: :event_output, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + conversion_rate: Float?, + conversion_rate_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::conversion_rate_config?, + currency: String?, + dimensional_price_configuration: Orb::NewDimensionalPriceConfiguration?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::NewBillingCycleConfiguration?, + metadata: ::Hash[Symbol, String?]?, + reference_id: String? + } + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + module Cadence + extend Orb::Internal::Type::Enum + + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self?.values: -> ::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::EventOutput::cadence] + end + + type event_output_config = + { unit_rating_key: String, grouping_key: String? } + + class EventOutputConfig < Orb::Internal::Type::BaseModel + attr_accessor unit_rating_key: String + + attr_accessor grouping_key: String? + + def initialize: ( + unit_rating_key: String, + ?grouping_key: String? + ) -> void + + def to_hash: -> { unit_rating_key: String, grouping_key: String? } + end + end + def self?.variants: -> ::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::price] end end diff --git a/sig/orb/models/tier_config.rbs b/sig/orb/models/tier_config.rbs deleted file mode 100644 index 3e66a83b..00000000 --- a/sig/orb/models/tier_config.rbs +++ /dev/null @@ -1,26 +0,0 @@ -module Orb - module Models - type tier_config = - { first_unit: Float, last_unit: Float?, unit_amount: String } - - class TierConfig < Orb::Internal::Type::BaseModel - attr_accessor first_unit: Float - - attr_accessor last_unit: Float? - - attr_accessor unit_amount: String - - def initialize: ( - first_unit: Float, - last_unit: Float?, - unit_amount: String - ) -> void - - def to_hash: -> { - first_unit: Float, - last_unit: Float?, - unit_amount: String - } - end - end -end diff --git a/sig/orb/models/tier_sub_line_item.rbs b/sig/orb/models/tier_sub_line_item.rbs index ae520a6a..05efcf57 100644 --- a/sig/orb/models/tier_sub_line_item.rbs +++ b/sig/orb/models/tier_sub_line_item.rbs @@ -6,7 +6,7 @@ module Orb grouping: Orb::SubLineItemGrouping?, name: String, quantity: Float, - tier_config: Orb::TierConfig, + tier_config: Orb::TierSubLineItem::TierConfig, type: Orb::Models::TierSubLineItem::type_ } @@ -19,7 +19,7 @@ module Orb attr_accessor quantity: Float - attr_accessor tier_config: Orb::TierConfig + attr_accessor tier_config: Orb::TierSubLineItem::TierConfig attr_accessor type: Orb::Models::TierSubLineItem::type_ @@ -28,7 +28,7 @@ module Orb grouping: Orb::SubLineItemGrouping?, name: String, quantity: Float, - tier_config: Orb::TierConfig, + tier_config: Orb::TierSubLineItem::TierConfig, type: Orb::Models::TierSubLineItem::type_ ) -> void @@ -37,10 +37,33 @@ module Orb grouping: Orb::SubLineItemGrouping?, name: String, quantity: Float, - tier_config: Orb::TierConfig, + tier_config: Orb::TierSubLineItem::TierConfig, type: Orb::Models::TierSubLineItem::type_ } + type tier_config = + { first_unit: Float, last_unit: Float?, unit_amount: String } + + class TierConfig < Orb::Internal::Type::BaseModel + attr_accessor first_unit: Float + + attr_accessor last_unit: Float? + + attr_accessor unit_amount: String + + def initialize: ( + first_unit: Float, + last_unit: Float?, + unit_amount: String + ) -> void + + def to_hash: -> { + first_unit: Float, + last_unit: Float?, + unit_amount: String + } + end + type type_ = :tier module Type diff --git a/sig/orb/models/tiered_bps_config.rbs b/sig/orb/models/tiered_bps_config.rbs deleted file mode 100644 index 96559629..00000000 --- a/sig/orb/models/tiered_bps_config.rbs +++ /dev/null @@ -1,13 +0,0 @@ -module Orb - module Models - type tiered_bps_config = { tiers: ::Array[Orb::BPSTier] } - - class TieredBPSConfig < Orb::Internal::Type::BaseModel - attr_accessor tiers: ::Array[Orb::BPSTier] - - def initialize: (tiers: ::Array[Orb::BPSTier]) -> void - - def to_hash: -> { tiers: ::Array[Orb::BPSTier] } - end - end -end diff --git a/sig/orb/resources/customers.rbs b/sig/orb/resources/customers.rbs index 8a84dba4..cc3ace59 100644 --- a/sig/orb/resources/customers.rbs +++ b/sig/orb/resources/customers.rbs @@ -13,6 +13,7 @@ module Orb ?accounting_sync_configuration: Orb::NewAccountingSyncConfiguration?, ?additional_emails: ::Array[String]?, ?auto_collection: bool?, + ?auto_issuance: bool?, ?billing_address: Orb::AddressInput?, ?currency: String?, ?email_delivery: bool?, @@ -34,6 +35,7 @@ module Orb ?accounting_sync_configuration: Orb::NewAccountingSyncConfiguration?, ?additional_emails: ::Array[String]?, ?auto_collection: bool?, + ?auto_issuance: bool?, ?billing_address: Orb::AddressInput?, ?currency: String?, ?email: String?, @@ -91,6 +93,7 @@ module Orb ?accounting_sync_configuration: Orb::NewAccountingSyncConfiguration?, ?additional_emails: ::Array[String]?, ?auto_collection: bool?, + ?auto_issuance: bool?, ?billing_address: Orb::AddressInput?, ?currency: String?, ?email: String?, diff --git a/sig/orb/resources/invoice_line_items.rbs b/sig/orb/resources/invoice_line_items.rbs index bc8f0afb..7beb3cf2 100644 --- a/sig/orb/resources/invoice_line_items.rbs +++ b/sig/orb/resources/invoice_line_items.rbs @@ -5,9 +5,10 @@ module Orb amount: String, end_date: Date, invoice_id: String, - name: String, quantity: Float, start_date: Date, + ?item_id: String?, + ?name: String?, ?request_options: Orb::request_opts ) -> Orb::Models::InvoiceLineItemCreateResponse diff --git a/sig/orb/resources/invoices.rbs b/sig/orb/resources/invoices.rbs index 7b532f15..2a4188f1 100644 --- a/sig/orb/resources/invoices.rbs +++ b/sig/orb/resources/invoices.rbs @@ -7,6 +7,7 @@ module Orb line_items: ::Array[Orb::InvoiceCreateParams::LineItem], ?customer_id: String?, ?discount: Orb::Models::discount?, + ?due_date: Orb::Models::InvoiceCreateParams::due_date?, ?external_customer_id: String?, ?memo: String?, ?metadata: ::Hash[Symbol, String?]?, @@ -17,7 +18,9 @@ module Orb def update: ( String invoice_id, + ?due_date: Orb::Models::InvoiceUpdateParams::due_date?, ?metadata: ::Hash[Symbol, String?]?, + ?net_terms: Integer?, ?request_options: Orb::request_opts ) -> Orb::Invoice diff --git a/sig/orb/resources/prices.rbs b/sig/orb/resources/prices.rbs index 8d17fe4b..9639af8c 100644 --- a/sig/orb/resources/prices.rbs +++ b/sig/orb/resources/prices.rbs @@ -10,33 +10,34 @@ module Orb model_type: Orb::Models::PriceCreateParams::model_type, name: String, unit_config: Orb::UnitConfig, + tiered_config: Orb::TieredConfig, + bulk_config: Orb::BulkConfig, package_config: Orb::PackageConfig, matrix_config: Orb::MatrixConfig, + threshold_total_amount_config: Orb::PriceCreateParams::ThresholdTotalAmountConfig, + tiered_package_config: Orb::PriceCreateParams::TieredPackageConfig, + tiered_with_minimum_config: Orb::PriceCreateParams::TieredWithMinimumConfig, + grouped_tiered_config: Orb::PriceCreateParams::GroupedTieredConfig, + tiered_package_with_minimum_config: Orb::PriceCreateParams::TieredPackageWithMinimumConfig, + package_with_allocation_config: Orb::PriceCreateParams::PackageWithAllocationConfig, + unit_with_percent_config: Orb::PriceCreateParams::UnitWithPercentConfig, matrix_with_allocation_config: Orb::MatrixWithAllocationConfig, - tiered_config: Orb::TieredConfig, - tiered_bps_config: Orb::TieredBPSConfig, - bps_config: Orb::BPSConfig, - bulk_bps_config: Orb::BulkBPSConfig, - bulk_config: Orb::BulkConfig, - threshold_total_amount_config: ::Hash[Symbol, top], - tiered_package_config: ::Hash[Symbol, top], - grouped_tiered_config: ::Hash[Symbol, top], - max_group_tiered_package_config: ::Hash[Symbol, top], - tiered_with_minimum_config: ::Hash[Symbol, top], - package_with_allocation_config: ::Hash[Symbol, top], - tiered_package_with_minimum_config: ::Hash[Symbol, top], - unit_with_percent_config: ::Hash[Symbol, top], - tiered_with_proration_config: ::Hash[Symbol, top], - unit_with_proration_config: ::Hash[Symbol, top], - grouped_allocation_config: ::Hash[Symbol, top], - grouped_with_prorated_minimum_config: ::Hash[Symbol, top], - grouped_with_metered_minimum_config: ::Hash[Symbol, top], - matrix_with_display_name_config: ::Hash[Symbol, top], - bulk_with_proration_config: ::Hash[Symbol, top], - grouped_tiered_package_config: ::Hash[Symbol, top], - scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top], - scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top], - cumulative_grouped_bulk_config: ::Hash[Symbol, top], + tiered_with_proration_config: Orb::PriceCreateParams::TieredWithProrationConfig, + unit_with_proration_config: Orb::PriceCreateParams::UnitWithProrationConfig, + grouped_allocation_config: Orb::PriceCreateParams::GroupedAllocationConfig, + bulk_with_proration_config: Orb::PriceCreateParams::BulkWithProrationConfig, + grouped_with_prorated_minimum_config: Orb::PriceCreateParams::GroupedWithProratedMinimumConfig, + grouped_with_metered_minimum_config: Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig, + grouped_with_min_max_thresholds_config: Orb::PriceCreateParams::GroupedWithMinMaxThresholdsConfig, + matrix_with_display_name_config: Orb::PriceCreateParams::MatrixWithDisplayNameConfig, + grouped_tiered_package_config: Orb::PriceCreateParams::GroupedTieredPackageConfig, + max_group_tiered_package_config: Orb::PriceCreateParams::MaxGroupTieredPackageConfig, + scalable_matrix_with_unit_pricing_config: Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig, + scalable_matrix_with_tiered_pricing_config: Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig, + cumulative_grouped_bulk_config: Orb::PriceCreateParams::CumulativeGroupedBulkConfig, + minimum_config: Orb::PriceCreateParams::MinimumConfig, + percent_config: Orb::PriceCreateParams::PercentConfig, + event_output_config: Orb::PriceCreateParams::EventOutputConfig, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, diff --git a/sig/orb/resources/subscription_changes.rbs b/sig/orb/resources/subscription_changes.rbs index 7c13d48a..d9845576 100644 --- a/sig/orb/resources/subscription_changes.rbs +++ b/sig/orb/resources/subscription_changes.rbs @@ -9,6 +9,7 @@ module Orb def apply: ( String subscription_change_id, ?description: String?, + ?mark_as_paid: bool?, ?previously_collected_amount: String?, ?request_options: Orb::request_opts ) -> Orb::Models::SubscriptionChangeApplyResponse diff --git a/sig/orb/resources/subscriptions.rbs b/sig/orb/resources/subscriptions.rbs index 36d98d2d..50777bcc 100644 --- a/sig/orb/resources/subscriptions.rbs +++ b/sig/orb/resources/subscriptions.rbs @@ -56,7 +56,9 @@ module Orb ?cursor: String?, ?customer_id: ::Array[String]?, ?external_customer_id: ::Array[String]?, + ?external_plan_id: String?, ?limit: Integer, + ?plan_id: String?, ?status: Orb::Models::SubscriptionListParams::status?, ?request_options: Orb::request_opts ) -> Orb::Internal::Page[Orb::Subscription] diff --git a/test/orb/internal/util_test.rb b/test/orb/internal/util_test.rb index 0db46f6f..55f52599 100644 --- a/test/orb/internal/util_test.rb +++ b/test/orb/internal/util_test.rb @@ -213,22 +213,38 @@ def env_table end end + def test_encoding_length + headers, = Orb::Internal::Util.encode_content( + {"content-type" => "multipart/form-data"}, + Pathname(__FILE__) + ) + assert_pattern do + headers.fetch("content-type") => /boundary=(.+)$/ + end + field, = Regexp.last_match.captures + assert(field.length < 70 - 6) + end + def test_file_encode file = Pathname(__FILE__) + fileinput = Orb::Internal::Type::Converter.dump(Orb::Internal::Type::FileInput, "abc") headers = {"content-type" => "multipart/form-data"} cases = { - "abc" => "abc", - StringIO.new("abc") => "abc", - Orb::FilePart.new("abc") => "abc", - Orb::FilePart.new(StringIO.new("abc")) => "abc", - file => /^class Orb/, - Orb::FilePart.new(file) => /^class Orb/ + "abc" => ["", "abc"], + StringIO.new("abc") => ["", "abc"], + fileinput => %w[upload abc], + Orb::FilePart.new(StringIO.new("abc")) => ["", "abc"], + file => [file.basename.to_path, /^class Orb/], + Orb::FilePart.new(file, filename: "d o g") => ["d%20o%20g", /^class Orb/] } - cases.each do |body, val| + cases.each do |body, testcase| + filename, val = testcase encoded = Orb::Internal::Util.encode_content(headers, body) cgi = FakeCGI.new(*encoded) + io = cgi[""] assert_pattern do - cgi[""].read => ^val + io.original_filename => ^filename + io.read => ^val end end end @@ -249,7 +265,14 @@ def test_hash_encode cgi = FakeCGI.new(*encoded) testcase.each do |key, val| assert_pattern do - cgi[key] => ^val + parsed = + case (p = cgi[key]) + in StringIO + p.read + else + p + end + parsed => ^val end end end @@ -287,6 +310,31 @@ def test_copy_write end class Orb::Test::UtilFusedEnumTest < Minitest::Test + def test_rewind_closing + touched = false + once = 0 + steps = 0 + enum = Enumerator.new do |y| + next if touched + + 10.times do + steps = _1 + y << _1 + end + ensure + once = once.succ + end + + fused = Orb::Internal::Util.fused_enum(enum, external: true) do + touched = true + loop { enum.next } + end + Orb::Internal::Util.close_fused!(fused) + + assert_equal(1, once) + assert_equal(0, steps) + end + def test_closing arr = [1, 2, 3] once = 0 diff --git a/test/orb/resources/customers_test.rb b/test/orb/resources/customers_test.rb index 942419a6..4006e6a2 100644 --- a/test/orb/resources/customers_test.rb +++ b/test/orb/resources/customers_test.rb @@ -15,6 +15,7 @@ def test_create_required_params id: String, additional_emails: ^(Orb::Internal::Type::ArrayOf[String]), auto_collection: Orb::Internal::Type::Boolean, + auto_issuance: Orb::Internal::Type::Boolean | nil, balance: String, billing_address: Orb::Address | nil, created_at: Time, @@ -50,6 +51,7 @@ def test_update id: String, additional_emails: ^(Orb::Internal::Type::ArrayOf[String]), auto_collection: Orb::Internal::Type::Boolean, + auto_issuance: Orb::Internal::Type::Boolean | nil, balance: String, billing_address: Orb::Address | nil, created_at: Time, @@ -92,6 +94,7 @@ def test_list id: String, additional_emails: ^(Orb::Internal::Type::ArrayOf[String]), auto_collection: Orb::Internal::Type::Boolean, + auto_issuance: Orb::Internal::Type::Boolean | nil, balance: String, billing_address: Orb::Address | nil, created_at: Time, @@ -135,6 +138,7 @@ def test_fetch id: String, additional_emails: ^(Orb::Internal::Type::ArrayOf[String]), auto_collection: Orb::Internal::Type::Boolean, + auto_issuance: Orb::Internal::Type::Boolean | nil, balance: String, billing_address: Orb::Address | nil, created_at: Time, @@ -170,6 +174,7 @@ def test_fetch_by_external_id id: String, additional_emails: ^(Orb::Internal::Type::ArrayOf[String]), auto_collection: Orb::Internal::Type::Boolean, + auto_issuance: Orb::Internal::Type::Boolean | nil, balance: String, billing_address: Orb::Address | nil, created_at: Time, @@ -222,6 +227,7 @@ def test_update_by_external_id id: String, additional_emails: ^(Orb::Internal::Type::ArrayOf[String]), auto_collection: Orb::Internal::Type::Boolean, + auto_issuance: Orb::Internal::Type::Boolean | nil, balance: String, billing_address: Orb::Address | nil, created_at: Time, diff --git a/test/orb/resources/invoice_line_items_test.rb b/test/orb/resources/invoice_line_items_test.rb index fd20ca77..4e3a561e 100644 --- a/test/orb/resources/invoice_line_items_test.rb +++ b/test/orb/resources/invoice_line_items_test.rb @@ -9,7 +9,6 @@ def test_create_required_params amount: "12.00", end_date: "2023-09-22", invoice_id: "4khy3nwzktxv7", - name: "Item Name", quantity: 1, start_date: "2023-09-22" ) diff --git a/test/orb/resources/items_test.rb b/test/orb/resources/items_test.rb index d09f19a0..89222d4b 100644 --- a/test/orb/resources/items_test.rb +++ b/test/orb/resources/items_test.rb @@ -16,7 +16,8 @@ def test_create_required_params created_at: Time, external_connections: ^(Orb::Internal::Type::ArrayOf[Orb::Item::ExternalConnection]), metadata: ^(Orb::Internal::Type::HashOf[String]), - name: String + name: String, + archived_at: Time | nil } end end @@ -34,7 +35,8 @@ def test_update created_at: Time, external_connections: ^(Orb::Internal::Type::ArrayOf[Orb::Item::ExternalConnection]), metadata: ^(Orb::Internal::Type::HashOf[String]), - name: String + name: String, + archived_at: Time | nil } end end @@ -59,7 +61,8 @@ def test_list created_at: Time, external_connections: ^(Orb::Internal::Type::ArrayOf[Orb::Item::ExternalConnection]), metadata: ^(Orb::Internal::Type::HashOf[String]), - name: String + name: String, + archived_at: Time | nil } end end @@ -77,7 +80,8 @@ def test_archive created_at: Time, external_connections: ^(Orb::Internal::Type::ArrayOf[Orb::Item::ExternalConnection]), metadata: ^(Orb::Internal::Type::HashOf[String]), - name: String + name: String, + archived_at: Time | nil } end end @@ -95,7 +99,8 @@ def test_fetch created_at: Time, external_connections: ^(Orb::Internal::Type::ArrayOf[Orb::Item::ExternalConnection]), metadata: ^(Orb::Internal::Type::HashOf[String]), - name: String + name: String, + archived_at: Time | nil } end end diff --git a/test/orb/resources/prices/external_price_id_test.rb b/test/orb/resources/prices/external_price_id_test.rb index 1cad4c46..c7d34a2d 100644 --- a/test/orb/resources/prices/external_price_id_test.rb +++ b/test/orb/resources/prices/external_price_id_test.rb @@ -13,17 +13,14 @@ def test_update assert_pattern do case response in Orb::Price::Unit - in Orb::Price::Package - in Orb::Price::Matrix in Orb::Price::Tiered - in Orb::Price::TieredBPS - in Orb::Price::BPS - in Orb::Price::BulkBPS in Orb::Price::Bulk + in Orb::Price::Package + in Orb::Price::Matrix in Orb::Price::ThresholdTotalAmount in Orb::Price::TieredPackage - in Orb::Price::GroupedTiered in Orb::Price::TieredWithMinimum + in Orb::Price::GroupedTiered in Orb::Price::TieredPackageWithMinimum in Orb::Price::PackageWithAllocation in Orb::Price::UnitWithPercent @@ -31,16 +28,19 @@ def test_update in Orb::Price::TieredWithProration in Orb::Price::UnitWithProration in Orb::Price::GroupedAllocation + in Orb::Price::BulkWithProration in Orb::Price::GroupedWithProratedMinimum in Orb::Price::GroupedWithMeteredMinimum + in Orb::Price::GroupedWithMinMaxThresholds in Orb::Price::MatrixWithDisplayName - in Orb::Price::BulkWithProration in Orb::Price::GroupedTieredPackage in Orb::Price::MaxGroupTieredPackage in Orb::Price::ScalableMatrixWithUnitPricing in Orb::Price::ScalableMatrixWithTieredPricing in Orb::Price::CumulativeGroupedBulk - in Orb::Price::GroupedWithMinMaxThresholds + in Orb::Price::Minimum + in Orb::Price::Percent + in Orb::Price::EventOutput end end @@ -51,7 +51,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::Unit::BillingMode, cadence: Orb::Price::Unit::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::Unit::ConversionRateConfig | nil, created_at: Time, @@ -74,68 +76,14 @@ def test_update unit_config: Orb::UnitConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } - in { - model_type: :package, - id: String, - billable_metric: Orb::BillableMetricTiny | nil, - billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::Package::Cadence, - conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Package::ConversionRateConfig | nil, - created_at: Time, - credit_allocation: Orb::Allocation | nil, - currency: String, - discount: Orb::Discount | nil, - external_price_id: String | nil, - fixed_price_quantity: Float | nil, - invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, - item: Orb::ItemSlim, - maximum: Orb::Maximum | nil, - maximum_amount: String | nil, - metadata: ^(Orb::Internal::Type::HashOf[String]), - minimum: Orb::Minimum | nil, - minimum_amount: String | nil, - name: String, - package_config: Orb::PackageConfig, - plan_phase_order: Integer | nil, - price_type: Orb::Price::Package::PriceType, - replaces_price_id: String | nil, - dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil - } - in { - model_type: :matrix, - id: String, - billable_metric: Orb::BillableMetricTiny | nil, - billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::Matrix::Cadence, - conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Matrix::ConversionRateConfig | nil, - created_at: Time, - credit_allocation: Orb::Allocation | nil, - currency: String, - discount: Orb::Discount | nil, - external_price_id: String | nil, - fixed_price_quantity: Float | nil, - invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, - item: Orb::ItemSlim, - matrix_config: Orb::MatrixConfig, - maximum: Orb::Maximum | nil, - maximum_amount: String | nil, - metadata: ^(Orb::Internal::Type::HashOf[String]), - minimum: Orb::Minimum | nil, - minimum_amount: String | nil, - name: String, - plan_phase_order: Integer | nil, - price_type: Orb::Price::Matrix::PriceType, - replaces_price_id: String | nil, - dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil - } in { model_type: :tiered, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::Tiered::BillingMode, cadence: Orb::Price::Tiered::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::Tiered::ConversionRateConfig | nil, created_at: Time, @@ -159,42 +107,16 @@ def test_update dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :tiered_bps, - id: String, - billable_metric: Orb::BillableMetricTiny | nil, - billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::TieredBPS::Cadence, - conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::TieredBPS::ConversionRateConfig | nil, - created_at: Time, - credit_allocation: Orb::Allocation | nil, - currency: String, - discount: Orb::Discount | nil, - external_price_id: String | nil, - fixed_price_quantity: Float | nil, - invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, - item: Orb::ItemSlim, - maximum: Orb::Maximum | nil, - maximum_amount: String | nil, - metadata: ^(Orb::Internal::Type::HashOf[String]), - minimum: Orb::Minimum | nil, - minimum_amount: String | nil, - name: String, - plan_phase_order: Integer | nil, - price_type: Orb::Price::TieredBPS::PriceType, - replaces_price_id: String | nil, - tiered_bps_config: Orb::TieredBPSConfig, - dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil - } - in { - model_type: :bps, + model_type: :bulk, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bps_config: Orb::BPSConfig, - cadence: Orb::Price::BPS::Cadence, + billing_mode: Orb::Price::Bulk::BillingMode, + bulk_config: Orb::BulkConfig, + cadence: Orb::Price::Bulk::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::BPS::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Bulk::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -210,19 +132,20 @@ def test_update minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::BPS::PriceType, + price_type: Orb::Price::Bulk::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :bulk_bps, + model_type: :package, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::Price::BulkBPS::Cadence, + billing_mode: Orb::Price::Package::BillingMode, + cadence: Orb::Price::Package::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::BulkBPS::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Package::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -237,20 +160,22 @@ def test_update minimum: Orb::Minimum | nil, minimum_amount: String | nil, name: String, + package_config: Orb::PackageConfig, plan_phase_order: Integer | nil, - price_type: Orb::Price::BulkBPS::PriceType, + price_type: Orb::Price::Package::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :bulk, + model_type: :matrix, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_config: Orb::BulkConfig, - cadence: Orb::Price::Bulk::Cadence, + billing_mode: Orb::Price::Matrix::BillingMode, + cadence: Orb::Price::Matrix::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Bulk::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Matrix::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -259,6 +184,7 @@ def test_update fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, + matrix_config: Orb::MatrixConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -266,7 +192,7 @@ def test_update minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::Bulk::PriceType, + price_type: Orb::Price::Matrix::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } @@ -275,7 +201,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::ThresholdTotalAmount::BillingMode, cadence: Orb::Price::ThresholdTotalAmount::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::ThresholdTotalAmount::ConversionRateConfig | nil, created_at: Time, @@ -295,7 +223,7 @@ def test_update plan_phase_order: Integer | nil, price_type: Orb::Price::ThresholdTotalAmount::PriceType, replaces_price_id: String | nil, - threshold_total_amount_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + threshold_total_amount_config: Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -303,7 +231,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::TieredPackage::BillingMode, cadence: Orb::Price::TieredPackage::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::TieredPackage::ConversionRateConfig | nil, created_at: Time, @@ -323,24 +253,25 @@ def test_update plan_phase_order: Integer | nil, price_type: Orb::Price::TieredPackage::PriceType, replaces_price_id: String | nil, - tiered_package_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + tiered_package_config: Orb::Price::TieredPackage::TieredPackageConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :grouped_tiered, + model_type: :tiered_with_minimum, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::GroupedTiered::Cadence, + billing_mode: Orb::Price::TieredWithMinimum::BillingMode, + cadence: Orb::Price::TieredWithMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::GroupedTiered::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::TieredWithMinimum::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_tiered_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -350,24 +281,28 @@ def test_update minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::GroupedTiered::PriceType, + price_type: Orb::Price::TieredWithMinimum::PriceType, replaces_price_id: String | nil, + tiered_with_minimum_config: Orb::Price::TieredWithMinimum::TieredWithMinimumConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :tiered_with_minimum, + model_type: :grouped_tiered, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::TieredWithMinimum::Cadence, + billing_mode: Orb::Price::GroupedTiered::BillingMode, + cadence: Orb::Price::GroupedTiered::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::TieredWithMinimum::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::GroupedTiered::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, + grouped_tiered_config: Orb::Price::GroupedTiered::GroupedTieredConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -377,9 +312,8 @@ def test_update minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::TieredWithMinimum::PriceType, + price_type: Orb::Price::GroupedTiered::PriceType, replaces_price_id: String | nil, - tiered_with_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -387,7 +321,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::TieredPackageWithMinimum::BillingMode, cadence: Orb::Price::TieredPackageWithMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::TieredPackageWithMinimum::ConversionRateConfig | nil, created_at: Time, @@ -407,7 +343,7 @@ def test_update plan_phase_order: Integer | nil, price_type: Orb::Price::TieredPackageWithMinimum::PriceType, replaces_price_id: String | nil, - tiered_package_with_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + tiered_package_with_minimum_config: Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -415,7 +351,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::PackageWithAllocation::BillingMode, cadence: Orb::Price::PackageWithAllocation::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::PackageWithAllocation::ConversionRateConfig | nil, created_at: Time, @@ -432,7 +370,7 @@ def test_update minimum: Orb::Minimum | nil, minimum_amount: String | nil, name: String, - package_with_allocation_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + package_with_allocation_config: Orb::Price::PackageWithAllocation::PackageWithAllocationConfig, plan_phase_order: Integer | nil, price_type: Orb::Price::PackageWithAllocation::PriceType, replaces_price_id: String | nil, @@ -443,7 +381,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::UnitWithPercent::BillingMode, cadence: Orb::Price::UnitWithPercent::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::UnitWithPercent::ConversionRateConfig | nil, created_at: Time, @@ -463,7 +403,7 @@ def test_update plan_phase_order: Integer | nil, price_type: Orb::Price::UnitWithPercent::PriceType, replaces_price_id: String | nil, - unit_with_percent_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + unit_with_percent_config: Orb::Price::UnitWithPercent::UnitWithPercentConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -471,7 +411,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::MatrixWithAllocation::BillingMode, cadence: Orb::Price::MatrixWithAllocation::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::MatrixWithAllocation::ConversionRateConfig | nil, created_at: Time, @@ -499,7 +441,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::TieredWithProration::BillingMode, cadence: Orb::Price::TieredWithProration::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::TieredWithProration::ConversionRateConfig | nil, created_at: Time, @@ -519,7 +463,7 @@ def test_update plan_phase_order: Integer | nil, price_type: Orb::Price::TieredWithProration::PriceType, replaces_price_id: String | nil, - tiered_with_proration_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + tiered_with_proration_config: Orb::Price::TieredWithProration::TieredWithProrationConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -527,7 +471,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::UnitWithProration::BillingMode, cadence: Orb::Price::UnitWithProration::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::UnitWithProration::ConversionRateConfig | nil, created_at: Time, @@ -547,7 +493,7 @@ def test_update plan_phase_order: Integer | nil, price_type: Orb::Price::UnitWithProration::PriceType, replaces_price_id: String | nil, - unit_with_proration_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + unit_with_proration_config: Orb::Price::UnitWithProration::UnitWithProrationConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -555,7 +501,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::GroupedAllocation::BillingMode, cadence: Orb::Price::GroupedAllocation::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::GroupedAllocation::ConversionRateConfig | nil, created_at: Time, @@ -564,7 +512,7 @@ def test_update discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_allocation_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_allocation_config: Orb::Price::GroupedAllocation::GroupedAllocationConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -578,12 +526,44 @@ def test_update replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } + in { + model_type: :bulk_with_proration, + id: String, + billable_metric: Orb::BillableMetricTiny | nil, + billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::BulkWithProration::BillingMode, + bulk_with_proration_config: Orb::Price::BulkWithProration::BulkWithProrationConfig, + cadence: Orb::Price::BulkWithProration::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, + conversion_rate: Float | nil, + conversion_rate_config: Orb::Price::BulkWithProration::ConversionRateConfig | nil, + created_at: Time, + credit_allocation: Orb::Allocation | nil, + currency: String, + discount: Orb::Discount | nil, + external_price_id: String | nil, + fixed_price_quantity: Float | nil, + invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, + item: Orb::ItemSlim, + maximum: Orb::Maximum | nil, + maximum_amount: String | nil, + metadata: ^(Orb::Internal::Type::HashOf[String]), + minimum: Orb::Minimum | nil, + minimum_amount: String | nil, + name: String, + plan_phase_order: Integer | nil, + price_type: Orb::Price::BulkWithProration::PriceType, + replaces_price_id: String | nil, + dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil + } in { model_type: :grouped_with_prorated_minimum, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::GroupedWithProratedMinimum::BillingMode, cadence: Orb::Price::GroupedWithProratedMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::GroupedWithProratedMinimum::ConversionRateConfig | nil, created_at: Time, @@ -592,7 +572,7 @@ def test_update discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_with_prorated_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_with_prorated_minimum_config: Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -611,7 +591,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::GroupedWithMeteredMinimum::BillingMode, cadence: Orb::Price::GroupedWithMeteredMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::GroupedWithMeteredMinimum::ConversionRateConfig | nil, created_at: Time, @@ -620,7 +602,7 @@ def test_update discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_with_metered_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_with_metered_minimum_config: Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -635,22 +617,24 @@ def test_update dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :matrix_with_display_name, + model_type: :grouped_with_min_max_thresholds, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::MatrixWithDisplayName::Cadence, + billing_mode: Orb::Price::GroupedWithMinMaxThresholds::BillingMode, + cadence: Orb::Price::GroupedWithMinMaxThresholds::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::MatrixWithDisplayName::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, + grouped_with_min_max_thresholds_config: Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, - matrix_with_display_name_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -658,19 +642,20 @@ def test_update minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::MatrixWithDisplayName::PriceType, + price_type: Orb::Price::GroupedWithMinMaxThresholds::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :bulk_with_proration, + model_type: :matrix_with_display_name, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_with_proration_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), - cadence: Orb::Price::BulkWithProration::Cadence, + billing_mode: Orb::Price::MatrixWithDisplayName::BillingMode, + cadence: Orb::Price::MatrixWithDisplayName::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::BulkWithProration::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::MatrixWithDisplayName::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -679,6 +664,7 @@ def test_update fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, + matrix_with_display_name_config: Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -686,7 +672,7 @@ def test_update minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::BulkWithProration::PriceType, + price_type: Orb::Price::MatrixWithDisplayName::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } @@ -695,7 +681,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::GroupedTieredPackage::BillingMode, cadence: Orb::Price::GroupedTieredPackage::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::GroupedTieredPackage::ConversionRateConfig | nil, created_at: Time, @@ -704,7 +692,7 @@ def test_update discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_tiered_package_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_tiered_package_config: Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -723,7 +711,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::MaxGroupTieredPackage::BillingMode, cadence: Orb::Price::MaxGroupTieredPackage::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::MaxGroupTieredPackage::ConversionRateConfig | nil, created_at: Time, @@ -734,7 +724,7 @@ def test_update fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, - max_group_tiered_package_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + max_group_tiered_package_config: Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -751,7 +741,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::ScalableMatrixWithUnitPricing::BillingMode, cadence: Orb::Price::ScalableMatrixWithUnitPricing::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::ScalableMatrixWithUnitPricing::ConversionRateConfig | nil, created_at: Time, @@ -771,7 +763,7 @@ def test_update plan_phase_order: Integer | nil, price_type: Orb::Price::ScalableMatrixWithUnitPricing::PriceType, replaces_price_id: String | nil, - scalable_matrix_with_unit_pricing_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + scalable_matrix_with_unit_pricing_config: Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -779,7 +771,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::ScalableMatrixWithTieredPricing::BillingMode, cadence: Orb::Price::ScalableMatrixWithTieredPricing::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::ScalableMatrixWithTieredPricing::ConversionRateConfig | nil, created_at: Time, @@ -799,7 +793,7 @@ def test_update plan_phase_order: Integer | nil, price_type: Orb::Price::ScalableMatrixWithTieredPricing::PriceType, replaces_price_id: String | nil, - scalable_matrix_with_tiered_pricing_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + scalable_matrix_with_tiered_pricing_config: Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -807,12 +801,14 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::CumulativeGroupedBulk::BillingMode, cadence: Orb::Price::CumulativeGroupedBulk::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::CumulativeGroupedBulk::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, - cumulative_grouped_bulk_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + cumulative_grouped_bulk_config: Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, @@ -831,20 +827,21 @@ def test_update dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :grouped_with_min_max_thresholds, + model_type: :minimum, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::GroupedWithMinMaxThresholds::Cadence, + billing_mode: Orb::Price::Minimum::BillingMode, + cadence: Orb::Price::Minimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Minimum::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_with_min_max_thresholds_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -852,67 +849,23 @@ def test_update metadata: ^(Orb::Internal::Type::HashOf[String]), minimum: Orb::Minimum | nil, minimum_amount: String | nil, + minimum_config: Orb::Price::Minimum::MinimumConfig, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::GroupedWithMinMaxThresholds::PriceType, + price_type: Orb::Price::Minimum::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } - end - end - end - - def test_fetch - response = @orb.prices.external_price_id.fetch("external_price_id") - - assert_pattern do - response => Orb::Price - end - - assert_pattern do - case response - in Orb::Price::Unit - in Orb::Price::Package - in Orb::Price::Matrix - in Orb::Price::Tiered - in Orb::Price::TieredBPS - in Orb::Price::BPS - in Orb::Price::BulkBPS - in Orb::Price::Bulk - in Orb::Price::ThresholdTotalAmount - in Orb::Price::TieredPackage - in Orb::Price::GroupedTiered - in Orb::Price::TieredWithMinimum - in Orb::Price::TieredPackageWithMinimum - in Orb::Price::PackageWithAllocation - in Orb::Price::UnitWithPercent - in Orb::Price::MatrixWithAllocation - in Orb::Price::TieredWithProration - in Orb::Price::UnitWithProration - in Orb::Price::GroupedAllocation - in Orb::Price::GroupedWithProratedMinimum - in Orb::Price::GroupedWithMeteredMinimum - in Orb::Price::MatrixWithDisplayName - in Orb::Price::BulkWithProration - in Orb::Price::GroupedTieredPackage - in Orb::Price::MaxGroupTieredPackage - in Orb::Price::ScalableMatrixWithUnitPricing - in Orb::Price::ScalableMatrixWithTieredPricing - in Orb::Price::CumulativeGroupedBulk - in Orb::Price::GroupedWithMinMaxThresholds - end - end - - assert_pattern do - case response in { - model_type: :unit, + model_type: :percent, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::Unit::Cadence, + billing_mode: Orb::Price::Percent::BillingMode, + cadence: Orb::Price::Percent::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Unit::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Percent::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -927,24 +880,27 @@ def test_fetch minimum: Orb::Minimum | nil, minimum_amount: String | nil, name: String, + percent_config: Orb::Price::Percent::PercentConfig, plan_phase_order: Integer | nil, - price_type: Orb::Price::Unit::PriceType, + price_type: Orb::Price::Percent::PriceType, replaces_price_id: String | nil, - unit_config: Orb::UnitConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :package, + model_type: :event_output, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::Package::Cadence, + billing_mode: Orb::Price::EventOutput::BillingMode, + cadence: Orb::Price::EventOutput::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Package::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::EventOutput::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, + event_output_config: Orb::Price::EventOutput::EventOutputConfig, external_price_id: String | nil, fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, @@ -955,20 +911,68 @@ def test_fetch minimum: Orb::Minimum | nil, minimum_amount: String | nil, name: String, - package_config: Orb::PackageConfig, plan_phase_order: Integer | nil, - price_type: Orb::Price::Package::PriceType, + price_type: Orb::Price::EventOutput::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } + end + end + end + + def test_fetch + response = @orb.prices.external_price_id.fetch("external_price_id") + + assert_pattern do + response => Orb::Price + end + + assert_pattern do + case response + in Orb::Price::Unit + in Orb::Price::Tiered + in Orb::Price::Bulk + in Orb::Price::Package + in Orb::Price::Matrix + in Orb::Price::ThresholdTotalAmount + in Orb::Price::TieredPackage + in Orb::Price::TieredWithMinimum + in Orb::Price::GroupedTiered + in Orb::Price::TieredPackageWithMinimum + in Orb::Price::PackageWithAllocation + in Orb::Price::UnitWithPercent + in Orb::Price::MatrixWithAllocation + in Orb::Price::TieredWithProration + in Orb::Price::UnitWithProration + in Orb::Price::GroupedAllocation + in Orb::Price::BulkWithProration + in Orb::Price::GroupedWithProratedMinimum + in Orb::Price::GroupedWithMeteredMinimum + in Orb::Price::GroupedWithMinMaxThresholds + in Orb::Price::MatrixWithDisplayName + in Orb::Price::GroupedTieredPackage + in Orb::Price::MaxGroupTieredPackage + in Orb::Price::ScalableMatrixWithUnitPricing + in Orb::Price::ScalableMatrixWithTieredPricing + in Orb::Price::CumulativeGroupedBulk + in Orb::Price::Minimum + in Orb::Price::Percent + in Orb::Price::EventOutput + end + end + + assert_pattern do + case response in { - model_type: :matrix, + model_type: :unit, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::Matrix::Cadence, + billing_mode: Orb::Price::Unit::BillingMode, + cadence: Orb::Price::Unit::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Matrix::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Unit::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -977,7 +981,6 @@ def test_fetch fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, - matrix_config: Orb::MatrixConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -985,8 +988,9 @@ def test_fetch minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::Matrix::PriceType, + price_type: Orb::Price::Unit::PriceType, replaces_price_id: String | nil, + unit_config: Orb::UnitConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -994,7 +998,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::Tiered::BillingMode, cadence: Orb::Price::Tiered::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::Tiered::ConversionRateConfig | nil, created_at: Time, @@ -1018,42 +1024,16 @@ def test_fetch dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :tiered_bps, - id: String, - billable_metric: Orb::BillableMetricTiny | nil, - billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::TieredBPS::Cadence, - conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::TieredBPS::ConversionRateConfig | nil, - created_at: Time, - credit_allocation: Orb::Allocation | nil, - currency: String, - discount: Orb::Discount | nil, - external_price_id: String | nil, - fixed_price_quantity: Float | nil, - invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, - item: Orb::ItemSlim, - maximum: Orb::Maximum | nil, - maximum_amount: String | nil, - metadata: ^(Orb::Internal::Type::HashOf[String]), - minimum: Orb::Minimum | nil, - minimum_amount: String | nil, - name: String, - plan_phase_order: Integer | nil, - price_type: Orb::Price::TieredBPS::PriceType, - replaces_price_id: String | nil, - tiered_bps_config: Orb::TieredBPSConfig, - dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil - } - in { - model_type: :bps, + model_type: :bulk, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bps_config: Orb::BPSConfig, - cadence: Orb::Price::BPS::Cadence, + billing_mode: Orb::Price::Bulk::BillingMode, + bulk_config: Orb::BulkConfig, + cadence: Orb::Price::Bulk::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::BPS::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Bulk::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -1069,19 +1049,20 @@ def test_fetch minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::BPS::PriceType, + price_type: Orb::Price::Bulk::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :bulk_bps, + model_type: :package, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::Price::BulkBPS::Cadence, + billing_mode: Orb::Price::Package::BillingMode, + cadence: Orb::Price::Package::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::BulkBPS::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Package::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -1096,20 +1077,22 @@ def test_fetch minimum: Orb::Minimum | nil, minimum_amount: String | nil, name: String, + package_config: Orb::PackageConfig, plan_phase_order: Integer | nil, - price_type: Orb::Price::BulkBPS::PriceType, + price_type: Orb::Price::Package::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :bulk, + model_type: :matrix, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_config: Orb::BulkConfig, - cadence: Orb::Price::Bulk::Cadence, + billing_mode: Orb::Price::Matrix::BillingMode, + cadence: Orb::Price::Matrix::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Bulk::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Matrix::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -1118,6 +1101,7 @@ def test_fetch fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, + matrix_config: Orb::MatrixConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -1125,7 +1109,7 @@ def test_fetch minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::Bulk::PriceType, + price_type: Orb::Price::Matrix::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } @@ -1134,7 +1118,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::ThresholdTotalAmount::BillingMode, cadence: Orb::Price::ThresholdTotalAmount::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::ThresholdTotalAmount::ConversionRateConfig | nil, created_at: Time, @@ -1154,7 +1140,7 @@ def test_fetch plan_phase_order: Integer | nil, price_type: Orb::Price::ThresholdTotalAmount::PriceType, replaces_price_id: String | nil, - threshold_total_amount_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + threshold_total_amount_config: Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -1162,7 +1148,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::TieredPackage::BillingMode, cadence: Orb::Price::TieredPackage::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::TieredPackage::ConversionRateConfig | nil, created_at: Time, @@ -1182,24 +1170,25 @@ def test_fetch plan_phase_order: Integer | nil, price_type: Orb::Price::TieredPackage::PriceType, replaces_price_id: String | nil, - tiered_package_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + tiered_package_config: Orb::Price::TieredPackage::TieredPackageConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :grouped_tiered, + model_type: :tiered_with_minimum, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::GroupedTiered::Cadence, + billing_mode: Orb::Price::TieredWithMinimum::BillingMode, + cadence: Orb::Price::TieredWithMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::GroupedTiered::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::TieredWithMinimum::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_tiered_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -1209,24 +1198,28 @@ def test_fetch minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::GroupedTiered::PriceType, + price_type: Orb::Price::TieredWithMinimum::PriceType, replaces_price_id: String | nil, + tiered_with_minimum_config: Orb::Price::TieredWithMinimum::TieredWithMinimumConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :tiered_with_minimum, + model_type: :grouped_tiered, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::TieredWithMinimum::Cadence, + billing_mode: Orb::Price::GroupedTiered::BillingMode, + cadence: Orb::Price::GroupedTiered::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::TieredWithMinimum::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::GroupedTiered::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, + grouped_tiered_config: Orb::Price::GroupedTiered::GroupedTieredConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -1236,9 +1229,8 @@ def test_fetch minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::TieredWithMinimum::PriceType, + price_type: Orb::Price::GroupedTiered::PriceType, replaces_price_id: String | nil, - tiered_with_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -1246,7 +1238,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::TieredPackageWithMinimum::BillingMode, cadence: Orb::Price::TieredPackageWithMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::TieredPackageWithMinimum::ConversionRateConfig | nil, created_at: Time, @@ -1266,7 +1260,7 @@ def test_fetch plan_phase_order: Integer | nil, price_type: Orb::Price::TieredPackageWithMinimum::PriceType, replaces_price_id: String | nil, - tiered_package_with_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + tiered_package_with_minimum_config: Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -1274,7 +1268,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::PackageWithAllocation::BillingMode, cadence: Orb::Price::PackageWithAllocation::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::PackageWithAllocation::ConversionRateConfig | nil, created_at: Time, @@ -1291,7 +1287,7 @@ def test_fetch minimum: Orb::Minimum | nil, minimum_amount: String | nil, name: String, - package_with_allocation_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + package_with_allocation_config: Orb::Price::PackageWithAllocation::PackageWithAllocationConfig, plan_phase_order: Integer | nil, price_type: Orb::Price::PackageWithAllocation::PriceType, replaces_price_id: String | nil, @@ -1302,7 +1298,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::UnitWithPercent::BillingMode, cadence: Orb::Price::UnitWithPercent::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::UnitWithPercent::ConversionRateConfig | nil, created_at: Time, @@ -1322,7 +1320,7 @@ def test_fetch plan_phase_order: Integer | nil, price_type: Orb::Price::UnitWithPercent::PriceType, replaces_price_id: String | nil, - unit_with_percent_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + unit_with_percent_config: Orb::Price::UnitWithPercent::UnitWithPercentConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -1330,7 +1328,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::MatrixWithAllocation::BillingMode, cadence: Orb::Price::MatrixWithAllocation::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::MatrixWithAllocation::ConversionRateConfig | nil, created_at: Time, @@ -1358,7 +1358,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::TieredWithProration::BillingMode, cadence: Orb::Price::TieredWithProration::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::TieredWithProration::ConversionRateConfig | nil, created_at: Time, @@ -1378,7 +1380,7 @@ def test_fetch plan_phase_order: Integer | nil, price_type: Orb::Price::TieredWithProration::PriceType, replaces_price_id: String | nil, - tiered_with_proration_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + tiered_with_proration_config: Orb::Price::TieredWithProration::TieredWithProrationConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -1386,7 +1388,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::UnitWithProration::BillingMode, cadence: Orb::Price::UnitWithProration::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::UnitWithProration::ConversionRateConfig | nil, created_at: Time, @@ -1406,7 +1410,7 @@ def test_fetch plan_phase_order: Integer | nil, price_type: Orb::Price::UnitWithProration::PriceType, replaces_price_id: String | nil, - unit_with_proration_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + unit_with_proration_config: Orb::Price::UnitWithProration::UnitWithProrationConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -1414,7 +1418,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::GroupedAllocation::BillingMode, cadence: Orb::Price::GroupedAllocation::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::GroupedAllocation::ConversionRateConfig | nil, created_at: Time, @@ -1423,7 +1429,7 @@ def test_fetch discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_allocation_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_allocation_config: Orb::Price::GroupedAllocation::GroupedAllocationConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -1437,12 +1443,44 @@ def test_fetch replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } + in { + model_type: :bulk_with_proration, + id: String, + billable_metric: Orb::BillableMetricTiny | nil, + billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::BulkWithProration::BillingMode, + bulk_with_proration_config: Orb::Price::BulkWithProration::BulkWithProrationConfig, + cadence: Orb::Price::BulkWithProration::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, + conversion_rate: Float | nil, + conversion_rate_config: Orb::Price::BulkWithProration::ConversionRateConfig | nil, + created_at: Time, + credit_allocation: Orb::Allocation | nil, + currency: String, + discount: Orb::Discount | nil, + external_price_id: String | nil, + fixed_price_quantity: Float | nil, + invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, + item: Orb::ItemSlim, + maximum: Orb::Maximum | nil, + maximum_amount: String | nil, + metadata: ^(Orb::Internal::Type::HashOf[String]), + minimum: Orb::Minimum | nil, + minimum_amount: String | nil, + name: String, + plan_phase_order: Integer | nil, + price_type: Orb::Price::BulkWithProration::PriceType, + replaces_price_id: String | nil, + dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil + } in { model_type: :grouped_with_prorated_minimum, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::GroupedWithProratedMinimum::BillingMode, cadence: Orb::Price::GroupedWithProratedMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::GroupedWithProratedMinimum::ConversionRateConfig | nil, created_at: Time, @@ -1451,7 +1489,7 @@ def test_fetch discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_with_prorated_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_with_prorated_minimum_config: Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -1470,7 +1508,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::GroupedWithMeteredMinimum::BillingMode, cadence: Orb::Price::GroupedWithMeteredMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::GroupedWithMeteredMinimum::ConversionRateConfig | nil, created_at: Time, @@ -1479,7 +1519,7 @@ def test_fetch discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_with_metered_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_with_metered_minimum_config: Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -1494,22 +1534,24 @@ def test_fetch dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :matrix_with_display_name, + model_type: :grouped_with_min_max_thresholds, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::MatrixWithDisplayName::Cadence, + billing_mode: Orb::Price::GroupedWithMinMaxThresholds::BillingMode, + cadence: Orb::Price::GroupedWithMinMaxThresholds::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::MatrixWithDisplayName::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, + grouped_with_min_max_thresholds_config: Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, - matrix_with_display_name_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -1517,19 +1559,20 @@ def test_fetch minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::MatrixWithDisplayName::PriceType, + price_type: Orb::Price::GroupedWithMinMaxThresholds::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :bulk_with_proration, + model_type: :matrix_with_display_name, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_with_proration_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), - cadence: Orb::Price::BulkWithProration::Cadence, + billing_mode: Orb::Price::MatrixWithDisplayName::BillingMode, + cadence: Orb::Price::MatrixWithDisplayName::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::BulkWithProration::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::MatrixWithDisplayName::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -1538,6 +1581,7 @@ def test_fetch fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, + matrix_with_display_name_config: Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -1545,7 +1589,7 @@ def test_fetch minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::BulkWithProration::PriceType, + price_type: Orb::Price::MatrixWithDisplayName::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } @@ -1554,7 +1598,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::GroupedTieredPackage::BillingMode, cadence: Orb::Price::GroupedTieredPackage::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::GroupedTieredPackage::ConversionRateConfig | nil, created_at: Time, @@ -1563,7 +1609,7 @@ def test_fetch discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_tiered_package_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_tiered_package_config: Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -1582,7 +1628,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::MaxGroupTieredPackage::BillingMode, cadence: Orb::Price::MaxGroupTieredPackage::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::MaxGroupTieredPackage::ConversionRateConfig | nil, created_at: Time, @@ -1593,7 +1641,7 @@ def test_fetch fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, - max_group_tiered_package_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + max_group_tiered_package_config: Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -1610,7 +1658,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::ScalableMatrixWithUnitPricing::BillingMode, cadence: Orb::Price::ScalableMatrixWithUnitPricing::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::ScalableMatrixWithUnitPricing::ConversionRateConfig | nil, created_at: Time, @@ -1630,7 +1680,7 @@ def test_fetch plan_phase_order: Integer | nil, price_type: Orb::Price::ScalableMatrixWithUnitPricing::PriceType, replaces_price_id: String | nil, - scalable_matrix_with_unit_pricing_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + scalable_matrix_with_unit_pricing_config: Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -1638,7 +1688,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::ScalableMatrixWithTieredPricing::BillingMode, cadence: Orb::Price::ScalableMatrixWithTieredPricing::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::ScalableMatrixWithTieredPricing::ConversionRateConfig | nil, created_at: Time, @@ -1658,7 +1710,7 @@ def test_fetch plan_phase_order: Integer | nil, price_type: Orb::Price::ScalableMatrixWithTieredPricing::PriceType, replaces_price_id: String | nil, - scalable_matrix_with_tiered_pricing_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + scalable_matrix_with_tiered_pricing_config: Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -1666,12 +1718,14 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::CumulativeGroupedBulk::BillingMode, cadence: Orb::Price::CumulativeGroupedBulk::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::CumulativeGroupedBulk::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, - cumulative_grouped_bulk_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + cumulative_grouped_bulk_config: Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, @@ -1690,20 +1744,21 @@ def test_fetch dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :grouped_with_min_max_thresholds, + model_type: :minimum, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::GroupedWithMinMaxThresholds::Cadence, + billing_mode: Orb::Price::Minimum::BillingMode, + cadence: Orb::Price::Minimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Minimum::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_with_min_max_thresholds_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -1711,9 +1766,70 @@ def test_fetch metadata: ^(Orb::Internal::Type::HashOf[String]), minimum: Orb::Minimum | nil, minimum_amount: String | nil, + minimum_config: Orb::Price::Minimum::MinimumConfig, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::GroupedWithMinMaxThresholds::PriceType, + price_type: Orb::Price::Minimum::PriceType, + replaces_price_id: String | nil, + dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil + } + in { + model_type: :percent, + id: String, + billable_metric: Orb::BillableMetricTiny | nil, + billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::Percent::BillingMode, + cadence: Orb::Price::Percent::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, + conversion_rate: Float | nil, + conversion_rate_config: Orb::Price::Percent::ConversionRateConfig | nil, + created_at: Time, + credit_allocation: Orb::Allocation | nil, + currency: String, + discount: Orb::Discount | nil, + external_price_id: String | nil, + fixed_price_quantity: Float | nil, + invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, + item: Orb::ItemSlim, + maximum: Orb::Maximum | nil, + maximum_amount: String | nil, + metadata: ^(Orb::Internal::Type::HashOf[String]), + minimum: Orb::Minimum | nil, + minimum_amount: String | nil, + name: String, + percent_config: Orb::Price::Percent::PercentConfig, + plan_phase_order: Integer | nil, + price_type: Orb::Price::Percent::PriceType, + replaces_price_id: String | nil, + dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil + } + in { + model_type: :event_output, + id: String, + billable_metric: Orb::BillableMetricTiny | nil, + billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::EventOutput::BillingMode, + cadence: Orb::Price::EventOutput::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, + conversion_rate: Float | nil, + conversion_rate_config: Orb::Price::EventOutput::ConversionRateConfig | nil, + created_at: Time, + credit_allocation: Orb::Allocation | nil, + currency: String, + discount: Orb::Discount | nil, + event_output_config: Orb::Price::EventOutput::EventOutputConfig, + external_price_id: String | nil, + fixed_price_quantity: Float | nil, + invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, + item: Orb::ItemSlim, + maximum: Orb::Maximum | nil, + maximum_amount: String | nil, + metadata: ^(Orb::Internal::Type::HashOf[String]), + minimum: Orb::Minimum | nil, + minimum_amount: String | nil, + name: String, + plan_phase_order: Integer | nil, + price_type: Orb::Price::EventOutput::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } diff --git a/test/orb/resources/prices_test.rb b/test/orb/resources/prices_test.rb index d3caf913..49a1fc00 100644 --- a/test/orb/resources/prices_test.rb +++ b/test/orb/resources/prices_test.rb @@ -21,17 +21,14 @@ def test_create_required_params assert_pattern do case response in Orb::Price::Unit - in Orb::Price::Package - in Orb::Price::Matrix in Orb::Price::Tiered - in Orb::Price::TieredBPS - in Orb::Price::BPS - in Orb::Price::BulkBPS in Orb::Price::Bulk + in Orb::Price::Package + in Orb::Price::Matrix in Orb::Price::ThresholdTotalAmount in Orb::Price::TieredPackage - in Orb::Price::GroupedTiered in Orb::Price::TieredWithMinimum + in Orb::Price::GroupedTiered in Orb::Price::TieredPackageWithMinimum in Orb::Price::PackageWithAllocation in Orb::Price::UnitWithPercent @@ -39,16 +36,19 @@ def test_create_required_params in Orb::Price::TieredWithProration in Orb::Price::UnitWithProration in Orb::Price::GroupedAllocation + in Orb::Price::BulkWithProration in Orb::Price::GroupedWithProratedMinimum in Orb::Price::GroupedWithMeteredMinimum + in Orb::Price::GroupedWithMinMaxThresholds in Orb::Price::MatrixWithDisplayName - in Orb::Price::BulkWithProration in Orb::Price::GroupedTieredPackage in Orb::Price::MaxGroupTieredPackage in Orb::Price::ScalableMatrixWithUnitPricing in Orb::Price::ScalableMatrixWithTieredPricing in Orb::Price::CumulativeGroupedBulk - in Orb::Price::GroupedWithMinMaxThresholds + in Orb::Price::Minimum + in Orb::Price::Percent + in Orb::Price::EventOutput end end @@ -59,7 +59,9 @@ def test_create_required_params id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::Unit::BillingMode, cadence: Orb::Price::Unit::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::Unit::ConversionRateConfig | nil, created_at: Time, @@ -82,68 +84,14 @@ def test_create_required_params unit_config: Orb::UnitConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } - in { - model_type: :package, - id: String, - billable_metric: Orb::BillableMetricTiny | nil, - billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::Package::Cadence, - conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Package::ConversionRateConfig | nil, - created_at: Time, - credit_allocation: Orb::Allocation | nil, - currency: String, - discount: Orb::Discount | nil, - external_price_id: String | nil, - fixed_price_quantity: Float | nil, - invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, - item: Orb::ItemSlim, - maximum: Orb::Maximum | nil, - maximum_amount: String | nil, - metadata: ^(Orb::Internal::Type::HashOf[String]), - minimum: Orb::Minimum | nil, - minimum_amount: String | nil, - name: String, - package_config: Orb::PackageConfig, - plan_phase_order: Integer | nil, - price_type: Orb::Price::Package::PriceType, - replaces_price_id: String | nil, - dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil - } - in { - model_type: :matrix, - id: String, - billable_metric: Orb::BillableMetricTiny | nil, - billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::Matrix::Cadence, - conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Matrix::ConversionRateConfig | nil, - created_at: Time, - credit_allocation: Orb::Allocation | nil, - currency: String, - discount: Orb::Discount | nil, - external_price_id: String | nil, - fixed_price_quantity: Float | nil, - invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, - item: Orb::ItemSlim, - matrix_config: Orb::MatrixConfig, - maximum: Orb::Maximum | nil, - maximum_amount: String | nil, - metadata: ^(Orb::Internal::Type::HashOf[String]), - minimum: Orb::Minimum | nil, - minimum_amount: String | nil, - name: String, - plan_phase_order: Integer | nil, - price_type: Orb::Price::Matrix::PriceType, - replaces_price_id: String | nil, - dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil - } in { model_type: :tiered, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::Tiered::BillingMode, cadence: Orb::Price::Tiered::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::Tiered::ConversionRateConfig | nil, created_at: Time, @@ -167,42 +115,16 @@ def test_create_required_params dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :tiered_bps, - id: String, - billable_metric: Orb::BillableMetricTiny | nil, - billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::TieredBPS::Cadence, - conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::TieredBPS::ConversionRateConfig | nil, - created_at: Time, - credit_allocation: Orb::Allocation | nil, - currency: String, - discount: Orb::Discount | nil, - external_price_id: String | nil, - fixed_price_quantity: Float | nil, - invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, - item: Orb::ItemSlim, - maximum: Orb::Maximum | nil, - maximum_amount: String | nil, - metadata: ^(Orb::Internal::Type::HashOf[String]), - minimum: Orb::Minimum | nil, - minimum_amount: String | nil, - name: String, - plan_phase_order: Integer | nil, - price_type: Orb::Price::TieredBPS::PriceType, - replaces_price_id: String | nil, - tiered_bps_config: Orb::TieredBPSConfig, - dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil - } - in { - model_type: :bps, + model_type: :bulk, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bps_config: Orb::BPSConfig, - cadence: Orb::Price::BPS::Cadence, + billing_mode: Orb::Price::Bulk::BillingMode, + bulk_config: Orb::BulkConfig, + cadence: Orb::Price::Bulk::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::BPS::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Bulk::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -218,19 +140,20 @@ def test_create_required_params minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::BPS::PriceType, + price_type: Orb::Price::Bulk::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :bulk_bps, + model_type: :package, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::Price::BulkBPS::Cadence, + billing_mode: Orb::Price::Package::BillingMode, + cadence: Orb::Price::Package::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::BulkBPS::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Package::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -245,20 +168,22 @@ def test_create_required_params minimum: Orb::Minimum | nil, minimum_amount: String | nil, name: String, + package_config: Orb::PackageConfig, plan_phase_order: Integer | nil, - price_type: Orb::Price::BulkBPS::PriceType, + price_type: Orb::Price::Package::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :bulk, + model_type: :matrix, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_config: Orb::BulkConfig, - cadence: Orb::Price::Bulk::Cadence, + billing_mode: Orb::Price::Matrix::BillingMode, + cadence: Orb::Price::Matrix::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Bulk::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Matrix::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -267,6 +192,7 @@ def test_create_required_params fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, + matrix_config: Orb::MatrixConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -274,7 +200,7 @@ def test_create_required_params minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::Bulk::PriceType, + price_type: Orb::Price::Matrix::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } @@ -283,7 +209,9 @@ def test_create_required_params id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::ThresholdTotalAmount::BillingMode, cadence: Orb::Price::ThresholdTotalAmount::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::ThresholdTotalAmount::ConversionRateConfig | nil, created_at: Time, @@ -303,7 +231,7 @@ def test_create_required_params plan_phase_order: Integer | nil, price_type: Orb::Price::ThresholdTotalAmount::PriceType, replaces_price_id: String | nil, - threshold_total_amount_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + threshold_total_amount_config: Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -311,7 +239,9 @@ def test_create_required_params id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::TieredPackage::BillingMode, cadence: Orb::Price::TieredPackage::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::TieredPackage::ConversionRateConfig | nil, created_at: Time, @@ -331,24 +261,25 @@ def test_create_required_params plan_phase_order: Integer | nil, price_type: Orb::Price::TieredPackage::PriceType, replaces_price_id: String | nil, - tiered_package_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + tiered_package_config: Orb::Price::TieredPackage::TieredPackageConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :grouped_tiered, + model_type: :tiered_with_minimum, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::GroupedTiered::Cadence, + billing_mode: Orb::Price::TieredWithMinimum::BillingMode, + cadence: Orb::Price::TieredWithMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::GroupedTiered::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::TieredWithMinimum::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_tiered_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -358,24 +289,28 @@ def test_create_required_params minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::GroupedTiered::PriceType, + price_type: Orb::Price::TieredWithMinimum::PriceType, replaces_price_id: String | nil, + tiered_with_minimum_config: Orb::Price::TieredWithMinimum::TieredWithMinimumConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :tiered_with_minimum, + model_type: :grouped_tiered, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::TieredWithMinimum::Cadence, + billing_mode: Orb::Price::GroupedTiered::BillingMode, + cadence: Orb::Price::GroupedTiered::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::TieredWithMinimum::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::GroupedTiered::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, + grouped_tiered_config: Orb::Price::GroupedTiered::GroupedTieredConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -385,9 +320,8 @@ def test_create_required_params minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::TieredWithMinimum::PriceType, + price_type: Orb::Price::GroupedTiered::PriceType, replaces_price_id: String | nil, - tiered_with_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -395,7 +329,9 @@ def test_create_required_params id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::TieredPackageWithMinimum::BillingMode, cadence: Orb::Price::TieredPackageWithMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::TieredPackageWithMinimum::ConversionRateConfig | nil, created_at: Time, @@ -415,7 +351,7 @@ def test_create_required_params plan_phase_order: Integer | nil, price_type: Orb::Price::TieredPackageWithMinimum::PriceType, replaces_price_id: String | nil, - tiered_package_with_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + tiered_package_with_minimum_config: Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -423,7 +359,9 @@ def test_create_required_params id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::PackageWithAllocation::BillingMode, cadence: Orb::Price::PackageWithAllocation::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::PackageWithAllocation::ConversionRateConfig | nil, created_at: Time, @@ -440,7 +378,7 @@ def test_create_required_params minimum: Orb::Minimum | nil, minimum_amount: String | nil, name: String, - package_with_allocation_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + package_with_allocation_config: Orb::Price::PackageWithAllocation::PackageWithAllocationConfig, plan_phase_order: Integer | nil, price_type: Orb::Price::PackageWithAllocation::PriceType, replaces_price_id: String | nil, @@ -451,7 +389,9 @@ def test_create_required_params id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::UnitWithPercent::BillingMode, cadence: Orb::Price::UnitWithPercent::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::UnitWithPercent::ConversionRateConfig | nil, created_at: Time, @@ -471,7 +411,7 @@ def test_create_required_params plan_phase_order: Integer | nil, price_type: Orb::Price::UnitWithPercent::PriceType, replaces_price_id: String | nil, - unit_with_percent_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + unit_with_percent_config: Orb::Price::UnitWithPercent::UnitWithPercentConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -479,7 +419,9 @@ def test_create_required_params id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::MatrixWithAllocation::BillingMode, cadence: Orb::Price::MatrixWithAllocation::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::MatrixWithAllocation::ConversionRateConfig | nil, created_at: Time, @@ -507,7 +449,9 @@ def test_create_required_params id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::TieredWithProration::BillingMode, cadence: Orb::Price::TieredWithProration::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::TieredWithProration::ConversionRateConfig | nil, created_at: Time, @@ -527,7 +471,7 @@ def test_create_required_params plan_phase_order: Integer | nil, price_type: Orb::Price::TieredWithProration::PriceType, replaces_price_id: String | nil, - tiered_with_proration_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + tiered_with_proration_config: Orb::Price::TieredWithProration::TieredWithProrationConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -535,7 +479,9 @@ def test_create_required_params id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::UnitWithProration::BillingMode, cadence: Orb::Price::UnitWithProration::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::UnitWithProration::ConversionRateConfig | nil, created_at: Time, @@ -555,7 +501,7 @@ def test_create_required_params plan_phase_order: Integer | nil, price_type: Orb::Price::UnitWithProration::PriceType, replaces_price_id: String | nil, - unit_with_proration_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + unit_with_proration_config: Orb::Price::UnitWithProration::UnitWithProrationConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -563,7 +509,9 @@ def test_create_required_params id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::GroupedAllocation::BillingMode, cadence: Orb::Price::GroupedAllocation::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::GroupedAllocation::ConversionRateConfig | nil, created_at: Time, @@ -572,7 +520,7 @@ def test_create_required_params discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_allocation_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_allocation_config: Orb::Price::GroupedAllocation::GroupedAllocationConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -586,12 +534,44 @@ def test_create_required_params replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } + in { + model_type: :bulk_with_proration, + id: String, + billable_metric: Orb::BillableMetricTiny | nil, + billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::BulkWithProration::BillingMode, + bulk_with_proration_config: Orb::Price::BulkWithProration::BulkWithProrationConfig, + cadence: Orb::Price::BulkWithProration::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, + conversion_rate: Float | nil, + conversion_rate_config: Orb::Price::BulkWithProration::ConversionRateConfig | nil, + created_at: Time, + credit_allocation: Orb::Allocation | nil, + currency: String, + discount: Orb::Discount | nil, + external_price_id: String | nil, + fixed_price_quantity: Float | nil, + invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, + item: Orb::ItemSlim, + maximum: Orb::Maximum | nil, + maximum_amount: String | nil, + metadata: ^(Orb::Internal::Type::HashOf[String]), + minimum: Orb::Minimum | nil, + minimum_amount: String | nil, + name: String, + plan_phase_order: Integer | nil, + price_type: Orb::Price::BulkWithProration::PriceType, + replaces_price_id: String | nil, + dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil + } in { model_type: :grouped_with_prorated_minimum, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::GroupedWithProratedMinimum::BillingMode, cadence: Orb::Price::GroupedWithProratedMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::GroupedWithProratedMinimum::ConversionRateConfig | nil, created_at: Time, @@ -600,7 +580,7 @@ def test_create_required_params discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_with_prorated_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_with_prorated_minimum_config: Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -619,7 +599,9 @@ def test_create_required_params id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::GroupedWithMeteredMinimum::BillingMode, cadence: Orb::Price::GroupedWithMeteredMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::GroupedWithMeteredMinimum::ConversionRateConfig | nil, created_at: Time, @@ -628,7 +610,7 @@ def test_create_required_params discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_with_metered_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_with_metered_minimum_config: Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -643,22 +625,24 @@ def test_create_required_params dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :matrix_with_display_name, + model_type: :grouped_with_min_max_thresholds, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::MatrixWithDisplayName::Cadence, + billing_mode: Orb::Price::GroupedWithMinMaxThresholds::BillingMode, + cadence: Orb::Price::GroupedWithMinMaxThresholds::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::MatrixWithDisplayName::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, + grouped_with_min_max_thresholds_config: Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, - matrix_with_display_name_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -666,19 +650,20 @@ def test_create_required_params minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::MatrixWithDisplayName::PriceType, + price_type: Orb::Price::GroupedWithMinMaxThresholds::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :bulk_with_proration, + model_type: :matrix_with_display_name, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_with_proration_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), - cadence: Orb::Price::BulkWithProration::Cadence, + billing_mode: Orb::Price::MatrixWithDisplayName::BillingMode, + cadence: Orb::Price::MatrixWithDisplayName::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::BulkWithProration::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::MatrixWithDisplayName::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -687,6 +672,7 @@ def test_create_required_params fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, + matrix_with_display_name_config: Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -694,7 +680,7 @@ def test_create_required_params minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::BulkWithProration::PriceType, + price_type: Orb::Price::MatrixWithDisplayName::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } @@ -703,7 +689,9 @@ def test_create_required_params id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::GroupedTieredPackage::BillingMode, cadence: Orb::Price::GroupedTieredPackage::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::GroupedTieredPackage::ConversionRateConfig | nil, created_at: Time, @@ -712,7 +700,7 @@ def test_create_required_params discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_tiered_package_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_tiered_package_config: Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -731,7 +719,9 @@ def test_create_required_params id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::MaxGroupTieredPackage::BillingMode, cadence: Orb::Price::MaxGroupTieredPackage::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::MaxGroupTieredPackage::ConversionRateConfig | nil, created_at: Time, @@ -742,7 +732,7 @@ def test_create_required_params fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, - max_group_tiered_package_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + max_group_tiered_package_config: Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -759,7 +749,9 @@ def test_create_required_params id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::ScalableMatrixWithUnitPricing::BillingMode, cadence: Orb::Price::ScalableMatrixWithUnitPricing::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::ScalableMatrixWithUnitPricing::ConversionRateConfig | nil, created_at: Time, @@ -779,7 +771,7 @@ def test_create_required_params plan_phase_order: Integer | nil, price_type: Orb::Price::ScalableMatrixWithUnitPricing::PriceType, replaces_price_id: String | nil, - scalable_matrix_with_unit_pricing_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + scalable_matrix_with_unit_pricing_config: Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -787,7 +779,9 @@ def test_create_required_params id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::ScalableMatrixWithTieredPricing::BillingMode, cadence: Orb::Price::ScalableMatrixWithTieredPricing::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::ScalableMatrixWithTieredPricing::ConversionRateConfig | nil, created_at: Time, @@ -807,7 +801,7 @@ def test_create_required_params plan_phase_order: Integer | nil, price_type: Orb::Price::ScalableMatrixWithTieredPricing::PriceType, replaces_price_id: String | nil, - scalable_matrix_with_tiered_pricing_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + scalable_matrix_with_tiered_pricing_config: Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -815,12 +809,14 @@ def test_create_required_params id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::CumulativeGroupedBulk::BillingMode, cadence: Orb::Price::CumulativeGroupedBulk::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::CumulativeGroupedBulk::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, - cumulative_grouped_bulk_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + cumulative_grouped_bulk_config: Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, @@ -839,20 +835,21 @@ def test_create_required_params dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :grouped_with_min_max_thresholds, + model_type: :minimum, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::GroupedWithMinMaxThresholds::Cadence, + billing_mode: Orb::Price::Minimum::BillingMode, + cadence: Orb::Price::Minimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Minimum::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_with_min_max_thresholds_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -860,67 +857,23 @@ def test_create_required_params metadata: ^(Orb::Internal::Type::HashOf[String]), minimum: Orb::Minimum | nil, minimum_amount: String | nil, + minimum_config: Orb::Price::Minimum::MinimumConfig, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::GroupedWithMinMaxThresholds::PriceType, + price_type: Orb::Price::Minimum::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } - end - end - end - - def test_update - response = @orb.prices.update("price_id") - - assert_pattern do - response => Orb::Price - end - - assert_pattern do - case response - in Orb::Price::Unit - in Orb::Price::Package - in Orb::Price::Matrix - in Orb::Price::Tiered - in Orb::Price::TieredBPS - in Orb::Price::BPS - in Orb::Price::BulkBPS - in Orb::Price::Bulk - in Orb::Price::ThresholdTotalAmount - in Orb::Price::TieredPackage - in Orb::Price::GroupedTiered - in Orb::Price::TieredWithMinimum - in Orb::Price::TieredPackageWithMinimum - in Orb::Price::PackageWithAllocation - in Orb::Price::UnitWithPercent - in Orb::Price::MatrixWithAllocation - in Orb::Price::TieredWithProration - in Orb::Price::UnitWithProration - in Orb::Price::GroupedAllocation - in Orb::Price::GroupedWithProratedMinimum - in Orb::Price::GroupedWithMeteredMinimum - in Orb::Price::MatrixWithDisplayName - in Orb::Price::BulkWithProration - in Orb::Price::GroupedTieredPackage - in Orb::Price::MaxGroupTieredPackage - in Orb::Price::ScalableMatrixWithUnitPricing - in Orb::Price::ScalableMatrixWithTieredPricing - in Orb::Price::CumulativeGroupedBulk - in Orb::Price::GroupedWithMinMaxThresholds - end - end - - assert_pattern do - case response in { - model_type: :unit, + model_type: :percent, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::Unit::Cadence, + billing_mode: Orb::Price::Percent::BillingMode, + cadence: Orb::Price::Percent::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Unit::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Percent::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -935,24 +888,27 @@ def test_update minimum: Orb::Minimum | nil, minimum_amount: String | nil, name: String, + percent_config: Orb::Price::Percent::PercentConfig, plan_phase_order: Integer | nil, - price_type: Orb::Price::Unit::PriceType, + price_type: Orb::Price::Percent::PriceType, replaces_price_id: String | nil, - unit_config: Orb::UnitConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :package, + model_type: :event_output, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::Package::Cadence, + billing_mode: Orb::Price::EventOutput::BillingMode, + cadence: Orb::Price::EventOutput::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Package::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::EventOutput::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, + event_output_config: Orb::Price::EventOutput::EventOutputConfig, external_price_id: String | nil, fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, @@ -963,20 +919,68 @@ def test_update minimum: Orb::Minimum | nil, minimum_amount: String | nil, name: String, - package_config: Orb::PackageConfig, plan_phase_order: Integer | nil, - price_type: Orb::Price::Package::PriceType, + price_type: Orb::Price::EventOutput::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } + end + end + end + + def test_update + response = @orb.prices.update("price_id") + + assert_pattern do + response => Orb::Price + end + + assert_pattern do + case response + in Orb::Price::Unit + in Orb::Price::Tiered + in Orb::Price::Bulk + in Orb::Price::Package + in Orb::Price::Matrix + in Orb::Price::ThresholdTotalAmount + in Orb::Price::TieredPackage + in Orb::Price::TieredWithMinimum + in Orb::Price::GroupedTiered + in Orb::Price::TieredPackageWithMinimum + in Orb::Price::PackageWithAllocation + in Orb::Price::UnitWithPercent + in Orb::Price::MatrixWithAllocation + in Orb::Price::TieredWithProration + in Orb::Price::UnitWithProration + in Orb::Price::GroupedAllocation + in Orb::Price::BulkWithProration + in Orb::Price::GroupedWithProratedMinimum + in Orb::Price::GroupedWithMeteredMinimum + in Orb::Price::GroupedWithMinMaxThresholds + in Orb::Price::MatrixWithDisplayName + in Orb::Price::GroupedTieredPackage + in Orb::Price::MaxGroupTieredPackage + in Orb::Price::ScalableMatrixWithUnitPricing + in Orb::Price::ScalableMatrixWithTieredPricing + in Orb::Price::CumulativeGroupedBulk + in Orb::Price::Minimum + in Orb::Price::Percent + in Orb::Price::EventOutput + end + end + + assert_pattern do + case response in { - model_type: :matrix, + model_type: :unit, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::Matrix::Cadence, + billing_mode: Orb::Price::Unit::BillingMode, + cadence: Orb::Price::Unit::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Matrix::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Unit::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -985,7 +989,6 @@ def test_update fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, - matrix_config: Orb::MatrixConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -993,8 +996,9 @@ def test_update minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::Matrix::PriceType, + price_type: Orb::Price::Unit::PriceType, replaces_price_id: String | nil, + unit_config: Orb::UnitConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -1002,7 +1006,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::Tiered::BillingMode, cadence: Orb::Price::Tiered::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::Tiered::ConversionRateConfig | nil, created_at: Time, @@ -1026,42 +1032,16 @@ def test_update dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :tiered_bps, - id: String, - billable_metric: Orb::BillableMetricTiny | nil, - billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::TieredBPS::Cadence, - conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::TieredBPS::ConversionRateConfig | nil, - created_at: Time, - credit_allocation: Orb::Allocation | nil, - currency: String, - discount: Orb::Discount | nil, - external_price_id: String | nil, - fixed_price_quantity: Float | nil, - invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, - item: Orb::ItemSlim, - maximum: Orb::Maximum | nil, - maximum_amount: String | nil, - metadata: ^(Orb::Internal::Type::HashOf[String]), - minimum: Orb::Minimum | nil, - minimum_amount: String | nil, - name: String, - plan_phase_order: Integer | nil, - price_type: Orb::Price::TieredBPS::PriceType, - replaces_price_id: String | nil, - tiered_bps_config: Orb::TieredBPSConfig, - dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil - } - in { - model_type: :bps, + model_type: :bulk, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bps_config: Orb::BPSConfig, - cadence: Orb::Price::BPS::Cadence, + billing_mode: Orb::Price::Bulk::BillingMode, + bulk_config: Orb::BulkConfig, + cadence: Orb::Price::Bulk::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::BPS::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Bulk::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -1077,19 +1057,20 @@ def test_update minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::BPS::PriceType, + price_type: Orb::Price::Bulk::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :bulk_bps, + model_type: :package, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::Price::BulkBPS::Cadence, + billing_mode: Orb::Price::Package::BillingMode, + cadence: Orb::Price::Package::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::BulkBPS::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Package::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -1104,20 +1085,22 @@ def test_update minimum: Orb::Minimum | nil, minimum_amount: String | nil, name: String, + package_config: Orb::PackageConfig, plan_phase_order: Integer | nil, - price_type: Orb::Price::BulkBPS::PriceType, + price_type: Orb::Price::Package::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :bulk, + model_type: :matrix, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_config: Orb::BulkConfig, - cadence: Orb::Price::Bulk::Cadence, + billing_mode: Orb::Price::Matrix::BillingMode, + cadence: Orb::Price::Matrix::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Bulk::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Matrix::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -1126,6 +1109,7 @@ def test_update fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, + matrix_config: Orb::MatrixConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -1133,7 +1117,7 @@ def test_update minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::Bulk::PriceType, + price_type: Orb::Price::Matrix::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } @@ -1142,7 +1126,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::ThresholdTotalAmount::BillingMode, cadence: Orb::Price::ThresholdTotalAmount::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::ThresholdTotalAmount::ConversionRateConfig | nil, created_at: Time, @@ -1162,7 +1148,7 @@ def test_update plan_phase_order: Integer | nil, price_type: Orb::Price::ThresholdTotalAmount::PriceType, replaces_price_id: String | nil, - threshold_total_amount_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + threshold_total_amount_config: Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -1170,7 +1156,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::TieredPackage::BillingMode, cadence: Orb::Price::TieredPackage::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::TieredPackage::ConversionRateConfig | nil, created_at: Time, @@ -1190,24 +1178,25 @@ def test_update plan_phase_order: Integer | nil, price_type: Orb::Price::TieredPackage::PriceType, replaces_price_id: String | nil, - tiered_package_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + tiered_package_config: Orb::Price::TieredPackage::TieredPackageConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :grouped_tiered, + model_type: :tiered_with_minimum, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::GroupedTiered::Cadence, + billing_mode: Orb::Price::TieredWithMinimum::BillingMode, + cadence: Orb::Price::TieredWithMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::GroupedTiered::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::TieredWithMinimum::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_tiered_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -1217,24 +1206,28 @@ def test_update minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::GroupedTiered::PriceType, + price_type: Orb::Price::TieredWithMinimum::PriceType, replaces_price_id: String | nil, + tiered_with_minimum_config: Orb::Price::TieredWithMinimum::TieredWithMinimumConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :tiered_with_minimum, + model_type: :grouped_tiered, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::TieredWithMinimum::Cadence, + billing_mode: Orb::Price::GroupedTiered::BillingMode, + cadence: Orb::Price::GroupedTiered::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::TieredWithMinimum::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::GroupedTiered::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, + grouped_tiered_config: Orb::Price::GroupedTiered::GroupedTieredConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -1244,9 +1237,8 @@ def test_update minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::TieredWithMinimum::PriceType, + price_type: Orb::Price::GroupedTiered::PriceType, replaces_price_id: String | nil, - tiered_with_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -1254,7 +1246,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::TieredPackageWithMinimum::BillingMode, cadence: Orb::Price::TieredPackageWithMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::TieredPackageWithMinimum::ConversionRateConfig | nil, created_at: Time, @@ -1274,7 +1268,7 @@ def test_update plan_phase_order: Integer | nil, price_type: Orb::Price::TieredPackageWithMinimum::PriceType, replaces_price_id: String | nil, - tiered_package_with_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + tiered_package_with_minimum_config: Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -1282,7 +1276,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::PackageWithAllocation::BillingMode, cadence: Orb::Price::PackageWithAllocation::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::PackageWithAllocation::ConversionRateConfig | nil, created_at: Time, @@ -1299,7 +1295,7 @@ def test_update minimum: Orb::Minimum | nil, minimum_amount: String | nil, name: String, - package_with_allocation_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + package_with_allocation_config: Orb::Price::PackageWithAllocation::PackageWithAllocationConfig, plan_phase_order: Integer | nil, price_type: Orb::Price::PackageWithAllocation::PriceType, replaces_price_id: String | nil, @@ -1310,7 +1306,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::UnitWithPercent::BillingMode, cadence: Orb::Price::UnitWithPercent::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::UnitWithPercent::ConversionRateConfig | nil, created_at: Time, @@ -1330,7 +1328,7 @@ def test_update plan_phase_order: Integer | nil, price_type: Orb::Price::UnitWithPercent::PriceType, replaces_price_id: String | nil, - unit_with_percent_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + unit_with_percent_config: Orb::Price::UnitWithPercent::UnitWithPercentConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -1338,7 +1336,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::MatrixWithAllocation::BillingMode, cadence: Orb::Price::MatrixWithAllocation::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::MatrixWithAllocation::ConversionRateConfig | nil, created_at: Time, @@ -1366,7 +1366,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::TieredWithProration::BillingMode, cadence: Orb::Price::TieredWithProration::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::TieredWithProration::ConversionRateConfig | nil, created_at: Time, @@ -1386,7 +1388,7 @@ def test_update plan_phase_order: Integer | nil, price_type: Orb::Price::TieredWithProration::PriceType, replaces_price_id: String | nil, - tiered_with_proration_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + tiered_with_proration_config: Orb::Price::TieredWithProration::TieredWithProrationConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -1394,7 +1396,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::UnitWithProration::BillingMode, cadence: Orb::Price::UnitWithProration::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::UnitWithProration::ConversionRateConfig | nil, created_at: Time, @@ -1414,24 +1418,56 @@ def test_update plan_phase_order: Integer | nil, price_type: Orb::Price::UnitWithProration::PriceType, replaces_price_id: String | nil, - unit_with_proration_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + unit_with_proration_config: Orb::Price::UnitWithProration::UnitWithProrationConfig, + dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil + } + in { + model_type: :grouped_allocation, + id: String, + billable_metric: Orb::BillableMetricTiny | nil, + billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::GroupedAllocation::BillingMode, + cadence: Orb::Price::GroupedAllocation::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, + conversion_rate: Float | nil, + conversion_rate_config: Orb::Price::GroupedAllocation::ConversionRateConfig | nil, + created_at: Time, + credit_allocation: Orb::Allocation | nil, + currency: String, + discount: Orb::Discount | nil, + external_price_id: String | nil, + fixed_price_quantity: Float | nil, + grouped_allocation_config: Orb::Price::GroupedAllocation::GroupedAllocationConfig, + invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, + item: Orb::ItemSlim, + maximum: Orb::Maximum | nil, + maximum_amount: String | nil, + metadata: ^(Orb::Internal::Type::HashOf[String]), + minimum: Orb::Minimum | nil, + minimum_amount: String | nil, + name: String, + plan_phase_order: Integer | nil, + price_type: Orb::Price::GroupedAllocation::PriceType, + replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :grouped_allocation, + model_type: :bulk_with_proration, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::GroupedAllocation::Cadence, + billing_mode: Orb::Price::BulkWithProration::BillingMode, + bulk_with_proration_config: Orb::Price::BulkWithProration::BulkWithProrationConfig, + cadence: Orb::Price::BulkWithProration::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::GroupedAllocation::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::BulkWithProration::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_allocation_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -1441,7 +1477,7 @@ def test_update minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::GroupedAllocation::PriceType, + price_type: Orb::Price::BulkWithProration::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } @@ -1450,7 +1486,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::GroupedWithProratedMinimum::BillingMode, cadence: Orb::Price::GroupedWithProratedMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::GroupedWithProratedMinimum::ConversionRateConfig | nil, created_at: Time, @@ -1459,7 +1497,7 @@ def test_update discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_with_prorated_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_with_prorated_minimum_config: Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -1478,7 +1516,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::GroupedWithMeteredMinimum::BillingMode, cadence: Orb::Price::GroupedWithMeteredMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::GroupedWithMeteredMinimum::ConversionRateConfig | nil, created_at: Time, @@ -1487,7 +1527,7 @@ def test_update discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_with_metered_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_with_metered_minimum_config: Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -1502,22 +1542,24 @@ def test_update dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :matrix_with_display_name, + model_type: :grouped_with_min_max_thresholds, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::MatrixWithDisplayName::Cadence, + billing_mode: Orb::Price::GroupedWithMinMaxThresholds::BillingMode, + cadence: Orb::Price::GroupedWithMinMaxThresholds::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::MatrixWithDisplayName::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, + grouped_with_min_max_thresholds_config: Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, - matrix_with_display_name_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -1525,19 +1567,20 @@ def test_update minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::MatrixWithDisplayName::PriceType, + price_type: Orb::Price::GroupedWithMinMaxThresholds::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :bulk_with_proration, + model_type: :matrix_with_display_name, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_with_proration_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), - cadence: Orb::Price::BulkWithProration::Cadence, + billing_mode: Orb::Price::MatrixWithDisplayName::BillingMode, + cadence: Orb::Price::MatrixWithDisplayName::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::BulkWithProration::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::MatrixWithDisplayName::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -1546,6 +1589,7 @@ def test_update fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, + matrix_with_display_name_config: Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -1553,7 +1597,7 @@ def test_update minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::BulkWithProration::PriceType, + price_type: Orb::Price::MatrixWithDisplayName::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } @@ -1562,7 +1606,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::GroupedTieredPackage::BillingMode, cadence: Orb::Price::GroupedTieredPackage::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::GroupedTieredPackage::ConversionRateConfig | nil, created_at: Time, @@ -1571,7 +1617,7 @@ def test_update discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_tiered_package_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_tiered_package_config: Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -1590,7 +1636,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::MaxGroupTieredPackage::BillingMode, cadence: Orb::Price::MaxGroupTieredPackage::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::MaxGroupTieredPackage::ConversionRateConfig | nil, created_at: Time, @@ -1601,7 +1649,7 @@ def test_update fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, - max_group_tiered_package_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + max_group_tiered_package_config: Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -1618,7 +1666,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::ScalableMatrixWithUnitPricing::BillingMode, cadence: Orb::Price::ScalableMatrixWithUnitPricing::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::ScalableMatrixWithUnitPricing::ConversionRateConfig | nil, created_at: Time, @@ -1638,7 +1688,7 @@ def test_update plan_phase_order: Integer | nil, price_type: Orb::Price::ScalableMatrixWithUnitPricing::PriceType, replaces_price_id: String | nil, - scalable_matrix_with_unit_pricing_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + scalable_matrix_with_unit_pricing_config: Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -1646,7 +1696,9 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::ScalableMatrixWithTieredPricing::BillingMode, cadence: Orb::Price::ScalableMatrixWithTieredPricing::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::ScalableMatrixWithTieredPricing::ConversionRateConfig | nil, created_at: Time, @@ -1666,7 +1718,7 @@ def test_update plan_phase_order: Integer | nil, price_type: Orb::Price::ScalableMatrixWithTieredPricing::PriceType, replaces_price_id: String | nil, - scalable_matrix_with_tiered_pricing_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + scalable_matrix_with_tiered_pricing_config: Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -1674,12 +1726,14 @@ def test_update id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::CumulativeGroupedBulk::BillingMode, cadence: Orb::Price::CumulativeGroupedBulk::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::CumulativeGroupedBulk::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, - cumulative_grouped_bulk_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + cumulative_grouped_bulk_config: Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, @@ -1698,20 +1752,21 @@ def test_update dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :grouped_with_min_max_thresholds, + model_type: :minimum, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::GroupedWithMinMaxThresholds::Cadence, + billing_mode: Orb::Price::Minimum::BillingMode, + cadence: Orb::Price::Minimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Minimum::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_with_min_max_thresholds_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -1719,9 +1774,70 @@ def test_update metadata: ^(Orb::Internal::Type::HashOf[String]), minimum: Orb::Minimum | nil, minimum_amount: String | nil, + minimum_config: Orb::Price::Minimum::MinimumConfig, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::GroupedWithMinMaxThresholds::PriceType, + price_type: Orb::Price::Minimum::PriceType, + replaces_price_id: String | nil, + dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil + } + in { + model_type: :percent, + id: String, + billable_metric: Orb::BillableMetricTiny | nil, + billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::Percent::BillingMode, + cadence: Orb::Price::Percent::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, + conversion_rate: Float | nil, + conversion_rate_config: Orb::Price::Percent::ConversionRateConfig | nil, + created_at: Time, + credit_allocation: Orb::Allocation | nil, + currency: String, + discount: Orb::Discount | nil, + external_price_id: String | nil, + fixed_price_quantity: Float | nil, + invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, + item: Orb::ItemSlim, + maximum: Orb::Maximum | nil, + maximum_amount: String | nil, + metadata: ^(Orb::Internal::Type::HashOf[String]), + minimum: Orb::Minimum | nil, + minimum_amount: String | nil, + name: String, + percent_config: Orb::Price::Percent::PercentConfig, + plan_phase_order: Integer | nil, + price_type: Orb::Price::Percent::PriceType, + replaces_price_id: String | nil, + dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil + } + in { + model_type: :event_output, + id: String, + billable_metric: Orb::BillableMetricTiny | nil, + billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::EventOutput::BillingMode, + cadence: Orb::Price::EventOutput::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, + conversion_rate: Float | nil, + conversion_rate_config: Orb::Price::EventOutput::ConversionRateConfig | nil, + created_at: Time, + credit_allocation: Orb::Allocation | nil, + currency: String, + discount: Orb::Discount | nil, + event_output_config: Orb::Price::EventOutput::EventOutputConfig, + external_price_id: String | nil, + fixed_price_quantity: Float | nil, + invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, + item: Orb::ItemSlim, + maximum: Orb::Maximum | nil, + maximum_amount: String | nil, + metadata: ^(Orb::Internal::Type::HashOf[String]), + minimum: Orb::Minimum | nil, + minimum_amount: String | nil, + name: String, + plan_phase_order: Integer | nil, + price_type: Orb::Price::EventOutput::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } @@ -1746,17 +1862,14 @@ def test_list assert_pattern do case row in Orb::Price::Unit - in Orb::Price::Package - in Orb::Price::Matrix in Orb::Price::Tiered - in Orb::Price::TieredBPS - in Orb::Price::BPS - in Orb::Price::BulkBPS in Orb::Price::Bulk + in Orb::Price::Package + in Orb::Price::Matrix in Orb::Price::ThresholdTotalAmount in Orb::Price::TieredPackage - in Orb::Price::GroupedTiered in Orb::Price::TieredWithMinimum + in Orb::Price::GroupedTiered in Orb::Price::TieredPackageWithMinimum in Orb::Price::PackageWithAllocation in Orb::Price::UnitWithPercent @@ -1764,16 +1877,19 @@ def test_list in Orb::Price::TieredWithProration in Orb::Price::UnitWithProration in Orb::Price::GroupedAllocation + in Orb::Price::BulkWithProration in Orb::Price::GroupedWithProratedMinimum in Orb::Price::GroupedWithMeteredMinimum + in Orb::Price::GroupedWithMinMaxThresholds in Orb::Price::MatrixWithDisplayName - in Orb::Price::BulkWithProration in Orb::Price::GroupedTieredPackage in Orb::Price::MaxGroupTieredPackage in Orb::Price::ScalableMatrixWithUnitPricing in Orb::Price::ScalableMatrixWithTieredPricing in Orb::Price::CumulativeGroupedBulk - in Orb::Price::GroupedWithMinMaxThresholds + in Orb::Price::Minimum + in Orb::Price::Percent + in Orb::Price::EventOutput end end @@ -1784,7 +1900,9 @@ def test_list id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::Unit::BillingMode, cadence: Orb::Price::Unit::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::Unit::ConversionRateConfig | nil, created_at: Time, @@ -1808,13 +1926,15 @@ def test_list dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :package, + model_type: :tiered, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::Package::Cadence, + billing_mode: Orb::Price::Tiered::BillingMode, + cadence: Orb::Price::Tiered::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Package::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Tiered::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -1829,20 +1949,23 @@ def test_list minimum: Orb::Minimum | nil, minimum_amount: String | nil, name: String, - package_config: Orb::PackageConfig, plan_phase_order: Integer | nil, - price_type: Orb::Price::Package::PriceType, + price_type: Orb::Price::Tiered::PriceType, replaces_price_id: String | nil, + tiered_config: Orb::TieredConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :matrix, + model_type: :bulk, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::Matrix::Cadence, + billing_mode: Orb::Price::Bulk::BillingMode, + bulk_config: Orb::BulkConfig, + cadence: Orb::Price::Bulk::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Matrix::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Bulk::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -1851,7 +1974,6 @@ def test_list fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, - matrix_config: Orb::MatrixConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -1859,18 +1981,20 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::Matrix::PriceType, + price_type: Orb::Price::Bulk::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :tiered, + model_type: :package, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::Tiered::Cadence, + billing_mode: Orb::Price::Package::BillingMode, + cadence: Orb::Price::Package::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Tiered::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Package::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -1885,20 +2009,22 @@ def test_list minimum: Orb::Minimum | nil, minimum_amount: String | nil, name: String, + package_config: Orb::PackageConfig, plan_phase_order: Integer | nil, - price_type: Orb::Price::Tiered::PriceType, + price_type: Orb::Price::Package::PriceType, replaces_price_id: String | nil, - tiered_config: Orb::TieredConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :tiered_bps, + model_type: :matrix, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::TieredBPS::Cadence, + billing_mode: Orb::Price::Matrix::BillingMode, + cadence: Orb::Price::Matrix::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::TieredBPS::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Matrix::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -1907,6 +2033,7 @@ def test_list fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, + matrix_config: Orb::MatrixConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -1914,20 +2041,20 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::TieredBPS::PriceType, + price_type: Orb::Price::Matrix::PriceType, replaces_price_id: String | nil, - tiered_bps_config: Orb::TieredBPSConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :bps, + model_type: :threshold_total_amount, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bps_config: Orb::BPSConfig, - cadence: Orb::Price::BPS::Cadence, + billing_mode: Orb::Price::ThresholdTotalAmount::BillingMode, + cadence: Orb::Price::ThresholdTotalAmount::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::BPS::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::ThresholdTotalAmount::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -1943,19 +2070,21 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::BPS::PriceType, + price_type: Orb::Price::ThresholdTotalAmount::PriceType, replaces_price_id: String | nil, + threshold_total_amount_config: Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :bulk_bps, + model_type: :tiered_package, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::Price::BulkBPS::Cadence, + billing_mode: Orb::Price::TieredPackage::BillingMode, + cadence: Orb::Price::TieredPackage::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::BulkBPS::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::TieredPackage::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -1971,19 +2100,21 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::BulkBPS::PriceType, + price_type: Orb::Price::TieredPackage::PriceType, replaces_price_id: String | nil, + tiered_package_config: Orb::Price::TieredPackage::TieredPackageConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :bulk, + model_type: :tiered_with_minimum, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_config: Orb::BulkConfig, - cadence: Orb::Price::Bulk::Cadence, + billing_mode: Orb::Price::TieredWithMinimum::BillingMode, + cadence: Orb::Price::TieredWithMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Bulk::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::TieredWithMinimum::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -1999,24 +2130,28 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::Bulk::PriceType, + price_type: Orb::Price::TieredWithMinimum::PriceType, replaces_price_id: String | nil, + tiered_with_minimum_config: Orb::Price::TieredWithMinimum::TieredWithMinimumConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :threshold_total_amount, + model_type: :grouped_tiered, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::ThresholdTotalAmount::Cadence, + billing_mode: Orb::Price::GroupedTiered::BillingMode, + cadence: Orb::Price::GroupedTiered::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::ThresholdTotalAmount::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::GroupedTiered::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, + grouped_tiered_config: Orb::Price::GroupedTiered::GroupedTieredConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -2026,19 +2161,20 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::ThresholdTotalAmount::PriceType, + price_type: Orb::Price::GroupedTiered::PriceType, replaces_price_id: String | nil, - threshold_total_amount_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :tiered_package, + model_type: :tiered_package_with_minimum, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::TieredPackage::Cadence, + billing_mode: Orb::Price::TieredPackageWithMinimum::BillingMode, + cadence: Orb::Price::TieredPackageWithMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::TieredPackage::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::TieredPackageWithMinimum::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -2054,26 +2190,27 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::TieredPackage::PriceType, + price_type: Orb::Price::TieredPackageWithMinimum::PriceType, replaces_price_id: String | nil, - tiered_package_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + tiered_package_with_minimum_config: Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :grouped_tiered, + model_type: :package_with_allocation, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::GroupedTiered::Cadence, + billing_mode: Orb::Price::PackageWithAllocation::BillingMode, + cadence: Orb::Price::PackageWithAllocation::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::GroupedTiered::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::PackageWithAllocation::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_tiered_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -2082,19 +2219,22 @@ def test_list minimum: Orb::Minimum | nil, minimum_amount: String | nil, name: String, + package_with_allocation_config: Orb::Price::PackageWithAllocation::PackageWithAllocationConfig, plan_phase_order: Integer | nil, - price_type: Orb::Price::GroupedTiered::PriceType, + price_type: Orb::Price::PackageWithAllocation::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :tiered_with_minimum, + model_type: :unit_with_percent, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::TieredWithMinimum::Cadence, + billing_mode: Orb::Price::UnitWithPercent::BillingMode, + cadence: Orb::Price::UnitWithPercent::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::TieredWithMinimum::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::UnitWithPercent::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -2110,19 +2250,21 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::TieredWithMinimum::PriceType, + price_type: Orb::Price::UnitWithPercent::PriceType, replaces_price_id: String | nil, - tiered_with_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + unit_with_percent_config: Orb::Price::UnitWithPercent::UnitWithPercentConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :tiered_package_with_minimum, + model_type: :matrix_with_allocation, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::TieredPackageWithMinimum::Cadence, + billing_mode: Orb::Price::MatrixWithAllocation::BillingMode, + cadence: Orb::Price::MatrixWithAllocation::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::TieredPackageWithMinimum::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::MatrixWithAllocation::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -2131,6 +2273,7 @@ def test_list fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, + matrix_with_allocation_config: Orb::MatrixWithAllocationConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -2138,19 +2281,20 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::TieredPackageWithMinimum::PriceType, + price_type: Orb::Price::MatrixWithAllocation::PriceType, replaces_price_id: String | nil, - tiered_package_with_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :package_with_allocation, + model_type: :tiered_with_proration, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::PackageWithAllocation::Cadence, + billing_mode: Orb::Price::TieredWithProration::BillingMode, + cadence: Orb::Price::TieredWithProration::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::PackageWithAllocation::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::TieredWithProration::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -2165,20 +2309,22 @@ def test_list minimum: Orb::Minimum | nil, minimum_amount: String | nil, name: String, - package_with_allocation_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), plan_phase_order: Integer | nil, - price_type: Orb::Price::PackageWithAllocation::PriceType, + price_type: Orb::Price::TieredWithProration::PriceType, replaces_price_id: String | nil, + tiered_with_proration_config: Orb::Price::TieredWithProration::TieredWithProrationConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :unit_with_percent, + model_type: :unit_with_proration, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::UnitWithPercent::Cadence, + billing_mode: Orb::Price::UnitWithProration::BillingMode, + cadence: Orb::Price::UnitWithProration::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::UnitWithPercent::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::UnitWithProration::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -2194,28 +2340,30 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::UnitWithPercent::PriceType, + price_type: Orb::Price::UnitWithProration::PriceType, replaces_price_id: String | nil, - unit_with_percent_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + unit_with_proration_config: Orb::Price::UnitWithProration::UnitWithProrationConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :matrix_with_allocation, + model_type: :grouped_allocation, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::MatrixWithAllocation::Cadence, + billing_mode: Orb::Price::GroupedAllocation::BillingMode, + cadence: Orb::Price::GroupedAllocation::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::MatrixWithAllocation::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::GroupedAllocation::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, + grouped_allocation_config: Orb::Price::GroupedAllocation::GroupedAllocationConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, - matrix_with_allocation_config: Orb::MatrixWithAllocationConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -2223,18 +2371,21 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::MatrixWithAllocation::PriceType, + price_type: Orb::Price::GroupedAllocation::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :tiered_with_proration, + model_type: :bulk_with_proration, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::TieredWithProration::Cadence, + billing_mode: Orb::Price::BulkWithProration::BillingMode, + bulk_with_proration_config: Orb::Price::BulkWithProration::BulkWithProrationConfig, + cadence: Orb::Price::BulkWithProration::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::TieredWithProration::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::BulkWithProration::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -2250,25 +2401,27 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::TieredWithProration::PriceType, + price_type: Orb::Price::BulkWithProration::PriceType, replaces_price_id: String | nil, - tiered_with_proration_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :unit_with_proration, + model_type: :grouped_with_prorated_minimum, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::UnitWithProration::Cadence, + billing_mode: Orb::Price::GroupedWithProratedMinimum::BillingMode, + cadence: Orb::Price::GroupedWithProratedMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::UnitWithProration::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::GroupedWithProratedMinimum::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, + grouped_with_prorated_minimum_config: Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -2278,26 +2431,27 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::UnitWithProration::PriceType, + price_type: Orb::Price::GroupedWithProratedMinimum::PriceType, replaces_price_id: String | nil, - unit_with_proration_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :grouped_allocation, + model_type: :grouped_with_metered_minimum, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::GroupedAllocation::Cadence, + billing_mode: Orb::Price::GroupedWithMeteredMinimum::BillingMode, + cadence: Orb::Price::GroupedWithMeteredMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::GroupedAllocation::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::GroupedWithMeteredMinimum::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_allocation_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_with_metered_minimum_config: Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -2307,25 +2461,27 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::GroupedAllocation::PriceType, + price_type: Orb::Price::GroupedWithMeteredMinimum::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :grouped_with_prorated_minimum, + model_type: :grouped_with_min_max_thresholds, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::GroupedWithProratedMinimum::Cadence, + billing_mode: Orb::Price::GroupedWithMinMaxThresholds::BillingMode, + cadence: Orb::Price::GroupedWithMinMaxThresholds::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::GroupedWithProratedMinimum::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_with_prorated_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_with_min_max_thresholds_config: Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -2335,27 +2491,29 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::GroupedWithProratedMinimum::PriceType, + price_type: Orb::Price::GroupedWithMinMaxThresholds::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :grouped_with_metered_minimum, + model_type: :matrix_with_display_name, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::GroupedWithMeteredMinimum::Cadence, + billing_mode: Orb::Price::MatrixWithDisplayName::BillingMode, + cadence: Orb::Price::MatrixWithDisplayName::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::GroupedWithMeteredMinimum::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::MatrixWithDisplayName::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_with_metered_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, + matrix_with_display_name_config: Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -2363,27 +2521,29 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::GroupedWithMeteredMinimum::PriceType, + price_type: Orb::Price::MatrixWithDisplayName::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :matrix_with_display_name, + model_type: :grouped_tiered_package, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::MatrixWithDisplayName::Cadence, + billing_mode: Orb::Price::GroupedTieredPackage::BillingMode, + cadence: Orb::Price::GroupedTieredPackage::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::MatrixWithDisplayName::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::GroupedTieredPackage::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, + grouped_tiered_package_config: Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, - matrix_with_display_name_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -2391,19 +2551,20 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::MatrixWithDisplayName::PriceType, + price_type: Orb::Price::GroupedTieredPackage::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :bulk_with_proration, + model_type: :max_group_tiered_package, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_with_proration_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), - cadence: Orb::Price::BulkWithProration::Cadence, + billing_mode: Orb::Price::MaxGroupTieredPackage::BillingMode, + cadence: Orb::Price::MaxGroupTieredPackage::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::BulkWithProration::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::MaxGroupTieredPackage::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -2412,6 +2573,7 @@ def test_list fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, + max_group_tiered_package_config: Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -2419,25 +2581,26 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::BulkWithProration::PriceType, + price_type: Orb::Price::MaxGroupTieredPackage::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :grouped_tiered_package, + model_type: :scalable_matrix_with_unit_pricing, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::GroupedTieredPackage::Cadence, + billing_mode: Orb::Price::ScalableMatrixWithUnitPricing::BillingMode, + cadence: Orb::Price::ScalableMatrixWithUnitPricing::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::GroupedTieredPackage::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::ScalableMatrixWithUnitPricing::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_tiered_package_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -2447,18 +2610,21 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::GroupedTieredPackage::PriceType, + price_type: Orb::Price::ScalableMatrixWithUnitPricing::PriceType, replaces_price_id: String | nil, + scalable_matrix_with_unit_pricing_config: Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :max_group_tiered_package, + model_type: :scalable_matrix_with_tiered_pricing, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::MaxGroupTieredPackage::Cadence, + billing_mode: Orb::Price::ScalableMatrixWithTieredPricing::BillingMode, + cadence: Orb::Price::ScalableMatrixWithTieredPricing::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::MaxGroupTieredPackage::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::ScalableMatrixWithTieredPricing::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -2467,7 +2633,6 @@ def test_list fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, - max_group_tiered_package_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -2475,20 +2640,24 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::MaxGroupTieredPackage::PriceType, + price_type: Orb::Price::ScalableMatrixWithTieredPricing::PriceType, replaces_price_id: String | nil, + scalable_matrix_with_tiered_pricing_config: Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :scalable_matrix_with_unit_pricing, + model_type: :cumulative_grouped_bulk, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::ScalableMatrixWithUnitPricing::Cadence, + billing_mode: Orb::Price::CumulativeGroupedBulk::BillingMode, + cadence: Orb::Price::CumulativeGroupedBulk::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::ScalableMatrixWithUnitPricing::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::CumulativeGroupedBulk::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, + cumulative_grouped_bulk_config: Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, @@ -2502,19 +2671,20 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::ScalableMatrixWithUnitPricing::PriceType, + price_type: Orb::Price::CumulativeGroupedBulk::PriceType, replaces_price_id: String | nil, - scalable_matrix_with_unit_pricing_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :scalable_matrix_with_tiered_pricing, + model_type: :minimum, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::ScalableMatrixWithTieredPricing::Cadence, + billing_mode: Orb::Price::Minimum::BillingMode, + cadence: Orb::Price::Minimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::ScalableMatrixWithTieredPricing::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Minimum::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -2528,24 +2698,25 @@ def test_list metadata: ^(Orb::Internal::Type::HashOf[String]), minimum: Orb::Minimum | nil, minimum_amount: String | nil, + minimum_config: Orb::Price::Minimum::MinimumConfig, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::ScalableMatrixWithTieredPricing::PriceType, + price_type: Orb::Price::Minimum::PriceType, replaces_price_id: String | nil, - scalable_matrix_with_tiered_pricing_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :cumulative_grouped_bulk, + model_type: :percent, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::CumulativeGroupedBulk::Cadence, + billing_mode: Orb::Price::Percent::BillingMode, + cadence: Orb::Price::Percent::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::CumulativeGroupedBulk::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Percent::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, - cumulative_grouped_bulk_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, @@ -2558,26 +2729,29 @@ def test_list minimum: Orb::Minimum | nil, minimum_amount: String | nil, name: String, + percent_config: Orb::Price::Percent::PercentConfig, plan_phase_order: Integer | nil, - price_type: Orb::Price::CumulativeGroupedBulk::PriceType, + price_type: Orb::Price::Percent::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :grouped_with_min_max_thresholds, + model_type: :event_output, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::GroupedWithMinMaxThresholds::Cadence, + billing_mode: Orb::Price::EventOutput::BillingMode, + cadence: Orb::Price::EventOutput::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::EventOutput::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, + event_output_config: Orb::Price::EventOutput::EventOutputConfig, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_with_min_max_thresholds_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -2587,7 +2761,7 @@ def test_list minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::GroupedWithMinMaxThresholds::PriceType, + price_type: Orb::Price::EventOutput::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } @@ -2660,17 +2834,14 @@ def test_fetch assert_pattern do case response in Orb::Price::Unit - in Orb::Price::Package - in Orb::Price::Matrix in Orb::Price::Tiered - in Orb::Price::TieredBPS - in Orb::Price::BPS - in Orb::Price::BulkBPS in Orb::Price::Bulk + in Orb::Price::Package + in Orb::Price::Matrix in Orb::Price::ThresholdTotalAmount in Orb::Price::TieredPackage - in Orb::Price::GroupedTiered in Orb::Price::TieredWithMinimum + in Orb::Price::GroupedTiered in Orb::Price::TieredPackageWithMinimum in Orb::Price::PackageWithAllocation in Orb::Price::UnitWithPercent @@ -2678,16 +2849,19 @@ def test_fetch in Orb::Price::TieredWithProration in Orb::Price::UnitWithProration in Orb::Price::GroupedAllocation + in Orb::Price::BulkWithProration in Orb::Price::GroupedWithProratedMinimum in Orb::Price::GroupedWithMeteredMinimum + in Orb::Price::GroupedWithMinMaxThresholds in Orb::Price::MatrixWithDisplayName - in Orb::Price::BulkWithProration in Orb::Price::GroupedTieredPackage in Orb::Price::MaxGroupTieredPackage in Orb::Price::ScalableMatrixWithUnitPricing in Orb::Price::ScalableMatrixWithTieredPricing in Orb::Price::CumulativeGroupedBulk - in Orb::Price::GroupedWithMinMaxThresholds + in Orb::Price::Minimum + in Orb::Price::Percent + in Orb::Price::EventOutput end end @@ -2698,7 +2872,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::Unit::BillingMode, cadence: Orb::Price::Unit::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::Unit::ConversionRateConfig | nil, created_at: Time, @@ -2721,68 +2897,14 @@ def test_fetch unit_config: Orb::UnitConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } - in { - model_type: :package, - id: String, - billable_metric: Orb::BillableMetricTiny | nil, - billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::Package::Cadence, - conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Package::ConversionRateConfig | nil, - created_at: Time, - credit_allocation: Orb::Allocation | nil, - currency: String, - discount: Orb::Discount | nil, - external_price_id: String | nil, - fixed_price_quantity: Float | nil, - invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, - item: Orb::ItemSlim, - maximum: Orb::Maximum | nil, - maximum_amount: String | nil, - metadata: ^(Orb::Internal::Type::HashOf[String]), - minimum: Orb::Minimum | nil, - minimum_amount: String | nil, - name: String, - package_config: Orb::PackageConfig, - plan_phase_order: Integer | nil, - price_type: Orb::Price::Package::PriceType, - replaces_price_id: String | nil, - dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil - } - in { - model_type: :matrix, - id: String, - billable_metric: Orb::BillableMetricTiny | nil, - billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::Matrix::Cadence, - conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Matrix::ConversionRateConfig | nil, - created_at: Time, - credit_allocation: Orb::Allocation | nil, - currency: String, - discount: Orb::Discount | nil, - external_price_id: String | nil, - fixed_price_quantity: Float | nil, - invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, - item: Orb::ItemSlim, - matrix_config: Orb::MatrixConfig, - maximum: Orb::Maximum | nil, - maximum_amount: String | nil, - metadata: ^(Orb::Internal::Type::HashOf[String]), - minimum: Orb::Minimum | nil, - minimum_amount: String | nil, - name: String, - plan_phase_order: Integer | nil, - price_type: Orb::Price::Matrix::PriceType, - replaces_price_id: String | nil, - dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil - } in { model_type: :tiered, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::Tiered::BillingMode, cadence: Orb::Price::Tiered::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::Tiered::ConversionRateConfig | nil, created_at: Time, @@ -2806,42 +2928,16 @@ def test_fetch dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :tiered_bps, - id: String, - billable_metric: Orb::BillableMetricTiny | nil, - billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::TieredBPS::Cadence, - conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::TieredBPS::ConversionRateConfig | nil, - created_at: Time, - credit_allocation: Orb::Allocation | nil, - currency: String, - discount: Orb::Discount | nil, - external_price_id: String | nil, - fixed_price_quantity: Float | nil, - invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, - item: Orb::ItemSlim, - maximum: Orb::Maximum | nil, - maximum_amount: String | nil, - metadata: ^(Orb::Internal::Type::HashOf[String]), - minimum: Orb::Minimum | nil, - minimum_amount: String | nil, - name: String, - plan_phase_order: Integer | nil, - price_type: Orb::Price::TieredBPS::PriceType, - replaces_price_id: String | nil, - tiered_bps_config: Orb::TieredBPSConfig, - dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil - } - in { - model_type: :bps, + model_type: :bulk, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bps_config: Orb::BPSConfig, - cadence: Orb::Price::BPS::Cadence, + billing_mode: Orb::Price::Bulk::BillingMode, + bulk_config: Orb::BulkConfig, + cadence: Orb::Price::Bulk::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::BPS::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Bulk::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -2857,19 +2953,20 @@ def test_fetch minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::BPS::PriceType, + price_type: Orb::Price::Bulk::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :bulk_bps, + model_type: :package, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::Price::BulkBPS::Cadence, + billing_mode: Orb::Price::Package::BillingMode, + cadence: Orb::Price::Package::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::BulkBPS::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Package::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -2884,20 +2981,22 @@ def test_fetch minimum: Orb::Minimum | nil, minimum_amount: String | nil, name: String, + package_config: Orb::PackageConfig, plan_phase_order: Integer | nil, - price_type: Orb::Price::BulkBPS::PriceType, + price_type: Orb::Price::Package::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :bulk, + model_type: :matrix, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_config: Orb::BulkConfig, - cadence: Orb::Price::Bulk::Cadence, + billing_mode: Orb::Price::Matrix::BillingMode, + cadence: Orb::Price::Matrix::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::Bulk::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Matrix::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -2906,6 +3005,7 @@ def test_fetch fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, + matrix_config: Orb::MatrixConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -2913,7 +3013,7 @@ def test_fetch minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::Bulk::PriceType, + price_type: Orb::Price::Matrix::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } @@ -2922,7 +3022,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::ThresholdTotalAmount::BillingMode, cadence: Orb::Price::ThresholdTotalAmount::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::ThresholdTotalAmount::ConversionRateConfig | nil, created_at: Time, @@ -2942,7 +3044,7 @@ def test_fetch plan_phase_order: Integer | nil, price_type: Orb::Price::ThresholdTotalAmount::PriceType, replaces_price_id: String | nil, - threshold_total_amount_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + threshold_total_amount_config: Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -2950,7 +3052,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::TieredPackage::BillingMode, cadence: Orb::Price::TieredPackage::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::TieredPackage::ConversionRateConfig | nil, created_at: Time, @@ -2970,24 +3074,25 @@ def test_fetch plan_phase_order: Integer | nil, price_type: Orb::Price::TieredPackage::PriceType, replaces_price_id: String | nil, - tiered_package_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + tiered_package_config: Orb::Price::TieredPackage::TieredPackageConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :grouped_tiered, + model_type: :tiered_with_minimum, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::GroupedTiered::Cadence, + billing_mode: Orb::Price::TieredWithMinimum::BillingMode, + cadence: Orb::Price::TieredWithMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::GroupedTiered::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::TieredWithMinimum::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_tiered_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -2997,24 +3102,28 @@ def test_fetch minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::GroupedTiered::PriceType, + price_type: Orb::Price::TieredWithMinimum::PriceType, replaces_price_id: String | nil, + tiered_with_minimum_config: Orb::Price::TieredWithMinimum::TieredWithMinimumConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :tiered_with_minimum, + model_type: :grouped_tiered, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::TieredWithMinimum::Cadence, + billing_mode: Orb::Price::GroupedTiered::BillingMode, + cadence: Orb::Price::GroupedTiered::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::TieredWithMinimum::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::GroupedTiered::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, + grouped_tiered_config: Orb::Price::GroupedTiered::GroupedTieredConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -3024,9 +3133,8 @@ def test_fetch minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::TieredWithMinimum::PriceType, + price_type: Orb::Price::GroupedTiered::PriceType, replaces_price_id: String | nil, - tiered_with_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -3034,7 +3142,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::TieredPackageWithMinimum::BillingMode, cadence: Orb::Price::TieredPackageWithMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::TieredPackageWithMinimum::ConversionRateConfig | nil, created_at: Time, @@ -3054,7 +3164,7 @@ def test_fetch plan_phase_order: Integer | nil, price_type: Orb::Price::TieredPackageWithMinimum::PriceType, replaces_price_id: String | nil, - tiered_package_with_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + tiered_package_with_minimum_config: Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -3062,7 +3172,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::PackageWithAllocation::BillingMode, cadence: Orb::Price::PackageWithAllocation::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::PackageWithAllocation::ConversionRateConfig | nil, created_at: Time, @@ -3079,7 +3191,7 @@ def test_fetch minimum: Orb::Minimum | nil, minimum_amount: String | nil, name: String, - package_with_allocation_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + package_with_allocation_config: Orb::Price::PackageWithAllocation::PackageWithAllocationConfig, plan_phase_order: Integer | nil, price_type: Orb::Price::PackageWithAllocation::PriceType, replaces_price_id: String | nil, @@ -3090,7 +3202,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::UnitWithPercent::BillingMode, cadence: Orb::Price::UnitWithPercent::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::UnitWithPercent::ConversionRateConfig | nil, created_at: Time, @@ -3110,7 +3224,7 @@ def test_fetch plan_phase_order: Integer | nil, price_type: Orb::Price::UnitWithPercent::PriceType, replaces_price_id: String | nil, - unit_with_percent_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + unit_with_percent_config: Orb::Price::UnitWithPercent::UnitWithPercentConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -3118,7 +3232,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::MatrixWithAllocation::BillingMode, cadence: Orb::Price::MatrixWithAllocation::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::MatrixWithAllocation::ConversionRateConfig | nil, created_at: Time, @@ -3146,7 +3262,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::TieredWithProration::BillingMode, cadence: Orb::Price::TieredWithProration::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::TieredWithProration::ConversionRateConfig | nil, created_at: Time, @@ -3166,7 +3284,7 @@ def test_fetch plan_phase_order: Integer | nil, price_type: Orb::Price::TieredWithProration::PriceType, replaces_price_id: String | nil, - tiered_with_proration_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + tiered_with_proration_config: Orb::Price::TieredWithProration::TieredWithProrationConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -3174,7 +3292,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::UnitWithProration::BillingMode, cadence: Orb::Price::UnitWithProration::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::UnitWithProration::ConversionRateConfig | nil, created_at: Time, @@ -3194,7 +3314,7 @@ def test_fetch plan_phase_order: Integer | nil, price_type: Orb::Price::UnitWithProration::PriceType, replaces_price_id: String | nil, - unit_with_proration_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + unit_with_proration_config: Orb::Price::UnitWithProration::UnitWithProrationConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -3202,7 +3322,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::GroupedAllocation::BillingMode, cadence: Orb::Price::GroupedAllocation::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::GroupedAllocation::ConversionRateConfig | nil, created_at: Time, @@ -3211,7 +3333,7 @@ def test_fetch discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_allocation_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_allocation_config: Orb::Price::GroupedAllocation::GroupedAllocationConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -3225,12 +3347,44 @@ def test_fetch replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } + in { + model_type: :bulk_with_proration, + id: String, + billable_metric: Orb::BillableMetricTiny | nil, + billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::BulkWithProration::BillingMode, + bulk_with_proration_config: Orb::Price::BulkWithProration::BulkWithProrationConfig, + cadence: Orb::Price::BulkWithProration::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, + conversion_rate: Float | nil, + conversion_rate_config: Orb::Price::BulkWithProration::ConversionRateConfig | nil, + created_at: Time, + credit_allocation: Orb::Allocation | nil, + currency: String, + discount: Orb::Discount | nil, + external_price_id: String | nil, + fixed_price_quantity: Float | nil, + invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, + item: Orb::ItemSlim, + maximum: Orb::Maximum | nil, + maximum_amount: String | nil, + metadata: ^(Orb::Internal::Type::HashOf[String]), + minimum: Orb::Minimum | nil, + minimum_amount: String | nil, + name: String, + plan_phase_order: Integer | nil, + price_type: Orb::Price::BulkWithProration::PriceType, + replaces_price_id: String | nil, + dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil + } in { model_type: :grouped_with_prorated_minimum, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::GroupedWithProratedMinimum::BillingMode, cadence: Orb::Price::GroupedWithProratedMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::GroupedWithProratedMinimum::ConversionRateConfig | nil, created_at: Time, @@ -3239,7 +3393,7 @@ def test_fetch discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_with_prorated_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_with_prorated_minimum_config: Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -3258,7 +3412,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::GroupedWithMeteredMinimum::BillingMode, cadence: Orb::Price::GroupedWithMeteredMinimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::GroupedWithMeteredMinimum::ConversionRateConfig | nil, created_at: Time, @@ -3267,7 +3423,7 @@ def test_fetch discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_with_metered_minimum_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_with_metered_minimum_config: Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -3282,22 +3438,24 @@ def test_fetch dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :matrix_with_display_name, + model_type: :grouped_with_min_max_thresholds, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::MatrixWithDisplayName::Cadence, + billing_mode: Orb::Price::GroupedWithMinMaxThresholds::BillingMode, + cadence: Orb::Price::GroupedWithMinMaxThresholds::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::MatrixWithDisplayName::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, + grouped_with_min_max_thresholds_config: Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, - matrix_with_display_name_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -3305,19 +3463,20 @@ def test_fetch minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::MatrixWithDisplayName::PriceType, + price_type: Orb::Price::GroupedWithMinMaxThresholds::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :bulk_with_proration, + model_type: :matrix_with_display_name, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_with_proration_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), - cadence: Orb::Price::BulkWithProration::Cadence, + billing_mode: Orb::Price::MatrixWithDisplayName::BillingMode, + cadence: Orb::Price::MatrixWithDisplayName::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::BulkWithProration::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::MatrixWithDisplayName::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, @@ -3326,6 +3485,7 @@ def test_fetch fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, + matrix_with_display_name_config: Orb::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -3333,7 +3493,7 @@ def test_fetch minimum_amount: String | nil, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::BulkWithProration::PriceType, + price_type: Orb::Price::MatrixWithDisplayName::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } @@ -3342,7 +3502,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::GroupedTieredPackage::BillingMode, cadence: Orb::Price::GroupedTieredPackage::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::GroupedTieredPackage::ConversionRateConfig | nil, created_at: Time, @@ -3351,7 +3513,7 @@ def test_fetch discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_tiered_package_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + grouped_tiered_package_config: Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -3370,7 +3532,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::MaxGroupTieredPackage::BillingMode, cadence: Orb::Price::MaxGroupTieredPackage::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::MaxGroupTieredPackage::ConversionRateConfig | nil, created_at: Time, @@ -3381,7 +3545,7 @@ def test_fetch fixed_price_quantity: Float | nil, invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, - max_group_tiered_package_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + max_group_tiered_package_config: Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -3398,7 +3562,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::ScalableMatrixWithUnitPricing::BillingMode, cadence: Orb::Price::ScalableMatrixWithUnitPricing::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::ScalableMatrixWithUnitPricing::ConversionRateConfig | nil, created_at: Time, @@ -3418,7 +3584,7 @@ def test_fetch plan_phase_order: Integer | nil, price_type: Orb::Price::ScalableMatrixWithUnitPricing::PriceType, replaces_price_id: String | nil, - scalable_matrix_with_unit_pricing_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + scalable_matrix_with_unit_pricing_config: Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -3426,7 +3592,9 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::ScalableMatrixWithTieredPricing::BillingMode, cadence: Orb::Price::ScalableMatrixWithTieredPricing::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::ScalableMatrixWithTieredPricing::ConversionRateConfig | nil, created_at: Time, @@ -3446,7 +3614,7 @@ def test_fetch plan_phase_order: Integer | nil, price_type: Orb::Price::ScalableMatrixWithTieredPricing::PriceType, replaces_price_id: String | nil, - scalable_matrix_with_tiered_pricing_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + scalable_matrix_with_tiered_pricing_config: Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { @@ -3454,12 +3622,14 @@ def test_fetch id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::CumulativeGroupedBulk::BillingMode, cadence: Orb::Price::CumulativeGroupedBulk::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, conversion_rate_config: Orb::Price::CumulativeGroupedBulk::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, - cumulative_grouped_bulk_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), + cumulative_grouped_bulk_config: Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, @@ -3478,20 +3648,21 @@ def test_fetch dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } in { - model_type: :grouped_with_min_max_thresholds, + model_type: :minimum, id: String, billable_metric: Orb::BillableMetricTiny | nil, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::GroupedWithMinMaxThresholds::Cadence, + billing_mode: Orb::Price::Minimum::BillingMode, + cadence: Orb::Price::Minimum::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, conversion_rate: Float | nil, - conversion_rate_config: Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig | nil, + conversion_rate_config: Orb::Price::Minimum::ConversionRateConfig | nil, created_at: Time, credit_allocation: Orb::Allocation | nil, currency: String, discount: Orb::Discount | nil, external_price_id: String | nil, fixed_price_quantity: Float | nil, - grouped_with_min_max_thresholds_config: ^(Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown]), invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, item: Orb::ItemSlim, maximum: Orb::Maximum | nil, @@ -3499,9 +3670,70 @@ def test_fetch metadata: ^(Orb::Internal::Type::HashOf[String]), minimum: Orb::Minimum | nil, minimum_amount: String | nil, + minimum_config: Orb::Price::Minimum::MinimumConfig, name: String, plan_phase_order: Integer | nil, - price_type: Orb::Price::GroupedWithMinMaxThresholds::PriceType, + price_type: Orb::Price::Minimum::PriceType, + replaces_price_id: String | nil, + dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil + } + in { + model_type: :percent, + id: String, + billable_metric: Orb::BillableMetricTiny | nil, + billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::Percent::BillingMode, + cadence: Orb::Price::Percent::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, + conversion_rate: Float | nil, + conversion_rate_config: Orb::Price::Percent::ConversionRateConfig | nil, + created_at: Time, + credit_allocation: Orb::Allocation | nil, + currency: String, + discount: Orb::Discount | nil, + external_price_id: String | nil, + fixed_price_quantity: Float | nil, + invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, + item: Orb::ItemSlim, + maximum: Orb::Maximum | nil, + maximum_amount: String | nil, + metadata: ^(Orb::Internal::Type::HashOf[String]), + minimum: Orb::Minimum | nil, + minimum_amount: String | nil, + name: String, + percent_config: Orb::Price::Percent::PercentConfig, + plan_phase_order: Integer | nil, + price_type: Orb::Price::Percent::PriceType, + replaces_price_id: String | nil, + dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil + } + in { + model_type: :event_output, + id: String, + billable_metric: Orb::BillableMetricTiny | nil, + billing_cycle_configuration: Orb::BillingCycleConfiguration, + billing_mode: Orb::Price::EventOutput::BillingMode, + cadence: Orb::Price::EventOutput::Cadence, + composite_price_filters: ^(Orb::Internal::Type::ArrayOf[Orb::TransformPriceFilter]) | nil, + conversion_rate: Float | nil, + conversion_rate_config: Orb::Price::EventOutput::ConversionRateConfig | nil, + created_at: Time, + credit_allocation: Orb::Allocation | nil, + currency: String, + discount: Orb::Discount | nil, + event_output_config: Orb::Price::EventOutput::EventOutputConfig, + external_price_id: String | nil, + fixed_price_quantity: Float | nil, + invoicing_cycle_configuration: Orb::BillingCycleConfiguration | nil, + item: Orb::ItemSlim, + maximum: Orb::Maximum | nil, + maximum_amount: String | nil, + metadata: ^(Orb::Internal::Type::HashOf[String]), + minimum: Orb::Minimum | nil, + minimum_amount: String | nil, + name: String, + plan_phase_order: Integer | nil, + price_type: Orb::Price::EventOutput::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil }