Class: Pago::V2026_04::Models::BenefitDiscordUpdate
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Constant Summary collapse
- JSON_KEYS =
{ metadata: "metadata", description: "description", type: "type", properties: "properties" }.freeze
- REQUIRED_KEYS =
["type"].freeze
Instance Attribute Summary collapse
-
#description ⇒ String?
readonly
The description of the benefit.
-
#metadata ⇒ Hash{String => String, Integer, Float, Boolean}
readonly
Key-value object allowing you to store additional information.
- #properties ⇒ Models::BenefitDiscordCreateProperties? readonly
- #type ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(metadata: ::Pago::UNSET, description: ::Pago::UNSET, type:, properties: ::Pago::UNSET) ⇒ BenefitDiscordUpdate
constructor
A new instance of BenefitDiscordUpdate.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(metadata: ::Pago::UNSET, description: ::Pago::UNSET, type:, properties: ::Pago::UNSET) ⇒ BenefitDiscordUpdate
Returns a new instance of BenefitDiscordUpdate.
3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 |
# File 'lib/pago/v2026_04/models.rb', line 3093 def initialize( metadata: ::Pago::UNSET, description: ::Pago::UNSET, type:, properties: ::Pago::UNSET ) super() assign(:metadata, ) assign(:description, description) assign(:type, type) assign(:properties, properties) end |
Instance Attribute Details
#description ⇒ String? (readonly)
The description of the benefit. Will be displayed on products having this benefit.
3085 3086 3087 |
# File 'lib/pago/v2026_04/models.rb', line 3085 def description @description end |
#metadata ⇒ Hash{String => String, Integer, Float, Boolean} (readonly)
Key-value object allowing you to store additional information.
The key must be a string with a maximum length of 40 characters. The value must be either:
- A string with a maximum length of 500 characters
- An integer
- A floating-point number
- A boolean
You can store up to 50 key-value pairs.
3081 3082 3083 |
# File 'lib/pago/v2026_04/models.rb', line 3081 def @metadata end |
#properties ⇒ Models::BenefitDiscordCreateProperties? (readonly)
3091 3092 3093 |
# File 'lib/pago/v2026_04/models.rb', line 3091 def properties @properties end |
#type ⇒ String (readonly)
3088 3089 3090 |
# File 'lib/pago/v2026_04/models.rb', line 3088 def type @type end |
Class Method Details
.from_json(data) ⇒ BenefitDiscordUpdate?
3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 |
# File 'lib/pago/v2026_04/models.rb', line 3108 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( metadata: (data.key?("metadata") ? data["metadata"] : ::Pago::UNSET), description: (data.key?("description") ? data["description"] : ::Pago::UNSET), type: (data.key?("type") ? data["type"] : ::Pago::UNSET), properties: (data.key?("properties") ? Models::BenefitDiscordCreateProperties.from_json(data["properties"]) : ::Pago::UNSET) ), data ) end |