Class: Pago::V2026_04::Models::Unauthorized

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])
{
  error: "error",
  detail: "detail"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["error", "detail"].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(error:, detail:) ⇒ Unauthorized

Returns a new instance of Unauthorized.

Parameters:

  • error: (String)
  • detail: (String)


43537
43538
43539
43540
43541
43542
43543
43544
# File 'lib/pago/v2026_04/models.rb', line 43537

def initialize(
  error:,
  detail:
)
  super()
  assign(:error, error)
  assign(:detail, detail)
end

Instance Attribute Details

#detailString (readonly)

Returns:

  • (String)


43535
43536
43537
# File 'lib/pago/v2026_04/models.rb', line 43535

def detail
  @detail
end

#errorString (readonly)

Returns:

  • (String)


43532
43533
43534
# File 'lib/pago/v2026_04/models.rb', line 43532

def error
  @error
end

Class Method Details

.from_json(data) ⇒ Unauthorized?

Parameters:

  • data (Hash, String, nil)

Returns:



43548
43549
43550
43551
43552
43553
43554
43555
43556
43557
43558
43559
43560
# File 'lib/pago/v2026_04/models.rb', line 43548

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(
      error: (data.key?("error") ? data["error"] : ::Pago::UNSET),
      detail: (data.key?("detail") ? data["detail"] : ::Pago::UNSET)
    ),
    data
  )
end