Class: Pago::V2026_04::Models::LicenseKeyRead

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])
{
  id: "id",
  created_at: "created_at",
  modified_at: "modified_at",
  organization_id: "organization_id",
  customer_id: "customer_id",
  customer: "customer",
  benefit_id: "benefit_id",
  key: "key",
  display_key: "display_key",
  status: "status",
  limit_activations: "limit_activations",
  usage: "usage",
  limit_usage: "limit_usage",
  validations: "validations",
  last_validated_at: "last_validated_at",
  expires_at: "expires_at"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["id", "created_at", "modified_at", "organization_id", "customer_id", "customer", "benefit_id", "key", "display_key", "status", "limit_activations", "usage", "limit_usage", "validations", "last_validated_at", "expires_at"].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(id:, created_at:, modified_at:, organization_id:, customer_id:, customer:, benefit_id:, key:, display_key:, status:, limit_activations:, usage:, limit_usage:, validations:, last_validated_at:, expires_at:) ⇒ LicenseKeyRead

Returns a new instance of LicenseKeyRead.

Parameters:

  • id: (String)
  • created_at: (String)
  • modified_at: (String, nil)
  • organization_id: (String)
  • customer_id: (String)
  • customer: (Models::LicenseKeyCustomer)
  • benefit_id: (String)
  • key: (String)
  • display_key: (String)
  • status: (String)
  • limit_activations: (Integer, nil)
  • usage: (Integer)
  • limit_usage: (Integer, nil)
  • validations: (Integer)
  • last_validated_at: (String, nil)
  • expires_at: (String, nil)


27034
27035
27036
27037
27038
27039
27040
27041
27042
27043
27044
27045
27046
27047
27048
27049
27050
27051
27052
27053
27054
27055
27056
27057
27058
27059
27060
27061
27062
27063
27064
27065
27066
27067
27068
27069
# File 'lib/pago/v2026_04/models.rb', line 27034

def initialize(
  id:,
  created_at:,
  modified_at:,
  organization_id:,
  customer_id:,
  customer:,
  benefit_id:,
  key:,
  display_key:,
  status:,
  limit_activations:,
  usage:,
  limit_usage:,
  validations:,
  last_validated_at:,
  expires_at:
)
  super()
  assign(:id, id)
  assign(:created_at, created_at)
  assign(:modified_at, modified_at)
  assign(:organization_id, organization_id)
  assign(:customer_id, customer_id)
  assign(:customer, customer)
  assign(:benefit_id, benefit_id)
  assign(:key, key)
  assign(:display_key, display_key)
  assign(:status, status)
  assign(:limit_activations, limit_activations)
  assign(:usage, usage)
  assign(:limit_usage, limit_usage)
  assign(:validations, validations)
  assign(:last_validated_at, last_validated_at)
  assign(:expires_at, expires_at)
end

Instance Attribute Details

#benefit_idString (readonly)

The benefit ID.

Returns:

  • (String)


27005
27006
27007
# File 'lib/pago/v2026_04/models.rb', line 27005

def benefit_id
  @benefit_id
end

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


26988
26989
26990
# File 'lib/pago/v2026_04/models.rb', line 26988

def created_at
  @created_at
end

#customerModels::LicenseKeyCustomer (readonly)



27001
27002
27003
# File 'lib/pago/v2026_04/models.rb', line 27001

def customer
  @customer
end

#customer_idString (readonly)

Returns:

  • (String)


26998
26999
27000
# File 'lib/pago/v2026_04/models.rb', line 26998

def customer_id
  @customer_id
end

#display_keyString (readonly)

Returns:

  • (String)


27011
27012
27013
# File 'lib/pago/v2026_04/models.rb', line 27011

def display_key
  @display_key
end

#expires_atString? (readonly)

Returns:

  • (String, nil)


27032
27033
27034
# File 'lib/pago/v2026_04/models.rb', line 27032

def expires_at
  @expires_at
end

#idString (readonly)

The ID of the object.

Returns:

  • (String)


26984
26985
26986
# File 'lib/pago/v2026_04/models.rb', line 26984

def id
  @id
end

#keyString (readonly)

Returns:

  • (String)


27008
27009
27010
# File 'lib/pago/v2026_04/models.rb', line 27008

def key
  @key
end

#last_validated_atString? (readonly)

Returns:

  • (String, nil)


27029
27030
27031
# File 'lib/pago/v2026_04/models.rb', line 27029

def last_validated_at
  @last_validated_at
end

#limit_activationsInteger? (readonly)

Returns:

  • (Integer, nil)


27017
27018
27019
# File 'lib/pago/v2026_04/models.rb', line 27017

def limit_activations
  @limit_activations
end

#limit_usageInteger? (readonly)

Returns:

  • (Integer, nil)


27023
27024
27025
# File 'lib/pago/v2026_04/models.rb', line 27023

def limit_usage
  @limit_usage
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


26992
26993
26994
# File 'lib/pago/v2026_04/models.rb', line 26992

def modified_at
  @modified_at
end

#organization_idString (readonly)

Returns:

  • (String)


26995
26996
26997
# File 'lib/pago/v2026_04/models.rb', line 26995

def organization_id
  @organization_id
end

#statusString (readonly)

Returns:

  • (String)


27014
27015
27016
# File 'lib/pago/v2026_04/models.rb', line 27014

def status
  @status
end

#usageInteger (readonly)

Returns:

  • (Integer)


27020
27021
27022
# File 'lib/pago/v2026_04/models.rb', line 27020

def usage
  @usage
end

#validationsInteger (readonly)

Returns:

  • (Integer)


27026
27027
27028
# File 'lib/pago/v2026_04/models.rb', line 27026

def validations
  @validations
end

Class Method Details

.from_json(data) ⇒ LicenseKeyRead?

Parameters:

  • data (Hash, String, nil)

Returns:



27073
27074
27075
27076
27077
27078
27079
27080
27081
27082
27083
27084
27085
27086
27087
27088
27089
27090
27091
27092
27093
27094
27095
27096
27097
27098
27099
# File 'lib/pago/v2026_04/models.rb', line 27073

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(
      id: (data.key?("id") ? data["id"] : ::Pago::UNSET),
      created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET),
      modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET),
      organization_id: (data.key?("organization_id") ? data["organization_id"] : ::Pago::UNSET),
      customer_id: (data.key?("customer_id") ? data["customer_id"] : ::Pago::UNSET),
      customer: (data.key?("customer") ? Models::LicenseKeyCustomer.from_json(data["customer"]) : ::Pago::UNSET),
      benefit_id: (data.key?("benefit_id") ? data["benefit_id"] : ::Pago::UNSET),
      key: (data.key?("key") ? data["key"] : ::Pago::UNSET),
      display_key: (data.key?("display_key") ? data["display_key"] : ::Pago::UNSET),
      status: (data.key?("status") ? data["status"] : ::Pago::UNSET),
      limit_activations: (data.key?("limit_activations") ? data["limit_activations"] : ::Pago::UNSET),
      usage: (data.key?("usage") ? data["usage"] : ::Pago::UNSET),
      limit_usage: (data.key?("limit_usage") ? data["limit_usage"] : ::Pago::UNSET),
      validations: (data.key?("validations") ? data["validations"] : ::Pago::UNSET),
      last_validated_at: (data.key?("last_validated_at") ? data["last_validated_at"] : ::Pago::UNSET),
      expires_at: (data.key?("expires_at") ? data["expires_at"] : ::Pago::UNSET)
    ),
    data
  )
end