Class: Pago::V2026_04::Models::LicenseKeyActivate

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])
{
  key: "key",
  organization_id: "organization_id",
  label: "label",
  conditions: "conditions",
  meta: "meta"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["key", "organization_id", "label"].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(key:, organization_id:, label:, conditions: ::Pago::UNSET, meta: ::Pago::UNSET) ⇒ LicenseKeyActivate

Returns a new instance of LicenseKeyActivate.

Parameters:

  • key: (String)
  • organization_id: (String)
  • label: (String)
  • conditions: (Hash[String, untyped], nil) (defaults to: ::Pago::UNSET)
  • meta: (Hash[String, untyped], nil) (defaults to: ::Pago::UNSET)


26584
26585
26586
26587
26588
26589
26590
26591
26592
26593
26594
26595
26596
26597
# File 'lib/pago/v2026_04/models.rb', line 26584

def initialize(
  key:,
  organization_id:,
  label:,
  conditions: ::Pago::UNSET,
  meta: ::Pago::UNSET
)
  super()
  assign(:key, key)
  assign(:organization_id, organization_id)
  assign(:label, label)
  assign(:conditions, conditions)
  assign(:meta, meta)
end

Instance Attribute Details

#conditionsHash{String => String, Integer, Float, Boolean} (readonly)

Key-value object allowing you to set conditions that must match when validating the license key.

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.

Returns:

  • (Hash{String => String, Integer, Float, Boolean})


26568
26569
26570
# File 'lib/pago/v2026_04/models.rb', line 26568

def conditions
  @conditions
end

#keyString (readonly)

Returns:

  • (String)


26548
26549
26550
# File 'lib/pago/v2026_04/models.rb', line 26548

def key
  @key
end

#labelString (readonly)

Returns:

  • (String)


26554
26555
26556
# File 'lib/pago/v2026_04/models.rb', line 26554

def label
  @label
end

#metaHash{String => String, Integer, Float, Boolean} (readonly)

Key-value object allowing you to store additional information about the activation

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.

Returns:

  • (Hash{String => String, Integer, Float, Boolean})


26582
26583
26584
# File 'lib/pago/v2026_04/models.rb', line 26582

def meta
  @meta
end

#organization_idString (readonly)

Returns:

  • (String)


26551
26552
26553
# File 'lib/pago/v2026_04/models.rb', line 26551

def organization_id
  @organization_id
end

Class Method Details

.from_json(data) ⇒ LicenseKeyActivate?

Parameters:

  • data (Hash, String, nil)

Returns:



26601
26602
26603
26604
26605
26606
26607
26608
26609
26610
26611
26612
26613
26614
26615
26616
# File 'lib/pago/v2026_04/models.rb', line 26601

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(
      key: (data.key?("key") ? data["key"] : ::Pago::UNSET),
      organization_id: (data.key?("organization_id") ? data["organization_id"] : ::Pago::UNSET),
      label: (data.key?("label") ? data["label"] : ::Pago::UNSET),
      conditions: (data.key?("conditions") ? data["conditions"] : ::Pago::UNSET),
      meta: (data.key?("meta") ? data["meta"] : ::Pago::UNSET)
    ),
    data
  )
end