Class: Pago::V2026_04::Models::ProductBenefitsUpdate
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Schema to update the benefits granted by a product.
Constant Summary collapse
- JSON_KEYS =
{ benefits: "benefits" }.freeze
- REQUIRED_KEYS =
["benefits"].freeze
Instance Attribute Summary collapse
-
#benefits ⇒ Array<String>
readonly
List of benefit IDs.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(benefits:) ⇒ ProductBenefitsUpdate
constructor
A new instance of ProductBenefitsUpdate.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(benefits:) ⇒ ProductBenefitsUpdate
Returns a new instance of ProductBenefitsUpdate.
36188 36189 36190 36191 36192 36193 |
# File 'lib/pago/v2026_04/models.rb', line 36188 def initialize( benefits: ) super() assign(:benefits, benefits) end |
Instance Attribute Details
#benefits ⇒ Array<String> (readonly)
List of benefit IDs. Each one must be on the same organization as the product.
36186 36187 36188 |
# File 'lib/pago/v2026_04/models.rb', line 36186 def benefits @benefits end |
Class Method Details
.from_json(data) ⇒ ProductBenefitsUpdate?
36197 36198 36199 36200 36201 36202 36203 36204 36205 36206 36207 36208 |
# File 'lib/pago/v2026_04/models.rb', line 36197 def self.from_json(data) data = ::JSON.parse(data) if data.is_a?(String) data = ::Pago::Serde.object(data) return nil if data.nil? wrap_raw( new( benefits: (data.key?("benefits") ? data["benefits"] : ::Pago::UNSET) ), data ) end |