Class: ApiReference::GroupedWithMinMaxThresholdsConfig1
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ApiReference::GroupedWithMinMaxThresholdsConfig1
- Defined in:
- lib/api_reference/models/grouped_with_min_max_thresholds_config1.rb
Overview
Configuration for grouped_with_min_max_thresholds pricing
Instance Attribute Summary collapse
-
#grouping_key ⇒ String
The event property used to group before applying thresholds.
-
#maximum_charge ⇒ String
The maximum amount to charge each group.
-
#minimum_charge ⇒ String
The minimum amount to charge each group, regardless of usage.
-
#per_unit_rate ⇒ String
The base price charged per group.
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(grouping_key:, per_unit_rate:, minimum_charge:, maximum_charge:) ⇒ GroupedWithMinMaxThresholdsConfig1
constructor
A new instance of GroupedWithMinMaxThresholdsConfig1.
-
#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(grouping_key:, per_unit_rate:, minimum_charge:, maximum_charge:) ⇒ GroupedWithMinMaxThresholdsConfig1
Returns a new instance of GroupedWithMinMaxThresholdsConfig1.
48 49 50 51 52 53 54 |
# File 'lib/api_reference/models/grouped_with_min_max_thresholds_config1.rb', line 48 def initialize(grouping_key:, per_unit_rate:, minimum_charge:, maximum_charge:) @grouping_key = grouping_key @per_unit_rate = per_unit_rate @minimum_charge = minimum_charge @maximum_charge = maximum_charge end |
Instance Attribute Details
#grouping_key ⇒ String
The event property used to group before applying thresholds
14 15 16 |
# File 'lib/api_reference/models/grouped_with_min_max_thresholds_config1.rb', line 14 def grouping_key @grouping_key end |
#maximum_charge ⇒ String
The maximum amount to charge each group
26 27 28 |
# File 'lib/api_reference/models/grouped_with_min_max_thresholds_config1.rb', line 26 def maximum_charge @maximum_charge end |
#minimum_charge ⇒ String
The minimum amount to charge each group, regardless of usage
22 23 24 |
# File 'lib/api_reference/models/grouped_with_min_max_thresholds_config1.rb', line 22 def minimum_charge @minimum_charge end |
#per_unit_rate ⇒ String
The base price charged per group
18 19 20 |
# File 'lib/api_reference/models/grouped_with_min_max_thresholds_config1.rb', line 18 def per_unit_rate @per_unit_rate end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/api_reference/models/grouped_with_min_max_thresholds_config1.rb', line 57 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. grouping_key = hash.key?('grouping_key') ? hash['grouping_key'] : nil per_unit_rate = hash.key?('per_unit_rate') ? hash['per_unit_rate'] : nil minimum_charge = hash.key?('minimum_charge') ? hash['minimum_charge'] : nil maximum_charge = hash.key?('maximum_charge') ? hash['maximum_charge'] : nil # Create object from extracted values. GroupedWithMinMaxThresholdsConfig1.new(grouping_key: grouping_key, per_unit_rate: per_unit_rate, minimum_charge: minimum_charge, maximum_charge: maximum_charge) 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/grouped_with_min_max_thresholds_config1.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['grouping_key'] = 'grouping_key' @_hash['per_unit_rate'] = 'per_unit_rate' @_hash['minimum_charge'] = 'minimum_charge' @_hash['maximum_charge'] = 'maximum_charge' @_hash end |
.nullables ⇒ Object
An array for nullable fields
44 45 46 |
# File 'lib/api_reference/models/grouped_with_min_max_thresholds_config1.rb', line 44 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 |
# File 'lib/api_reference/models/grouped_with_min_max_thresholds_config1.rb', line 39 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/api_reference/models/grouped_with_min_max_thresholds_config1.rb', line 77 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.grouping_key, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.per_unit_rate, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.minimum_charge, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.maximum_charge, ->(val) { val.instance_of? String }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['grouping_key'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['per_unit_rate'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['minimum_charge'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['maximum_charge'], ->(val) { val.instance_of? String }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
113 114 115 116 117 118 |
# File 'lib/api_reference/models/grouped_with_min_max_thresholds_config1.rb', line 113 def inspect class_name = self.class.name.split('::').last "<#{class_name} grouping_key: #{@grouping_key.inspect}, per_unit_rate:"\ " #{@per_unit_rate.inspect}, minimum_charge: #{@minimum_charge.inspect}, maximum_charge:"\ " #{@maximum_charge.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
106 107 108 109 110 |
# File 'lib/api_reference/models/grouped_with_min_max_thresholds_config1.rb', line 106 def to_s class_name = self.class.name.split('::').last "<#{class_name} grouping_key: #{@grouping_key}, per_unit_rate: #{@per_unit_rate},"\ " minimum_charge: #{@minimum_charge}, maximum_charge: #{@maximum_charge}>" end |