Class: Pago::V2026_04::Models::BenefitLicenseKeysCreateProperties

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])
[].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: ::Pago::UNSET, expires: ::Pago::UNSET, activations: ::Pago::UNSET, limit_usage: ::Pago::UNSET) ⇒ BenefitLicenseKeysCreateProperties

Returns a new instance of BenefitLicenseKeysCreateProperties.

Parameters:



6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
# File 'lib/pago/v2026_04/models.rb', line 6988

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

Instance Attribute Details

#activationsModels::BenefitLicenseKeyActivationCreateProperties? (readonly)



6983
6984
6985
# File 'lib/pago/v2026_04/models.rb', line 6983

def activations
  @activations
end

#expiresModels::BenefitLicenseKeyExpirationProperties? (readonly)



6980
6981
6982
# File 'lib/pago/v2026_04/models.rb', line 6980

def expires
  @expires
end

#limit_usageInteger? (readonly)

Returns:

  • (Integer, nil)


6986
6987
6988
# File 'lib/pago/v2026_04/models.rb', line 6986

def limit_usage
  @limit_usage
end

#prefixString? (readonly)

Returns:

  • (String, nil)


6977
6978
6979
# File 'lib/pago/v2026_04/models.rb', line 6977

def prefix
  @prefix
end

Class Method Details

.from_json(data) ⇒ BenefitLicenseKeysCreateProperties?

Parameters:

  • data (Hash, String, nil)

Returns:



7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
# File 'lib/pago/v2026_04/models.rb', line 7003

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