Class: Pago::V2026_04::Models::ValidatedLicenseKey

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",
  activation: "activation"
}.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:, activation: ::Pago::UNSET) ⇒ ValidatedLicenseKey

Returns a new instance of ValidatedLicenseKey.

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)
  • activation: (Models::LicenseKeyActivationBase, nil) (defaults to: ::Pago::UNSET)


43908
43909
43910
43911
43912
43913
43914
43915
43916
43917
43918
43919
43920
43921
43922
43923
43924
43925
43926
43927
43928
43929
43930
43931
43932
43933
43934
43935
43936
43937
43938
43939
43940
43941
43942
43943
43944
43945
# File 'lib/pago/v2026_04/models.rb', line 43908

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:,
  activation: ::Pago::UNSET
)
  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(:activation, activation)
end

Instance Attribute Details

#activationModels::LicenseKeyActivationBase? (readonly)



43906
43907
43908
# File 'lib/pago/v2026_04/models.rb', line 43906

def activation
  @activation
end

#benefit_idString (readonly)

The benefit ID.

Returns:

  • (String)


43876
43877
43878
# File 'lib/pago/v2026_04/models.rb', line 43876

def benefit_id
  @benefit_id
end

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


43859
43860
43861
# File 'lib/pago/v2026_04/models.rb', line 43859

def created_at
  @created_at
end

#customerModels::LicenseKeyCustomer (readonly)



43872
43873
43874
# File 'lib/pago/v2026_04/models.rb', line 43872

def customer
  @customer
end

#customer_idString (readonly)

Returns:

  • (String)


43869
43870
43871
# File 'lib/pago/v2026_04/models.rb', line 43869

def customer_id
  @customer_id
end

#display_keyString (readonly)

Returns:

  • (String)


43882
43883
43884
# File 'lib/pago/v2026_04/models.rb', line 43882

def display_key
  @display_key
end

#expires_atString? (readonly)

Returns:

  • (String, nil)


43903
43904
43905
# File 'lib/pago/v2026_04/models.rb', line 43903

def expires_at
  @expires_at
end

#idString (readonly)

The ID of the object.

Returns:

  • (String)


43855
43856
43857
# File 'lib/pago/v2026_04/models.rb', line 43855

def id
  @id
end

#keyString (readonly)

Returns:

  • (String)


43879
43880
43881
# File 'lib/pago/v2026_04/models.rb', line 43879

def key
  @key
end

#last_validated_atString? (readonly)

Returns:

  • (String, nil)


43900
43901
43902
# File 'lib/pago/v2026_04/models.rb', line 43900

def last_validated_at
  @last_validated_at
end

#limit_activationsInteger? (readonly)

Returns:

  • (Integer, nil)


43888
43889
43890
# File 'lib/pago/v2026_04/models.rb', line 43888

def limit_activations
  @limit_activations
end

#limit_usageInteger? (readonly)

Returns:

  • (Integer, nil)


43894
43895
43896
# File 'lib/pago/v2026_04/models.rb', line 43894

def limit_usage
  @limit_usage
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


43863
43864
43865
# File 'lib/pago/v2026_04/models.rb', line 43863

def modified_at
  @modified_at
end

#organization_idString (readonly)

Returns:

  • (String)


43866
43867
43868
# File 'lib/pago/v2026_04/models.rb', line 43866

def organization_id
  @organization_id
end

#statusString (readonly)

Returns:

  • (String)


43885
43886
43887
# File 'lib/pago/v2026_04/models.rb', line 43885

def status
  @status
end

#usageInteger (readonly)

Returns:

  • (Integer)


43891
43892
43893
# File 'lib/pago/v2026_04/models.rb', line 43891

def usage
  @usage
end

#validationsInteger (readonly)

Returns:

  • (Integer)


43897
43898
43899
# File 'lib/pago/v2026_04/models.rb', line 43897

def validations
  @validations
end

Class Method Details

.from_json(data) ⇒ ValidatedLicenseKey?

Parameters:

  • data (Hash, String, nil)

Returns:



43949
43950
43951
43952
43953
43954
43955
43956
43957
43958
43959
43960
43961
43962
43963
43964
43965
43966
43967
43968
43969
43970
43971
43972
43973
43974
43975
43976
# File 'lib/pago/v2026_04/models.rb', line 43949

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),
      activation: (data.key?("activation") ? Models::LicenseKeyActivationBase.from_json(data["activation"]) : ::Pago::UNSET)
    ),
    data
  )
end