Class: Pago::V2026_04::Models::LicenseKeyValidate

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",
  activation_id: "activation_id",
  benefit_id: "benefit_id",
  customer_id: "customer_id",
  increment_usage: "increment_usage",
  conditions: "conditions"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["key", "organization_id"].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:, activation_id: ::Pago::UNSET, benefit_id: ::Pago::UNSET, customer_id: ::Pago::UNSET, increment_usage: ::Pago::UNSET, conditions: ::Pago::UNSET) ⇒ LicenseKeyValidate

Returns a new instance of LicenseKeyValidate.

Parameters:

  • key: (String)
  • organization_id: (String)
  • activation_id: (String, nil) (defaults to: ::Pago::UNSET)
  • benefit_id: (String, nil) (defaults to: ::Pago::UNSET)
  • customer_id: (String, nil) (defaults to: ::Pago::UNSET)
  • increment_usage: (Integer, nil) (defaults to: ::Pago::UNSET)
  • conditions: (Hash[String, untyped], nil) (defaults to: ::Pago::UNSET)


27206
27207
27208
27209
27210
27211
27212
27213
27214
27215
27216
27217
27218
27219
27220
27221
27222
27223
# File 'lib/pago/v2026_04/models.rb', line 27206

def initialize(
  key:,
  organization_id:,
  activation_id: ::Pago::UNSET,
  benefit_id: ::Pago::UNSET,
  customer_id: ::Pago::UNSET,
  increment_usage: ::Pago::UNSET,
  conditions: ::Pago::UNSET
)
  super()
  assign(:key, key)
  assign(:organization_id, organization_id)
  assign(:activation_id, activation_id)
  assign(:benefit_id, benefit_id)
  assign(:customer_id, customer_id)
  assign(:increment_usage, increment_usage)
  assign(:conditions, conditions)
end

Instance Attribute Details

#activation_idString? (readonly)

Returns:

  • (String, nil)


27181
27182
27183
# File 'lib/pago/v2026_04/models.rb', line 27181

def activation_id
  @activation_id
end

#benefit_idString? (readonly)

Returns:

  • (String, nil)


27184
27185
27186
# File 'lib/pago/v2026_04/models.rb', line 27184

def benefit_id
  @benefit_id
end

#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})


27204
27205
27206
# File 'lib/pago/v2026_04/models.rb', line 27204

def conditions
  @conditions
end

#customer_idString? (readonly)

Returns:

  • (String, nil)


27187
27188
27189
# File 'lib/pago/v2026_04/models.rb', line 27187

def customer_id
  @customer_id
end

#increment_usageInteger? (readonly)

Returns:

  • (Integer, nil)


27190
27191
27192
# File 'lib/pago/v2026_04/models.rb', line 27190

def increment_usage
  @increment_usage
end

#keyString (readonly)

Returns:

  • (String)


27175
27176
27177
# File 'lib/pago/v2026_04/models.rb', line 27175

def key
  @key
end

#organization_idString (readonly)

Returns:

  • (String)


27178
27179
27180
# File 'lib/pago/v2026_04/models.rb', line 27178

def organization_id
  @organization_id
end

Class Method Details

.from_json(data) ⇒ LicenseKeyValidate?

Parameters:

  • data (Hash, String, nil)

Returns:



27227
27228
27229
27230
27231
27232
27233
27234
27235
27236
27237
27238
27239
27240
27241
27242
27243
27244
# File 'lib/pago/v2026_04/models.rb', line 27227

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),
      activation_id: (data.key?("activation_id") ? data["activation_id"] : ::Pago::UNSET),
      benefit_id: (data.key?("benefit_id") ? data["benefit_id"] : ::Pago::UNSET),
      customer_id: (data.key?("customer_id") ? data["customer_id"] : ::Pago::UNSET),
      increment_usage: (data.key?("increment_usage") ? data["increment_usage"] : ::Pago::UNSET),
      conditions: (data.key?("conditions") ? data["conditions"] : ::Pago::UNSET)
    ),
    data
  )
end