Class: Pago::V2026_04::Models::BenefitLicenseKeysProperties

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:) ⇒ BenefitLicenseKeysProperties

Returns a new instance of BenefitLicenseKeysProperties.

Parameters:



7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
# File 'lib/pago/v2026_04/models.rb', line 7041

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)



7036
7037
7038
# File 'lib/pago/v2026_04/models.rb', line 7036

def activations
  @activations
end

#expiresModels::BenefitLicenseKeyExpirationProperties? (readonly)



7033
7034
7035
# File 'lib/pago/v2026_04/models.rb', line 7033

def expires
  @expires
end

#limit_usageInteger? (readonly)

Returns:

  • (Integer, nil)


7039
7040
7041
# File 'lib/pago/v2026_04/models.rb', line 7039

def limit_usage
  @limit_usage
end

#prefixString? (readonly)

Returns:

  • (String, nil)


7030
7031
7032
# File 'lib/pago/v2026_04/models.rb', line 7030

def prefix
  @prefix
end

Class Method Details

.from_json(data) ⇒ BenefitLicenseKeysProperties?

Parameters:

  • data (Hash, String, nil)

Returns:



7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
# File 'lib/pago/v2026_04/models.rb', line 7056

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