Class: Pago::V2026_04::Models::DownloadableRead

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",
  benefit_id: "benefit_id",
  file: "file"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["id", "benefit_id", "file"].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:, benefit_id:, file:) ⇒ DownloadableRead

Returns a new instance of DownloadableRead.

Parameters:



24715
24716
24717
24718
24719
24720
24721
24722
24723
24724
# File 'lib/pago/v2026_04/models.rb', line 24715

def initialize(
  id:,
  benefit_id:,
  file:
)
  super()
  assign(:id, id)
  assign(:benefit_id, benefit_id)
  assign(:file, file)
end

Instance Attribute Details

#benefit_idString (readonly)

Returns:

  • (String)


24710
24711
24712
# File 'lib/pago/v2026_04/models.rb', line 24710

def benefit_id
  @benefit_id
end

#fileModels::FileDownload (readonly)



24713
24714
24715
# File 'lib/pago/v2026_04/models.rb', line 24713

def file
  @file
end

#idString (readonly)

Returns:

  • (String)


24707
24708
24709
# File 'lib/pago/v2026_04/models.rb', line 24707

def id
  @id
end

Class Method Details

.from_json(data) ⇒ DownloadableRead?

Parameters:

  • data (Hash, String, nil)

Returns:



24728
24729
24730
24731
24732
24733
24734
24735
24736
24737
24738
24739
24740
24741
# File 'lib/pago/v2026_04/models.rb', line 24728

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