Class: ApiReference::MinimumCompositeConfig1
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ApiReference::MinimumCompositeConfig1
- Defined in:
- lib/api_reference/models/minimum_composite_config1.rb
Overview
Configuration for minimum_composite pricing
Instance Attribute Summary collapse
-
#minimum_amount ⇒ String
The minimum amount to apply.
-
#prorated ⇒ TrueClass | FalseClass
If true, subtotals from this price are prorated based on the service period.
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(minimum_amount:, prorated: SKIP) ⇒ MinimumCompositeConfig1
constructor
A new instance of MinimumCompositeConfig1.
-
#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(minimum_amount:, prorated: SKIP) ⇒ MinimumCompositeConfig1
Returns a new instance of MinimumCompositeConfig1.
41 42 43 44 |
# File 'lib/api_reference/models/minimum_composite_config1.rb', line 41 def initialize(minimum_amount:, prorated: SKIP) @minimum_amount = minimum_amount @prorated = prorated unless prorated == SKIP end |
Instance Attribute Details
#minimum_amount ⇒ String
The minimum amount to apply
14 15 16 |
# File 'lib/api_reference/models/minimum_composite_config1.rb', line 14 def minimum_amount @minimum_amount end |
#prorated ⇒ TrueClass | FalseClass
If true, subtotals from this price are prorated based on the service period
19 20 21 |
# File 'lib/api_reference/models/minimum_composite_config1.rb', line 19 def prorated @prorated end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/api_reference/models/minimum_composite_config1.rb', line 47 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. minimum_amount = hash.key?('minimum_amount') ? hash['minimum_amount'] : nil prorated = hash.key?('prorated') ? hash['prorated'] : SKIP # Create object from extracted values. MinimumCompositeConfig1.new(minimum_amount: minimum_amount, prorated: prorated) end |
.names ⇒ Object
A mapping from model property names to API property names.
22 23 24 25 26 27 |
# File 'lib/api_reference/models/minimum_composite_config1.rb', line 22 def self.names @_hash = {} if @_hash.nil? @_hash['minimum_amount'] = 'minimum_amount' @_hash['prorated'] = 'prorated' @_hash end |
.nullables ⇒ Object
An array for nullable fields
37 38 39 |
# File 'lib/api_reference/models/minimum_composite_config1.rb', line 37 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
30 31 32 33 34 |
# File 'lib/api_reference/models/minimum_composite_config1.rb', line 30 def self.optionals %w[ prorated ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/api_reference/models/minimum_composite_config1.rb', line 62 def self.validate(value) if value.instance_of? self return APIHelper.valid_type?(value.minimum_amount, ->(val) { val.instance_of? String }) end return false unless value.instance_of? Hash APIHelper.valid_type?(value['minimum_amount'], ->(val) { val.instance_of? String }) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
81 82 83 84 85 |
# File 'lib/api_reference/models/minimum_composite_config1.rb', line 81 def inspect class_name = self.class.name.split('::').last "<#{class_name} minimum_amount: #{@minimum_amount.inspect}, prorated:"\ " #{@prorated.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
75 76 77 78 |
# File 'lib/api_reference/models/minimum_composite_config1.rb', line 75 def to_s class_name = self.class.name.split('::').last "<#{class_name} minimum_amount: #{@minimum_amount}, prorated: #{@prorated}>" end |