Class: Pago::V2026_04::Models::LicenseKeyWithActivations

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",
  activations: "activations"
}.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", "activations"].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:, activations:) ⇒ LicenseKeyWithActivations

Returns a new instance of LicenseKeyWithActivations.

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)
  • activations: (Array[Models::LicenseKeyActivationBase])


27324
27325
27326
27327
27328
27329
27330
27331
27332
27333
27334
27335
27336
27337
27338
27339
27340
27341
27342
27343
27344
27345
27346
27347
27348
27349
27350
27351
27352
27353
27354
27355
27356
27357
27358
27359
27360
27361
# File 'lib/pago/v2026_04/models.rb', line 27324

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:,
  activations:
)
  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)
  assign(:activations, activations)
end

Instance Attribute Details

#activationsArray<Models::LicenseKeyActivationBase> (readonly)



27322
27323
27324
# File 'lib/pago/v2026_04/models.rb', line 27322

def activations
  @activations
end

#benefit_idString (readonly)

The benefit ID.

Returns:

  • (String)


27292
27293
27294
# File 'lib/pago/v2026_04/models.rb', line 27292

def benefit_id
  @benefit_id
end

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


27275
27276
27277
# File 'lib/pago/v2026_04/models.rb', line 27275

def created_at
  @created_at
end

#customerModels::LicenseKeyCustomer (readonly)



27288
27289
27290
# File 'lib/pago/v2026_04/models.rb', line 27288

def customer
  @customer
end

#customer_idString (readonly)

Returns:

  • (String)


27285
27286
27287
# File 'lib/pago/v2026_04/models.rb', line 27285

def customer_id
  @customer_id
end

#display_keyString (readonly)

Returns:

  • (String)


27298
27299
27300
# File 'lib/pago/v2026_04/models.rb', line 27298

def display_key
  @display_key
end

#expires_atString? (readonly)

Returns:

  • (String, nil)


27319
27320
27321
# File 'lib/pago/v2026_04/models.rb', line 27319

def expires_at
  @expires_at
end

#idString (readonly)

The ID of the object.

Returns:

  • (String)


27271
27272
27273
# File 'lib/pago/v2026_04/models.rb', line 27271

def id
  @id
end

#keyString (readonly)

Returns:

  • (String)


27295
27296
27297
# File 'lib/pago/v2026_04/models.rb', line 27295

def key
  @key
end

#last_validated_atString? (readonly)

Returns:

  • (String, nil)


27316
27317
27318
# File 'lib/pago/v2026_04/models.rb', line 27316

def last_validated_at
  @last_validated_at
end

#limit_activationsInteger? (readonly)

Returns:

  • (Integer, nil)


27304
27305
27306
# File 'lib/pago/v2026_04/models.rb', line 27304

def limit_activations
  @limit_activations
end

#limit_usageInteger? (readonly)

Returns:

  • (Integer, nil)


27310
27311
27312
# File 'lib/pago/v2026_04/models.rb', line 27310

def limit_usage
  @limit_usage
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


27279
27280
27281
# File 'lib/pago/v2026_04/models.rb', line 27279

def modified_at
  @modified_at
end

#organization_idString (readonly)

Returns:

  • (String)


27282
27283
27284
# File 'lib/pago/v2026_04/models.rb', line 27282

def organization_id
  @organization_id
end

#statusString (readonly)

Returns:

  • (String)


27301
27302
27303
# File 'lib/pago/v2026_04/models.rb', line 27301

def status
  @status
end

#usageInteger (readonly)

Returns:

  • (Integer)


27307
27308
27309
# File 'lib/pago/v2026_04/models.rb', line 27307

def usage
  @usage
end

#validationsInteger (readonly)

Returns:

  • (Integer)


27313
27314
27315
# File 'lib/pago/v2026_04/models.rb', line 27313

def validations
  @validations
end

Class Method Details

.from_json(data) ⇒ LicenseKeyWithActivations?

Parameters:

  • data (Hash, String, nil)

Returns:



27365
27366
27367
27368
27369
27370
27371
27372
27373
27374
27375
27376
27377
27378
27379
27380
27381
27382
27383
27384
27385
27386
27387
27388
27389
27390
27391
27392
# File 'lib/pago/v2026_04/models.rb', line 27365

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),
      activations: (data.key?("activations") ? ::Pago::Serde.array(data["activations"]) { |item0| Models::LicenseKeyActivationBase.from_json(item0) } : ::Pago::UNSET)
    ),
    data
  )
end