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/.stats.yml b/.stats.yml index 69ee938b..4975db47 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-b6ec9a6bf40b74575d917ab145b2413bc61dcd6989bb9d1aa41624bf3437599e.yml +openapi_spec_hash: 53cf9363c3bd9649e0af5f713abdcba7 +config_hash: 1f73a949b649ecfe6ec68ba1bb459dc2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fc104bc..a84af7dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,48 @@ # Changelog +## 1.12.0 (2025-09-30) + +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 ([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)) +* **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..e2fef6cb 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, 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, 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,467 @@ 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 } + + 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 # @!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)] end end @@ -346,9 +803,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, nil] optional :price, union: -> { Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::Price }, nil?: true @@ -360,9 +817,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, 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 +829,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 +843,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 +881,467 @@ 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 } + + 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 # @!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)] 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..1e702dab 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, 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, 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,463 @@ 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 } + + 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 # @!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)] end end @@ -329,9 +782,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, 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 +794,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, 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 +806,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 +820,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 +858,467 @@ 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 } + + 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 # @!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)] 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..d3094044 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] + 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] 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..ba8fe5d2 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] 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] 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..f423dc1a 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] 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] 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_response.rb b/lib/orb/models/invoice_line_item_create_response.rb index c4533fc8..d7e10321 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] 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] 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..79ea35bb 100644 --- a/lib/orb/models/item.rb +++ b/lib/orb/models/item.rb @@ -77,6 +77,7 @@ module ExternalConnectionName TAXJAR = :taxjar AVALARA = :avalara ANROK = :anrok + NUMERAL = :numeral # @!method self.values # @return [Array] diff --git a/lib/orb/models/item_update_params.rb b/lib/orb/models/item_update_params.rb index 2f974597..2a2197eb 100644 --- a/lib/orb/models/item_update_params.rb +++ b/lib/orb/models/item_update_params.rb @@ -66,6 +66,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_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..6d007440 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] 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] 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..cabcb53f 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..1459085e 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, 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, 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,461 @@ 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 } + + 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 # @!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)] 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..43054141 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..c5c976ec 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,7 @@ module Price variant :cumulative_grouped_bulk, -> { Orb::Price::CumulativeGroupedBulk } - variant :grouped_with_min_max_thresholds, -> { Orb::Price::GroupedWithMinMaxThresholds } + variant :minimum, -> { Orb::Price::Minimum } class Unit < Orb::Internal::Type::BaseModel # @!attribute id @@ -91,11 +87,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] @@ -181,6 +189,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 +217,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 +227,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 +237,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] @@ -267,491 +281,24 @@ 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 dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] - # - # @param model_type [Symbol, :unit] - - # @see Orb::Models::Price::Unit#cadence - module Cadence - extend Orb::Internal::Type::Enum - - ONE_TIME = :one_time - MONTHLY = :monthly - QUARTERLY = :quarterly - SEMI_ANNUAL = :semi_annual - ANNUAL = :annual - CUSTOM = :custom - - # @!method self.values - # @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 - - # @!method self.values - # @return [Array] - end - end - - class Package < Orb::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute billable_metric - # - # @return [Orb::Models::BillableMetricTiny, nil] - required :billable_metric, -> { Orb::BillableMetricTiny }, nil?: true - - # @!attribute billing_cycle_configuration - # - # @return [Orb::Models::BillingCycleConfiguration] - required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } - - # @!attribute cadence - # - # @return [Symbol, Orb::Models::Price::Package::Cadence] - required :cadence, enum: -> { Orb::Price::Package::Cadence } - - # @!attribute conversion_rate - # - # @return [Float, nil] - required :conversion_rate, Float, nil?: true - - # @!attribute conversion_rate_config - # - # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - required :conversion_rate_config, union: -> { Orb::Price::Package::ConversionRateConfig }, nil?: true - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time - - # @!attribute credit_allocation - # - # @return [Orb::Models::Allocation, nil] - required :credit_allocation, -> { Orb::Allocation }, nil?: true - - # @!attribute currency - # - # @return [String] - required :currency, String - - # @!attribute discount - # @deprecated - # - # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::UsageDiscount, Orb::Models::AmountDiscount, nil] - required :discount, union: -> { Orb::Discount }, nil?: true - - # @!attribute external_price_id - # - # @return [String, nil] - required :external_price_id, String, nil?: true - - # @!attribute fixed_price_quantity - # - # @return [Float, nil] - required :fixed_price_quantity, Float, nil?: true - - # @!attribute invoicing_cycle_configuration - # - # @return [Orb::Models::BillingCycleConfiguration, nil] - required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true - - # @!attribute item - # - # @return [Orb::Models::ItemSlim] - required :item, -> { Orb::ItemSlim } - - # @!attribute maximum - # @deprecated - # - # @return [Orb::Models::Maximum, nil] - required :maximum, -> { Orb::Maximum }, nil?: true - - # @!attribute maximum_amount - # @deprecated - # - # @return [String, nil] - required :maximum_amount, 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 - # @deprecated - # - # @return [Orb::Models::Minimum, nil] - required :minimum, -> { Orb::Minimum }, nil?: true - - # @!attribute minimum_amount - # @deprecated - # - # @return [String, nil] - required :minimum_amount, String, nil?: true - - # @!attribute model_type - # - # @return [Symbol, :package] - required :model_type, const: :package - - # @!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] - required :plan_phase_order, Integer, nil?: true - - # @!attribute price_type - # - # @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 - # price in plan version migrations. - # - # @return [String, nil] - required :replaces_price_id, String, nil?: true - - # @!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) - # Some parameter documentations has been truncated, see - # {Orb::Models::Price::Package} for more details. - # - # @param id [String] - # - # @param billable_metric [Orb::Models::BillableMetricTiny, nil] - # - # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] - # - # @param cadence [Symbol, Orb::Models::Price::Package::Cadence] - # - # @param conversion_rate [Float, nil] - # - # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - # - # @param created_at [Time] - # - # @param credit_allocation [Orb::Models::Allocation, nil] - # - # @param currency [String] - # - # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::UsageDiscount, Orb::Models::AmountDiscount, nil] - # - # @param external_price_id [String, nil] - # - # @param fixed_price_quantity [Float, nil] - # - # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] - # - # @param item [Orb::Models::ItemSlim] - # - # @param maximum [Orb::Models::Maximum, nil] - # - # @param maximum_amount [String, nil] - # - # @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 name [String] - # - # @param package_config [Orb::Models::PackageConfig] - # - # @param plan_phase_order [Integer, nil] - # - # @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 unit_config [Orb::Models::UnitConfig] Configuration for unit pricing # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :package] + # @param model_type [Symbol, :unit] The pricing model type - # @see Orb::Models::Price::Package#cadence - module Cadence + # @see Orb::Models::Price::Unit#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::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 - module PriceType - extend Orb::Internal::Type::Enum - - USAGE_PRICE = :usage_price - FIXED_PRICE = :fixed_price - - # @!method self.values - # @return [Array] - end - end - - class Matrix < Orb::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute billable_metric - # - # @return [Orb::Models::BillableMetricTiny, nil] - required :billable_metric, -> { Orb::BillableMetricTiny }, nil?: true - - # @!attribute billing_cycle_configuration - # - # @return [Orb::Models::BillingCycleConfiguration] - required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } - - # @!attribute cadence - # - # @return [Symbol, Orb::Models::Price::Matrix::Cadence] - required :cadence, enum: -> { Orb::Price::Matrix::Cadence } - - # @!attribute conversion_rate - # - # @return [Float, nil] - required :conversion_rate, Float, nil?: true - - # @!attribute conversion_rate_config - # - # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - required :conversion_rate_config, union: -> { Orb::Price::Matrix::ConversionRateConfig }, nil?: true - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time - - # @!attribute credit_allocation - # - # @return [Orb::Models::Allocation, nil] - required :credit_allocation, -> { Orb::Allocation }, nil?: true - - # @!attribute currency - # - # @return [String] - required :currency, String - - # @!attribute discount - # @deprecated - # - # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::UsageDiscount, Orb::Models::AmountDiscount, nil] - required :discount, union: -> { Orb::Discount }, nil?: true - - # @!attribute external_price_id - # - # @return [String, nil] - required :external_price_id, String, nil?: true - - # @!attribute fixed_price_quantity - # - # @return [Float, nil] - required :fixed_price_quantity, Float, nil?: true - - # @!attribute invoicing_cycle_configuration - # - # @return [Orb::Models::BillingCycleConfiguration, nil] - required :invoicing_cycle_configuration, -> { Orb::BillingCycleConfiguration }, nil?: true - - # @!attribute item - # - # @return [Orb::Models::ItemSlim] - required :item, -> { Orb::ItemSlim } - - # @!attribute matrix_config - # - # @return [Orb::Models::MatrixConfig] - required :matrix_config, -> { Orb::MatrixConfig } - - # @!attribute maximum - # @deprecated - # - # @return [Orb::Models::Maximum, nil] - required :maximum, -> { Orb::Maximum }, nil?: true - - # @!attribute maximum_amount - # @deprecated - # - # @return [String, nil] - required :maximum_amount, 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 - # @deprecated - # - # @return [Orb::Models::Minimum, nil] - required :minimum, -> { Orb::Minimum }, nil?: true - - # @!attribute minimum_amount - # @deprecated - # - # @return [String, nil] - required :minimum_amount, String, nil?: true - - # @!attribute model_type - # - # @return [Symbol, :matrix] - required :model_type, const: :matrix - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute plan_phase_order - # - # @return [Integer, nil] - required :plan_phase_order, Integer, nil?: true - - # @!attribute price_type - # - # @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 - # price in plan version migrations. - # - # @return [String, nil] - required :replaces_price_id, String, nil?: true - - # @!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:, 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. - # - # @param id [String] - # - # @param billable_metric [Orb::Models::BillableMetricTiny, nil] - # - # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] - # - # @param cadence [Symbol, Orb::Models::Price::Matrix::Cadence] - # - # @param conversion_rate [Float, nil] - # - # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - # - # @param created_at [Time] - # - # @param credit_allocation [Orb::Models::Allocation, nil] - # - # @param currency [String] - # - # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::UsageDiscount, Orb::Models::AmountDiscount, nil] - # - # @param external_price_id [String, nil] - # - # @param fixed_price_quantity [Float, nil] - # - # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] - # - # @param item [Orb::Models::ItemSlim] - # - # @param matrix_config [Orb::Models::MatrixConfig] - # - # @param maximum [Orb::Models::Maximum, nil] - # - # @param maximum_amount [String, nil] - # - # @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 name [String] - # - # @param plan_phase_order [Integer, nil] - # - # @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 dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] - # - # @param model_type [Symbol, :matrix] - - # @see Orb::Models::Price::Matrix#cadence + # @see Orb::Models::Price::Unit#cadence module Cadence extend Orb::Internal::Type::Enum @@ -759,33 +306,20 @@ module Cadence MONTHLY = :monthly QUARTERLY = :quarterly SEMI_ANNUAL = :semi_annual - ANNUAL = :annual - CUSTOM = :custom - - # @!method self.values - # @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 } + 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::Matrix#price_type + # @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] @@ -808,11 +342,23 @@ class Tiered < 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::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 # # @return [Float, nil] @@ -898,6 +444,7 @@ 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 @@ -925,6 +472,7 @@ class Tiered < Orb::Internal::Type::BaseModel required :replaces_price_id, String, nil?: true # @!attribute tiered_config + # Configuration for tiered pricing # # @return [Orb::Models::TieredConfig] required :tiered_config, -> { Orb::TieredConfig } @@ -934,7 +482,7 @@ class Tiered < 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:, 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:, 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::Tiered} for more details. # @@ -944,8 +492,12 @@ class Tiered < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # + # @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] # # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] @@ -984,11 +536,22 @@ class Tiered < 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 tiered_config [Orb::Models::TieredConfig] + # @param tiered_config [Orb::Models::TieredConfig] Configuration for tiered pricing # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :tiered] + # @param model_type [Symbol, :tiered] The pricing model type + + # @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 @@ -1005,33 +568,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 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 Bulk < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -1047,10 +597,28 @@ class TieredBPS < 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::TieredBPS::Cadence] - required :cadence, enum: -> { Orb::Price::TieredBPS::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 # @@ -1060,11 +628,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::Bulk::ConversionRateConfig }, nil?: true # @!attribute created_at # @@ -1141,9 +705,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, :bulk] + required :model_type, const: :bulk # @!attribute name # @@ -1157,8 +722,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::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 @@ -1167,19 +732,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) - # Some parameter documentations has been truncated, see - # {Orb::Models::Price::TieredBPS} 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] # @@ -1187,7 +747,13 @@ 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::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] # @@ -1223,17 +789,26 @@ 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::Bulk::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, :bulk] The pricing model type + + # @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::TieredBPS#cadence + # @see Orb::Models::Price::Bulk#cadence module Cadence extend Orb::Internal::Type::Enum @@ -1248,33 +823,20 @@ module Cadence # @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 } - - variant :tiered, -> { Orb::TieredConversionRateConfig } - - # @!method self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] - end - - # @see Orb::Models::Price::TieredBPS#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 BPS < Orb::Internal::Type::BaseModel + class Package < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -1290,15 +852,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::Package::BillingMode] + required :billing_mode, enum: -> { Orb::Price::Package::BillingMode } # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::BPS::Cadence] - required :cadence, enum: -> { Orb::Price::BPS::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 # @@ -1308,7 +877,7 @@ 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::Package::ConversionRateConfig }, nil?: true # @!attribute created_at # @@ -1385,15 +954,22 @@ 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, :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] @@ -1401,8 +977,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::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 @@ -1416,9 +992,9 @@ class BPS < 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:, 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:, 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::Package} for more details. # # @param id [String] # @@ -1426,9 +1002,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::Package::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::Package::Cadence] # - # @param cadence [Symbol, Orb::Models::Price::BPS::Cadence] + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -1462,17 +1040,30 @@ class BPS < 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::BPS::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 dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :bps] + # @param model_type [Symbol, :package] The pricing model type + + # @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::BPS#cadence + # @see Orb::Models::Price::Package#cadence module Cadence extend Orb::Internal::Type::Enum @@ -1487,33 +1078,20 @@ 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::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 BulkBPS < Orb::Internal::Type::BaseModel + class Matrix < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -1529,15 +1107,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::Matrix::BillingMode] + required :billing_mode, enum: -> { Orb::Price::Matrix::BillingMode } # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::BulkBPS::Cadence] - required :cadence, enum: -> { Orb::Price::BulkBPS::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 # @@ -1547,7 +1132,7 @@ 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::Matrix::ConversionRateConfig }, nil?: true # @!attribute created_at # @@ -1590,6 +1175,12 @@ class BulkBPS < Orb::Internal::Type::BaseModel # @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 # @@ -1624,9 +1215,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, :matrix] + required :model_type, const: :matrix # @!attribute name # @@ -1640,8 +1232,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::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 @@ -1655,9 +1247,9 @@ class BulkBPS < 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_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:, 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::BulkBPS} for more details. + # {Orb::Models::Price::Matrix} for more details. # # @param id [String] # @@ -1665,9 +1257,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::Matrix::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::Matrix::Cadence] # - # @param cadence [Symbol, Orb::Models::Price::BulkBPS::Cadence] + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -1689,6 +1283,8 @@ class BulkBPS < Orb::Internal::Type::BaseModel # # @param item [Orb::Models::ItemSlim] # + # @param matrix_config [Orb::Models::MatrixConfig] Configuration for matrix pricing + # # @param maximum [Orb::Models::Maximum, nil] # # @param maximum_amount [String, nil] @@ -1703,15 +1299,26 @@ 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::Matrix::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_bps] + # @param model_type [Symbol, :matrix] The pricing model type + + # @see Orb::Models::Price::Matrix#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::Matrix#cadence module Cadence extend Orb::Internal::Type::Enum @@ -1726,33 +1333,20 @@ 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::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 Bulk < Orb::Internal::Type::BaseModel + class ThresholdTotalAmount < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -1768,15 +1362,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::ThresholdTotalAmount::BillingMode] + required :billing_mode, enum: -> { Orb::Price::ThresholdTotalAmount::BillingMode } # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::Bulk::Cadence] - required :cadence, enum: -> { Orb::Price::Bulk::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 # @@ -1786,7 +1387,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::ThresholdTotalAmount::ConversionRateConfig }, + nil?: true # @!attribute created_at # @@ -1863,9 +1466,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, :threshold_total_amount] + required :model_type, const: :threshold_total_amount # @!attribute name # @@ -1879,8 +1483,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::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 @@ -1889,14 +1493,21 @@ class Bulk < 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:, 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:, 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] # @@ -1904,9 +1515,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::ThresholdTotalAmount::BillingMode] # - # @param cadence [Symbol, Orb::Models::Price::Bulk::Cadence] + # @param cadence [Symbol, Orb::Models::Price::ThresholdTotalAmount::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -1942,15 +1555,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::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, :bulk] + # @param model_type [Symbol, :threshold_total_amount] The pricing model type - # @see Orb::Models::Price::Bulk#cadence + # @see Orb::Models::Price::ThresholdTotalAmount#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::ThresholdTotalAmount#cadence module Cadence extend Orb::Internal::Type::Enum @@ -1965,33 +1591,69 @@ 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::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 ThresholdTotalAmount < Orb::Internal::Type::BaseModel + class TieredPackage < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -2007,10 +1669,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::TieredPackage::BillingMode] + required :billing_mode, enum: -> { Orb::Price::TieredPackage::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::ThresholdTotalAmount::Cadence] - required :cadence, enum: -> { Orb::Price::ThresholdTotalAmount::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 # @@ -2021,7 +1695,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::TieredPackage::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -2099,9 +1773,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, :tiered_package] + required :model_type, const: :tiered_package # @!attribute name # @@ -2115,8 +1790,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::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 @@ -2125,19 +1800,20 @@ class ThresholdTotalAmount < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true - # @!attribute threshold_total_amount_config + # @!attribute tiered_package_config + # Configuration for tiered_package pricing # - # @return [Hash{Symbol=>Object}] - required :threshold_total_amount_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @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:, 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:, 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::ThresholdTotalAmount} for more details. + # {Orb::Models::Price::TieredPackage} for more details. # # @param id [String] # @@ -2145,7 +1821,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::TieredPackage::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::TieredPackage::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -2181,17 +1861,28 @@ 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::TieredPackage::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 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, :threshold_total_amount] + # @param model_type [Symbol, :tiered_package] The pricing model type - # @see Orb::Models::Price::ThresholdTotalAmount#cadence + # @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::TieredPackage#cadence module Cadence extend Orb::Internal::Type::Enum @@ -2206,33 +1897,69 @@ 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)] - end - - # @see Orb::Models::Price::ThresholdTotalAmount#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 TieredPackage < Orb::Internal::Type::BaseModel + class TieredWithMinimum < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -2248,10 +1975,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::TieredWithMinimum::BillingMode] + required :billing_mode, enum: -> { Orb::Price::TieredWithMinimum::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::TieredPackage::Cadence] - required :cadence, enum: -> { Orb::Price::TieredPackage::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 # @@ -2262,7 +2001,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::TieredWithMinimum::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -2340,9 +2079,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_with_minimum] + required :model_type, const: :tiered_with_minimum # @!attribute name # @@ -2356,8 +2096,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::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 @@ -2366,19 +2106,20 @@ class TieredPackage < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true - # @!attribute tiered_package_config + # @!attribute tiered_with_minimum_config + # Configuration for tiered_with_minimum pricing # - # @return [Hash{Symbol=>Object}] - required :tiered_package_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @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:, 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_with_minimum_config:, dimensional_price_configuration: nil, model_type: :tiered_with_minimum) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::TieredPackage} for more details. + # {Orb::Models::Price::TieredWithMinimum} for more details. # # @param id [String] # @@ -2386,7 +2127,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::TieredWithMinimum::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::TieredWithMinimum::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -2422,17 +2167,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::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_package_config [Hash{Symbol=>Object}] + # @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, :tiered_package] + # @param model_type [Symbol, :tiered_with_minimum] The pricing model type - # @see Orb::Models::Price::TieredPackage#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 @@ -2447,30 +2203,82 @@ 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::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 GroupedTiered < Orb::Internal::Type::BaseModel @@ -2489,11 +2297,23 @@ class GroupedTiered < 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::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 # # @return [Float, nil] @@ -2538,9 +2358,10 @@ class GroupedTiered < Orb::Internal::Type::BaseModel required :fixed_price_quantity, Float, nil?: true # @!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::Price::GroupedTiered::GroupedTieredConfig] + required :grouped_tiered_config, -> { Orb::Price::GroupedTiered::GroupedTieredConfig } # @!attribute invoicing_cycle_configuration # @@ -2586,6 +2407,7 @@ 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 @@ -2617,7 +2439,7 @@ 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:, 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::GroupedTiered} for more details. # @@ -2627,8 +2449,12 @@ class GroupedTiered < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # + # @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] # # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] @@ -2645,7 +2471,7 @@ class GroupedTiered < Orb::Internal::Type::BaseModel # # @param fixed_price_quantity [Float, nil] # - # @param grouped_tiered_config [Hash{Symbol=>Object}] + # @param grouped_tiered_config [Orb::Models::Price::GroupedTiered::GroupedTieredConfig] Configuration for grouped_tiered pricing # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # @@ -2671,7 +2497,18 @@ class GroupedTiered < Orb::Internal::Type::BaseModel # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :grouped_tiered] + # @param model_type [Symbol, :grouped_tiered] The pricing model type + + # @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 @@ -2688,18 +2525,51 @@ 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::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::GroupedTiered#price_type @@ -2708,13 +2578,14 @@ module PriceType 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 TieredPackageWithMinimum < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -2730,10 +2601,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::TieredPackageWithMinimum::BillingMode] + required :billing_mode, enum: -> { Orb::Price::TieredPackageWithMinimum::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::TieredWithMinimum::Cadence] - required :cadence, enum: -> { Orb::Price::TieredWithMinimum::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 # @@ -2744,7 +2627,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::TieredPackageWithMinimum::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -2822,9 +2705,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, :tiered_package_with_minimum] + required :model_type, const: :tiered_package_with_minimum # @!attribute name # @@ -2838,8 +2722,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::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 @@ -2848,19 +2732,21 @@ class TieredWithMinimum < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true - # @!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::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_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:, 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::TieredWithMinimum} for more details. + # {Orb::Models::Price::TieredPackageWithMinimum} for more details. # # @param id [String] # @@ -2868,7 +2754,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::TieredPackageWithMinimum::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::TieredPackageWithMinimum::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -2904,17 +2794,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::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_with_minimum_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_with_minimum] + # @param model_type [Symbol, :tiered_package_with_minimum] The pricing model type - # @see Orb::Models::Price::TieredWithMinimum#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 @@ -2929,33 +2830,77 @@ 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::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 TieredPackageWithMinimum < Orb::Internal::Type::BaseModel + class PackageWithAllocation < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -2971,10 +2916,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::PackageWithAllocation::BillingMode] + required :billing_mode, enum: -> { Orb::Price::PackageWithAllocation::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::TieredPackageWithMinimum::Cadence] - required :cadence, enum: -> { Orb::Price::TieredPackageWithMinimum::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 # @@ -2985,7 +2942,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::PackageWithAllocation::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -3063,15 +3020,23 @@ 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, :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] @@ -3079,8 +3044,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::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 @@ -3089,19 +3054,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:, 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::TieredPackageWithMinimum} for more details. + # {Orb::Models::Price::PackageWithAllocation} for more details. # # @param id [String] # @@ -3109,7 +3069,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::PackageWithAllocation::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::PackageWithAllocation::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -3143,19 +3107,30 @@ class TieredPackageWithMinimum < 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::TieredPackageWithMinimum::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 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, :package_with_allocation] The pricing model type - # @see Orb::Models::Price::TieredPackageWithMinimum#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 @@ -3170,33 +3145,50 @@ 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)] + # @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::TieredPackageWithMinimum#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 PackageWithAllocation < Orb::Internal::Type::BaseModel + class UnitWithPercent < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -3212,10 +3204,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::UnitWithPercent::BillingMode] + required :billing_mode, enum: -> { Orb::Price::UnitWithPercent::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::PackageWithAllocation::Cadence] - required :cadence, enum: -> { Orb::Price::PackageWithAllocation::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 # @@ -3226,7 +3230,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::UnitWithPercent::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -3304,20 +3308,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, :unit_with_percent] + required :model_type, const: :unit_with_percent # @!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 +3325,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::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 @@ -3335,14 +3335,20 @@ class PackageWithAllocation < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true + # @!attribute unit_with_percent_config + # Configuration for unit_with_percent pricing + # + # @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:, 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:, unit_with_percent_config:, dimensional_price_configuration: nil, model_type: :unit_with_percent) # Some parameter documentations has been truncated, see - # {Orb::Models::Price::PackageWithAllocation} for more details. + # {Orb::Models::Price::UnitWithPercent} for more details. # # @param id [String] # @@ -3350,7 +3356,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::UnitWithPercent::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::UnitWithPercent::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -3384,19 +3394,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::UnitWithPercent::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 [Orb::Models::Price::UnitWithPercent::UnitWithPercentConfig] Configuration for unit_with_percent pricing + # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :package_with_allocation] + # @param model_type [Symbol, :unit_with_percent] The pricing model type - # @see Orb::Models::Price::PackageWithAllocation#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 @@ -3411,33 +3432,42 @@ 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::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 UnitWithPercent < Orb::Internal::Type::BaseModel + class MatrixWithAllocation < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -3453,10 +3483,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::MatrixWithAllocation::BillingMode] + required :billing_mode, enum: -> { Orb::Price::MatrixWithAllocation::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::UnitWithPercent::Cadence] - required :cadence, enum: -> { Orb::Price::UnitWithPercent::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 # @@ -3467,7 +3509,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::MatrixWithAllocation::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -3511,6 +3553,12 @@ class UnitWithPercent < Orb::Internal::Type::BaseModel # @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 # @@ -3545,9 +3593,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, :matrix_with_allocation] + required :model_type, const: :matrix_with_allocation # @!attribute name # @@ -3561,8 +3610,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::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 @@ -3571,19 +3620,14 @@ class UnitWithPercent < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true - # @!attribute unit_with_percent_config - # - # @return [Hash{Symbol=>Object}] - required :unit_with_percent_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_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:, 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::UnitWithPercent} for more details. + # {Orb::Models::Price::MatrixWithAllocation} for more details. # # @param id [String] # @@ -3591,7 +3635,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::MatrixWithAllocation::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::MatrixWithAllocation::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -3613,6 +3661,8 @@ class UnitWithPercent < Orb::Internal::Type::BaseModel # # @param item [Orb::Models::ItemSlim] # + # @param matrix_with_allocation_config [Orb::Models::MatrixWithAllocationConfig] Configuration for matrix_with_allocation pricing + # # @param maximum [Orb::Models::Maximum, nil] # # @param maximum_amount [String, nil] @@ -3627,17 +3677,26 @@ 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::MatrixWithAllocation::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 dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :unit_with_percent] + # @param model_type [Symbol, :matrix_with_allocation] The pricing model type - # @see Orb::Models::Price::UnitWithPercent#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 @@ -3652,33 +3711,20 @@ 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::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 MatrixWithAllocation < Orb::Internal::Type::BaseModel + class TieredWithProration < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -3694,10 +3740,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::TieredWithProration::BillingMode] + required :billing_mode, enum: -> { Orb::Price::TieredWithProration::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::MatrixWithAllocation::Cadence] - required :cadence, enum: -> { Orb::Price::MatrixWithAllocation::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 # @@ -3708,7 +3766,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::TieredWithProration::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -3752,11 +3810,6 @@ class MatrixWithAllocation < Orb::Internal::Type::BaseModel # @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 +3844,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, :tiered_with_proration] + required :model_type, const: :tiered_with_proration # @!attribute name # @@ -3807,8 +3861,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::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 @@ -3817,14 +3871,20 @@ class MatrixWithAllocation < 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:, 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:, 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::MatrixWithAllocation} for more details. + # {Orb::Models::Price::TieredWithProration} for more details. # # @param id [String] # @@ -3832,7 +3892,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::TieredWithProration::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::TieredWithProration::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -3854,8 +3918,6 @@ class MatrixWithAllocation < Orb::Internal::Type::BaseModel # # @param item [Orb::Models::ItemSlim] # - # @param matrix_with_allocation_config [Orb::Models::MatrixWithAllocationConfig] - # # @param maximum [Orb::Models::Maximum, nil] # # @param maximum_amount [String, nil] @@ -3870,15 +3932,28 @@ 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::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, :matrix_with_allocation] + # @param model_type [Symbol, :tiered_with_proration] The pricing model type - # @see Orb::Models::Price::MatrixWithAllocation#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 @@ -3893,33 +3968,61 @@ 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)] - end - - # @see Orb::Models::Price::MatrixWithAllocation#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 TieredWithProration < Orb::Internal::Type::BaseModel + class UnitWithProration < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -3935,10 +4038,22 @@ class TieredWithProration < 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::TieredWithProration::Cadence] - required :cadence, enum: -> { Orb::Price::TieredWithProration::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 # @@ -3949,7 +4064,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::UnitWithProration::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -4027,9 +4142,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, :unit_with_proration] + required :model_type, const: :unit_with_proration # @!attribute name # @@ -4043,8 +4159,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::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 @@ -4053,19 +4169,20 @@ class TieredWithProration < Orb::Internal::Type::BaseModel # @return [String, nil] required :replaces_price_id, String, nil?: true - # @!attribute tiered_with_proration_config + # @!attribute unit_with_proration_config + # Configuration for unit_with_proration pricing # - # @return [Hash{Symbol=>Object}] - required :tiered_with_proration_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:, tiered_with_proration_config:, dimensional_price_configuration: nil, model_type: :tiered_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:, 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::TieredWithProration} for more details. + # {Orb::Models::Price::UnitWithProration} for more details. # # @param id [String] # @@ -4073,7 +4190,11 @@ 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::UnitWithProration::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::UnitWithProration::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -4109,17 +4230,28 @@ 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::UnitWithProration::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 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, :tiered_with_proration] + # @param model_type [Symbol, :unit_with_proration] The pricing model type - # @see Orb::Models::Price::TieredWithProration#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 @@ -4134,33 +4266,34 @@ 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::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 UnitWithProration < Orb::Internal::Type::BaseModel + class GroupedAllocation < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -4176,10 +4309,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::GroupedAllocation::BillingMode] + required :billing_mode, enum: -> { Orb::Price::GroupedAllocation::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::UnitWithProration::Cadence] - required :cadence, enum: -> { Orb::Price::UnitWithProration::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 # @@ -4190,7 +4335,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::GroupedAllocation::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -4224,6 +4369,12 @@ class UnitWithProration < 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] @@ -4268,9 +4419,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_allocation] + required :model_type, const: :grouped_allocation # @!attribute name # @@ -4284,8 +4436,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::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 @@ -4294,19 +4446,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_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::UnitWithProration} for more details. + # {Orb::Models::Price::GroupedAllocation} for more details. # # @param id [String] # @@ -4314,7 +4461,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::GroupedAllocation::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::GroupedAllocation::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -4332,6 +4483,8 @@ class UnitWithProration < Orb::Internal::Type::BaseModel # # @param fixed_price_quantity [Float, nil] # + # @param grouped_allocation_config [Orb::Models::Price::GroupedAllocation::GroupedAllocationConfig] Configuration for grouped_allocation pricing + # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # # @param item [Orb::Models::ItemSlim] @@ -4350,17 +4503,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::GroupedAllocation::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_allocation] The pricing model type - # @see Orb::Models::Price::UnitWithProration#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 @@ -4375,33 +4537,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::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::UnitWithProration#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 GroupedAllocation < Orb::Internal::Type::BaseModel + class BulkWithProration < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -4417,10 +4596,28 @@ class GroupedAllocation < 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::GroupedAllocation::Cadence] - required :cadence, enum: -> { Orb::Price::GroupedAllocation::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 # @@ -4431,7 +4628,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::BulkWithProration::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -4465,11 +4662,6 @@ class GroupedAllocation < Orb::Internal::Type::BaseModel # @return [Float, nil] required :fixed_price_quantity, Float, nil?: true - # @!attribute grouped_allocation_config - # - # @return [Hash{Symbol=>Object}] - required :grouped_allocation_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] - # @!attribute invoicing_cycle_configuration # # @return [Orb::Models::BillingCycleConfiguration, nil] @@ -4514,9 +4706,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, :bulk_with_proration] + required :model_type, const: :bulk_with_proration # @!attribute name # @@ -4530,8 +4723,8 @@ class GroupedAllocation < Orb::Internal::Type::BaseModel # @!attribute price_type # - # @return [Symbol, Orb::Models::Price::GroupedAllocation::PriceType] - required :price_type, enum: -> { Orb::Price::GroupedAllocation::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 @@ -4545,9 +4738,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:, 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::GroupedAllocation} for more details. + # {Orb::Models::Price::BulkWithProration} for more details. # # @param id [String] # @@ -4555,7 +4748,13 @@ 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::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] # @@ -4573,8 +4772,6 @@ class GroupedAllocation < Orb::Internal::Type::BaseModel # # @param fixed_price_quantity [Float, nil] # - # @param grouped_allocation_config [Hash{Symbol=>Object}] - # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # # @param item [Orb::Models::ItemSlim] @@ -4593,15 +4790,62 @@ 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::BulkWithProration::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, :bulk_with_proration] The pricing model type - # @see Orb::Models::Price::GroupedAllocation#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 @@ -4616,26 +4860,13 @@ 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)] - end - - # @see Orb::Models::Price::GroupedAllocation#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] @@ -4658,11 +4889,23 @@ class GroupedWithProratedMinimum < 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::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 # # @return [Float, nil] @@ -4707,9 +4950,11 @@ class GroupedWithProratedMinimum < Orb::Internal::Type::BaseModel required :fixed_price_quantity, Float, nil?: true # @!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::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig] + required :grouped_with_prorated_minimum_config, + -> { Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig } # @!attribute invoicing_cycle_configuration # @@ -4755,6 +5000,7 @@ 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 @@ -4786,7 +5032,7 @@ 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_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::GroupedWithProratedMinimum} for more details. # @@ -4796,8 +5042,12 @@ class GroupedWithProratedMinimum < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # + # @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] # # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] @@ -4814,7 +5064,7 @@ class GroupedWithProratedMinimum < Orb::Internal::Type::BaseModel # # @param fixed_price_quantity [Float, nil] # - # @param grouped_with_prorated_minimum_config [Hash{Symbol=>Object}] + # @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] # @@ -4840,7 +5090,18 @@ class GroupedWithProratedMinimum < Orb::Internal::Type::BaseModel # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :grouped_with_prorated_minimum] + # @param model_type [Symbol, :grouped_with_prorated_minimum] The pricing model type + + # @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 @@ -4857,18 +5118,34 @@ 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::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::GroupedWithProratedMinimum#price_type @@ -4877,6 +5154,7 @@ module PriceType USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] @@ -4899,11 +5177,23 @@ class GroupedWithMeteredMinimum < 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::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 # # @return [Float, nil] @@ -4948,9 +5238,11 @@ class GroupedWithMeteredMinimum < Orb::Internal::Type::BaseModel required :fixed_price_quantity, Float, nil?: true # @!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::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig] + required :grouped_with_metered_minimum_config, + -> { Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig } # @!attribute invoicing_cycle_configuration # @@ -4996,6 +5288,7 @@ 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 @@ -5027,7 +5320,7 @@ 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:, 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::GroupedWithMeteredMinimum} for more details. # @@ -5037,8 +5330,12 @@ class GroupedWithMeteredMinimum < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # + # @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] # # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] @@ -5055,7 +5352,7 @@ class GroupedWithMeteredMinimum < Orb::Internal::Type::BaseModel # # @param fixed_price_quantity [Float, nil] # - # @param grouped_with_metered_minimum_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] # @@ -5081,7 +5378,18 @@ class GroupedWithMeteredMinimum < Orb::Internal::Type::BaseModel # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :grouped_with_metered_minimum] + # @param model_type [Symbol, :grouped_with_metered_minimum] The pricing model type + + # @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 @@ -5098,18 +5406,108 @@ 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::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::GroupedWithMeteredMinimum#price_type @@ -5118,13 +5516,14 @@ module PriceType 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 GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -5140,10 +5539,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::GroupedWithMinMaxThresholds::BillingMode] + required :billing_mode, enum: -> { Orb::Price::GroupedWithMinMaxThresholds::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::MatrixWithDisplayName::Cadence] - required :cadence, enum: -> { Orb::Price::MatrixWithDisplayName::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 # @@ -5154,7 +5565,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::GroupedWithMinMaxThresholds::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -5188,6 +5599,13 @@ class MatrixWithDisplayName < Orb::Internal::Type::BaseModel # @return [Float, nil] required :fixed_price_quantity, Float, nil?: true + # @!attribute grouped_with_min_max_thresholds_config + # Configuration for grouped_with_min_max_thresholds pricing + # + # @return [Orb::Models::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig] + required :grouped_with_min_max_thresholds_config, + -> { Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig } + # @!attribute invoicing_cycle_configuration # # @return [Orb::Models::BillingCycleConfiguration, nil] @@ -5198,11 +5616,6 @@ class MatrixWithDisplayName < Orb::Internal::Type::BaseModel # @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 +5650,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_with_min_max_thresholds] + required :model_type, const: :grouped_with_min_max_thresholds # @!attribute name # @@ -5253,8 +5667,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::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 @@ -5268,9 +5682,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_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::MatrixWithDisplayName} for more details. + # {Orb::Models::Price::GroupedWithMinMaxThresholds} for more details. # # @param id [String] # @@ -5278,7 +5692,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::GroupedWithMinMaxThresholds::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::GroupedWithMinMaxThresholds::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -5296,12 +5714,12 @@ class MatrixWithDisplayName < Orb::Internal::Type::BaseModel # # @param fixed_price_quantity [Float, nil] # + # @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 matrix_with_display_name_config [Hash{Symbol=>Object}] - # # @param maximum [Orb::Models::Maximum, nil] # # @param maximum_amount [String, nil] @@ -5316,15 +5734,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::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, :matrix_with_display_name] + # @param model_type [Symbol, :grouped_with_min_max_thresholds] The pricing model type - # @see Orb::Models::Price::MatrixWithDisplayName#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 @@ -5339,33 +5768,58 @@ 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::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::MatrixWithDisplayName#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 BulkWithProration < Orb::Internal::Type::BaseModel + class MatrixWithDisplayName < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -5381,15 +5835,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::MatrixWithDisplayName::BillingMode] + required :billing_mode, enum: -> { Orb::Price::MatrixWithDisplayName::BillingMode } # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::BulkWithProration::Cadence] - required :cadence, enum: -> { Orb::Price::BulkWithProration::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 # @@ -5400,7 +5861,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::MatrixWithDisplayName::ConversionRateConfig }, nil?: true # @!attribute created_at @@ -5444,6 +5905,13 @@ class BulkWithProration < Orb::Internal::Type::BaseModel # @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 # @@ -5478,9 +5946,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, :matrix_with_display_name] + required :model_type, const: :matrix_with_display_name # @!attribute name # @@ -5494,8 +5963,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::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 @@ -5509,9 +5978,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:, 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::BulkWithProration} for more details. + # {Orb::Models::Price::MatrixWithDisplayName} for more details. # # @param id [String] # @@ -5519,9 +5988,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::MatrixWithDisplayName::BillingMode] # - # @param cadence [Symbol, Orb::Models::Price::BulkWithProration::Cadence] + # @param cadence [Symbol, Orb::Models::Price::MatrixWithDisplayName::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -5543,6 +6014,8 @@ class BulkWithProration < Orb::Internal::Type::BaseModel # # @param item [Orb::Models::ItemSlim] # + # @param matrix_with_display_name_config [Orb::Models::Price::MatrixWithDisplayName::MatrixWithDisplayNameConfig] Configuration for matrix_with_display_name pricing + # # @param maximum [Orb::Models::Maximum, nil] # # @param maximum_amount [String, nil] @@ -5557,15 +6030,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::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, :bulk_with_proration] + # @param model_type [Symbol, :matrix_with_display_name] The pricing model type - # @see Orb::Models::Price::BulkWithProration#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 @@ -5580,26 +6064,65 @@ 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::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::BulkWithProration#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] @@ -5622,11 +6145,23 @@ class GroupedTieredPackage < 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::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 # # @return [Float, nil] @@ -5671,9 +6206,11 @@ class GroupedTieredPackage < Orb::Internal::Type::BaseModel required :fixed_price_quantity, Float, nil?: true # @!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::Price::GroupedTieredPackage::GroupedTieredPackageConfig] + required :grouped_tiered_package_config, + -> { Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig } # @!attribute invoicing_cycle_configuration # @@ -5719,6 +6256,7 @@ 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 @@ -5750,7 +6288,7 @@ class GroupedTieredPackage < 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_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:, 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::GroupedTieredPackage} for more details. # @@ -5760,8 +6298,12 @@ class GroupedTieredPackage < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # + # @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] # # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] @@ -5778,7 +6320,7 @@ class GroupedTieredPackage < Orb::Internal::Type::BaseModel # # @param fixed_price_quantity [Float, nil] # - # @param grouped_tiered_package_config [Hash{Symbol=>Object}] + # @param grouped_tiered_package_config [Orb::Models::Price::GroupedTieredPackage::GroupedTieredPackageConfig] Configuration for grouped_tiered_package pricing # # @param invoicing_cycle_configuration [Orb::Models::BillingCycleConfiguration, nil] # @@ -5804,7 +6346,18 @@ class GroupedTieredPackage < Orb::Internal::Type::BaseModel # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :grouped_tiered_package] + # @param model_type [Symbol, :grouped_tiered_package] The pricing model type + + # @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 @@ -5821,18 +6374,61 @@ 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)] + # @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::GroupedTieredPackage#price_type @@ -5841,6 +6437,7 @@ module PriceType USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] @@ -5863,11 +6460,23 @@ class MaxGroupTieredPackage < Orb::Internal::Type::BaseModel # @return [Orb::Models::BillingCycleConfiguration] required :billing_cycle_configuration, -> { Orb::BillingCycleConfiguration } + # @!attribute billing_mode + # + # @return [Symbol, Orb::Models::Price::MaxGroupTieredPackage::BillingMode] + required :billing_mode, enum: -> { Orb::Price::MaxGroupTieredPackage::BillingMode } + # @!attribute 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 # # @return [Float, nil] @@ -5922,9 +6531,11 @@ class MaxGroupTieredPackage < Orb::Internal::Type::BaseModel required :item, -> { Orb::ItemSlim } # @!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::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig] + required :max_group_tiered_package_config, + -> { Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig } # @!attribute maximum # @deprecated @@ -5960,6 +6571,7 @@ 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 @@ -5991,7 +6603,7 @@ class MaxGroupTieredPackage < 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:, 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:, 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::MaxGroupTieredPackage} for more details. # @@ -6001,8 +6613,12 @@ class MaxGroupTieredPackage < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # + # @param billing_mode [Symbol, Orb::Models::Price::MaxGroupTieredPackage::BillingMode] + # # @param cadence [Symbol, Orb::Models::Price::MaxGroupTieredPackage::Cadence] # + # @param composite_price_filters [Array, nil] + # # @param conversion_rate [Float, nil] # # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] @@ -6023,7 +6639,7 @@ class MaxGroupTieredPackage < Orb::Internal::Type::BaseModel # # @param item [Orb::Models::ItemSlim] # - # @param max_group_tiered_package_config [Hash{Symbol=>Object}] + # @param max_group_tiered_package_config [Orb::Models::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig] Configuration for max_group_tiered_package pricing # # @param maximum [Orb::Models::Maximum, nil] # @@ -6045,7 +6661,18 @@ class MaxGroupTieredPackage < Orb::Internal::Type::BaseModel # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :max_group_tiered_package] + # @param model_type [Symbol, :max_group_tiered_package] The pricing model type + + # @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 @@ -6062,18 +6689,60 @@ 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)] + # @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::MaxGroupTieredPackage#price_type @@ -6082,6 +6751,7 @@ module PriceType USAGE_PRICE = :usage_price FIXED_PRICE = :fixed_price + COMPOSITE_PRICE = :composite_price # @!method self.values # @return [Array] @@ -6104,11 +6774,23 @@ class ScalableMatrixWithUnitPricing < 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::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 # # @return [Float, nil] @@ -6196,6 +6878,7 @@ 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 @@ -6223,17 +6906,18 @@ class ScalableMatrixWithUnitPricing < Orb::Internal::Type::BaseModel required :replaces_price_id, String, nil?: true # @!attribute scalable_matrix_with_unit_pricing_config + # Configuration for scalable_matrix_with_unit_pricing pricing # - # @return [Hash{Symbol=>Object}] + # @return [Orb::Models::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig] required :scalable_matrix_with_unit_pricing_config, - Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + -> { 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:, 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:, 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::ScalableMatrixWithUnitPricing} for more details. # @@ -6243,8 +6927,12 @@ class ScalableMatrixWithUnitPricing < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # + # @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] # # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] @@ -6283,11 +6971,22 @@ class ScalableMatrixWithUnitPricing < 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 scalable_matrix_with_unit_pricing_config [Hash{Symbol=>Object}] + # @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, :scalable_matrix_with_unit_pricing] + # @param model_type [Symbol, :scalable_matrix_with_unit_pricing] The pricing model type + + # @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 @@ -6304,30 +7003,93 @@ 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)] - end - # @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 ScalableMatrixWithTieredPricing < Orb::Internal::Type::BaseModel @@ -6346,11 +7108,23 @@ class ScalableMatrixWithTieredPricing < 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::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 # # @return [Float, nil] @@ -6438,6 +7212,7 @@ class ScalableMatrixWithTieredPricing < Orb::Internal::Type::BaseModel required :minimum_amount, String, nil?: true # @!attribute model_type + # The pricing model type # # @return [Symbol, :scalable_matrix_with_tiered_pricing] required :model_type, const: :scalable_matrix_with_tiered_pricing @@ -6465,17 +7240,18 @@ class ScalableMatrixWithTieredPricing < Orb::Internal::Type::BaseModel required :replaces_price_id, String, nil?: true # @!attribute scalable_matrix_with_tiered_pricing_config + # Configuration for scalable_matrix_with_tiered_pricing pricing # - # @return [Hash{Symbol=>Object}] + # @return [Orb::Models::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig] required :scalable_matrix_with_tiered_pricing_config, - Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + -> { 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:, 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:, 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::ScalableMatrixWithTieredPricing} for more details. # @@ -6485,8 +7261,12 @@ class ScalableMatrixWithTieredPricing < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # + # @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] # # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] @@ -6525,11 +7305,22 @@ class ScalableMatrixWithTieredPricing < 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 scalable_matrix_with_tiered_pricing_config [Hash{Symbol=>Object}] + # @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, :scalable_matrix_with_tiered_pricing] + # @param model_type [Symbol, :scalable_matrix_with_tiered_pricing] The pricing model type + + # @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 @@ -6546,30 +7337,107 @@ 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)] - end - # @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 CumulativeGroupedBulk < Orb::Internal::Type::BaseModel @@ -6588,11 +7456,23 @@ class CumulativeGroupedBulk < 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::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 # # @return [Float, nil] @@ -6616,9 +7496,11 @@ class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel required :credit_allocation, -> { Orb::Allocation }, nil?: true # @!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::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig] + required :cumulative_grouped_bulk_config, + -> { Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig } # @!attribute currency # @@ -6685,6 +7567,7 @@ 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 @@ -6716,7 +7599,7 @@ 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:, 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::CumulativeGroupedBulk} for more details. # @@ -6726,8 +7609,12 @@ class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel # # @param billing_cycle_configuration [Orb::Models::BillingCycleConfiguration] # + # @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] # # @param conversion_rate_config [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] @@ -6736,7 +7623,7 @@ class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel # # @param credit_allocation [Orb::Models::Allocation, nil] # - # @param cumulative_grouped_bulk_config [Hash{Symbol=>Object}] + # @param cumulative_grouped_bulk_config [Orb::Models::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig] Configuration for cumulative_grouped_bulk pricing # # @param currency [String] # @@ -6770,7 +7657,18 @@ class CumulativeGroupedBulk < Orb::Internal::Type::BaseModel # # @param dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :cumulative_grouped_bulk] + # @param model_type [Symbol, :cumulative_grouped_bulk] The pricing model type + + # @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 @@ -6787,18 +7685,56 @@ 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::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::CumulativeGroupedBulk#price_type @@ -6807,13 +7743,14 @@ module PriceType 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 Minimum < Orb::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -6829,10 +7766,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::Minimum::BillingMode] + required :billing_mode, enum: -> { Orb::Price::Minimum::BillingMode } + # @!attribute cadence # - # @return [Symbol, Orb::Models::Price::GroupedWithMinMaxThresholds::Cadence] - required :cadence, enum: -> { Orb::Price::GroupedWithMinMaxThresholds::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 # @@ -6842,9 +7791,7 @@ class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel # @!attribute conversion_rate_config # # @return [Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig, nil] - required :conversion_rate_config, - union: -> { Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig }, - nil?: true + required :conversion_rate_config, union: -> { Orb::Price::Minimum::ConversionRateConfig }, nil?: true # @!attribute created_at # @@ -6877,12 +7824,6 @@ 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] @@ -6926,10 +7867,17 @@ class GroupedWithMinMaxThresholds < 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, :grouped_with_min_max_thresholds] - required :model_type, const: :grouped_with_min_max_thresholds + # @return [Symbol, :minimum] + required :model_type, const: :minimum # @!attribute name # @@ -6943,8 +7891,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::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 @@ -6958,9 +7906,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:, 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::GroupedWithMinMaxThresholds} for more details. + # {Orb::Models::Price::Minimum} for more details. # # @param id [String] # @@ -6968,7 +7916,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::Minimum::BillingMode] + # + # @param cadence [Symbol, Orb::Models::Price::Minimum::Cadence] + # + # @param composite_price_filters [Array, nil] # # @param conversion_rate [Float, nil] # @@ -6986,8 +7938,6 @@ class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel # # @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] @@ -7002,19 +7952,32 @@ class GroupedWithMinMaxThresholds < 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::GroupedWithMinMaxThresholds::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 dimensional_price_configuration [Orb::Models::DimensionalPriceConfiguration, nil] # - # @param model_type [Symbol, :grouped_with_min_max_thresholds] + # @param model_type [Symbol, :minimum] The pricing model type - # @see Orb::Models::Price::GroupedWithMinMaxThresholds#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 @@ -7029,26 +7992,35 @@ 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::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::GroupedWithMinMaxThresholds#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] @@ -7056,7 +8028,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)] end end end diff --git a/lib/orb/models/price_create_params.rb b/lib/orb/models/price_create_params.rb index fb9cc042..adfc0717 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,169 @@ 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 [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 [Hash{Symbol=>Object}] - required :grouped_tiered_package_config, Orb::Internal::Type::HashOf[Orb::Internal::Type::Unknown] + # @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 } + + # @!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:, 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 +288,63 @@ 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 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 cumulative_grouped_bulk_config [Hash{Symbol=>Object}] + # @param minimum_config [Orb::Models::PriceCreateParams::MinimumConfig] Configuration for 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 # @@ -360,27 +385,1005 @@ module Cadence # @return [Array] end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum - CUMULATIVE_GROUPED_BULK = :cumulative_grouped_bulk + MINIMUM = :minimum # @!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] } - discriminator :conversion_rate_type + # @!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 + + # @!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 - variant :unit, -> { Orb::UnitConversionRateConfig } + class MinimumConfig < Orb::Internal::Type::BaseModel + # @!attribute minimum_amount + # The minimum amount to apply + # + # @return [String] + required :minimum_amount, String - variant :tiered, -> { Orb::TieredConversionRateConfig } + # @!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 self.variants - # @return [Array(Orb::Models::UnitConversionRateConfig, Orb::Models::TieredConversionRateConfig)] + # @!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 end end diff --git a/lib/orb/models/price_evaluate_multiple_params.rb b/lib/orb/models/price_evaluate_multiple_params.rb index 4670fb80..a8aa956a 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, 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, 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,276 @@ 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 } + + 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 + # @!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)] 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..c3180887 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, 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, 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,276 @@ 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 } + + 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 + # @!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)] end end end diff --git a/lib/orb/models/price_interval.rb b/lib/orb/models/price_interval.rb index 3ba3f270..1c08c50a 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] 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] 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..2089f3ce 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, 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, 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,501 @@ 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 } + + 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 # @!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)] end end @@ -687,9 +1139,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, nil] optional :price, union: -> { Orb::SubscriptionCreateParams::ReplacePrice::Price }, nil?: true # @!attribute price_id @@ -716,11 +1168,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, 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 +1182,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 +1196,502 @@ 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 } + + 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 # @!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)] 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..e40a54e4 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, 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, 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,280 @@ 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 } + + 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 + # @!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)] 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 +599,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 +626,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 +677,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..ba943cb2 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, 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, 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,506 @@ 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 } + + 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 # @!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)] end end @@ -655,9 +1112,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, nil] optional :price, union: -> { Orb::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price @@ -689,11 +1146,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, 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 +1160,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 +1174,506 @@ 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 } + + 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 # @!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)] 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..f9c7c4a5 100644 --- a/lib/orb/models/unit_config.rb +++ b/lib/orb/models/unit_config.rb @@ -9,8 +9,18 @@ class UnitConfig < Orb::Internal::Type::BaseModel # @return [String] required :unit_amount, String - # @!method initialize(unit_amount:) + # @!attribute scaling_factor + # Multiplier to scale rated quantity by + # + # @return [Float, nil] + optional :scaling_factor, Float, nil?: true + + # @!method initialize(unit_amount:, scaling_factor: nil) + # Configuration for unit pricing + # # @param unit_amount [String] Rate per unit of usage + # + # @param scaling_factor [Float, nil] Multiplier to scale rated quantity by end 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/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..bb3304a4 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:, 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,63 @@ 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 cumulative_grouped_bulk_config [Hash{Symbol=>Object}] + # @param minimum_config [Orb::Models::PriceCreateParams::MinimumConfig] Configuration for 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 # @@ -112,7 +110,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] # # @see Orb::Models::PriceCreateParams def create(params) @@ -135,7 +133,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] # # @see Orb::Models::PriceUpdateParams def update(price_id, params = {}) @@ -163,7 +161,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 +351,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] # # @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..b20945b5 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] # # @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] # # @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..f634b217 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,38 @@ 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 ) ) ) @@ -371,33 +370,32 @@ 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 ) ) ).returns(T.attached_class) @@ -407,7 +405,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 +419,32 @@ 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 ) ) } @@ -456,7 +453,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,35 +461,815 @@ 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 + ) + end + + class TieredWithProration < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::Price::TieredWithProration, + 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 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::AddPrice::Price::TieredWithProration::TieredWithProrationConfig + ) + end + attr_reader :tiered_with_proration_config + + 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 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::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 + + 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 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 sig do override.returns( @@ -715,39 +1492,38 @@ 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::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 ) ) ) @@ -763,33 +1539,32 @@ 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::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::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 ) ) ).returns(T.attached_class) @@ -801,7 +1576,7 @@ module Orb allocation_price: nil, # The phase to replace this price from. plan_phase_order: nil, - # The price to add to the plan + # New plan price request body params. price: nil ) end @@ -816,33 +1591,32 @@ 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::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 ) ) } @@ -851,7 +1625,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 @@ -859,35 +1633,815 @@ 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::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 + ) + 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 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..73bb3baf 100644 --- a/rbi/orb/models/beta_create_plan_version_params.rbi +++ b/rbi/orb/models/beta_create_plan_version_params.rbi @@ -276,39 +276,38 @@ 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 ) ) ) @@ -323,33 +322,32 @@ 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 ) ) ).returns(T.attached_class) @@ -359,7 +357,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 +371,32 @@ 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 ) ) } @@ -408,7 +405,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,35 +413,814 @@ 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 + ) + end + + class TieredWithProration < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::BetaCreatePlanVersionParams::AddPrice::Price::TieredWithProration, + 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 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::AddPrice::Price::TieredWithProration::TieredWithProrationConfig + ) + end + attr_reader :tiered_with_proration_config + + 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 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::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 + + 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 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 sig do override.returns( @@ -667,39 +1443,38 @@ 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::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 ) ) ) @@ -715,33 +1490,32 @@ 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::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::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 ) ) ).returns(T.attached_class) @@ -753,7 +1527,7 @@ module Orb allocation_price: nil, # The phase to replace this price from. plan_phase_order: nil, - # The price to add to the plan + # New plan price request body params. price: nil ) end @@ -768,33 +1542,32 @@ 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::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 ) ) } @@ -803,7 +1576,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 @@ -811,35 +1584,814 @@ 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::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 + ) + 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 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..a8039d72 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,1737 @@ 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 + ), + 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..aaded5f6 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,17 @@ 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 ), quantity: Float, start_date: Time, @@ -1321,7 +1324,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 +1444,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 +1463,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 +1478,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 +1497,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..df498e8e 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,17 @@ 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 ), quantity: Float, start_date: Time, @@ -1424,7 +1427,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 +1558,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 +1577,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 +1592,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 +1611,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_response.rbi b/rbi/orb/models/invoice_line_item_create_response.rbi index a73a00fa..f674f8f5 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,17 @@ 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 ), quantity: Float, start_date: Time, @@ -270,7 +268,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..f91b73d7 100644 --- a/rbi/orb/models/item.rbi +++ b/rbi/orb/models/item.rbi @@ -148,6 +148,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_update_params.rbi b/rbi/orb/models/item_update_params.rbi index 0880437d..a76c065e 100644 --- a/rbi/orb/models/item_update_params.rbi +++ b/rbi/orb/models/item_update_params.rbi @@ -147,6 +147,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_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..c4adc95e 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,17 @@ 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 ), price_id: String, subtotal: String, diff --git a/rbi/orb/models/plan.rbi b/rbi/orb/models/plan.rbi index 813e07cf..0030e5e7 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,17 @@ 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 ) ], 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..081a364b 100644 --- a/rbi/orb/models/plan_create_params.rbi +++ b/rbi/orb/models/plan_create_params.rbi @@ -149,39 +149,38 @@ 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 ) ) ) @@ -196,33 +195,32 @@ 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 ) ) ).returns(T.attached_class) @@ -232,7 +230,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 +244,32 @@ 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 ) ) } @@ -281,7 +278,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 +286,814 @@ 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 + ) + 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 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..ad844e12 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,17 @@ 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 ) ], version: Integer diff --git a/rbi/orb/models/price.rbi b/rbi/orb/models/price.rbi index 6fc9e6b1..e92c74b7 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,17 @@ 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 ) end @@ -77,9 +75,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 @@ -153,6 +157,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 +175,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 +198,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 +246,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -263,8 +274,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 +288,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 +323,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 +366,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 +377,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 +390,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 +417,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 @@ -476,22 +499,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 +517,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 +540,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 +575,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 +588,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -581,14 +611,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 +630,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 +653,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 +665,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 +715,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 +735,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 +762,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 @@ -776,12 +826,6 @@ module Orb 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 +851,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 +861,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 +885,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 +915,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 +922,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 +933,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:, @@ -896,7 +948,6 @@ module Orb fixed_price_quantity:, invoicing_cycle_configuration:, item:, - matrix_config:, maximum:, maximum_amount:, # User specified key-value pairs for the resource. If not present, this defaults @@ -913,7 +964,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 +975,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 +992,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 +1000,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 +1010,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 +1057,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 +1077,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 +1104,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 @@ -1125,16 +1188,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 +1213,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 +1229,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 +1264,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 +1277,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -1230,14 +1300,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 +1319,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 +1342,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 +1354,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 +1405,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 +1428,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 +1455,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 @@ -1426,6 +1512,13 @@ module Orb 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 +1544,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 +1554,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 +1562,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 +1578,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 +1607,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 +1615,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 +1626,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -1546,6 +1639,8 @@ module Orb fixed_price_quantity:, invoicing_cycle_configuration:, 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 +1656,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 +1668,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 +1684,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 +1693,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 +1703,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 +1753,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 +1773,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 +1802,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 @@ -1784,6 +1890,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 +1900,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 +1910,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 +1940,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 +1977,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 +1990,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, - bps_config:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -1889,8 +2018,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 +2032,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 +2059,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 +2072,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 +2156,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 +2314,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 @@ -2105,6 +2398,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 +2408,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 +2416,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 +2444,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 +2480,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 +2493,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:, @@ -2210,8 +2521,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 +2535,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 +2562,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 +2574,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 +2639,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 +2793,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 @@ -2430,6 +2881,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 +2891,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 +2899,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 +2927,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 +2963,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 +2976,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, - bulk_config:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -2535,8 +3004,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 +3018,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 +3045,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,776 +3058,233 @@ 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) } - 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) - - sig do - override.returns(T::Array[Orb::Price::Bulk::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 - ) + T.all(Symbol, Orb::Price::TieredWithMinimum::BillingMode) end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + 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::ConversionRateConfig::Variants] + T::Array[Orb::Price::TieredWithMinimum::BillingMode::TaggedSymbol] ) end - def self.variants + def self.values end end - module PriceType + module Cadence 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::Cadence) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - USAGE_PRICE = - T.let(:usage_price, Orb::Price::Bulk::PriceType::TaggedSymbol) - FIXED_PRICE = - T.let(:fixed_price, Orb::Price::Bulk::PriceType::TaggedSymbol) - - sig do - override.returns( - T::Array[Orb::Price::Bulk::PriceType::TaggedSymbol] + ONE_TIME = + T.let( + :one_time, + Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol ) - end - def self.values - end - end - end - - 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 - - sig { returns(T.nilable(Orb::BillableMetricTiny)) } - attr_reader :billable_metric - - sig do - params( - billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash) - ).void - end - attr_writer :billable_metric - - sig { returns(Orb::BillingCycleConfiguration) } - attr_reader :billing_cycle_configuration - - sig do - params( - billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash - ).void - end - attr_writer :billing_cycle_configuration - - sig { returns(Orb::Price::ThresholdTotalAmount::Cadence::TaggedSymbol) } - attr_accessor :cadence - - sig { returns(T.nilable(Float)) } - attr_accessor :conversion_rate - - sig do - returns( - T.nilable( - Orb::Price::ThresholdTotalAmount::ConversionRateConfig::Variants - ) - ) - end - attr_accessor :conversion_rate_config - - sig { returns(Time) } - attr_accessor :created_at - - sig { returns(T.nilable(Orb::Allocation)) } - attr_reader :credit_allocation - - sig do - params(credit_allocation: T.nilable(Orb::Allocation::OrHash)).void - end - attr_writer :credit_allocation - - sig { returns(String) } - attr_accessor :currency - - sig { returns(T.nilable(Orb::Discount::Variants)) } - attr_accessor :discount - - sig { returns(T.nilable(String)) } - attr_accessor :external_price_id - - sig { returns(T.nilable(Float)) } - attr_accessor :fixed_price_quantity - - sig { returns(T.nilable(Orb::BillingCycleConfiguration)) } - attr_reader :invoicing_cycle_configuration - - sig do - params( - invoicing_cycle_configuration: - T.nilable(Orb::BillingCycleConfiguration::OrHash) - ).void - end - attr_writer :invoicing_cycle_configuration - - sig { returns(Orb::ItemSlim) } - attr_reader :item - - sig { params(item: Orb::ItemSlim::OrHash).void } - attr_writer :item - - 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 - - # 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 - - sig { returns(Symbol) } - attr_accessor :model_type - - sig { returns(String) } - attr_accessor :name - - sig { returns(T.nilable(Integer)) } - attr_accessor :plan_phase_order - - 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 - # price in plan version migrations. - 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 - - sig do - params( - dimensional_price_configuration: - T.nilable(Orb::DimensionalPriceConfiguration::OrHash) - ).void - end - attr_writer :dimensional_price_configuration - - sig do - params( - id: String, - billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), - billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::ThresholdTotalAmount::Cadence::OrSymbol, - conversion_rate: T.nilable(Float), - conversion_rate_config: - T.nilable( - T.any( - Orb::UnitConversionRateConfig::OrHash, - Orb::TieredConversionRateConfig::OrHash - ) - ), - created_at: Time, - credit_allocation: T.nilable(Orb::Allocation::OrHash), - currency: String, - discount: - T.nilable( - T.any( - Orb::PercentageDiscount::OrHash, - Orb::TrialDiscount::OrHash, - Orb::UsageDiscount::OrHash, - Orb::AmountDiscount::OrHash - ) - ), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - invoicing_cycle_configuration: - T.nilable(Orb::BillingCycleConfiguration::OrHash), - item: Orb::ItemSlim::OrHash, - maximum: T.nilable(Orb::Maximum::OrHash), - maximum_amount: T.nilable(String), - metadata: T::Hash[Symbol, String], - minimum: T.nilable(Orb::Minimum::OrHash), - minimum_amount: T.nilable(String), - name: String, - plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::ThresholdTotalAmount::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 - ).returns(T.attached_class) - end - def self.new( - 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:, - # 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:, - 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:, - threshold_total_amount_config:, - dimensional_price_configuration: nil, - model_type: :threshold_total_amount - ) - end - - sig do - override.returns( - { - id: String, - billable_metric: T.nilable(Orb::BillableMetricTiny), - billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::ThresholdTotalAmount::Cadence::TaggedSymbol, - conversion_rate: T.nilable(Float), - conversion_rate_config: - T.nilable( - Orb::Price::ThresholdTotalAmount::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), - fixed_price_quantity: T.nilable(Float), - invoicing_cycle_configuration: - T.nilable(Orb::BillingCycleConfiguration), - item: Orb::ItemSlim, - maximum: T.nilable(Orb::Maximum), - maximum_amount: T.nilable(String), - metadata: T::Hash[Symbol, String], - minimum: T.nilable(Orb::Minimum), - minimum_amount: T.nilable(String), - model_type: Symbol, - name: String, - plan_phase_order: T.nilable(Integer), - price_type: - Orb::Price::ThresholdTotalAmount::PriceType::TaggedSymbol, - replaces_price_id: T.nilable(String), - threshold_total_amount_config: T::Hash[Symbol, T.anything], - dimensional_price_configuration: - T.nilable(Orb::DimensionalPriceConfiguration) - } - ) - end - def to_hash - end - - module Cadence - extend Orb::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - 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 + 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::ThresholdTotalAmount::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::ThresholdTotalAmount::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::ThresholdTotalAmount::PriceType) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - USAGE_PRICE = - T.let( - :usage_price, - Orb::Price::ThresholdTotalAmount::PriceType::TaggedSymbol - ) - FIXED_PRICE = - T.let( - :fixed_price, - Orb::Price::ThresholdTotalAmount::PriceType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - Orb::Price::ThresholdTotalAmount::PriceType::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - class TieredPackage < Orb::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(Orb::Price::TieredPackage, Orb::Internal::AnyHash) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(T.nilable(Orb::BillableMetricTiny)) } - attr_reader :billable_metric - - sig do - params( - billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash) - ).void - end - attr_writer :billable_metric - - sig { returns(Orb::BillingCycleConfiguration) } - attr_reader :billing_cycle_configuration - - sig do - params( - billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash - ).void - end - attr_writer :billing_cycle_configuration - - sig { returns(Orb::Price::TieredPackage::Cadence::TaggedSymbol) } - attr_accessor :cadence - - sig { returns(T.nilable(Float)) } - attr_accessor :conversion_rate - - sig do - returns( - T.nilable(Orb::Price::TieredPackage::ConversionRateConfig::Variants) - ) - end - attr_accessor :conversion_rate_config - - sig { returns(Time) } - attr_accessor :created_at - - sig { returns(T.nilable(Orb::Allocation)) } - attr_reader :credit_allocation - - sig do - params(credit_allocation: T.nilable(Orb::Allocation::OrHash)).void - end - attr_writer :credit_allocation - - sig { returns(String) } - attr_accessor :currency - - sig { returns(T.nilable(Orb::Discount::Variants)) } - attr_accessor :discount - - sig { returns(T.nilable(String)) } - attr_accessor :external_price_id - - sig { returns(T.nilable(Float)) } - attr_accessor :fixed_price_quantity - - sig { returns(T.nilable(Orb::BillingCycleConfiguration)) } - attr_reader :invoicing_cycle_configuration - - sig do - params( - invoicing_cycle_configuration: - T.nilable(Orb::BillingCycleConfiguration::OrHash) - ).void - end - attr_writer :invoicing_cycle_configuration - - sig { returns(Orb::ItemSlim) } - attr_reader :item - - sig { params(item: Orb::ItemSlim::OrHash).void } - attr_writer :item - - 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 - - # 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 - - sig { returns(Symbol) } - attr_accessor :model_type - - sig { returns(String) } - attr_accessor :name - - sig { returns(T.nilable(Integer)) } - attr_accessor :plan_phase_order - - 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 - # price in plan version migrations. - sig { returns(T.nilable(String)) } - attr_accessor :replaces_price_id - - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_package_config - - sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) } - attr_reader :dimensional_price_configuration - - sig do - params( - dimensional_price_configuration: - T.nilable(Orb::DimensionalPriceConfiguration::OrHash) - ).void - end - attr_writer :dimensional_price_configuration - - sig do - params( - id: String, - billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), - billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, - cadence: Orb::Price::TieredPackage::Cadence::OrSymbol, - conversion_rate: T.nilable(Float), - conversion_rate_config: - T.nilable( - T.any( - Orb::UnitConversionRateConfig::OrHash, - Orb::TieredConversionRateConfig::OrHash - ) - ), - created_at: Time, - credit_allocation: T.nilable(Orb::Allocation::OrHash), - currency: String, - discount: - T.nilable( - T.any( - Orb::PercentageDiscount::OrHash, - Orb::TrialDiscount::OrHash, - Orb::UsageDiscount::OrHash, - Orb::AmountDiscount::OrHash - ) - ), - external_price_id: T.nilable(String), - fixed_price_quantity: T.nilable(Float), - invoicing_cycle_configuration: - T.nilable(Orb::BillingCycleConfiguration::OrHash), - item: Orb::ItemSlim::OrHash, - maximum: T.nilable(Orb::Maximum::OrHash), - maximum_amount: T.nilable(String), - metadata: T::Hash[Symbol, String], - minimum: T.nilable(Orb::Minimum::OrHash), - minimum_amount: T.nilable(String), - name: String, - plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::TieredPackage::PriceType::OrSymbol, - replaces_price_id: T.nilable(String), - tiered_package_config: T::Hash[Symbol, T.anything], - dimensional_price_configuration: - T.nilable(Orb::DimensionalPriceConfiguration::OrHash), - model_type: Symbol - ).returns(T.attached_class) - end - def self.new( - 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:, - # 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:, - 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:, - tiered_package_config:, - dimensional_price_configuration: nil, - model_type: :tiered_package - ) - end - - sig do - override.returns( - { - id: String, - billable_metric: T.nilable(Orb::BillableMetricTiny), - billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Price::TieredPackage::Cadence::TaggedSymbol, - conversion_rate: T.nilable(Float), - conversion_rate_config: - 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), - fixed_price_quantity: T.nilable(Float), - invoicing_cycle_configuration: - T.nilable(Orb::BillingCycleConfiguration), - item: Orb::ItemSlim, - maximum: T.nilable(Orb::Maximum), - maximum_amount: T.nilable(String), - metadata: T::Hash[Symbol, String], - minimum: T.nilable(Orb::Minimum), - minimum_amount: T.nilable(String), - model_type: Symbol, - name: String, - plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::TieredPackage::PriceType::TaggedSymbol, - replaces_price_id: T.nilable(String), - tiered_package_config: T::Hash[Symbol, T.anything], - dimensional_price_configuration: - T.nilable(Orb::DimensionalPriceConfiguration) - } - ) - end - def to_hash + override.returns( + T::Array[Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol] + ) + end + def self.values + end end - module Cadence + module PriceType 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::TieredWithMinimum::PriceType) + 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 = + USAGE_PRICE = T.let( - :semi_annual, - Orb::Price::TieredPackage::Cadence::TaggedSymbol + :usage_price, + Orb::Price::TieredWithMinimum::PriceType::TaggedSymbol + ) + FIXED_PRICE = + T.let( + :fixed_price, + Orb::Price::TieredWithMinimum::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::TieredWithMinimum::PriceType::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::TieredWithMinimum::PriceType::TaggedSymbol] ) end def self.values end end - 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::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 - override.returns( + returns( T::Array[ - Orb::Price::TieredPackage::ConversionRateConfig::Variants + Orb::Price::TieredWithMinimum::TieredWithMinimumConfig::Tier ] ) end - def self.variants - end - end + attr_accessor :tiers - module PriceType - extend Orb::Internal::Type::Enum + # 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 - TaggedSymbol = - T.type_alias { T.all(Symbol, Orb::Price::TieredPackage::PriceType) } - OrSymbol = T.type_alias { T.any(Symbol, String) } + sig { params(hide_zero_amount_tiers: T::Boolean).void } + attr_writer :hide_zero_amount_tiers - USAGE_PRICE = - T.let( - :usage_price, - Orb::Price::TieredPackage::PriceType::TaggedSymbol - ) - FIXED_PRICE = - T.let( - :fixed_price, - Orb::Price::TieredPackage::PriceType::TaggedSymbol - ) + # 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( - T::Array[Orb::Price::TieredPackage::PriceType::TaggedSymbol] + { + tiers: + T::Array[ + Orb::Price::TieredWithMinimum::TieredWithMinimumConfig::Tier + ], + hide_zero_amount_tiers: T::Boolean, + prorate: T::Boolean + } ) end - def self.values + 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 @@ -3381,9 +3318,15 @@ module Orb end attr_writer :billing_cycle_configuration + 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 @@ -3417,8 +3360,17 @@ module Orb sig { returns(T.nilable(Float)) } attr_accessor :fixed_price_quantity - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_tiered_config + # 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 @@ -3462,6 +3414,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -3495,7 +3448,10 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, + 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( @@ -3518,7 +3474,8 @@ module Orb ), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), - grouped_tiered_config: T::Hash[Symbol, T.anything], + grouped_tiered_config: + Orb::Price::GroupedTiered::GroupedTieredConfig::OrHash, invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration::OrHash), item: Orb::ItemSlim::OrHash, @@ -3540,7 +3497,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -3549,6 +3508,7 @@ module Orb discount:, external_price_id:, fixed_price_quantity:, + # Configuration for grouped_tiered pricing grouped_tiered_config:, invoicing_cycle_configuration:, item:, @@ -3568,6 +3528,7 @@ module Orb # price in plan version migrations. replaces_price_id:, dimensional_price_configuration: nil, + # The pricing model type model_type: :grouped_tiered ) end @@ -3578,7 +3539,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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( @@ -3590,7 +3555,8 @@ 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], + grouped_tiered_config: + Orb::Price::GroupedTiered::GroupedTieredConfig, invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, @@ -3612,6 +3578,35 @@ module Orb def to_hash end + module BillingMode + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Orb::Price::GroupedTiered::BillingMode) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_ADVANCE = + T.let( + :in_advance, + Orb::Price::GroupedTiered::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::GroupedTiered::BillingMode::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 @@ -3644,25 +3639,97 @@ module Orb 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::GroupedTiered::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 @@ -3683,6 +3750,11 @@ module Orb :fixed_price, Orb::Price::GroupedTiered::PriceType::TaggedSymbol ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::GroupedTiered::PriceType::TaggedSymbol + ) sig do override.returns( @@ -3694,10 +3766,10 @@ module Orb end end - class TieredWithMinimum < Orb::Internal::Type::BaseModel + class TieredPackageWithMinimum < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::TieredWithMinimum, Orb::Internal::AnyHash) + T.any(Orb::Price::TieredPackageWithMinimum, Orb::Internal::AnyHash) end sig { returns(String) } @@ -3723,16 +3795,28 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::Price::TieredWithMinimum::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::TieredWithMinimum::ConversionRateConfig::Variants + Orb::Price::TieredPackageWithMinimum::ConversionRateConfig::Variants ) ) end @@ -3803,6 +3887,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 +3897,9 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig { returns(Orb::Price::TieredWithMinimum::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 @@ -3820,8 +3907,21 @@ 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 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 @@ -3839,7 +3939,11 @@ 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::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( @@ -3872,9 +3976,11 @@ 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::TieredPackageWithMinimum::PriceType::OrSymbol, replaces_price_id: T.nilable(String), - tiered_with_minimum_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 @@ -3884,7 +3990,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -3910,9 +4018,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 tiered_package_with_minimum pricing + tiered_package_with_minimum_config:, dimensional_price_configuration: nil, - model_type: :tiered_with_minimum + # The pricing model type + model_type: :tiered_package_with_minimum ) end @@ -3922,11 +4032,16 @@ 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::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::TieredWithMinimum::ConversionRateConfig::Variants + Orb::Price::TieredPackageWithMinimum::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -3946,9 +4061,10 @@ module Orb name: String, plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::TieredWithMinimum::PriceType::TaggedSymbol, + Orb::Price::TieredPackageWithMinimum::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), - tiered_with_minimum_config: T::Hash[Symbol, T.anything], + tiered_package_with_minimum_config: + Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -3957,105 +4073,239 @@ module Orb def to_hash end + module BillingMode + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Orb::Price::TieredPackageWithMinimum::BillingMode) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_ADVANCE = + T.let( + :in_advance, + Orb::Price::TieredPackageWithMinimum::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::TieredPackageWithMinimum::BillingMode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Price::TieredPackageWithMinimum::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::TieredWithMinimum::Cadence) + T.all(Symbol, Orb::Price::TieredPackageWithMinimum::Cadence) end OrSymbol = T.type_alias { T.any(Symbol, String) } ONE_TIME = T.let( :one_time, - Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol + Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol + Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol + Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol + Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol ) ANNUAL = - T.let(:annual, Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol) + T.let( + :annual, + Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + ) CUSTOM = - T.let(:custom, Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol) + T.let( + :custom, + Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + ) sig do override.returns( - T::Array[Orb::Price::TieredWithMinimum::Cadence::TaggedSymbol] + T::Array[ + Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + ] ) end def self.values end end - module ConversionRateConfig - extend Orb::Internal::Type::Union + module PriceType + extend Orb::Internal::Type::Enum + + TaggedSymbol = + 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::TieredPackageWithMinimum::PriceType::TaggedSymbol + ) + FIXED_PRICE = + T.let( + :fixed_price, + Orb::Price::TieredPackageWithMinimum::PriceType::TaggedSymbol + ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::TieredPackageWithMinimum::PriceType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Orb::Price::TieredPackageWithMinimum::PriceType::TaggedSymbol + ] + ) + end + def self.values + end + end - Variants = + class TieredPackageWithMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = T.type_alias do T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + 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 - override.returns( + returns( T::Array[ - Orb::Price::TieredWithMinimum::ConversionRateConfig::Variants + Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig::Tier ] ) 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) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } + attr_accessor :tiers - USAGE_PRICE = - T.let( - :usage_price, - Orb::Price::TieredWithMinimum::PriceType::TaggedSymbol - ) - FIXED_PRICE = - T.let( - :fixed_price, - Orb::Price::TieredWithMinimum::PriceType::TaggedSymbol - ) + # 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( - T::Array[Orb::Price::TieredWithMinimum::PriceType::TaggedSymbol] + { + package_size: Float, + tiers: + T::Array[ + Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig::Tier + ] + } ) end - def self.values + 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 TieredPackageWithMinimum < Orb::Internal::Type::BaseModel + class PackageWithAllocation < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::TieredPackageWithMinimum, Orb::Internal::AnyHash) + T.any(Orb::Price::PackageWithAllocation, Orb::Internal::AnyHash) end sig { returns(String) } @@ -4082,17 +4332,25 @@ module Orb attr_writer :billing_cycle_configuration sig do - returns(Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol) + 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::TieredPackageWithMinimum::ConversionRateConfig::Variants + Orb::Price::PackageWithAllocation::ConversionRateConfig::Variants ) ) end @@ -4163,17 +4421,34 @@ 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 do - returns(Orb::Price::TieredPackageWithMinimum::PriceType::TaggedSymbol) + returns(Orb::Price::PackageWithAllocation::PriceType::TaggedSymbol) end attr_accessor :price_type @@ -4182,9 +4457,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 +4473,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::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( @@ -4233,11 +4509,11 @@ 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::TieredPackageWithMinimum::PriceType::OrSymbol, + price_type: Orb::Price::PackageWithAllocation::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 +4523,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -4268,14 +4546,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:, - tiered_package_with_minimum_config:, dimensional_price_configuration: nil, - model_type: :tiered_package_with_minimum + # The pricing model type + model_type: :package_with_allocation ) end @@ -4285,12 +4565,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::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::TieredPackageWithMinimum::ConversionRateConfig::Variants + Orb::Price::PackageWithAllocation::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -4308,11 +4591,12 @@ 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::TieredPackageWithMinimum::PriceType::TaggedSymbol, + Orb::Price::PackageWithAllocation::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,76 +4605,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 do - T.all(Symbol, Orb::Price::TieredPackageWithMinimum::Cadence) + T.all(Symbol, Orb::Price::PackageWithAllocation::Cadence) end OrSymbol = T.type_alias { T.any(Symbol, String) } ONE_TIME = T.let( :one_time, - Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol ) ANNUAL = T.let( :annual, - Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol ) CUSTOM = T.let( :custom, - Orb::Price::TieredPackageWithMinimum::Cadence::TaggedSymbol + Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol ) sig do override.returns( - T::Array[ - Orb::Price::TieredPackageWithMinimum::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::TieredPackageWithMinimum::ConversionRateConfig::Variants - ] + { + allocation: String, + package_amount: String, + package_size: String + } ) end - def self.variants + def to_hash end end @@ -4399,25 +4742,30 @@ module Orb TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::TieredPackageWithMinimum::PriceType) + T.all(Symbol, Orb::Price::PackageWithAllocation::PriceType) end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::TieredPackageWithMinimum::PriceType::TaggedSymbol + Orb::Price::PackageWithAllocation::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::TieredPackageWithMinimum::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::TieredPackageWithMinimum::PriceType::TaggedSymbol + Orb::Price::PackageWithAllocation::PriceType::TaggedSymbol ] ) end @@ -4426,10 +4774,10 @@ module Orb end end - class PackageWithAllocation < Orb::Internal::Type::BaseModel + class UnitWithPercent < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::PackageWithAllocation, Orb::Internal::AnyHash) + T.any(Orb::Price::UnitWithPercent, Orb::Internal::AnyHash) end sig { returns(String) } @@ -4455,18 +4803,22 @@ module Orb end attr_writer :billing_cycle_configuration - sig do - returns(Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol) - end + 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::PackageWithAllocation::ConversionRateConfig::Variants + Orb::Price::UnitWithPercent::ConversionRateConfig::Variants ) ) end @@ -4537,21 +4889,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(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) - end + 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 @@ -4559,6 +4907,18 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :replaces_price_id + # 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 @@ -4575,7 +4935,10 @@ 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::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( @@ -4607,10 +4970,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::UnitWithPercent::PriceType::OrSymbol, replaces_price_id: T.nilable(String), + unit_with_percent_config: + Orb::Price::UnitWithPercent::UnitWithPercentConfig::OrHash, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -4620,7 +4984,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -4641,14 +5007,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 unit_with_percent pricing + unit_with_percent_config:, dimensional_price_configuration: nil, - model_type: :package_with_allocation + # The pricing model type + model_type: :unit_with_percent ) end @@ -4658,11 +5026,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::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::PackageWithAllocation::ConversionRateConfig::Variants + Orb::Price::UnitWithPercent::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -4680,11 +5052,11 @@ 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, + price_type: Orb::Price::UnitWithPercent::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), + unit_with_percent_config: + Orb::Price::UnitWithPercent::UnitWithPercentConfig, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -4693,113 +5065,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::PackageWithAllocation::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::PackageWithAllocation::Cadence::TaggedSymbol + :in_advance, + Orb::Price::UnitWithPercent::BillingMode::TaggedSymbol ) - MONTHLY = + IN_ARREAR = T.let( - :monthly, - Orb::Price::PackageWithAllocation::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::PackageWithAllocation::Cadence::TaggedSymbol + Orb::Price::UnitWithPercent::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol + Orb::Price::UnitWithPercent::Cadence::TaggedSymbol ) ANNUAL = - T.let( - :annual, - Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol - ) + T.let(:annual, Orb::Price::UnitWithPercent::Cadence::TaggedSymbol) CUSTOM = - T.let( - :custom, - Orb::Price::PackageWithAllocation::Cadence::TaggedSymbol - ) + T.let(:custom, Orb::Price::UnitWithPercent::Cadence::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::PackageWithAllocation::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::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::UnitWithPercent::PriceType) end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::PackageWithAllocation::PriceType::TaggedSymbol + Orb::Price::UnitWithPercent::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::PackageWithAllocation::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::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 - override.returns( - T::Array[ - Orb::Price::PackageWithAllocation::PriceType::TaggedSymbol - ] + params(percent: String, unit_amount: String).returns( + T.attached_class ) end - def self.values + 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 UnitWithPercent < Orb::Internal::Type::BaseModel + class MatrixWithAllocation < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::UnitWithPercent, Orb::Internal::AnyHash) + T.any(Orb::Price::MatrixWithAllocation, Orb::Internal::AnyHash) end sig { returns(String) } @@ -4825,16 +5229,24 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::Price::UnitWithPercent::Cadence::TaggedSymbol) } + sig do + 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::UnitWithPercent::ConversionRateConfig::Variants + Orb::Price::MatrixWithAllocation::ConversionRateConfig::Variants ) ) end @@ -4880,6 +5292,18 @@ module Orb 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 @@ -4905,6 +5329,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 +5339,9 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig { returns(Orb::Price::UnitWithPercent::PriceType::TaggedSymbol) } + sig do + returns(Orb::Price::MatrixWithAllocation::PriceType::TaggedSymbol) + end attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -4922,9 +5349,6 @@ 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 - sig { returns(T.nilable(Orb::DimensionalPriceConfiguration)) } attr_reader :dimensional_price_configuration @@ -4941,7 +5365,11 @@ 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::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( @@ -4967,6 +5395,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], @@ -4974,9 +5404,8 @@ 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::MatrixWithAllocation::PriceType::OrSymbol, replaces_price_id: T.nilable(String), - unit_with_percent_config: T::Hash[Symbol, T.anything], dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -4986,7 +5415,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -4997,6 +5428,8 @@ module Orb fixed_price_quantity:, invoicing_cycle_configuration:, 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 @@ -5012,9 +5445,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_percent_config:, dimensional_price_configuration: nil, - model_type: :unit_with_percent + # The pricing model type + model_type: :matrix_with_allocation ) end @@ -5024,11 +5457,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::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::UnitWithPercent::ConversionRateConfig::Variants + Orb::Price::MatrixWithAllocation::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -5039,6 +5476,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], @@ -5047,9 +5485,9 @@ module Orb model_type: Symbol, name: String, plan_phase_order: T.nilable(Integer), - price_type: Orb::Price::UnitWithPercent::PriceType::TaggedSymbol, + price_type: + Orb::Price::MatrixWithAllocation::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), - unit_with_percent_config: T::Hash[Symbol, T.anything], dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -5058,60 +5496,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::UnitWithPercent::Cadence) } + T.type_alias do + T.all(Symbol, Orb::Price::MatrixWithAllocation::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::MatrixWithAllocation::BillingMode::TaggedSymbol ) - SEMI_ANNUAL = + IN_ARREAR = T.let( - :semi_annual, - Orb::Price::UnitWithPercent::Cadence::TaggedSymbol + :in_arrear, + Orb::Price::MatrixWithAllocation::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::MatrixWithAllocation::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::MatrixWithAllocation::Cadence) end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ONE_TIME = + T.let( + :one_time, + Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol + ) + QUARTERLY = + T.let( + :quarterly, + Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol + ) + SEMI_ANNUAL = + T.let( + :semi_annual, + Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol + ) + ANNUAL = + T.let( + :annual, + Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol + ) sig do override.returns( - T::Array[ - Orb::Price::UnitWithPercent::ConversionRateConfig::Variants - ] + T::Array[Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol] ) end - def self.variants + def self.values end end @@ -5120,24 +5581,31 @@ module Orb TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::UnitWithPercent::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::UnitWithPercent::PriceType::TaggedSymbol + Orb::Price::MatrixWithAllocation::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::UnitWithPercent::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::UnitWithPercent::PriceType::TaggedSymbol] + T::Array[ + Orb::Price::MatrixWithAllocation::PriceType::TaggedSymbol + ] ) end def self.values @@ -5145,10 +5613,10 @@ module Orb end end - class MatrixWithAllocation < Orb::Internal::Type::BaseModel + class TieredWithProration < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::MatrixWithAllocation, Orb::Internal::AnyHash) + T.any(Orb::Price::TieredWithProration, Orb::Internal::AnyHash) end sig { returns(String) } @@ -5174,16 +5642,24 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol) } + sig do + 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::MatrixWithAllocation::ConversionRateConfig::Variants + Orb::Price::TieredWithProration::ConversionRateConfig::Variants ) ) end @@ -5229,17 +5705,6 @@ module Orb 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 +5730,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -5275,7 +5741,7 @@ module Orb attr_accessor :plan_phase_order sig do - returns(Orb::Price::MatrixWithAllocation::PriceType::TaggedSymbol) + returns(Orb::Price::TieredWithProration::PriceType::TaggedSymbol) end attr_accessor :price_type @@ -5284,6 +5750,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 @@ -5300,7 +5780,11 @@ 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::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( @@ -5326,8 +5810,6 @@ 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], @@ -5335,8 +5817,10 @@ 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::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 @@ -5346,7 +5830,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -5357,7 +5843,6 @@ module Orb fixed_price_quantity:, invoicing_cycle_configuration:, item:, - matrix_with_allocation_config:, maximum:, maximum_amount:, # User specified key-value pairs for the resource. If not present, this defaults @@ -5373,8 +5858,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_proration pricing + tiered_with_proration_config:, dimensional_price_configuration: nil, - model_type: :matrix_with_allocation + # The pricing model type + model_type: :tiered_with_proration ) end @@ -5384,11 +5872,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::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::MatrixWithAllocation::ConversionRateConfig::Variants + Orb::Price::TieredWithProration::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -5399,7 +5891,6 @@ 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], @@ -5409,8 +5900,10 @@ module Orb name: String, plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::MatrixWithAllocation::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) } @@ -5419,113 +5912,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::MatrixWithAllocation::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::MatrixWithAllocation::Cadence::TaggedSymbol + Orb::Price::TieredWithProration::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol + Orb::Price::TieredWithProration::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol + Orb::Price::TieredWithProration::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol + Orb::Price::TieredWithProration::Cadence::TaggedSymbol ) ANNUAL = T.let( :annual, - Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol + Orb::Price::TieredWithProration::Cadence::TaggedSymbol ) CUSTOM = T.let( :custom, - Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol + Orb::Price::TieredWithProration::Cadence::TaggedSymbol ) sig do override.returns( - T::Array[Orb::Price::MatrixWithAllocation::Cadence::TaggedSymbol] + T::Array[Orb::Price::TieredWithProration::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::TieredWithProration::PriceType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USAGE_PRICE = + T.let( + :usage_price, + Orb::Price::TieredWithProration::PriceType::TaggedSymbol + ) + FIXED_PRICE = + T.let( + :fixed_price, + 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 - 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::Price::TieredWithProration::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::Price::MatrixWithAllocation::ConversionRateConfig::Variants + Orb::Price::TieredWithProration::TieredWithProrationConfig::Tier ] ) end - def self.variants - end - end - - module PriceType - extend Orb::Internal::Type::Enum + attr_accessor :tiers - TaggedSymbol = - T.type_alias do - T.all(Symbol, Orb::Price::MatrixWithAllocation::PriceType) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - USAGE_PRICE = - T.let( - :usage_price, - Orb::Price::MatrixWithAllocation::PriceType::TaggedSymbol - ) - FIXED_PRICE = - T.let( - :fixed_price, - Orb::Price::MatrixWithAllocation::PriceType::TaggedSymbol - ) + # 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( - T::Array[ - Orb::Price::MatrixWithAllocation::PriceType::TaggedSymbol - ] + { + tiers: + T::Array[ + Orb::Price::TieredWithProration::TieredWithProrationConfig::Tier + ] + } ) end - def self.values + 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 TieredWithProration < Orb::Internal::Type::BaseModel + class UnitWithProration < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::TieredWithProration, Orb::Internal::AnyHash) + T.any(Orb::Price::UnitWithProration, Orb::Internal::AnyHash) end sig { returns(String) } @@ -5551,16 +6146,24 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::Price::TieredWithProration::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::TieredWithProration::ConversionRateConfig::Variants + Orb::Price::UnitWithProration::ConversionRateConfig::Variants ) ) end @@ -5631,6 +6234,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 +6244,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::UnitWithProration::PriceType::TaggedSymbol) } attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -5650,8 +6252,17 @@ 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 + # 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 @@ -5669,7 +6280,10 @@ 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::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( @@ -5702,9 +6316,10 @@ 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::UnitWithProration::PriceType::OrSymbol, replaces_price_id: T.nilable(String), - tiered_with_proration_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 @@ -5714,7 +6329,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -5740,9 +6357,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_proration_config:, + # Configuration for unit_with_proration pricing + unit_with_proration_config:, dimensional_price_configuration: nil, - model_type: :tiered_with_proration + # The pricing model type + model_type: :unit_with_proration ) end @@ -5752,11 +6371,15 @@ 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::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::TieredWithProration::ConversionRateConfig::Variants + Orb::Price::UnitWithProration::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -5776,9 +6399,10 @@ module Orb name: String, plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::TieredWithProration::PriceType::TaggedSymbol, + Orb::Price::UnitWithProration::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), - tiered_with_proration_config: T::Hash[Symbol, T.anything], + unit_with_proration_config: + Orb::Price::UnitWithProration::UnitWithProrationConfig, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -5787,111 +6411,143 @@ module Orb def to_hash end + module BillingMode + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Orb::Price::UnitWithProration::BillingMode) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_ADVANCE = + T.let( + :in_advance, + Orb::Price::UnitWithProration::BillingMode::TaggedSymbol + ) + IN_ARREAR = + T.let( + :in_arrear, + Orb::Price::UnitWithProration::BillingMode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Orb::Price::UnitWithProration::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::TieredWithProration::Cadence) + T.all(Symbol, Orb::Price::UnitWithProration::Cadence) end OrSymbol = T.type_alias { T.any(Symbol, String) } ONE_TIME = T.let( :one_time, - Orb::Price::TieredWithProration::Cadence::TaggedSymbol + Orb::Price::UnitWithProration::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::TieredWithProration::Cadence::TaggedSymbol + Orb::Price::UnitWithProration::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::TieredWithProration::Cadence::TaggedSymbol + Orb::Price::UnitWithProration::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::TieredWithProration::Cadence::TaggedSymbol + Orb::Price::UnitWithProration::Cadence::TaggedSymbol ) ANNUAL = - T.let( - :annual, - Orb::Price::TieredWithProration::Cadence::TaggedSymbol - ) + T.let(:annual, Orb::Price::UnitWithProration::Cadence::TaggedSymbol) CUSTOM = - T.let( - :custom, - Orb::Price::TieredWithProration::Cadence::TaggedSymbol - ) + T.let(:custom, Orb::Price::UnitWithProration::Cadence::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::TieredWithProration::Cadence::TaggedSymbol] + T::Array[Orb::Price::UnitWithProration::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::UnitWithProration::PriceType) end OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = T.let( :usage_price, - Orb::Price::TieredWithProration::PriceType::TaggedSymbol + Orb::Price::UnitWithProration::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::TieredWithProration::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::TieredWithProration::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 UnitWithProration < Orb::Internal::Type::BaseModel + class GroupedAllocation < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::UnitWithProration, Orb::Internal::AnyHash) + T.any(Orb::Price::GroupedAllocation, Orb::Internal::AnyHash) end sig { returns(String) } @@ -5917,16 +6573,24 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::Price::UnitWithProration::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::UnitWithProration::ConversionRateConfig::Variants + Orb::Price::GroupedAllocation::ConversionRateConfig::Variants ) ) end @@ -5955,6 +6619,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 @@ -5997,6 +6673,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 +6683,7 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig { returns(Orb::Price::UnitWithProration::PriceType::TaggedSymbol) } + 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 @@ -6014,9 +6691,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 +6707,10 @@ 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::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( @@ -6056,6 +6733,8 @@ 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, @@ -6066,9 +6745,8 @@ 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::GroupedAllocation::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 +6756,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -6087,6 +6767,8 @@ module Orb discount:, external_price_id:, fixed_price_quantity:, + # Configuration for grouped_allocation pricing + grouped_allocation_config:, invoicing_cycle_configuration:, item:, maximum:, @@ -6104,9 +6786,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_allocation ) end @@ -6116,11 +6798,15 @@ 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::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::UnitWithProration::ConversionRateConfig::Variants + Orb::Price::GroupedAllocation::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -6128,6 +6814,8 @@ 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, @@ -6140,9 +6828,8 @@ module Orb name: String, plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::UnitWithProration::PriceType::TaggedSymbol, + Orb::Price::GroupedAllocation::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 +6838,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::UnitWithProration::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::UnitWithProration::Cadence::TaggedSymbol + Orb::Price::GroupedAllocation::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::UnitWithProration::Cadence::TaggedSymbol + Orb::Price::GroupedAllocation::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::UnitWithProration::Cadence::TaggedSymbol + Orb::Price::GroupedAllocation::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::UnitWithProration::Cadence::TaggedSymbol + Orb::Price::GroupedAllocation::Cadence::TaggedSymbol ) ANNUAL = - T.let(:annual, Orb::Price::UnitWithProration::Cadence::TaggedSymbol) + T.let(:annual, Orb::Price::GroupedAllocation::Cadence::TaggedSymbol) CUSTOM = - T.let(:custom, Orb::Price::UnitWithProration::Cadence::TaggedSymbol) + T.let(:custom, Orb::Price::GroupedAllocation::Cadence::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::UnitWithProration::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::UnitWithProration::ConversionRateConfig::Variants - ] + { + allocation: String, + grouping_key: String, + overage_unit_rate: String + } ) end - def self.variants + def to_hash end end @@ -6221,24 +6967,29 @@ module Orb TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::UnitWithProration::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::UnitWithProration::PriceType::TaggedSymbol + Orb::Price::GroupedAllocation::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::UnitWithProration::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::UnitWithProration::PriceType::TaggedSymbol] + T::Array[Orb::Price::GroupedAllocation::PriceType::TaggedSymbol] ) end def self.values @@ -6246,10 +6997,10 @@ module Orb end end - class GroupedAllocation < Orb::Internal::Type::BaseModel + class BulkWithProration < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::GroupedAllocation, Orb::Internal::AnyHash) + T.any(Orb::Price::BulkWithProration, Orb::Internal::AnyHash) end sig { returns(String) } @@ -6275,16 +7026,36 @@ module Orb end attr_writer :billing_cycle_configuration - sig { returns(Orb::Price::GroupedAllocation::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::GroupedAllocation::ConversionRateConfig::Variants + Orb::Price::BulkWithProration::ConversionRateConfig::Variants ) ) end @@ -6313,9 +7084,6 @@ module Orb sig { returns(T.nilable(Float)) } attr_accessor :fixed_price_quantity - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_allocation_config - sig { returns(T.nilable(Orb::BillingCycleConfiguration)) } attr_reader :invoicing_cycle_configuration @@ -6358,6 +7126,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 +7136,7 @@ module Orb sig { returns(T.nilable(Integer)) } attr_accessor :plan_phase_order - sig { returns(Orb::Price::GroupedAllocation::PriceType::TaggedSymbol) } + 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 @@ -6391,7 +7160,12 @@ 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::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( @@ -6414,7 +7188,6 @@ module Orb ), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), - grouped_allocation_config: T::Hash[Symbol, T.anything], invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration::OrHash), item: Orb::ItemSlim::OrHash, @@ -6425,7 +7198,7 @@ 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::BulkWithProration::PriceType::OrSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), @@ -6436,7 +7209,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:, @@ -6445,7 +7222,6 @@ module Orb discount:, external_price_id:, fixed_price_quantity:, - grouped_allocation_config:, invoicing_cycle_configuration:, item:, maximum:, @@ -6464,7 +7240,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: :bulk_with_proration ) end @@ -6474,11 +7251,17 @@ 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::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::GroupedAllocation::ConversionRateConfig::Variants + Orb::Price::BulkWithProration::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -6486,7 +7269,6 @@ 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], invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, @@ -6499,7 +7281,7 @@ module Orb name: String, plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::GroupedAllocation::PriceType::TaggedSymbol, + Orb::Price::BulkWithProration::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) @@ -6509,94 +7291,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::GroupedAllocation::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::GroupedAllocation::Cadence::TaggedSymbol + Orb::Price::BulkWithProration::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::GroupedAllocation::Cadence::TaggedSymbol + Orb::Price::BulkWithProration::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::GroupedAllocation::Cadence::TaggedSymbol + Orb::Price::BulkWithProration::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::GroupedAllocation::Cadence::TaggedSymbol + Orb::Price::BulkWithProration::Cadence::TaggedSymbol ) ANNUAL = - T.let(:annual, Orb::Price::GroupedAllocation::Cadence::TaggedSymbol) + T.let(:annual, Orb::Price::BulkWithProration::Cadence::TaggedSymbol) CUSTOM = - T.let(:custom, Orb::Price::GroupedAllocation::Cadence::TaggedSymbol) + T.let(:custom, Orb::Price::BulkWithProration::Cadence::TaggedSymbol) sig do override.returns( - T::Array[Orb::Price::GroupedAllocation::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::GroupedAllocation::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::GroupedAllocation::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::GroupedAllocation::PriceType::TaggedSymbol + Orb::Price::BulkWithProration::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::GroupedAllocation::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::GroupedAllocation::PriceType::TaggedSymbol] + T::Array[Orb::Price::BulkWithProration::PriceType::TaggedSymbol] ) end def self.values @@ -6636,11 +7519,21 @@ module Orb 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_accessor :cadence + sig { returns(T.nilable(T::Array[Orb::TransformPriceFilter])) } + attr_accessor :composite_price_filters + sig { returns(T.nilable(Float)) } attr_accessor :conversion_rate @@ -6676,8 +7569,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_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 @@ -6721,6 +7627,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -6758,7 +7665,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, + 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( @@ -6781,7 +7692,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_prorated_minimum_config: + Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig::OrHash, invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration::OrHash), item: Orb::ItemSlim::OrHash, @@ -6804,7 +7716,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -6813,6 +7727,7 @@ module Orb discount:, external_price_id:, fixed_price_quantity:, + # Configuration for grouped_with_prorated_minimum pricing grouped_with_prorated_minimum_config:, invoicing_cycle_configuration:, item:, @@ -6832,6 +7747,7 @@ module Orb # price in plan version migrations. replaces_price_id:, dimensional_price_configuration: nil, + # The pricing model type model_type: :grouped_with_prorated_minimum ) end @@ -6842,8 +7758,12 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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( @@ -6855,7 +7775,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_prorated_minimum_config: + Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig, invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, @@ -6878,6 +7799,37 @@ 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 @@ -6929,25 +7881,51 @@ module Orb 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::GroupedWithProratedMinimum::ConversionRateConfig::Variants - ] + { grouping_key: String, minimum: String, unit_rate: String } ) end - def self.variants + def to_hash end end @@ -6970,6 +7948,11 @@ module Orb :fixed_price, Orb::Price::GroupedWithProratedMinimum::PriceType::TaggedSymbol ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::GroupedWithProratedMinimum::PriceType::TaggedSymbol + ) sig do override.returns( @@ -7012,11 +7995,21 @@ module Orb end attr_writer :billing_cycle_configuration + 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 @@ -7052,8 +8045,21 @@ 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 + # 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 @@ -7097,6 +8103,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -7134,7 +8141,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, + 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( @@ -7157,7 +8168,8 @@ module Orb ), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), - grouped_with_metered_minimum_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, @@ -7180,7 +8192,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -7189,6 +8203,7 @@ module Orb discount:, external_price_id:, fixed_price_quantity:, + # Configuration for grouped_with_metered_minimum pricing grouped_with_metered_minimum_config:, invoicing_cycle_configuration:, item:, @@ -7208,6 +8223,7 @@ module Orb # price in plan version migrations. replaces_price_id:, dimensional_price_configuration: nil, + # The pricing model type model_type: :grouped_with_metered_minimum ) end @@ -7218,8 +8234,12 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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( @@ -7231,7 +8251,8 @@ 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], + grouped_with_metered_minimum_config: + Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig, invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, @@ -7254,6 +8275,37 @@ 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 @@ -7305,25 +8357,185 @@ module Orb end end - module ConversionRateConfig - extend Orb::Internal::Type::Union + class GroupedWithMeteredMinimumConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + 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 + 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::GroupedWithMeteredMinimum::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::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 - Variants = - T.type_alias do - T.any( - Orb::UnitConversionRateConfig, - Orb::TieredConversionRateConfig + # 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 - - sig do - override.returns( - T::Array[ - Orb::Price::GroupedWithMeteredMinimum::ConversionRateConfig::Variants - ] + def self.new( + # Pricing value + pricing_value:, + # Per unit amount + unit_amount: ) - end - def self.variants + end + + sig do + override.returns({ pricing_value: String, unit_amount: String }) + end + def to_hash + end end end @@ -7346,6 +8558,11 @@ module Orb :fixed_price, Orb::Price::GroupedWithMeteredMinimum::PriceType::TaggedSymbol ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::GroupedWithMeteredMinimum::PriceType::TaggedSymbol + ) sig do override.returns( @@ -7359,10 +8576,13 @@ module Orb end end - class MatrixWithDisplayName < Orb::Internal::Type::BaseModel + class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::MatrixWithDisplayName, Orb::Internal::AnyHash) + T.any( + Orb::Price::GroupedWithMinMaxThresholds, + Orb::Internal::AnyHash + ) end sig { returns(String) } @@ -7389,17 +8609,29 @@ module Orb attr_writer :billing_cycle_configuration sig do - returns(Orb::Price::MatrixWithDisplayName::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::MatrixWithDisplayName::ConversionRateConfig::Variants + Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig::Variants ) ) end @@ -7428,6 +8660,22 @@ module Orb sig { returns(T.nilable(Float)) } attr_accessor :fixed_price_quantity + # 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 @@ -7445,9 +8693,6 @@ module Orb 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 +8718,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 +8729,9 @@ module Orb attr_accessor :plan_phase_order sig do - returns(Orb::Price::MatrixWithDisplayName::PriceType::TaggedSymbol) + returns( + Orb::Price::GroupedWithMinMaxThresholds::PriceType::TaggedSymbol + ) end attr_accessor :price_type @@ -7508,7 +8756,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::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( @@ -7531,10 +8783,11 @@ module Orb ), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), + grouped_with_min_max_thresholds_config: + Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig::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 +8795,8 @@ 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::GroupedWithMinMaxThresholds::PriceType::OrSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), @@ -7553,7 +8807,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -7562,9 +8818,10 @@ module Orb discount:, external_price_id:, fixed_price_quantity:, + # Configuration for grouped_with_min_max_thresholds pricing + grouped_with_min_max_thresholds_config:, invoicing_cycle_configuration:, item:, - matrix_with_display_name_config:, maximum:, maximum_amount:, # User specified key-value pairs for the resource. If not present, this defaults @@ -7581,7 +8838,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_with_min_max_thresholds ) end @@ -7591,11 +8849,16 @@ 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::GroupedWithMinMaxThresholds::BillingMode::TaggedSymbol, + cadence: + 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::MatrixWithDisplayName::ConversionRateConfig::Variants + Orb::Price::GroupedWithMinMaxThresholds::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -7603,10 +8866,11 @@ module Orb discount: T.nilable(Orb::Discount::Variants), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), + grouped_with_min_max_thresholds_config: + Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, 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 +8880,7 @@ module Orb name: String, plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::MatrixWithDisplayName::PriceType::TaggedSymbol, + Orb::Price::GroupedWithMinMaxThresholds::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) @@ -7626,74 +8890,148 @@ 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::MatrixWithDisplayName::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::MatrixWithDisplayName::Cadence::TaggedSymbol + Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol + Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol + Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol + Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol ) ANNUAL = T.let( :annual, - Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol + Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol ) CUSTOM = T.let( :custom, - Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol + Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol ) sig do override.returns( - T::Array[Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol] + T::Array[ + Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol + ] ) end def self.values 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::MatrixWithDisplayName::ConversionRateConfig::Variants - ] + { + grouping_key: String, + maximum_charge: String, + minimum_charge: String, + per_unit_rate: String + } ) end - def self.variants + def to_hash end end @@ -7702,25 +9040,30 @@ module Orb TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::MatrixWithDisplayName::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::MatrixWithDisplayName::PriceType::TaggedSymbol + Orb::Price::GroupedWithMinMaxThresholds::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::MatrixWithDisplayName::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::MatrixWithDisplayName::PriceType::TaggedSymbol + Orb::Price::GroupedWithMinMaxThresholds::PriceType::TaggedSymbol ] ) end @@ -7729,10 +9072,10 @@ module Orb end end - class BulkWithProration < Orb::Internal::Type::BaseModel + class MatrixWithDisplayName < Orb::Internal::Type::BaseModel OrHash = T.type_alias do - T.any(Orb::Price::BulkWithProration, Orb::Internal::AnyHash) + T.any(Orb::Price::MatrixWithDisplayName, Orb::Internal::AnyHash) end sig { returns(String) } @@ -7758,19 +9101,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::MatrixWithDisplayName::BillingMode::TaggedSymbol) + end + attr_accessor :billing_mode - sig { returns(Orb::Price::BulkWithProration::Cadence::TaggedSymbol) } + 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::BulkWithProration::ConversionRateConfig::Variants + Orb::Price::MatrixWithDisplayName::ConversionRateConfig::Variants ) ) end @@ -7816,6 +9166,22 @@ module Orb 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 @@ -7841,6 +9207,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 +9217,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::MatrixWithDisplayName::PriceType::TaggedSymbol) + end attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -7874,8 +9243,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::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( @@ -7901,6 +9273,8 @@ module Orb 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], @@ -7908,7 +9282,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::MatrixWithDisplayName::PriceType::OrSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), @@ -7919,8 +9293,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:, @@ -7931,6 +9306,8 @@ module Orb fixed_price_quantity:, invoicing_cycle_configuration:, 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 @@ -7947,7 +9324,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: :matrix_with_display_name ) end @@ -7957,12 +9335,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::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::BulkWithProration::ConversionRateConfig::Variants + Orb::Price::MatrixWithDisplayName::ConversionRateConfig::Variants ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), @@ -7973,6 +9354,8 @@ module Orb 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], @@ -7982,7 +9365,7 @@ module Orb name: String, plan_phase_order: T.nilable(Integer), price_type: - Orb::Price::BulkWithProration::PriceType::TaggedSymbol, + Orb::Price::MatrixWithDisplayName::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) @@ -7992,68 +9375,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::BulkWithProration::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::BulkWithProration::Cadence::TaggedSymbol + Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol ) MONTHLY = T.let( :monthly, - Orb::Price::BulkWithProration::Cadence::TaggedSymbol + Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol ) QUARTERLY = T.let( :quarterly, - Orb::Price::BulkWithProration::Cadence::TaggedSymbol + Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol ) SEMI_ANNUAL = T.let( :semi_annual, - Orb::Price::BulkWithProration::Cadence::TaggedSymbol + Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol ) ANNUAL = - T.let(:annual, Orb::Price::BulkWithProration::Cadence::TaggedSymbol) + T.let( + :annual, + Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol + ) CUSTOM = - T.let(:custom, Orb::Price::BulkWithProration::Cadence::TaggedSymbol) + T.let( + :custom, + Orb::Price::MatrixWithDisplayName::Cadence::TaggedSymbol + ) sig do override.returns( - T::Array[Orb::Price::BulkWithProration::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::BulkWithProration::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 @@ -8062,24 +9568,31 @@ module Orb TaggedSymbol = T.type_alias do - T.all(Symbol, Orb::Price::BulkWithProration::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::BulkWithProration::PriceType::TaggedSymbol + Orb::Price::MatrixWithDisplayName::PriceType::TaggedSymbol ) FIXED_PRICE = T.let( :fixed_price, - Orb::Price::BulkWithProration::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::BulkWithProration::PriceType::TaggedSymbol] + T::Array[ + Orb::Price::MatrixWithDisplayName::PriceType::TaggedSymbol + ] ) end def self.values @@ -8116,9 +9629,17 @@ module Orb end attr_writer :billing_cycle_configuration + sig do + 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 @@ -8154,8 +9675,19 @@ 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 + # 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 @@ -8199,6 +9731,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -8234,7 +9767,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, + 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( @@ -8257,7 +9794,8 @@ module Orb ), external_price_id: T.nilable(String), fixed_price_quantity: T.nilable(Float), - grouped_tiered_package_config: T::Hash[Symbol, T.anything], + grouped_tiered_package_config: + Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig::OrHash, invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration::OrHash), item: Orb::ItemSlim::OrHash, @@ -8279,7 +9817,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -8288,6 +9828,7 @@ module Orb discount:, external_price_id:, fixed_price_quantity:, + # Configuration for grouped_tiered_package pricing grouped_tiered_package_config:, invoicing_cycle_configuration:, item:, @@ -8307,6 +9848,7 @@ module Orb # price in plan version migrations. replaces_price_id:, dimensional_price_configuration: nil, + # The pricing model type model_type: :grouped_tiered_package ) end @@ -8317,7 +9859,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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( @@ -8329,7 +9875,8 @@ 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], + grouped_tiered_package_config: + Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig, invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, @@ -8352,6 +9899,37 @@ 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 @@ -8401,25 +9979,107 @@ module Orb 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::GroupedTieredPackage::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 @@ -8442,6 +10102,11 @@ module Orb :fixed_price, Orb::Price::GroupedTieredPackage::PriceType::TaggedSymbol ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::GroupedTieredPackage::PriceType::TaggedSymbol + ) sig do override.returns( @@ -8484,11 +10149,19 @@ module Orb end attr_writer :billing_cycle_configuration + sig do + returns(Orb::Price::MaxGroupTieredPackage::BillingMode::TaggedSymbol) + end + attr_accessor :billing_mode + 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 @@ -8541,8 +10214,21 @@ module Orb sig { params(item: Orb::ItemSlim::OrHash).void } attr_writer :item - 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::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 @@ -8569,6 +10255,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -8604,7 +10291,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, + 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( @@ -8630,7 +10321,8 @@ module Orb invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration::OrHash), item: Orb::ItemSlim::OrHash, - max_group_tiered_package_config: T::Hash[Symbol, T.anything], + 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], @@ -8649,7 +10341,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -8660,6 +10354,7 @@ module Orb fixed_price_quantity:, invoicing_cycle_configuration:, item:, + # Configuration for max_group_tiered_package pricing max_group_tiered_package_config:, maximum:, maximum_amount:, @@ -8677,6 +10372,7 @@ module Orb # price in plan version migrations. replaces_price_id:, dimensional_price_configuration: nil, + # The pricing model type model_type: :max_group_tiered_package ) end @@ -8687,7 +10383,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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( @@ -8702,7 +10402,8 @@ module Orb invoicing_cycle_configuration: T.nilable(Orb::BillingCycleConfiguration), item: Orb::ItemSlim, - max_group_tiered_package_config: T::Hash[Symbol, T.anything], + max_group_tiered_package_config: + Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig, maximum: T.nilable(Orb::Maximum), maximum_amount: T.nilable(String), metadata: T::Hash[Symbol, String], @@ -8722,6 +10423,37 @@ 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 @@ -8771,25 +10503,107 @@ module Orb 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::MaxGroupTieredPackage::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 @@ -8812,6 +10626,11 @@ module Orb :fixed_price, Orb::Price::MaxGroupTieredPackage::PriceType::TaggedSymbol ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::MaxGroupTieredPackage::PriceType::TaggedSymbol + ) sig do override.returns( @@ -8857,6 +10676,13 @@ module Orb end attr_writer :billing_cycle_configuration + sig do + returns( + Orb::Price::ScalableMatrixWithUnitPricing::BillingMode::TaggedSymbol + ) + end + attr_accessor :billing_mode + sig do returns( Orb::Price::ScalableMatrixWithUnitPricing::Cadence::TaggedSymbol @@ -8864,6 +10690,9 @@ module Orb 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 @@ -8941,6 +10770,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -8962,8 +10792,21 @@ 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 + # 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 @@ -8981,8 +10824,12 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, + 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( @@ -9019,7 +10866,7 @@ module Orb Orb::Price::ScalableMatrixWithUnitPricing::PriceType::OrSymbol, replaces_price_id: T.nilable(String), scalable_matrix_with_unit_pricing_config: - T::Hash[Symbol, T.anything], + Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig::OrHash, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -9029,7 +10876,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -9055,8 +10904,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 scalable_matrix_with_unit_pricing pricing scalable_matrix_with_unit_pricing_config:, dimensional_price_configuration: nil, + # The pricing model type model_type: :scalable_matrix_with_unit_pricing ) end @@ -9067,8 +10918,12 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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( @@ -9095,7 +10950,7 @@ module Orb Orb::Price::ScalableMatrixWithUnitPricing::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), scalable_matrix_with_unit_pricing_config: - T::Hash[Symbol, T.anything], + Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -9104,6 +10959,40 @@ 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 @@ -9155,28 +11044,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::ScalableMatrixWithUnitPricing::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end - module PriceType extend Orb::Internal::Type::Enum @@ -9199,6 +11066,11 @@ module Orb :fixed_price, Orb::Price::ScalableMatrixWithUnitPricing::PriceType::TaggedSymbol ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::ScalableMatrixWithUnitPricing::PriceType::TaggedSymbol + ) sig do override.returns( @@ -9210,6 +11082,138 @@ module Orb 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 ScalableMatrixWithTieredPricing < Orb::Internal::Type::BaseModel @@ -9244,6 +11248,13 @@ module Orb end attr_writer :billing_cycle_configuration + sig do + returns( + Orb::Price::ScalableMatrixWithTieredPricing::BillingMode::TaggedSymbol + ) + end + attr_accessor :billing_mode + sig do returns( Orb::Price::ScalableMatrixWithTieredPricing::Cadence::TaggedSymbol @@ -9251,6 +11262,9 @@ module Orb 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 @@ -9328,6 +11342,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -9349,8 +11364,21 @@ 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 + # 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 @@ -9368,8 +11396,12 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, + 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( @@ -9406,7 +11438,7 @@ module Orb Orb::Price::ScalableMatrixWithTieredPricing::PriceType::OrSymbol, replaces_price_id: T.nilable(String), scalable_matrix_with_tiered_pricing_config: - T::Hash[Symbol, T.anything], + Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::OrHash, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), model_type: Symbol @@ -9416,7 +11448,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -9442,8 +11476,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 scalable_matrix_with_tiered_pricing pricing scalable_matrix_with_tiered_pricing_config:, dimensional_price_configuration: nil, + # The pricing model type model_type: :scalable_matrix_with_tiered_pricing ) end @@ -9454,8 +11490,12 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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( @@ -9482,7 +11522,7 @@ module Orb Orb::Price::ScalableMatrixWithTieredPricing::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), scalable_matrix_with_tiered_pricing_config: - T::Hash[Symbol, T.anything], + Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig, dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) } @@ -9491,6 +11531,40 @@ 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 @@ -9545,28 +11619,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::ScalableMatrixWithTieredPricing::ConversionRateConfig::Variants - ] - ) - end - def self.variants - end - end - module PriceType extend Orb::Internal::Type::Enum @@ -9589,6 +11641,11 @@ module Orb :fixed_price, Orb::Price::ScalableMatrixWithTieredPricing::PriceType::TaggedSymbol ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::ScalableMatrixWithTieredPricing::PriceType::TaggedSymbol + ) sig do override.returns( @@ -9600,6 +11657,182 @@ module Orb def self.values end end + + class ScalableMatrixWithTieredPricingConfig < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + 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 + returns( + T::Array[ + Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig::MatrixScalingFactor + ] + ) + end + attr_accessor :matrix_scaling_factors + + # Tier pricing structure + sig do + returns( + T::Array[ + Orb::Price::ScalableMatrixWithTieredPricing::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::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( + { + 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 + + 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 CumulativeGroupedBulk < Orb::Internal::Type::BaseModel @@ -9631,11 +11864,19 @@ module Orb end attr_writer :billing_cycle_configuration + sig do + 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 @@ -9659,8 +11900,21 @@ module Orb end attr_writer :credit_allocation - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :cumulative_grouped_bulk_config + # 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 @@ -9716,6 +11970,7 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount + # The pricing model type sig { returns(Symbol) } attr_accessor :model_type @@ -9751,7 +12006,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny::OrHash), billing_cycle_configuration: Orb::BillingCycleConfiguration::OrHash, + 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( @@ -9762,7 +12021,8 @@ module Orb ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation::OrHash), - cumulative_grouped_bulk_config: T::Hash[Symbol, T.anything], + cumulative_grouped_bulk_config: + Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig::OrHash, currency: String, discount: T.nilable( @@ -9796,11 +12056,14 @@ 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:, @@ -9824,6 +12087,7 @@ module Orb # price in plan version migrations. replaces_price_id:, dimensional_price_configuration: nil, + # The pricing model type model_type: :cumulative_grouped_bulk ) end @@ -9834,7 +12098,11 @@ module Orb id: String, billable_metric: T.nilable(Orb::BillableMetricTiny), billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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( @@ -9842,7 +12110,8 @@ module Orb ), created_at: Time, credit_allocation: T.nilable(Orb::Allocation), - cumulative_grouped_bulk_config: T::Hash[Symbol, T.anything], + cumulative_grouped_bulk_config: + Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig, currency: String, discount: T.nilable(Orb::Discount::Variants), external_price_id: T.nilable(String), @@ -9869,6 +12138,37 @@ 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 @@ -9918,25 +12218,111 @@ module Orb 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::CumulativeGroupedBulk::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 @@ -9959,6 +12345,11 @@ module Orb :fixed_price, Orb::Price::CumulativeGroupedBulk::PriceType::TaggedSymbol ) + COMPOSITE_PRICE = + T.let( + :composite_price, + Orb::Price::CumulativeGroupedBulk::PriceType::TaggedSymbol + ) sig do override.returns( @@ -9972,14 +12363,9 @@ module Orb end end - class GroupedWithMinMaxThresholds < Orb::Internal::Type::BaseModel + class Minimum < Orb::Internal::Type::BaseModel OrHash = - T.type_alias do - T.any( - Orb::Price::GroupedWithMinMaxThresholds, - Orb::Internal::AnyHash - ) - end + T.type_alias { T.any(Orb::Price::Minimum, Orb::Internal::AnyHash) } sig { returns(String) } attr_accessor :id @@ -10004,21 +12390,21 @@ module Orb end attr_writer :billing_cycle_configuration - sig do - returns( - Orb::Price::GroupedWithMinMaxThresholds::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::GroupedWithMinMaxThresholds::ConversionRateConfig::Variants - ) + T.nilable(Orb::Price::Minimum::ConversionRateConfig::Variants) ) end attr_accessor :conversion_rate_config @@ -10046,9 +12432,6 @@ module Orb 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 @@ -10091,6 +12474,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 @@ -10100,11 +12495,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::Minimum::PriceType::TaggedSymbol) } attr_accessor :price_type # The price id this price replaces. This price will take the place of the replaced @@ -10128,7 +12519,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::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( @@ -10151,7 +12545,6 @@ module Orb ), 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, @@ -10160,10 +12553,10 @@ 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::GroupedWithMinMaxThresholds::PriceType::OrSymbol, + price_type: Orb::Price::Minimum::PriceType::OrSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration::OrHash), @@ -10174,7 +12567,9 @@ module Orb id:, billable_metric:, billing_cycle_configuration:, + billing_mode:, cadence:, + composite_price_filters:, conversion_rate:, conversion_rate_config:, created_at:, @@ -10183,7 +12578,6 @@ module Orb discount:, external_price_id:, fixed_price_quantity:, - grouped_with_min_max_thresholds_config:, invoicing_cycle_configuration:, item:, maximum:, @@ -10195,6 +12589,8 @@ module Orb metadata:, minimum:, minimum_amount:, + # Configuration for minimum pricing + minimum_config:, name:, plan_phase_order:, price_type:, @@ -10202,7 +12598,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: :minimum ) end @@ -10212,21 +12609,19 @@ 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::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::GroupedWithMinMaxThresholds::ConversionRateConfig::Variants - ), + T.nilable(Orb::Price::Minimum::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), 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, @@ -10235,11 +12630,11 @@ 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::GroupedWithMinMaxThresholds::PriceType::TaggedSymbol, + price_type: Orb::Price::Minimum::PriceType::TaggedSymbol, replaces_price_id: T.nilable(String), dimensional_price_configuration: T.nilable(Orb::DimensionalPriceConfiguration) @@ -10249,76 +12644,88 @@ module Orb def to_hash end + module BillingMode + extend Orb::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Orb::Price::Minimum::BillingMode) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + 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 do - T.all(Symbol, Orb::Price::GroupedWithMinMaxThresholds::Cadence) - end + 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::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol - ) - MONTHLY = - T.let( - :monthly, - Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol - ) + T.let(:one_time, Orb::Price::Minimum::Cadence::TaggedSymbol) + MONTHLY = T.let(:monthly, Orb::Price::Minimum::Cadence::TaggedSymbol) QUARTERLY = - T.let( - :quarterly, - Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol - ) + T.let(:quarterly, Orb::Price::Minimum::Cadence::TaggedSymbol) SEMI_ANNUAL = - T.let( - :semi_annual, - Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol - ) - ANNUAL = - T.let( - :annual, - Orb::Price::GroupedWithMinMaxThresholds::Cadence::TaggedSymbol - ) - CUSTOM = - T.let( - :custom, - Orb::Price::GroupedWithMinMaxThresholds::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::GroupedWithMinMaxThresholds::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::GroupedWithMinMaxThresholds::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 @@ -10326,27 +12733,22 @@ 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::Minimum::PriceType) } OrSymbol = T.type_alias { T.any(Symbol, String) } USAGE_PRICE = - T.let( - :usage_price, - Orb::Price::GroupedWithMinMaxThresholds::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::GroupedWithMinMaxThresholds::PriceType::TaggedSymbol + :composite_price, + Orb::Price::Minimum::PriceType::TaggedSymbol ) sig do override.returns( - T::Array[ - Orb::Price::GroupedWithMinMaxThresholds::PriceType::TaggedSymbol - ] + T::Array[Orb::Price::Minimum::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..2f942635 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,176 @@ module Orb end attr_writer :matrix_with_allocation_config - sig { returns(Orb::TieredConfig) } - attr_reader :tiered_config - - sig { params(tiered_config: Orb::TieredConfig::OrHash).void } - attr_writer :tiered_config + # Configuration for tiered_with_proration pricing + sig { returns(Orb::PriceCreateParams::TieredWithProrationConfig) } + attr_reader :tiered_with_proration_config - sig { returns(Orb::TieredBPSConfig) } - attr_reader :tiered_bps_config + sig do + params( + tiered_with_proration_config: + Orb::PriceCreateParams::TieredWithProrationConfig::OrHash + ).void + end + attr_writer :tiered_with_proration_config - sig { params(tiered_bps_config: Orb::TieredBPSConfig::OrHash).void } - attr_writer :tiered_bps_config + # Configuration for unit_with_proration pricing + sig { returns(Orb::PriceCreateParams::UnitWithProrationConfig) } + attr_reader :unit_with_proration_config - sig { returns(Orb::BPSConfig) } - attr_reader :bps_config + sig do + params( + unit_with_proration_config: + Orb::PriceCreateParams::UnitWithProrationConfig::OrHash + ).void + end + attr_writer :unit_with_proration_config - sig { params(bps_config: Orb::BPSConfig::OrHash).void } - attr_writer :bps_config + # Configuration for grouped_allocation pricing + sig { returns(Orb::PriceCreateParams::GroupedAllocationConfig) } + attr_reader :grouped_allocation_config - sig { returns(Orb::BulkBPSConfig) } - attr_reader :bulk_bps_config + sig do + params( + grouped_allocation_config: + Orb::PriceCreateParams::GroupedAllocationConfig::OrHash + ).void + end + attr_writer :grouped_allocation_config - sig { params(bulk_bps_config: Orb::BulkBPSConfig::OrHash).void } - attr_writer :bulk_bps_config + # Configuration for bulk_with_proration pricing + sig { returns(Orb::PriceCreateParams::BulkWithProrationConfig) } + attr_reader :bulk_with_proration_config - sig { returns(Orb::BulkConfig) } - attr_reader :bulk_config + sig do + params( + bulk_with_proration_config: + Orb::PriceCreateParams::BulkWithProrationConfig::OrHash + ).void + end + attr_writer :bulk_with_proration_config - sig { params(bulk_config: Orb::BulkConfig::OrHash).void } - attr_writer :bulk_config + # Configuration for grouped_with_prorated_minimum pricing + sig { returns(Orb::PriceCreateParams::GroupedWithProratedMinimumConfig) } + attr_reader :grouped_with_prorated_minimum_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :threshold_total_amount_config + sig do + params( + grouped_with_prorated_minimum_config: + Orb::PriceCreateParams::GroupedWithProratedMinimumConfig::OrHash + ).void + end + attr_writer :grouped_with_prorated_minimum_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :tiered_package_config + # Configuration for grouped_with_metered_minimum pricing + sig { returns(Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig) } + attr_reader :grouped_with_metered_minimum_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :grouped_tiered_config + sig do + params( + grouped_with_metered_minimum_config: + Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig::OrHash + ).void + end + attr_writer :grouped_with_metered_minimum_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :max_group_tiered_package_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 :tiered_with_minimum_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 :package_with_allocation_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 :tiered_package_with_minimum_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 :unit_with_percent_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_proration_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 :unit_with_proration_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 :grouped_allocation_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 :grouped_with_prorated_minimum_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 :grouped_with_metered_minimum_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 :matrix_with_display_name_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 :bulk_with_proration_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_tiered_package_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 :scalable_matrix_with_unit_pricing_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 :scalable_matrix_with_tiered_pricing_config + # Configuration for minimum pricing + sig { returns(Orb::PriceCreateParams::MinimumConfig) } + attr_reader :minimum_config - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :cumulative_grouped_bulk_config + sig do + params( + minimum_config: Orb::PriceCreateParams::MinimumConfig::OrHash + ).void + end + attr_writer :minimum_config sig do params( @@ -235,35 +422,53 @@ 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, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -294,37 +499,64 @@ 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:, # The id of the billable metric for the price. Only needed if the price is # usage-based. billable_metric_id: nil, @@ -387,35 +619,50 @@ 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, request_options: Orb::RequestOptions } ) @@ -450,6 +697,7 @@ module Orb end end + # The pricing model type module ModelType extend Orb::Internal::Type::Enum @@ -457,11 +705,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 - ) + MINIMUM = + T.let(:minimum, Orb::PriceCreateParams::ModelType::TaggedSymbol) sig do override.returns( @@ -472,24 +717,1890 @@ 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( - T::Array[Orb::PriceCreateParams::ConversionRateConfig::Variants] + { + tiers: + T::Array[Orb::PriceCreateParams::TieredWithMinimumConfig::Tier], + hide_zero_amount_tiers: T::Boolean, + prorate: T::Boolean + } ) end - def self.variants + 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 end diff --git a/rbi/orb/models/price_evaluate_multiple_params.rbi b/rbi/orb/models/price_evaluate_multiple_params.rbi index 3b9d57df..0dd45db3 100644 --- a/rbi/orb/models/price_evaluate_multiple_params.rbi +++ b/rbi/orb/models/price_evaluate_multiple_params.rbi @@ -113,40 +113,38 @@ 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 ) ) ) @@ -166,33 +164,32 @@ 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 ) ), price_id: T.nilable(String) @@ -209,8 +206,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 +223,32 @@ 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 ) ), price_id: T.nilable(String) @@ -263,8 +258,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 +266,397 @@ 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 + ) + 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 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..2a341d73 100644 --- a/rbi/orb/models/price_evaluate_preview_events_params.rbi +++ b/rbi/orb/models/price_evaluate_preview_events_params.rbi @@ -214,40 +214,38 @@ 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 ) ) ) @@ -267,33 +265,32 @@ 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 ) ), price_id: T.nilable(String) @@ -310,8 +307,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 +324,32 @@ 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 ) ), price_id: T.nilable(String) @@ -364,8 +359,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 +367,397 @@ 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 + ) + 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 sig do override.returns( diff --git a/rbi/orb/models/price_interval.rbi b/rbi/orb/models/price_interval.rbi index 4513fee2..7a91a9cc 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,17 @@ 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 ), 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..29522556 100644 --- a/rbi/orb/models/subscription_create_params.rbi +++ b/rbi/orb/models/subscription_create_params.rbi @@ -578,39 +578,38 @@ 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 ) ) ) @@ -640,33 +639,32 @@ 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 ) ), price_id: T.nilable(String), @@ -693,7 +691,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 +716,32 @@ 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 ) ), price_id: T.nilable(String), @@ -755,7 +752,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,35 +760,814 @@ 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 + ) + end + + class TieredWithProration < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionCreateParams::AddPrice::Price::TieredWithProration, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionCreateParams::AddPrice::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::AddPrice::Price::TieredWithProration::TieredWithProrationConfig + ) + end + attr_reader :tiered_with_proration_config + + sig do + params( + tiered_with_proration_config: + Orb::SubscriptionCreateParams::AddPrice::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::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 sig do override.returns( @@ -1047,39 +1823,38 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount - # 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::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 ) ) ) @@ -1103,33 +1878,32 @@ 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::ReplacePrice::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::ReplacePrice::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 ) ), price_id: T.nilable(String) @@ -1153,7 +1927,7 @@ module Orb # [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. + # New subscription price request body params. price: nil, # The id of the price to add to the subscription. price_id: nil @@ -1174,33 +1948,32 @@ 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::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 ) ), price_id: T.nilable(String) @@ -1210,7 +1983,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 @@ -1218,35 +1991,814 @@ 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::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 + ) + 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 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..9b995de5 100644 --- a/rbi/orb/models/subscription_price_intervals_params.rbi +++ b/rbi/orb/models/subscription_price_intervals_params.rbi @@ -218,39 +218,38 @@ 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 ) ) ) @@ -300,33 +299,32 @@ 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 ) ), price_id: T.nilable(String), @@ -359,7 +357,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 +402,32 @@ 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 ) ), price_id: T.nilable(String), @@ -654,7 +651,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,36 +659,398 @@ 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 ) 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 + sig do override.returns( T::Array[ @@ -713,26 +1072,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 +1114,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 +1153,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 +1173,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 +1196,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..73f5e85f 100644 --- a/rbi/orb/models/subscription_schedule_plan_change_params.rbi +++ b/rbi/orb/models/subscription_schedule_plan_change_params.rbi @@ -629,39 +629,38 @@ 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 ) ) ) @@ -691,33 +690,32 @@ 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 ) ), price_id: T.nilable(String), @@ -744,7 +742,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 +767,32 @@ 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 ) ), price_id: T.nilable(String), @@ -806,7 +803,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,35 +811,814 @@ 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 + ) + end + + class TieredWithProration < Orb::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::Price::TieredWithProration, + Orb::Internal::AnyHash + ) + end + + # The cadence to bill for this price on. + sig do + returns( + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::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::AddPrice::Price::TieredWithProration::TieredWithProrationConfig + ) + end + attr_reader :tiered_with_proration_config + + sig do + params( + tiered_with_proration_config: + Orb::SubscriptionSchedulePlanChangeParams::AddPrice::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::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 sig do override.returns( @@ -1106,39 +1882,38 @@ module Orb sig { returns(T.nilable(String)) } attr_accessor :minimum_amount - # 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::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 ) ) ) @@ -1162,33 +1937,32 @@ 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::ReplacePrice::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::ReplacePrice::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 ) ), price_id: T.nilable(String) @@ -1212,7 +1986,7 @@ module Orb # [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. + # New subscription price request body params. price: nil, # The id of the price to add to the subscription. price_id: nil @@ -1233,33 +2007,32 @@ 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::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 ) ), price_id: T.nilable(String) @@ -1269,7 +2042,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 @@ -1277,35 +2050,814 @@ 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::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 + ) + 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 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..01a32cdc 100644 --- a/rbi/orb/models/unit_config.rbi +++ b/rbi/orb/models/unit_config.rbi @@ -9,14 +9,29 @@ module Orb sig { returns(String) } attr_accessor :unit_amount - sig { params(unit_amount: String).returns(T.attached_class) } + # Multiplier to scale rated quantity by + sig { returns(T.nilable(Float)) } + attr_accessor :scaling_factor + + # Configuration for unit pricing + sig do + params(unit_amount: String, scaling_factor: T.nilable(Float)).returns( + T.attached_class + ) + end def self.new( # Rate per unit of usage - unit_amount: + unit_amount:, + # Multiplier to scale rated quantity by + scaling_factor: nil ) end - sig { override.returns({ unit_amount: String }) } + sig do + override.returns( + { unit_amount: String, scaling_factor: T.nilable(Float) } + ) + end def to_hash end end 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/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..ddb46081 100644 --- a/rbi/orb/resources/prices.rbi +++ b/rbi/orb/resources/prices.rbi @@ -24,35 +24,53 @@ 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, billable_metric_id: T.nilable(String), billed_in_advance: T.nilable(T::Boolean), billing_cycle_configuration: @@ -83,37 +101,64 @@ 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:, # 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..2fbc44b2 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,349 @@ 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 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 + def self?.variants: -> ::Array[Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::price] end end @@ -260,37 +572,349 @@ 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 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 + 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..b5421416 100644 --- a/sig/orb/models/beta_create_plan_version_params.rbs +++ b/sig/orb/models/beta_create_plan_version_params.rbs @@ -120,37 +120,349 @@ 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 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 + def self?.variants: -> ::Array[Orb::Models::BetaCreatePlanVersionParams::AddPrice::price] end end @@ -256,37 +568,349 @@ 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 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 + 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_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..28f7629c 100644 --- a/sig/orb/models/item.rbs +++ b/sig/orb/models/item.rbs @@ -65,6 +65,7 @@ module Orb | :taxjar | :avalara | :anrok + | :numeral module ExternalConnectionName extend Orb::Internal::Type::Enum @@ -76,6 +77,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_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..3c88206f 100644 --- a/sig/orb/models/plan_create_params.rbs +++ b/sig/orb/models/plan_create_params.rbs @@ -99,37 +99,349 @@ 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 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 + 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..fa87592e 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,17 @@ 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 module Price extend Orb::Internal::Type::Union @@ -39,7 +37,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 +71,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 +125,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 +156,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 +183,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 +210,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 +246,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 +298,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 +335,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 +365,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 +398,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 +433,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 +481,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 +491,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 +507,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 +521,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 +528,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 +552,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 +589,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 +628,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 +680,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 +717,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 +747,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 +780,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 +814,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 +861,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 +873,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 +902,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 +910,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 +933,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 +971,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 +1010,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,539 +1062,7 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :bps - - attr_accessor name: String - - attr_accessor plan_phase_order: Integer? - - attr_accessor price_type: Orb::Models::Price::BPS::price_type - - attr_accessor replaces_price_id: String? - - 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, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::BPS::conversion_rate_config?, - created_at: Time, - credit_allocation: Orb::Allocation?, - currency: String, - discount: Orb::Models::discount?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, - item: Orb::ItemSlim, - maximum: Orb::Maximum?, - maximum_amount: String?, - metadata: ::Hash[Symbol, String], - minimum: Orb::Minimum?, - minimum_amount: String?, - name: String, - plan_phase_order: Integer?, - price_type: Orb::Models::Price::BPS::price_type, - replaces_price_id: String?, - ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :bps - ) -> 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, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::BPS::conversion_rate_config?, - created_at: Time, - credit_allocation: Orb::Allocation?, - currency: String, - discount: Orb::Models::discount?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, - item: Orb::ItemSlim, - maximum: Orb::Maximum?, - maximum_amount: String?, - metadata: ::Hash[Symbol, String], - minimum: Orb::Minimum?, - minimum_amount: String?, - model_type: :bps, - name: String, - plan_phase_order: Integer?, - price_type: Orb::Models::Price::BPS::price_type, - replaces_price_id: String?, - dimensional_price_configuration: Orb::DimensionalPriceConfiguration? - } - - 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::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] - end - - type price_type = :usage_price | :fixed_price - - module PriceType - extend Orb::Internal::Type::Enum - - USAGE_PRICE: :usage_price - FIXED_PRICE: :fixed_price - - def self?.values: -> ::Array[Orb::Models::Price::BPS::price_type] - end - end - - type bulk_bps = - { - id: String, - billable_metric: Orb::BillableMetricTiny?, - billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_bps_config: Orb::BulkBPSConfig, - cadence: Orb::Models::Price::BulkBPS::cadence, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::BulkBPS::conversion_rate_config?, - created_at: Time, - credit_allocation: Orb::Allocation?, - currency: String, - discount: Orb::Models::discount?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, - item: Orb::ItemSlim, - maximum: Orb::Maximum?, - maximum_amount: String?, - metadata: ::Hash[Symbol, String], - minimum: Orb::Minimum?, - minimum_amount: String?, - model_type: :bulk_bps, - name: String, - plan_phase_order: Integer?, - price_type: Orb::Models::Price::BulkBPS::price_type, - replaces_price_id: String?, - dimensional_price_configuration: Orb::DimensionalPriceConfiguration? - } - - class BulkBPS < 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 cadence: Orb::Models::Price::BulkBPS::cadence - - attr_accessor conversion_rate: Float? - - attr_accessor conversion_rate_config: Orb::Models::Price::BulkBPS::conversion_rate_config? - - attr_accessor created_at: Time - - attr_accessor credit_allocation: Orb::Allocation? - - attr_accessor currency: String - - attr_accessor discount: Orb::Models::discount? - - attr_accessor external_price_id: String? - - attr_accessor fixed_price_quantity: Float? - - attr_accessor invoicing_cycle_configuration: Orb::BillingCycleConfiguration? - - attr_accessor item: Orb::ItemSlim - - attr_accessor maximum: Orb::Maximum? - - attr_accessor maximum_amount: String? - - attr_accessor metadata: ::Hash[Symbol, String] - - attr_accessor minimum: Orb::Minimum? - - attr_accessor minimum_amount: String? - - attr_accessor model_type: :bulk_bps - - attr_accessor name: String - - attr_accessor plan_phase_order: Integer? - - attr_accessor price_type: Orb::Models::Price::BulkBPS::price_type - - attr_accessor replaces_price_id: String? - - 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, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::BulkBPS::conversion_rate_config?, - created_at: Time, - credit_allocation: Orb::Allocation?, - currency: String, - discount: Orb::Models::discount?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, - item: Orb::ItemSlim, - maximum: Orb::Maximum?, - maximum_amount: String?, - metadata: ::Hash[Symbol, String], - minimum: Orb::Minimum?, - minimum_amount: String?, - name: String, - plan_phase_order: Integer?, - price_type: Orb::Models::Price::BulkBPS::price_type, - replaces_price_id: String?, - ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :bulk_bps - ) -> 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, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::BulkBPS::conversion_rate_config?, - created_at: Time, - credit_allocation: Orb::Allocation?, - currency: String, - discount: Orb::Models::discount?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, - item: Orb::ItemSlim, - maximum: Orb::Maximum?, - maximum_amount: String?, - metadata: ::Hash[Symbol, String], - minimum: Orb::Minimum?, - minimum_amount: String?, - model_type: :bulk_bps, - name: String, - plan_phase_order: Integer?, - price_type: Orb::Models::Price::BulkBPS::price_type, - replaces_price_id: String?, - dimensional_price_configuration: Orb::DimensionalPriceConfiguration? - } - - 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::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] - end - - type price_type = :usage_price | :fixed_price - - module PriceType - extend Orb::Internal::Type::Enum - - USAGE_PRICE: :usage_price - FIXED_PRICE: :fixed_price - - def self?.values: -> ::Array[Orb::Models::Price::BulkBPS::price_type] - end - end - - type bulk = - { - id: String, - billable_metric: Orb::BillableMetricTiny?, - billing_cycle_configuration: Orb::BillingCycleConfiguration, - bulk_config: Orb::BulkConfig, - cadence: Orb::Models::Price::Bulk::cadence, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::Bulk::conversion_rate_config?, - created_at: Time, - credit_allocation: Orb::Allocation?, - currency: String, - discount: Orb::Models::discount?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, - item: Orb::ItemSlim, - maximum: Orb::Maximum?, - maximum_amount: String?, - metadata: ::Hash[Symbol, String], - minimum: Orb::Minimum?, - minimum_amount: String?, - model_type: :bulk, - name: String, - plan_phase_order: Integer?, - price_type: Orb::Models::Price::Bulk::price_type, - replaces_price_id: String?, - dimensional_price_configuration: Orb::DimensionalPriceConfiguration? - } - - 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 bulk_config: Orb::BulkConfig - - attr_accessor cadence: Orb::Models::Price::Bulk::cadence - - attr_accessor conversion_rate: Float? - - attr_accessor conversion_rate_config: Orb::Models::Price::Bulk::conversion_rate_config? - - attr_accessor created_at: Time - - attr_accessor credit_allocation: Orb::Allocation? - - attr_accessor currency: String - - attr_accessor discount: Orb::Models::discount? - - attr_accessor external_price_id: String? - - attr_accessor fixed_price_quantity: Float? - - attr_accessor invoicing_cycle_configuration: Orb::BillingCycleConfiguration? - - attr_accessor item: Orb::ItemSlim - - attr_accessor maximum: Orb::Maximum? - - attr_accessor maximum_amount: String? - - attr_accessor metadata: ::Hash[Symbol, String] - - attr_accessor minimum: Orb::Minimum? - - attr_accessor minimum_amount: String? - - attr_accessor model_type: :bulk - - attr_accessor name: String - - attr_accessor plan_phase_order: Integer? - - attr_accessor price_type: Orb::Models::Price::Bulk::price_type - - attr_accessor replaces_price_id: String? - - 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, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::Bulk::conversion_rate_config?, - created_at: Time, - credit_allocation: Orb::Allocation?, - currency: String, - discount: Orb::Models::discount?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, - item: Orb::ItemSlim, - maximum: Orb::Maximum?, - maximum_amount: String?, - metadata: ::Hash[Symbol, String], - minimum: Orb::Minimum?, - minimum_amount: String?, - name: String, - plan_phase_order: Integer?, - price_type: Orb::Models::Price::Bulk::price_type, - replaces_price_id: String?, - ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :bulk - ) -> 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, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::Bulk::conversion_rate_config?, - created_at: Time, - credit_allocation: Orb::Allocation?, - currency: String, - discount: Orb::Models::discount?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, - item: Orb::ItemSlim, - maximum: Orb::Maximum?, - maximum_amount: String?, - metadata: ::Hash[Symbol, String], - minimum: Orb::Minimum?, - minimum_amount: String?, - model_type: :bulk, - name: String, - plan_phase_order: Integer?, - price_type: Orb::Models::Price::Bulk::price_type, - replaces_price_id: String?, - dimensional_price_configuration: Orb::DimensionalPriceConfiguration? - } - - 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::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] - end - - type price_type = :usage_price | :fixed_price - - module PriceType - extend Orb::Internal::Type::Enum - - USAGE_PRICE: :usage_price - FIXED_PRICE: :fixed_price - - def self?.values: -> ::Array[Orb::Models::Price::Bulk::price_type] - end - end - - type threshold_total_amount = - { - id: String, - billable_metric: Orb::BillableMetricTiny?, - billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::ThresholdTotalAmount::cadence, - conversion_rate: Float?, - conversion_rate_config: Orb::Models::Price::ThresholdTotalAmount::conversion_rate_config?, - created_at: Time, - credit_allocation: Orb::Allocation?, - currency: String, - discount: Orb::Models::discount?, - external_price_id: String?, - fixed_price_quantity: Float?, - invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, - item: Orb::ItemSlim, - maximum: Orb::Maximum?, - maximum_amount: String?, - metadata: ::Hash[Symbol, String], - minimum: Orb::Minimum?, - minimum_amount: String?, - model_type: :threshold_total_amount, - name: String, - plan_phase_order: Integer?, - price_type: Orb::Models::Price::ThresholdTotalAmount::price_type, - replaces_price_id: String?, - threshold_total_amount_config: ::Hash[Symbol, top], - dimensional_price_configuration: Orb::DimensionalPriceConfiguration? - } - - 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 cadence: Orb::Models::Price::ThresholdTotalAmount::cadence - - attr_accessor conversion_rate: Float? - - attr_accessor conversion_rate_config: Orb::Models::Price::ThresholdTotalAmount::conversion_rate_config? - - attr_accessor created_at: Time - - attr_accessor credit_allocation: Orb::Allocation? - - attr_accessor currency: String - - attr_accessor discount: Orb::Models::discount? - - attr_accessor external_price_id: String? - - attr_accessor fixed_price_quantity: Float? - - attr_accessor invoicing_cycle_configuration: Orb::BillingCycleConfiguration? - - attr_accessor item: Orb::ItemSlim - - attr_accessor maximum: Orb::Maximum? - - attr_accessor maximum_amount: String? - - attr_accessor metadata: ::Hash[Symbol, String] - - attr_accessor minimum: Orb::Minimum? - - attr_accessor minimum_amount: String? - - attr_accessor model_type: :threshold_total_amount + attr_accessor model_type: :threshold_total_amount attr_accessor name: String @@ -1537,7 +1072,7 @@ module Orb attr_accessor replaces_price_id: String? - attr_accessor threshold_total_amount_config: ::Hash[Symbol, top] + attr_accessor threshold_total_amount_config: Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? @@ -1545,7 +1080,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::ThresholdTotalAmount::conversion_rate_config?, created_at: Time, @@ -1565,7 +1102,7 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::ThresholdTotalAmount::price_type, replaces_price_id: String?, - threshold_total_amount_config: ::Hash[Symbol, top], + threshold_total_amount_config: Orb::Price::ThresholdTotalAmount::ThresholdTotalAmountConfig, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, ?model_type: :threshold_total_amount ) -> void @@ -1574,7 +1111,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::ThresholdTotalAmount::conversion_rate_config?, created_at: Time, @@ -1595,10 +1134,21 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::ThresholdTotalAmount::price_type, replaces_price_id: String?, - threshold_total_amount_config: ::Hash[Symbol, top], + 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 @@ -1615,25 +1165,51 @@ module Orb def self?.values: -> ::Array[Orb::Models::Price::ThresholdTotalAmount::cadence] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::ThresholdTotalAmount::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::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 initialize: (threshold: String, total_amount: String) -> void + + def to_hash: -> { threshold: String, total_amount: String } + end + end end type tiered_package = @@ -1641,7 +1217,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::TieredPackage::conversion_rate_config?, created_at: Time, @@ -1662,7 +1240,7 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::TieredPackage::price_type, replaces_price_id: String?, - tiered_package_config: ::Hash[Symbol, top], + tiered_package_config: Orb::Price::TieredPackage::TieredPackageConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } @@ -1673,8 +1251,12 @@ module Orb attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration + attr_accessor billing_mode: Orb::Models::Price::TieredPackage::billing_mode + attr_accessor cadence: Orb::Models::Price::TieredPackage::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? @@ -1715,7 +1297,7 @@ module Orb attr_accessor replaces_price_id: String? - attr_accessor tiered_package_config: ::Hash[Symbol, top] + attr_accessor tiered_package_config: Orb::Price::TieredPackage::TieredPackageConfig attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? @@ -1723,7 +1305,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::TieredPackage::conversion_rate_config?, created_at: Time, @@ -1743,7 +1327,7 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::TieredPackage::price_type, replaces_price_id: String?, - tiered_package_config: ::Hash[Symbol, top], + tiered_package_config: Orb::Price::TieredPackage::TieredPackageConfig, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, ?model_type: :tiered_package ) -> void @@ -1752,7 +1336,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::TieredPackage::conversion_rate_config?, created_at: Time, @@ -1773,10 +1359,21 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::TieredPackage::price_type, replaces_price_id: String?, - tiered_package_config: ::Hash[Symbol, top], + 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 @@ -1793,42 +1390,69 @@ module Orb 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] - 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] 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 grouped_tiered = + type tiered_with_minimum = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedTiered::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::GroupedTiered::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::TieredWithMinimum::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 +1460,31 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :grouped_tiered, + model_type: :tiered_with_minimum, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedTiered::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 GroupedTiered < 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 cadence: Orb::Models::Price::GroupedTiered::cadence + attr_accessor billing_mode: Orb::Models::Price::TieredWithMinimum::billing_mode + + 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::GroupedTiered::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::TieredWithMinimum::conversion_rate_config? attr_accessor created_at: Time @@ -1869,8 +1498,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,32 +1512,35 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :grouped_tiered + attr_accessor model_type: :tiered_with_minimum attr_accessor name: String attr_accessor plan_phase_order: Integer? - attr_accessor price_type: Orb::Models::Price::GroupedTiered::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, - cadence: Orb::Models::Price::GroupedTiered::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::GroupedTiered::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::TieredWithMinimum::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?, @@ -1920,26 +1550,28 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedTiered::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: :grouped_tiered + ?model_type: :tiered_with_minimum ) -> 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::TieredWithMinimum::billing_mode, + cadence: Orb::Models::Price::TieredWithMinimum::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::TieredWithMinimum::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 +1579,26 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :grouped_tiered, + model_type: :tiered_with_minimum, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedTiered::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 @@ -1968,44 +1612,97 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::GroupedTiered::cadence] - end - - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::GroupedTiered::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::GroupedTiered::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 tiered_with_minimum = + type grouped_tiered = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::TieredWithMinimum::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::TieredWithMinimum::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?, @@ -2013,27 +1710,30 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :tiered_with_minimum, + model_type: :grouped_tiered, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::TieredWithMinimum::price_type, + price_type: Orb::Models::Price::GroupedTiered::price_type, replaces_price_id: String?, - tiered_with_minimum_config: ::Hash[Symbol, top], dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class TieredWithMinimum < 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::TieredWithMinimum::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::TieredWithMinimum::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::GroupedTiered::conversion_rate_config? attr_accessor created_at: Time @@ -2047,6 +1747,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 @@ -2061,33 +1763,34 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :tiered_with_minimum + attr_accessor model_type: :grouped_tiered 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::GroupedTiered::price_type attr_accessor replaces_price_id: String? - attr_accessor tiered_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::TieredWithMinimum::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::TieredWithMinimum::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?, @@ -2097,26 +1800,28 @@ module Orb minimum_amount: String?, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::TieredWithMinimum::price_type, + price_type: Orb::Models::Price::GroupedTiered::price_type, replaces_price_id: String?, - tiered_with_minimum_config: ::Hash[Symbol, top], ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :tiered_with_minimum + ?model_type: :grouped_tiered ) -> 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::GroupedTiered::billing_mode, + cadence: Orb::Models::Price::GroupedTiered::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::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?, @@ -2124,15 +1829,25 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :tiered_with_minimum, + model_type: :grouped_tiered, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::TieredWithMinimum::price_type, + price_type: Orb::Models::Price::GroupedTiered::price_type, replaces_price_id: String?, - tiered_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::GroupedTiered::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -2146,27 +1861,56 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::TieredWithMinimum::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 - module ConversionRateConfig - extend Orb::Internal::Type::Union + attr_accessor tiers: ::Array[Orb::Price::GroupedTiered::GroupedTieredConfig::Tier] - def self?.variants: -> ::Array[Orb::Models::Price::TieredWithMinimum::conversion_rate_config] + 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 } + + 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 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::GroupedTiered::price_type] end end @@ -2175,7 +1919,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::TieredPackageWithMinimum::conversion_rate_config?, created_at: Time, @@ -2196,7 +1942,7 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::TieredPackageWithMinimum::price_type, replaces_price_id: String?, - tiered_package_with_minimum_config: ::Hash[Symbol, top], + tiered_package_with_minimum_config: Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } @@ -2207,8 +1953,12 @@ module Orb attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration + 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::TieredPackageWithMinimum::conversion_rate_config? @@ -2249,7 +1999,7 @@ module Orb attr_accessor replaces_price_id: String? - attr_accessor tiered_package_with_minimum_config: ::Hash[Symbol, top] + attr_accessor tiered_package_with_minimum_config: Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? @@ -2257,7 +2007,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::TieredPackageWithMinimum::conversion_rate_config?, created_at: Time, @@ -2277,7 +2029,7 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::TieredPackageWithMinimum::price_type, replaces_price_id: String?, - tiered_package_with_minimum_config: ::Hash[Symbol, top], + tiered_package_with_minimum_config: Orb::Price::TieredPackageWithMinimum::TieredPackageWithMinimumConfig, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, ?model_type: :tiered_package_with_minimum ) -> void @@ -2286,7 +2038,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::TieredPackageWithMinimum::conversion_rate_config?, created_at: Time, @@ -2307,10 +2061,21 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::TieredPackageWithMinimum::price_type, replaces_price_id: String?, - tiered_package_with_minimum_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 @@ -2327,25 +2092,66 @@ module Orb 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] - 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] 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 package_with_allocation = @@ -2353,7 +2159,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::PackageWithAllocation::conversion_rate_config?, created_at: Time, @@ -2371,7 +2179,7 @@ module Orb minimum_amount: String?, model_type: :package_with_allocation, name: String, - package_with_allocation_config: ::Hash[Symbol, top], + package_with_allocation_config: Orb::Price::PackageWithAllocation::PackageWithAllocationConfig, plan_phase_order: Integer?, price_type: Orb::Models::Price::PackageWithAllocation::price_type, replaces_price_id: String?, @@ -2385,8 +2193,12 @@ module Orb attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration + 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::PackageWithAllocation::conversion_rate_config? @@ -2421,7 +2233,7 @@ module Orb attr_accessor name: String - attr_accessor package_with_allocation_config: ::Hash[Symbol, top] + attr_accessor package_with_allocation_config: Orb::Price::PackageWithAllocation::PackageWithAllocationConfig attr_accessor plan_phase_order: Integer? @@ -2435,7 +2247,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::PackageWithAllocation::conversion_rate_config?, created_at: Time, @@ -2452,7 +2266,7 @@ module Orb minimum: Orb::Minimum?, minimum_amount: String?, name: String, - package_with_allocation_config: ::Hash[Symbol, top], + package_with_allocation_config: Orb::Price::PackageWithAllocation::PackageWithAllocationConfig, plan_phase_order: Integer?, price_type: Orb::Models::Price::PackageWithAllocation::price_type, replaces_price_id: String?, @@ -2464,7 +2278,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::PackageWithAllocation::conversion_rate_config?, created_at: Time, @@ -2482,13 +2298,24 @@ module Orb minimum_amount: String?, model_type: :package_with_allocation, name: String, - package_with_allocation_config: ::Hash[Symbol, top], + package_with_allocation_config: Orb::Price::PackageWithAllocation::PackageWithAllocationConfig, plan_phase_order: Integer?, 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 @@ -2505,22 +2332,37 @@ module Orb 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::PackageWithAllocation::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::PackageWithAllocation::price_type] end @@ -2531,7 +2373,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::UnitWithPercent::conversion_rate_config?, created_at: Time, @@ -2552,7 +2396,7 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::UnitWithPercent::price_type, replaces_price_id: String?, - unit_with_percent_config: ::Hash[Symbol, top], + unit_with_percent_config: Orb::Price::UnitWithPercent::UnitWithPercentConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } @@ -2563,8 +2407,12 @@ module Orb attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration + 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::UnitWithPercent::conversion_rate_config? @@ -2605,7 +2453,7 @@ module Orb attr_accessor replaces_price_id: String? - attr_accessor unit_with_percent_config: ::Hash[Symbol, top] + attr_accessor unit_with_percent_config: Orb::Price::UnitWithPercent::UnitWithPercentConfig attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? @@ -2613,7 +2461,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::UnitWithPercent::conversion_rate_config?, created_at: Time, @@ -2633,7 +2483,7 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::UnitWithPercent::price_type, replaces_price_id: String?, - unit_with_percent_config: ::Hash[Symbol, top], + unit_with_percent_config: Orb::Price::UnitWithPercent::UnitWithPercentConfig, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, ?model_type: :unit_with_percent ) -> void @@ -2642,7 +2492,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::UnitWithPercent::conversion_rate_config?, created_at: Time, @@ -2663,10 +2515,21 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::UnitWithPercent::price_type, replaces_price_id: String?, - unit_with_percent_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 @@ -2677,31 +2540,35 @@ module Orb MONTHLY: :monthly QUARTERLY: :quarterly SEMI_ANNUAL: :semi_annual - 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 + ANNUAL: :annual + CUSTOM: :custom - def self?.variants: -> ::Array[Orb::Models::Price::UnitWithPercent::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::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 matrix_with_allocation = @@ -2709,7 +2576,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::MatrixWithAllocation::conversion_rate_config?, created_at: Time, @@ -2741,8 +2610,12 @@ module Orb attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration + 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::MatrixWithAllocation::conversion_rate_config? @@ -2791,7 +2664,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::MatrixWithAllocation::conversion_rate_config?, created_at: Time, @@ -2820,7 +2695,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::MatrixWithAllocation::conversion_rate_config?, created_at: Time, @@ -2845,6 +2722,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::MatrixWithAllocation::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -2861,22 +2749,14 @@ module Orb def self?.values: -> ::Array[Orb::Models::Price::MatrixWithAllocation::cadence] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::MatrixWithAllocation::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::MatrixWithAllocation::price_type] end @@ -2887,7 +2767,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::TieredWithProration::conversion_rate_config?, created_at: Time, @@ -2908,7 +2790,7 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::TieredWithProration::price_type, replaces_price_id: String?, - tiered_with_proration_config: ::Hash[Symbol, top], + tiered_with_proration_config: Orb::Price::TieredWithProration::TieredWithProrationConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } @@ -2919,8 +2801,12 @@ module Orb attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration + 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::TieredWithProration::conversion_rate_config? @@ -2961,7 +2847,7 @@ module Orb attr_accessor replaces_price_id: String? - attr_accessor tiered_with_proration_config: ::Hash[Symbol, top] + attr_accessor tiered_with_proration_config: Orb::Price::TieredWithProration::TieredWithProrationConfig attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? @@ -2969,7 +2855,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::TieredWithProration::conversion_rate_config?, created_at: Time, @@ -2989,7 +2877,7 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::TieredWithProration::price_type, replaces_price_id: String?, - tiered_with_proration_config: ::Hash[Symbol, top], + tiered_with_proration_config: Orb::Price::TieredWithProration::TieredWithProrationConfig, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, ?model_type: :tiered_with_proration ) -> void @@ -2998,7 +2886,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::TieredWithProration::conversion_rate_config?, created_at: Time, @@ -3019,10 +2909,21 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::TieredWithProration::price_type, replaces_price_id: String?, - tiered_with_proration_config: ::Hash[Symbol, top], + 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 @@ -3039,25 +2940,49 @@ module Orb 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] - 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] 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_proration = @@ -3065,7 +2990,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::UnitWithProration::conversion_rate_config?, created_at: Time, @@ -3086,7 +3013,7 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::UnitWithProration::price_type, replaces_price_id: String?, - unit_with_proration_config: ::Hash[Symbol, top], + unit_with_proration_config: Orb::Price::UnitWithProration::UnitWithProrationConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } @@ -3097,8 +3024,12 @@ module Orb attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration + 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::UnitWithProration::conversion_rate_config? @@ -3139,7 +3070,7 @@ module Orb attr_accessor replaces_price_id: String? - attr_accessor unit_with_proration_config: ::Hash[Symbol, top] + attr_accessor unit_with_proration_config: Orb::Price::UnitWithProration::UnitWithProrationConfig attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? @@ -3147,7 +3078,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::UnitWithProration::conversion_rate_config?, created_at: Time, @@ -3167,7 +3100,7 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::UnitWithProration::price_type, replaces_price_id: String?, - unit_with_proration_config: ::Hash[Symbol, top], + unit_with_proration_config: Orb::Price::UnitWithProration::UnitWithProrationConfig, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, ?model_type: :unit_with_proration ) -> void @@ -3176,7 +3109,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::UnitWithProration::conversion_rate_config?, created_at: Time, @@ -3197,10 +3132,21 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::UnitWithProration::price_type, replaces_price_id: String?, - unit_with_proration_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 @@ -3217,25 +3163,27 @@ module Orb def self?.values: -> ::Array[Orb::Models::Price::UnitWithProration::cadence] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::UnitWithProration::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::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 grouped_allocation = @@ -3243,7 +3191,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::GroupedAllocation::conversion_rate_config?, created_at: Time, @@ -3252,7 +3202,7 @@ module Orb discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_allocation_config: ::Hash[Symbol, top], + grouped_allocation_config: Orb::Price::GroupedAllocation::GroupedAllocationConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -3275,8 +3225,12 @@ module Orb attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration + 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::GroupedAllocation::conversion_rate_config? @@ -3293,7 +3247,7 @@ module Orb attr_accessor fixed_price_quantity: Float? - attr_accessor grouped_allocation_config: ::Hash[Symbol, top] + attr_accessor grouped_allocation_config: Orb::Price::GroupedAllocation::GroupedAllocationConfig attr_accessor invoicing_cycle_configuration: Orb::BillingCycleConfiguration? @@ -3325,7 +3279,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::GroupedAllocation::conversion_rate_config?, created_at: Time, @@ -3334,7 +3290,7 @@ module Orb discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_allocation_config: ::Hash[Symbol, top], + grouped_allocation_config: Orb::Price::GroupedAllocation::GroupedAllocationConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -3354,7 +3310,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::GroupedAllocation::conversion_rate_config?, created_at: Time, @@ -3363,7 +3321,7 @@ module Orb discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_allocation_config: ::Hash[Symbol, top], + grouped_allocation_config: Orb::Price::GroupedAllocation::GroupedAllocationConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -3379,6 +3337,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::GroupedAllocation::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -3395,33 +3364,277 @@ module Orb 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::GroupedAllocation::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::GroupedAllocation::price_type] end end + type bulk_with_proration = + { + id: String, + billable_metric: Orb::BillableMetricTiny?, + billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::BulkWithProration::conversion_rate_config?, + created_at: Time, + credit_allocation: Orb::Allocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, + item: Orb::ItemSlim, + maximum: Orb::Maximum?, + maximum_amount: String?, + metadata: ::Hash[Symbol, String], + minimum: Orb::Minimum?, + minimum_amount: String?, + model_type: :bulk_with_proration, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::BulkWithProration::price_type, + replaces_price_id: String?, + dimensional_price_configuration: Orb::DimensionalPriceConfiguration? + } + + 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 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::BulkWithProration::conversion_rate_config? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Allocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::BillingCycleConfiguration? + + attr_accessor item: Orb::ItemSlim + + attr_accessor maximum: Orb::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: ::Hash[Symbol, String] + + attr_accessor minimum: Orb::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :bulk_with_proration + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::BulkWithProration::price_type + + attr_accessor replaces_price_id: String? + + attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? + + def initialize: ( + id: String, + billable_metric: Orb::BillableMetricTiny?, + billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::BulkWithProration::conversion_rate_config?, + created_at: Time, + credit_allocation: Orb::Allocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, + item: Orb::ItemSlim, + maximum: Orb::Maximum?, + maximum_amount: String?, + metadata: ::Hash[Symbol, String], + minimum: Orb::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::BulkWithProration::price_type, + replaces_price_id: String?, + ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, + ?model_type: :bulk_with_proration + ) -> void + + def to_hash: -> { + id: String, + billable_metric: Orb::BillableMetricTiny?, + billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::BulkWithProration::conversion_rate_config?, + created_at: Time, + credit_allocation: Orb::Allocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, + item: Orb::ItemSlim, + maximum: Orb::Maximum?, + maximum_amount: String?, + metadata: ::Hash[Symbol, String], + minimum: Orb::Minimum?, + minimum_amount: String?, + model_type: :bulk_with_proration, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::BulkWithProration::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::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 + + 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::BulkWithProration::cadence] + end + + 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] + end + end + type grouped_with_prorated_minimum = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::GroupedWithProratedMinimum::conversion_rate_config?, created_at: Time, @@ -3430,7 +3643,7 @@ module Orb discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_with_prorated_minimum_config: ::Hash[Symbol, top], + grouped_with_prorated_minimum_config: Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -3453,8 +3666,12 @@ module Orb attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration + 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::GroupedWithProratedMinimum::conversion_rate_config? @@ -3471,7 +3688,7 @@ module Orb attr_accessor fixed_price_quantity: Float? - attr_accessor grouped_with_prorated_minimum_config: ::Hash[Symbol, top] + attr_accessor grouped_with_prorated_minimum_config: Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig attr_accessor invoicing_cycle_configuration: Orb::BillingCycleConfiguration? @@ -3503,7 +3720,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::GroupedWithProratedMinimum::conversion_rate_config?, created_at: Time, @@ -3512,7 +3731,7 @@ module Orb discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_with_prorated_minimum_config: ::Hash[Symbol, top], + grouped_with_prorated_minimum_config: Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -3532,7 +3751,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::GroupedWithProratedMinimum::conversion_rate_config?, created_at: Time, @@ -3541,7 +3762,7 @@ module Orb discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_with_prorated_minimum_config: ::Hash[Symbol, top], + grouped_with_prorated_minimum_config: Orb::Price::GroupedWithProratedMinimum::GroupedWithProratedMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -3557,6 +3778,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::GroupedWithProratedMinimum::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -3573,22 +3805,37 @@ module Orb 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 + + attr_accessor minimum: String + + attr_accessor unit_rate: String - module ConversionRateConfig - extend Orb::Internal::Type::Union + def initialize: ( + grouping_key: String, + minimum: String, + unit_rate: String + ) -> void - def self?.variants: -> ::Array[Orb::Models::Price::GroupedWithProratedMinimum::conversion_rate_config] + 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::GroupedWithProratedMinimum::price_type] end @@ -3599,7 +3846,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::GroupedWithMeteredMinimum::conversion_rate_config?, created_at: Time, @@ -3608,7 +3857,7 @@ module Orb discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_with_metered_minimum_config: ::Hash[Symbol, top], + grouped_with_metered_minimum_config: Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -3631,8 +3880,12 @@ module Orb attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration + 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::GroupedWithMeteredMinimum::conversion_rate_config? @@ -3649,7 +3902,7 @@ module Orb attr_accessor fixed_price_quantity: Float? - attr_accessor grouped_with_metered_minimum_config: ::Hash[Symbol, top] + attr_accessor grouped_with_metered_minimum_config: Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig attr_accessor invoicing_cycle_configuration: Orb::BillingCycleConfiguration? @@ -3681,7 +3934,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::GroupedWithMeteredMinimum::conversion_rate_config?, created_at: Time, @@ -3690,7 +3945,7 @@ module Orb discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_with_metered_minimum_config: ::Hash[Symbol, top], + grouped_with_metered_minimum_config: Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -3710,7 +3965,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::GroupedWithMeteredMinimum::conversion_rate_config?, created_at: Time, @@ -3719,7 +3976,7 @@ module Orb discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_with_metered_minimum_config: ::Hash[Symbol, top], + grouped_with_metered_minimum_config: Orb::Price::GroupedWithMeteredMinimum::GroupedWithMeteredMinimumConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -3735,6 +3992,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::GroupedWithMeteredMinimum::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -3751,69 +4019,137 @@ module Orb def self?.values: -> ::Array[Orb::Models::Price::GroupedWithMeteredMinimum::cadence] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig + 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 } + + 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 - module ConversionRateConfig - extend Orb::Internal::Type::Union + def initialize: (pricing_value: String, unit_amount: String) -> void - def self?.variants: -> ::Array[Orb::Models::Price::GroupedWithMeteredMinimum::conversion_rate_config] + 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::GroupedWithMeteredMinimum::price_type] end end - type matrix_with_display_name = + type grouped_with_min_max_thresholds = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::MatrixWithDisplayName::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::MatrixWithDisplayName::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_min_max_thresholds_config: Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, 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_with_min_max_thresholds, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::MatrixWithDisplayName::price_type, + price_type: Orb::Models::Price::GroupedWithMinMaxThresholds::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class MatrixWithDisplayName < 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::MatrixWithDisplayName::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::MatrixWithDisplayName::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::GroupedWithMinMaxThresholds::conversion_rate_config? attr_accessor created_at: Time @@ -3827,12 +4163,12 @@ module Orb attr_accessor fixed_price_quantity: Float? + attr_accessor grouped_with_min_max_thresholds_config: Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig + 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 +4179,13 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :matrix_with_display_name + 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::MatrixWithDisplayName::price_type + attr_accessor price_type: Orb::Models::Price::GroupedWithMinMaxThresholds::price_type attr_accessor replaces_price_id: String? @@ -3859,18 +4195,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::GroupedWithMinMaxThresholds::billing_mode, + cadence: Orb::Models::Price::GroupedWithMinMaxThresholds::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::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_min_max_thresholds_config: Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, 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 +4216,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::GroupedWithMinMaxThresholds::price_type, replaces_price_id: String?, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :matrix_with_display_name + ?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::MatrixWithDisplayName::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::MatrixWithDisplayName::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_min_max_thresholds_config: Orb::Price::GroupedWithMinMaxThresholds::GroupedWithMinMaxThresholdsConfig, 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_with_min_max_thresholds, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::MatrixWithDisplayName::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 @@ -3926,39 +4277,64 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::MatrixWithDisplayName::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 + } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class GroupedWithMinMaxThresholdsConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String - def self?.variants: -> ::Array[Orb::Models::Price::MatrixWithDisplayName::conversion_rate_config] + 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 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::GroupedWithMinMaxThresholds::price_type] end end - type bulk_with_proration = + type matrix_with_display_name = { 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::MatrixWithDisplayName::billing_mode, + cadence: Orb::Models::Price::MatrixWithDisplayName::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::MatrixWithDisplayName::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -3967,33 +4343,36 @@ module Orb fixed_price_quantity: Float?, 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: :bulk_with_proration, + model_type: :matrix_with_display_name, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::BulkWithProration::price_type, + price_type: Orb::Models::Price::MatrixWithDisplayName::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class BulkWithProration < 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 bulk_with_proration_config: ::Hash[Symbol, top] + attr_accessor billing_mode: Orb::Models::Price::MatrixWithDisplayName::billing_mode - attr_accessor cadence: Orb::Models::Price::BulkWithProration::cadence + 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::BulkWithProration::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::MatrixWithDisplayName::conversion_rate_config? attr_accessor created_at: Time @@ -4011,6 +4390,8 @@ module Orb 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? @@ -4021,13 +4402,13 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :bulk_with_proration + 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::BulkWithProration::price_type + attr_accessor price_type: Orb::Models::Price::MatrixWithDisplayName::price_type attr_accessor replaces_price_id: String? @@ -4037,10 +4418,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::MatrixWithDisplayName::billing_mode, + cadence: Orb::Models::Price::MatrixWithDisplayName::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::MatrixWithDisplayName::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -4049,6 +4431,7 @@ module Orb fixed_price_quantity: Float?, 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], @@ -4056,20 +4439,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::MatrixWithDisplayName::price_type, replaces_price_id: String?, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :bulk_with_proration + ?model_type: :matrix_with_display_name ) -> 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::MatrixWithDisplayName::billing_mode, + cadence: Orb::Models::Price::MatrixWithDisplayName::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::MatrixWithDisplayName::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, currency: String, @@ -4078,19 +4462,31 @@ module Orb fixed_price_quantity: Float?, 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: :bulk_with_proration, + model_type: :matrix_with_display_name, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::BulkWithProration::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 @@ -4104,27 +4500,68 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::BulkWithProration::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::BulkWithProration::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::BulkWithProration::price_type] + def self?.values: -> ::Array[Orb::Models::Price::MatrixWithDisplayName::price_type] end end @@ -4133,7 +4570,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::GroupedTieredPackage::conversion_rate_config?, created_at: Time, @@ -4142,7 +4581,7 @@ module Orb discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_tiered_package_config: ::Hash[Symbol, top], + grouped_tiered_package_config: Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -4165,8 +4604,12 @@ module Orb attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration + 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::GroupedTieredPackage::conversion_rate_config? @@ -4183,7 +4626,7 @@ module Orb attr_accessor fixed_price_quantity: Float? - attr_accessor grouped_tiered_package_config: ::Hash[Symbol, top] + attr_accessor grouped_tiered_package_config: Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig attr_accessor invoicing_cycle_configuration: Orb::BillingCycleConfiguration? @@ -4215,7 +4658,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::GroupedTieredPackage::conversion_rate_config?, created_at: Time, @@ -4224,7 +4669,7 @@ module Orb discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_tiered_package_config: ::Hash[Symbol, top], + grouped_tiered_package_config: Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -4244,7 +4689,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::GroupedTieredPackage::conversion_rate_config?, created_at: Time, @@ -4253,7 +4700,7 @@ module Orb discount: Orb::Models::discount?, external_price_id: String?, fixed_price_quantity: Float?, - grouped_tiered_package_config: ::Hash[Symbol, top], + grouped_tiered_package_config: Orb::Price::GroupedTieredPackage::GroupedTieredPackageConfig, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -4269,6 +4716,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::GroupedTieredPackage::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -4285,22 +4743,53 @@ module Orb 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] + } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class GroupedTieredPackageConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String - def self?.variants: -> ::Array[Orb::Models::Price::GroupedTieredPackage::conversion_rate_config] + 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 + + 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 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] end @@ -4311,7 +4800,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::MaxGroupTieredPackage::conversion_rate_config?, created_at: Time, @@ -4322,7 +4813,7 @@ module Orb fixed_price_quantity: Float?, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, - max_group_tiered_package_config: ::Hash[Symbol, top], + max_group_tiered_package_config: Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], @@ -4343,8 +4834,12 @@ module Orb attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration + attr_accessor billing_mode: Orb::Models::Price::MaxGroupTieredPackage::billing_mode + 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::MaxGroupTieredPackage::conversion_rate_config? @@ -4365,7 +4860,7 @@ module Orb attr_accessor item: Orb::ItemSlim - attr_accessor max_group_tiered_package_config: ::Hash[Symbol, top] + attr_accessor max_group_tiered_package_config: Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig attr_accessor maximum: Orb::Maximum? @@ -4393,7 +4888,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::MaxGroupTieredPackage::conversion_rate_config?, created_at: Time, @@ -4404,7 +4901,7 @@ module Orb fixed_price_quantity: Float?, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, - max_group_tiered_package_config: ::Hash[Symbol, top], + max_group_tiered_package_config: Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], @@ -4422,7 +4919,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::MaxGroupTieredPackage::conversion_rate_config?, created_at: Time, @@ -4433,7 +4932,7 @@ module Orb fixed_price_quantity: Float?, invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, - max_group_tiered_package_config: ::Hash[Symbol, top], + max_group_tiered_package_config: Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig, maximum: Orb::Maximum?, maximum_amount: String?, metadata: ::Hash[Symbol, String], @@ -4447,6 +4946,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::MaxGroupTieredPackage::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -4463,22 +4973,56 @@ module Orb 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] + } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class MaxGroupTieredPackageConfig < Orb::Internal::Type::BaseModel + attr_accessor grouping_key: String - def self?.variants: -> ::Array[Orb::Models::Price::MaxGroupTieredPackage::conversion_rate_config] + 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 + + 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::MaxGroupTieredPackage::price_type] end @@ -4489,7 +5033,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::ScalableMatrixWithUnitPricing::conversion_rate_config?, created_at: Time, @@ -4510,7 +5056,7 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::ScalableMatrixWithUnitPricing::price_type, replaces_price_id: String?, - scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_unit_pricing_config: Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } @@ -4521,8 +5067,12 @@ module Orb attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration + 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::ScalableMatrixWithUnitPricing::conversion_rate_config? @@ -4563,7 +5113,7 @@ module Orb attr_accessor replaces_price_id: String? - attr_accessor scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top] + attr_accessor scalable_matrix_with_unit_pricing_config: Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? @@ -4571,7 +5121,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::ScalableMatrixWithUnitPricing::conversion_rate_config?, created_at: Time, @@ -4591,7 +5143,7 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::ScalableMatrixWithUnitPricing::price_type, replaces_price_id: String?, - scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_unit_pricing_config: Orb::Price::ScalableMatrixWithUnitPricing::ScalableMatrixWithUnitPricingConfig, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, ?model_type: :scalable_matrix_with_unit_pricing ) -> void @@ -4600,7 +5152,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::ScalableMatrixWithUnitPricing::conversion_rate_config?, created_at: Time, @@ -4621,10 +5175,21 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::ScalableMatrixWithUnitPricing::price_type, replaces_price_id: String?, - scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top], + 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 @@ -4641,25 +5206,81 @@ module Orb def self?.values: -> ::Array[Orb::Models::Price::ScalableMatrixWithUnitPricing::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] - 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] 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 scalable_matrix_with_tiered_pricing = @@ -4667,7 +5288,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::ScalableMatrixWithTieredPricing::conversion_rate_config?, created_at: Time, @@ -4688,7 +5311,7 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::ScalableMatrixWithTieredPricing::price_type, replaces_price_id: String?, - scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_tiered_pricing_config: Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } @@ -4699,8 +5322,12 @@ module Orb attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration + 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::ScalableMatrixWithTieredPricing::conversion_rate_config? @@ -4741,7 +5368,7 @@ module Orb attr_accessor replaces_price_id: String? - attr_accessor scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top] + attr_accessor scalable_matrix_with_tiered_pricing_config: Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig attr_accessor dimensional_price_configuration: Orb::DimensionalPriceConfiguration? @@ -4749,7 +5376,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::ScalableMatrixWithTieredPricing::conversion_rate_config?, created_at: Time, @@ -4769,7 +5398,7 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::ScalableMatrixWithTieredPricing::price_type, replaces_price_id: String?, - scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top], + scalable_matrix_with_tiered_pricing_config: Orb::Price::ScalableMatrixWithTieredPricing::ScalableMatrixWithTieredPricingConfig, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, ?model_type: :scalable_matrix_with_tiered_pricing ) -> void @@ -4778,7 +5407,9 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::ScalableMatrixWithTieredPricing::conversion_rate_config?, created_at: Time, @@ -4799,10 +5430,21 @@ module Orb plan_phase_order: Integer?, price_type: Orb::Models::Price::ScalableMatrixWithTieredPricing::price_type, replaces_price_id: String?, - scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top], + 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 @@ -4819,25 +5461,91 @@ module Orb def self?.values: -> ::Array[Orb::Models::Price::ScalableMatrixWithTieredPricing::cadence] end - type conversion_rate_config = - Orb::UnitConversionRateConfig | Orb::TieredConversionRateConfig - - module ConversionRateConfig - extend Orb::Internal::Type::Union - - def self?.variants: -> ::Array[Orb::Models::Price::ScalableMatrixWithTieredPricing::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::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 cumulative_grouped_bulk = @@ -4845,12 +5553,14 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::CumulativeGroupedBulk::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, - cumulative_grouped_bulk_config: ::Hash[Symbol, top], + cumulative_grouped_bulk_config: Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig, currency: String, discount: Orb::Models::discount?, external_price_id: String?, @@ -4877,8 +5587,12 @@ module Orb attr_accessor billing_cycle_configuration: Orb::BillingCycleConfiguration + 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::CumulativeGroupedBulk::conversion_rate_config? @@ -4887,7 +5601,7 @@ module Orb attr_accessor credit_allocation: Orb::Allocation? - attr_accessor cumulative_grouped_bulk_config: ::Hash[Symbol, top] + attr_accessor cumulative_grouped_bulk_config: Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig attr_accessor currency: String @@ -4927,12 +5641,14 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::CumulativeGroupedBulk::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, - cumulative_grouped_bulk_config: ::Hash[Symbol, top], + cumulative_grouped_bulk_config: Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig, currency: String, discount: Orb::Models::discount?, external_price_id: String?, @@ -4956,12 +5672,14 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, + 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::CumulativeGroupedBulk::conversion_rate_config?, created_at: Time, credit_allocation: Orb::Allocation?, - cumulative_grouped_bulk_config: ::Hash[Symbol, top], + cumulative_grouped_bulk_config: Orb::Price::CumulativeGroupedBulk::CumulativeGroupedBulkConfig, currency: String, discount: Orb::Models::discount?, external_price_id: String?, @@ -4981,6 +5699,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::CumulativeGroupedBulk::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -4997,42 +5726,84 @@ module Orb 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::CumulativeGroupedBulk::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::CumulativeGroupedBulk::price_type] end end - type grouped_with_min_max_thresholds = + type minimum = { id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedWithMinMaxThresholds::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::GroupedWithMinMaxThresholds::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::Minimum::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_min_max_thresholds_config: ::Hash[Symbol, top], invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -5040,26 +5811,31 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :grouped_with_min_max_thresholds, + minimum_config: Orb::Price::Minimum::MinimumConfig, + model_type: :minimum, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedWithMinMaxThresholds::price_type, + price_type: Orb::Models::Price::Minimum::price_type, replaces_price_id: String?, dimensional_price_configuration: Orb::DimensionalPriceConfiguration? } - class GroupedWithMinMaxThresholds < 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::GroupedWithMinMaxThresholds::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::GroupedWithMinMaxThresholds::conversion_rate_config? + attr_accessor conversion_rate_config: Orb::Models::Price::Minimum::conversion_rate_config? attr_accessor created_at: Time @@ -5073,8 +5849,6 @@ module Orb 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 +5863,15 @@ module Orb attr_accessor minimum_amount: String? - attr_accessor model_type: :grouped_with_min_max_thresholds + 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::GroupedWithMinMaxThresholds::price_type + attr_accessor price_type: Orb::Models::Price::Minimum::price_type attr_accessor replaces_price_id: String? @@ -5105,16 +5881,17 @@ module Orb id: String, billable_metric: Orb::BillableMetricTiny?, billing_cycle_configuration: Orb::BillingCycleConfiguration, - cadence: Orb::Models::Price::GroupedWithMinMaxThresholds::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::GroupedWithMinMaxThresholds::conversion_rate_config?, + conversion_rate_config: Orb::Models::Price::Minimum::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_min_max_thresholds_config: ::Hash[Symbol, top], invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -5122,28 +5899,30 @@ 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::GroupedWithMinMaxThresholds::price_type, + price_type: Orb::Models::Price::Minimum::price_type, replaces_price_id: String?, ?dimensional_price_configuration: Orb::DimensionalPriceConfiguration?, - ?model_type: :grouped_with_min_max_thresholds + ?model_type: :minimum ) -> 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::Minimum::billing_mode, + cadence: Orb::Models::Price::Minimum::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::Minimum::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_min_max_thresholds_config: ::Hash[Symbol, top], invoicing_cycle_configuration: Orb::BillingCycleConfiguration?, item: Orb::ItemSlim, maximum: Orb::Maximum?, @@ -5151,14 +5930,26 @@ module Orb metadata: ::Hash[Symbol, String], minimum: Orb::Minimum?, minimum_amount: String?, - model_type: :grouped_with_min_max_thresholds, + minimum_config: Orb::Price::Minimum::MinimumConfig, + model_type: :minimum, name: String, plan_phase_order: Integer?, - price_type: Orb::Models::Price::GroupedWithMinMaxThresholds::price_type, + price_type: Orb::Models::Price::Minimum::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::Minimum::billing_mode] + end + type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom @@ -5172,27 +5963,33 @@ module Orb ANNUAL: :annual CUSTOM: :custom - def self?.values: -> ::Array[Orb::Models::Price::GroupedWithMinMaxThresholds::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 } - module ConversionRateConfig - extend Orb::Internal::Type::Union + class MinimumConfig < Orb::Internal::Type::BaseModel + attr_accessor minimum_amount: String - def self?.variants: -> ::Array[Orb::Models::Price::GroupedWithMinMaxThresholds::conversion_rate_config] + 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 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::Minimum::price_type] end end diff --git a/sig/orb/models/price_create_params.rbs b/sig/orb/models/price_create_params.rbs index f036bb01..dd184525 100644 --- a/sig/orb/models/price_create_params.rbs +++ b/sig/orb/models/price_create_params.rbs @@ -19,33 +19,32 @@ 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 } & Orb::Internal::Type::request_parameters @@ -87,59 +86,57 @@ module Orb attr_accessor metadata: ::Hash[Symbol, String?]? - attr_accessor package_config: Orb::PackageConfig - - attr_accessor matrix_config: Orb::MatrixConfig + attr_accessor tiered_config: Orb::TieredConfig - attr_accessor matrix_with_allocation_config: Orb::MatrixWithAllocationConfig + attr_accessor bulk_config: Orb::BulkConfig - attr_accessor tiered_config: Orb::TieredConfig + attr_accessor package_config: Orb::PackageConfig - attr_accessor tiered_bps_config: Orb::TieredBPSConfig + attr_accessor matrix_config: Orb::MatrixConfig - attr_accessor bps_config: Orb::BPSConfig + attr_accessor threshold_total_amount_config: Orb::PriceCreateParams::ThresholdTotalAmountConfig - attr_accessor bulk_bps_config: Orb::BulkBPSConfig + attr_accessor tiered_package_config: Orb::PriceCreateParams::TieredPackageConfig - attr_accessor bulk_config: Orb::BulkConfig + attr_accessor tiered_with_minimum_config: Orb::PriceCreateParams::TieredWithMinimumConfig - attr_accessor threshold_total_amount_config: ::Hash[Symbol, top] + attr_accessor grouped_tiered_config: Orb::PriceCreateParams::GroupedTieredConfig - attr_accessor tiered_package_config: ::Hash[Symbol, top] + attr_accessor tiered_package_with_minimum_config: Orb::PriceCreateParams::TieredPackageWithMinimumConfig - attr_accessor grouped_tiered_config: ::Hash[Symbol, top] + attr_accessor package_with_allocation_config: Orb::PriceCreateParams::PackageWithAllocationConfig - attr_accessor max_group_tiered_package_config: ::Hash[Symbol, top] + attr_accessor unit_with_percent_config: Orb::PriceCreateParams::UnitWithPercentConfig - attr_accessor tiered_with_minimum_config: ::Hash[Symbol, top] + attr_accessor matrix_with_allocation_config: Orb::MatrixWithAllocationConfig - attr_accessor package_with_allocation_config: ::Hash[Symbol, top] + attr_accessor tiered_with_proration_config: Orb::PriceCreateParams::TieredWithProrationConfig - attr_accessor tiered_package_with_minimum_config: ::Hash[Symbol, top] + attr_accessor unit_with_proration_config: Orb::PriceCreateParams::UnitWithProrationConfig - attr_accessor unit_with_percent_config: ::Hash[Symbol, top] + attr_accessor grouped_allocation_config: Orb::PriceCreateParams::GroupedAllocationConfig - attr_accessor tiered_with_proration_config: ::Hash[Symbol, top] + attr_accessor bulk_with_proration_config: Orb::PriceCreateParams::BulkWithProrationConfig - attr_accessor unit_with_proration_config: ::Hash[Symbol, top] + attr_accessor grouped_with_prorated_minimum_config: Orb::PriceCreateParams::GroupedWithProratedMinimumConfig - attr_accessor grouped_allocation_config: ::Hash[Symbol, top] + attr_accessor grouped_with_metered_minimum_config: Orb::PriceCreateParams::GroupedWithMeteredMinimumConfig - attr_accessor grouped_with_prorated_minimum_config: ::Hash[Symbol, top] + attr_accessor grouped_with_min_max_thresholds_config: Orb::PriceCreateParams::GroupedWithMinMaxThresholdsConfig - attr_accessor grouped_with_metered_minimum_config: ::Hash[Symbol, top] + attr_accessor matrix_with_display_name_config: Orb::PriceCreateParams::MatrixWithDisplayNameConfig - attr_accessor matrix_with_display_name_config: ::Hash[Symbol, top] + attr_accessor grouped_tiered_package_config: Orb::PriceCreateParams::GroupedTieredPackageConfig - attr_accessor bulk_with_proration_config: ::Hash[Symbol, top] + attr_accessor max_group_tiered_package_config: Orb::PriceCreateParams::MaxGroupTieredPackageConfig - attr_accessor grouped_tiered_package_config: ::Hash[Symbol, top] + attr_accessor scalable_matrix_with_unit_pricing_config: Orb::PriceCreateParams::ScalableMatrixWithUnitPricingConfig - attr_accessor scalable_matrix_with_unit_pricing_config: ::Hash[Symbol, top] + attr_accessor scalable_matrix_with_tiered_pricing_config: Orb::PriceCreateParams::ScalableMatrixWithTieredPricingConfig - attr_accessor scalable_matrix_with_tiered_pricing_config: ::Hash[Symbol, top] + attr_accessor cumulative_grouped_bulk_config: Orb::PriceCreateParams::CumulativeGroupedBulkConfig - attr_accessor cumulative_grouped_bulk_config: ::Hash[Symbol, top] + attr_accessor minimum_config: Orb::PriceCreateParams::MinimumConfig def initialize: ( cadence: Orb::Models::PriceCreateParams::cadence, @@ -148,33 +145,32 @@ 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, ?billable_metric_id: String?, ?billed_in_advance: bool?, ?billing_cycle_configuration: Orb::NewBillingCycleConfiguration?, @@ -207,33 +203,32 @@ 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, request_options: Orb::RequestOptions } @@ -253,23 +248,805 @@ module Orb def self?.values: -> ::Array[Orb::Models::PriceCreateParams::cadence] end - type model_type = :cumulative_grouped_bulk + type model_type = :minimum module ModelType extend Orb::Internal::Type::Enum - CUMULATIVE_GROUPED_BULK: :cumulative_grouped_bulk + MINIMUM: :minimum 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 - module ConversionRateConfig - extend Orb::Internal::Type::Union + def initialize: (minimum_amount: String, ?prorated: bool) -> void - def self?.variants: -> ::Array[Orb::Models::PriceCreateParams::conversion_rate_config] + def to_hash: -> { minimum_amount: String, prorated: bool } 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..63ccf377 100644 --- a/sig/orb/models/price_evaluate_multiple_params.rbs +++ b/sig/orb/models/price_evaluate_multiple_params.rbs @@ -86,37 +86,186 @@ 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 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 + 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..2b076380 100644 --- a/sig/orb/models/price_evaluate_preview_events_params.rbs +++ b/sig/orb/models/price_evaluate_preview_events_params.rbs @@ -132,37 +132,186 @@ 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 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 + 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..5923aa12 100644 --- a/sig/orb/models/subscription_create_params.rbs +++ b/sig/orb/models/subscription_create_params.rbs @@ -292,37 +292,349 @@ 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 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 + def self?.variants: -> ::Array[Orb::Models::SubscriptionCreateParams::AddPrice::price] end end @@ -457,37 +769,349 @@ 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 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 + 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..597a330d 100644 --- a/sig/orb/models/subscription_price_intervals_params.rbs +++ b/sig/orb/models/subscription_price_intervals_params.rbs @@ -220,67 +220,229 @@ 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 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 + 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 +456,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..f4f1ed7c 100644 --- a/sig/orb/models/subscription_schedule_plan_change_params.rbs +++ b/sig/orb/models/subscription_schedule_plan_change_params.rbs @@ -268,37 +268,349 @@ 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 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 + def self?.variants: -> ::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::price] end end @@ -434,37 +746,349 @@ 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 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 + 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/models/unit_config.rbs b/sig/orb/models/unit_config.rbs index 52367a99..e2a6e9b7 100644 --- a/sig/orb/models/unit_config.rbs +++ b/sig/orb/models/unit_config.rbs @@ -1,13 +1,15 @@ module Orb module Models - type unit_config = { unit_amount: String } + type unit_config = { unit_amount: String, scaling_factor: Float? } class UnitConfig < Orb::Internal::Type::BaseModel attr_accessor unit_amount: String - def initialize: (unit_amount: String) -> void + attr_accessor scaling_factor: Float? - def to_hash: -> { unit_amount: String } + def initialize: (unit_amount: String, ?scaling_factor: Float?) -> void + + def to_hash: -> { unit_amount: String, scaling_factor: Float? } 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/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..9db5ce33 100644 --- a/sig/orb/resources/prices.rbs +++ b/sig/orb/resources/prices.rbs @@ -10,33 +10,32 @@ 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, ?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/prices/external_price_id_test.rb b/test/orb/resources/prices/external_price_id_test.rb index 1cad4c46..2f61d44d 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,17 @@ 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 end end @@ -51,7 +49,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 +74,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 +105,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 +130,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 +158,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 +182,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 +190,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 +199,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 +221,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 +229,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 +251,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 +279,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 +310,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 +319,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 +341,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 +349,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 +368,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 +379,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 +401,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 +409,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 +439,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 +461,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 +469,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 +491,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 +499,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 +510,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 +524,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 +570,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 +589,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 +600,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 +615,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 +640,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 +662,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 +670,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 +679,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 +690,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 +709,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 +722,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 +739,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 +761,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 +769,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 +791,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 +799,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 +825,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,9 +847,10 @@ 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 } @@ -872,17 +868,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 @@ -890,16 +883,17 @@ 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 end end @@ -910,7 +904,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, @@ -933,68 +929,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, @@ -1018,42 +960,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 +985,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 +1013,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 +1037,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 +1045,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 +1054,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 +1076,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 +1084,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 +1106,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 +1134,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 +1165,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 +1174,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 +1196,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 +1204,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 +1223,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 +1234,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 +1256,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 +1264,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 +1294,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 +1316,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 +1324,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 +1346,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 +1354,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 +1365,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 +1379,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 +1425,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 +1444,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 +1455,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 +1470,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 +1495,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 +1517,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 +1525,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 +1534,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 +1545,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 +1564,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 +1577,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 +1594,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 +1616,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 +1624,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 +1646,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 +1654,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 +1680,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 +1702,10 @@ 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 } diff --git a/test/orb/resources/prices_test.rb b/test/orb/resources/prices_test.rb index d3caf913..6871b93d 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,17 @@ 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 end end @@ -59,7 +57,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 +82,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 +113,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 +138,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 +166,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 +190,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 +198,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 +207,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 +229,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 +237,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 +259,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 +287,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 +318,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 +327,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 +349,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 +357,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 +376,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 +387,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 +409,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 +417,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 +447,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 +469,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 +477,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 +499,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 +507,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 +518,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 +532,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 +578,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 +597,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 +608,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 +623,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 +648,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 +670,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 +678,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 +687,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 +698,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 +717,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 +730,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 +747,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 +769,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 +777,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 +799,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 +807,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 +833,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,9 +855,10 @@ 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 } @@ -880,17 +876,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 @@ -898,16 +891,17 @@ 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 end end @@ -918,7 +912,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, @@ -941,68 +937,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, @@ -1026,42 +968,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 +993,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 +1021,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 +1045,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 +1053,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 +1062,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 +1084,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 +1092,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 +1114,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 +1142,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 +1173,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 +1182,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 +1204,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 +1212,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 +1231,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 +1242,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 +1264,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 +1272,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 +1302,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 +1324,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 +1332,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,7 +1354,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 { @@ -1422,7 +1362,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, @@ -1431,7 +1373,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, @@ -1445,12 +1387,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, @@ -1459,7 +1433,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 +1452,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 +1463,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 +1478,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 +1503,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 +1525,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 +1533,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 +1542,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 +1553,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 +1572,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 +1585,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 +1602,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 +1624,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 +1632,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 +1654,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 +1662,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 +1688,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 +1710,10 @@ 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 } @@ -1746,17 +1738,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 +1753,17 @@ 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 end end @@ -1784,7 +1774,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, @@ -1807,68 +1799,14 @@ def test_list 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, @@ -1888,46 +1826,20 @@ def test_list plan_phase_order: Integer | nil, price_type: Orb::Price::Tiered::PriceType, replaces_price_id: String | nil, - tiered_config: Orb::TieredConfig, - 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, + tiered_config: Orb::TieredConfig, 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, @@ -1943,19 +1855,20 @@ def test_list 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, @@ -1970,20 +1883,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::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, @@ -1992,6 +1907,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]), @@ -1999,7 +1915,7 @@ def test_list 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 } @@ -2008,7 +1924,9 @@ def test_list 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, @@ -2028,7 +1946,7 @@ def test_list 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 { @@ -2036,7 +1954,9 @@ def test_list 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, @@ -2056,24 +1976,25 @@ def test_list 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, @@ -2083,24 +2004,28 @@ def test_list 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, @@ -2110,9 +2035,8 @@ def test_list 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 { @@ -2120,7 +2044,9 @@ def test_list 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, @@ -2140,7 +2066,7 @@ def test_list 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 { @@ -2148,7 +2074,9 @@ def test_list 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, @@ -2165,7 +2093,7 @@ 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]), + package_with_allocation_config: Orb::Price::PackageWithAllocation::PackageWithAllocationConfig, plan_phase_order: Integer | nil, price_type: Orb::Price::PackageWithAllocation::PriceType, replaces_price_id: String | nil, @@ -2176,7 +2104,9 @@ def test_list 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, @@ -2196,7 +2126,7 @@ def test_list 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 { @@ -2204,7 +2134,9 @@ def test_list 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, @@ -2232,7 +2164,9 @@ def test_list 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, @@ -2252,7 +2186,7 @@ def test_list 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 { @@ -2260,7 +2194,9 @@ def test_list 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, @@ -2280,7 +2216,7 @@ def test_list 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 { @@ -2288,7 +2224,9 @@ def test_list 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, @@ -2297,7 +2235,7 @@ def test_list 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, @@ -2311,12 +2249,44 @@ def test_list 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, @@ -2325,7 +2295,7 @@ def test_list 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, @@ -2344,7 +2314,9 @@ def test_list 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, @@ -2353,7 +2325,7 @@ def test_list 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, @@ -2368,22 +2340,24 @@ def test_list 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]), @@ -2391,19 +2365,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::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, @@ -2412,6 +2387,7 @@ def test_list 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]), @@ -2419,7 +2395,7 @@ def test_list 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 } @@ -2428,7 +2404,9 @@ def test_list 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, @@ -2437,7 +2415,7 @@ def test_list 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, @@ -2456,7 +2434,9 @@ def test_list 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, @@ -2467,7 +2447,7 @@ 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]), + max_group_tiered_package_config: Orb::Price::MaxGroupTieredPackage::MaxGroupTieredPackageConfig, maximum: Orb::Maximum | nil, maximum_amount: String | nil, metadata: ^(Orb::Internal::Type::HashOf[String]), @@ -2484,7 +2464,9 @@ def test_list 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, @@ -2504,7 +2486,7 @@ def test_list 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 { @@ -2512,7 +2494,9 @@ def test_list 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, @@ -2532,7 +2516,7 @@ def test_list 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 { @@ -2540,12 +2524,14 @@ def test_list 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, @@ -2564,20 +2550,21 @@ def test_list 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, @@ -2585,9 +2572,10 @@ 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::GroupedWithMinMaxThresholds::PriceType, + price_type: Orb::Price::Minimum::PriceType, replaces_price_id: String | nil, dimensional_price_configuration: Orb::DimensionalPriceConfiguration | nil } @@ -2660,17 +2648,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 +2663,17 @@ 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 end end @@ -2698,7 +2684,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 +2709,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 +2740,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 +2765,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 +2793,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 +2817,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 +2825,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 +2834,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 +2856,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 +2864,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 +2886,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 +2914,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 +2945,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 +2954,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 +2976,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 +2984,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 +3003,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 +3014,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 +3036,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 +3044,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 +3074,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 +3096,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 +3104,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 +3126,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 +3134,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 +3145,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 +3159,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 +3205,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 +3224,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 +3235,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 +3250,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 +3275,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 +3297,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 +3305,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 +3314,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 +3325,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 +3344,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 +3357,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 +3374,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 +3396,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 +3404,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 +3426,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 +3434,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 +3460,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 +3482,10 @@ 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 }