Class: Pago::V2026_04::Models::BenefitLicenseKeysSubscriberProperties

Inherits:
Model
  • Object
show all
Defined in:
lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  prefix: "prefix",
  expires: "expires",
  activations: "activations",
  limit_usage: "limit_usage"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["prefix", "expires", "activations", "limit_usage"].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw

Constructor Details

#initialize(prefix:, expires:, activations:, limit_usage:) ⇒ BenefitLicenseKeysSubscriberProperties

Returns a new instance of BenefitLicenseKeysSubscriberProperties.

Parameters:



7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
# File 'lib/pago/v2026_04/models.rb', line 7204

def initialize(
  prefix:,
  expires:,
  activations:,
  limit_usage:
)
  super()
  assign(:prefix, prefix)
  assign(:expires, expires)
  assign(:activations, activations)
  assign(:limit_usage, limit_usage)
end

Instance Attribute Details

#activationsModels::BenefitLicenseKeyActivationProperties? (readonly)



7199
7200
7201
# File 'lib/pago/v2026_04/models.rb', line 7199

def activations
  @activations
end

#expiresModels::BenefitLicenseKeyExpirationProperties? (readonly)



7196
7197
7198
# File 'lib/pago/v2026_04/models.rb', line 7196

def expires
  @expires
end

#limit_usageInteger? (readonly)

Returns:

  • (Integer, nil)


7202
7203
7204
# File 'lib/pago/v2026_04/models.rb', line 7202

def limit_usage
  @limit_usage
end

#prefixString? (readonly)

Returns:

  • (String, nil)


7193
7194
7195
# File 'lib/pago/v2026_04/models.rb', line 7193

def prefix
  @prefix
end

Class Method Details

.from_json(data) ⇒ BenefitLicenseKeysSubscriberProperties?

Parameters:

  • data (Hash, String, nil)

Returns:



7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
# File 'lib/pago/v2026_04/models.rb', line 7219

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(
      prefix: (data.key?("prefix") ? data["prefix"] : ::Pago::UNSET),
      expires: (data.key?("expires") ? Models::BenefitLicenseKeyExpirationProperties.from_json(data["expires"]) : ::Pago::UNSET),
      activations: (data.key?("activations") ? Models::BenefitLicenseKeyActivationProperties.from_json(data["activations"]) : ::Pago::UNSET),
      limit_usage: (data.key?("limit_usage") ? data["limit_usage"] : ::Pago::UNSET)
    ),
    data
  )
end