Class: ApiReference::ScalableMatrixWithTieredPricingConfig
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ApiReference::ScalableMatrixWithTieredPricingConfig
- Defined in:
- lib/api_reference/models/scalable_matrix_with_tiered_pricing_config.rb
Overview
Configuration for scalable matrix with tiered pricing
Instance Attribute Summary collapse
-
#first_dimension ⇒ String
Used for the scalable matrix first dimension.
-
#matrix_scaling_factors ⇒ Array[ScalableMatrixWithTieredScalingFactor]
Apply a scaling factor to each dimension.
-
#second_dimension ⇒ String
Used for the scalable matrix second dimension (optional).
-
#tiers ⇒ Array[ScalableMatrixWithTieredTierEntry]
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(tiers:, first_dimension:, matrix_scaling_factors:, second_dimension: SKIP) ⇒ ScalableMatrixWithTieredPricingConfig
constructor
A new instance of ScalableMatrixWithTieredPricingConfig.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(tiers:, first_dimension:, matrix_scaling_factors:, second_dimension: SKIP) ⇒ ScalableMatrixWithTieredPricingConfig
Returns a new instance of ScalableMatrixWithTieredPricingConfig.
52 53 54 55 56 57 58 |
# File 'lib/api_reference/models/scalable_matrix_with_tiered_pricing_config.rb', line 52 def initialize(tiers:, first_dimension:, matrix_scaling_factors:, second_dimension: SKIP) @tiers = tiers @first_dimension = first_dimension @second_dimension = second_dimension unless second_dimension == SKIP @matrix_scaling_factors = matrix_scaling_factors end |
Instance Attribute Details
#first_dimension ⇒ String
Used for the scalable matrix first dimension
18 19 20 |
# File 'lib/api_reference/models/scalable_matrix_with_tiered_pricing_config.rb', line 18 def first_dimension @first_dimension end |
#matrix_scaling_factors ⇒ Array[ScalableMatrixWithTieredScalingFactor]
Apply a scaling factor to each dimension
26 27 28 |
# File 'lib/api_reference/models/scalable_matrix_with_tiered_pricing_config.rb', line 26 def matrix_scaling_factors @matrix_scaling_factors end |
#second_dimension ⇒ String
Used for the scalable matrix second dimension (optional)
22 23 24 |
# File 'lib/api_reference/models/scalable_matrix_with_tiered_pricing_config.rb', line 22 def second_dimension @second_dimension end |
#tiers ⇒ Array[ScalableMatrixWithTieredTierEntry]
TODO: Write general description for this method
14 15 16 |
# File 'lib/api_reference/models/scalable_matrix_with_tiered_pricing_config.rb', line 14 def tiers @tiers end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/api_reference/models/scalable_matrix_with_tiered_pricing_config.rb', line 61 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it tiers = nil unless hash['tiers'].nil? tiers = [] hash['tiers'].each do |structure| tiers << (ScalableMatrixWithTieredTierEntry.from_hash(structure) if structure) end end tiers = nil unless hash.key?('tiers') first_dimension = hash.key?('first_dimension') ? hash['first_dimension'] : nil # Parameter is an array, so we need to iterate through it matrix_scaling_factors = nil unless hash['matrix_scaling_factors'].nil? matrix_scaling_factors = [] hash['matrix_scaling_factors'].each do |structure| matrix_scaling_factors << (ScalableMatrixWithTieredScalingFactor.from_hash(structure) if structure) end end matrix_scaling_factors = nil unless hash.key?('matrix_scaling_factors') second_dimension = hash.key?('second_dimension') ? hash['second_dimension'] : SKIP # Create object from extracted values. ScalableMatrixWithTieredPricingConfig.new(tiers: tiers, first_dimension: first_dimension, matrix_scaling_factors: matrix_scaling_factors, second_dimension: second_dimension) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/api_reference/models/scalable_matrix_with_tiered_pricing_config.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['tiers'] = 'tiers' @_hash['first_dimension'] = 'first_dimension' @_hash['second_dimension'] = 'second_dimension' @_hash['matrix_scaling_factors'] = 'matrix_scaling_factors' @_hash end |
.nullables ⇒ Object
An array for nullable fields
46 47 48 49 50 |
# File 'lib/api_reference/models/scalable_matrix_with_tiered_pricing_config.rb', line 46 def self.nullables %w[ second_dimension ] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 |
# File 'lib/api_reference/models/scalable_matrix_with_tiered_pricing_config.rb', line 39 def self.optionals %w[ second_dimension ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
105 106 107 108 109 110 |
# File 'lib/api_reference/models/scalable_matrix_with_tiered_pricing_config.rb', line 105 def inspect class_name = self.class.name.split('::').last "<#{class_name} tiers: #{@tiers.inspect}, first_dimension: #{@first_dimension.inspect},"\ " second_dimension: #{@second_dimension.inspect}, matrix_scaling_factors:"\ " #{@matrix_scaling_factors.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
98 99 100 101 102 |
# File 'lib/api_reference/models/scalable_matrix_with_tiered_pricing_config.rb', line 98 def to_s class_name = self.class.name.split('::').last "<#{class_name} tiers: #{@tiers}, first_dimension: #{@first_dimension}, second_dimension:"\ " #{@second_dimension}, matrix_scaling_factors: #{@matrix_scaling_factors}>" end |