Class: ApiReference::DimensionalPriceConfiguration
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ApiReference::DimensionalPriceConfiguration
- Defined in:
- lib/api_reference/models/dimensional_price_configuration.rb
Overview
DimensionalPriceConfiguration Model.
Instance Attribute Summary collapse
-
#dimension_values ⇒ Array[String]
TODO: Write general description for this method.
-
#dimensional_price_group_id ⇒ String
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(dimensional_price_group_id:, dimension_values:, additional_properties: nil) ⇒ DimensionalPriceConfiguration
constructor
A new instance of DimensionalPriceConfiguration.
-
#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(dimensional_price_group_id:, dimension_values:, additional_properties: nil) ⇒ DimensionalPriceConfiguration
Returns a new instance of DimensionalPriceConfiguration.
38 39 40 41 42 43 44 45 46 |
# File 'lib/api_reference/models/dimensional_price_configuration.rb', line 38 def initialize(dimensional_price_group_id:, dimension_values:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @dimensional_price_group_id = dimensional_price_group_id @dimension_values = dimension_values @additional_properties = additional_properties end |
Instance Attribute Details
#dimension_values ⇒ Array[String]
TODO: Write general description for this method
18 19 20 |
# File 'lib/api_reference/models/dimensional_price_configuration.rb', line 18 def dimension_values @dimension_values end |
#dimensional_price_group_id ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/api_reference/models/dimensional_price_configuration.rb', line 14 def dimensional_price_group_id @dimensional_price_group_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/api_reference/models/dimensional_price_configuration.rb', line 49 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. dimensional_price_group_id = hash.key?('dimensional_price_group_id') ? hash['dimensional_price_group_id'] : nil dimension_values = hash.key?('dimension_values') ? hash['dimension_values'] : nil # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. DimensionalPriceConfiguration.new(dimensional_price_group_id: dimensional_price_group_id, dimension_values: dimension_values, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
21 22 23 24 25 26 |
# File 'lib/api_reference/models/dimensional_price_configuration.rb', line 21 def self.names @_hash = {} if @_hash.nil? @_hash['dimensional_price_group_id'] = 'dimensional_price_group_id' @_hash['dimension_values'] = 'dimension_values' @_hash end |
.nullables ⇒ Object
An array for nullable fields
34 35 36 |
# File 'lib/api_reference/models/dimensional_price_configuration.rb', line 34 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
29 30 31 |
# File 'lib/api_reference/models/dimensional_price_configuration.rb', line 29 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/api_reference/models/dimensional_price_configuration.rb', line 73 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.dimensional_price_group_id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.dimension_values, ->(val) { val.instance_of? String }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['dimensional_price_group_id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['dimension_values'], ->(val) { val.instance_of? String }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
101 102 103 104 105 106 |
# File 'lib/api_reference/models/dimensional_price_configuration.rb', line 101 def inspect class_name = self.class.name.split('::').last "<#{class_name} dimensional_price_group_id: #{@dimensional_price_group_id.inspect},"\ " dimension_values: #{@dimension_values.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
94 95 96 97 98 |
# File 'lib/api_reference/models/dimensional_price_configuration.rb', line 94 def to_s class_name = self.class.name.split('::').last "<#{class_name} dimensional_price_group_id: #{@dimensional_price_group_id},"\ " dimension_values: #{@dimension_values}, additional_properties: #{@additional_properties}>" end |