Class: Pago::V2026_04::Models::FileUpload

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",
  organization_id: "organization_id",
  name: "name",
  path: "path",
  mime_type: "mime_type",
  size: "size",
  storage_version: "storage_version",
  checksum_etag: "checksum_etag",
  checksum_sha256_base64: "checksum_sha256_base64",
  checksum_sha256_hex: "checksum_sha256_hex",
  last_modified_at: "last_modified_at",
  upload: "upload",
  version: "version",
  is_uploaded: "is_uploaded",
  service: "service",
  size_readable: "size_readable"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["id", "organization_id", "name", "path", "mime_type", "size", "storage_version", "checksum_etag", "checksum_sha256_base64", "checksum_sha256_hex", "last_modified_at", "upload", "version", "service", "size_readable"].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:, organization_id:, name:, path:, mime_type:, size:, storage_version:, checksum_etag:, checksum_sha256_base64:, checksum_sha256_hex:, last_modified_at:, upload:, version:, is_uploaded: ::Pago::UNSET, service:, size_readable:) ⇒ FileUpload

Returns a new instance of FileUpload.

Parameters:

  • id: (String)
  • organization_id: (String)
  • name: (String)
  • path: (String)
  • mime_type: (String)
  • size: (Integer)
  • storage_version: (String, nil)
  • checksum_etag: (String, nil)
  • checksum_sha256_base64: (String, nil)
  • checksum_sha256_hex: (String, nil)
  • last_modified_at: (String, nil)
  • upload: (Models::S3FileUploadMultipart)
  • version: (String, nil)
  • is_uploaded: (Boolean, nil) (defaults to: ::Pago::UNSET)
  • service: (String)
  • size_readable: (String)


25699
25700
25701
25702
25703
25704
25705
25706
25707
25708
25709
25710
25711
25712
25713
25714
25715
25716
25717
25718
25719
25720
25721
25722
25723
25724
25725
25726
25727
25728
25729
25730
25731
25732
25733
25734
# File 'lib/pago/v2026_04/models.rb', line 25699

def initialize(
  id:,
  organization_id:,
  name:,
  path:,
  mime_type:,
  size:,
  storage_version:,
  checksum_etag:,
  checksum_sha256_base64:,
  checksum_sha256_hex:,
  last_modified_at:,
  upload:,
  version:,
  is_uploaded: ::Pago::UNSET,
  service:,
  size_readable:
)
  super()
  assign(:id, id)
  assign(:organization_id, organization_id)
  assign(:name, name)
  assign(:path, path)
  assign(:mime_type, mime_type)
  assign(:size, size)
  assign(:storage_version, storage_version)
  assign(:checksum_etag, checksum_etag)
  assign(:checksum_sha256_base64, checksum_sha256_base64)
  assign(:checksum_sha256_hex, checksum_sha256_hex)
  assign(:last_modified_at, last_modified_at)
  assign(:upload, upload)
  assign(:version, version)
  assign(:is_uploaded, is_uploaded)
  assign(:service, service)
  assign(:size_readable, size_readable)
end

Instance Attribute Details

#checksum_etagString? (readonly)

Returns:

  • (String, nil)


25673
25674
25675
# File 'lib/pago/v2026_04/models.rb', line 25673

def checksum_etag
  @checksum_etag
end

#checksum_sha256_base64String? (readonly)

Returns:

  • (String, nil)


25676
25677
25678
# File 'lib/pago/v2026_04/models.rb', line 25676

def checksum_sha256_base64
  @checksum_sha256_base64
end

#checksum_sha256_hexString? (readonly)

Returns:

  • (String, nil)


25679
25680
25681
# File 'lib/pago/v2026_04/models.rb', line 25679

def checksum_sha256_hex
  @checksum_sha256_hex
end

#idString (readonly)

The ID of the object.

Returns:

  • (String)


25652
25653
25654
# File 'lib/pago/v2026_04/models.rb', line 25652

def id
  @id
end

#is_uploadedBoolean (readonly)

Returns:

  • (Boolean)


25691
25692
25693
# File 'lib/pago/v2026_04/models.rb', line 25691

def is_uploaded
  @is_uploaded
end

#last_modified_atString? (readonly)

Returns:

  • (String, nil)


25682
25683
25684
# File 'lib/pago/v2026_04/models.rb', line 25682

def last_modified_at
  @last_modified_at
end

#mime_typeString (readonly)

Returns:

  • (String)


25664
25665
25666
# File 'lib/pago/v2026_04/models.rb', line 25664

def mime_type
  @mime_type
end

#nameString (readonly)

Returns:

  • (String)


25658
25659
25660
# File 'lib/pago/v2026_04/models.rb', line 25658

def name
  @name
end

#organization_idString (readonly)

Returns:

  • (String)


25655
25656
25657
# File 'lib/pago/v2026_04/models.rb', line 25655

def organization_id
  @organization_id
end

#pathString (readonly)

Returns:

  • (String)


25661
25662
25663
# File 'lib/pago/v2026_04/models.rb', line 25661

def path
  @path
end

#serviceString (readonly)

Returns:

  • (String)


25694
25695
25696
# File 'lib/pago/v2026_04/models.rb', line 25694

def service
  @service
end

#sizeInteger (readonly)

Returns:

  • (Integer)


25667
25668
25669
# File 'lib/pago/v2026_04/models.rb', line 25667

def size
  @size
end

#size_readableString (readonly)

Returns:

  • (String)


25697
25698
25699
# File 'lib/pago/v2026_04/models.rb', line 25697

def size_readable
  @size_readable
end

#storage_versionString? (readonly)

Returns:

  • (String, nil)


25670
25671
25672
# File 'lib/pago/v2026_04/models.rb', line 25670

def storage_version
  @storage_version
end

#uploadModels::S3FileUploadMultipart (readonly)



25685
25686
25687
# File 'lib/pago/v2026_04/models.rb', line 25685

def upload
  @upload
end

#versionString? (readonly)

Returns:

  • (String, nil)


25688
25689
25690
# File 'lib/pago/v2026_04/models.rb', line 25688

def version
  @version
end

Class Method Details

.from_json(data) ⇒ FileUpload?

Parameters:

  • data (Hash, String, nil)

Returns:



25738
25739
25740
25741
25742
25743
25744
25745
25746
25747
25748
25749
25750
25751
25752
25753
25754
25755
25756
25757
25758
25759
25760
25761
25762
25763
25764
# File 'lib/pago/v2026_04/models.rb', line 25738

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),
      organization_id: (data.key?("organization_id") ? data["organization_id"] : ::Pago::UNSET),
      name: (data.key?("name") ? data["name"] : ::Pago::UNSET),
      path: (data.key?("path") ? data["path"] : ::Pago::UNSET),
      mime_type: (data.key?("mime_type") ? data["mime_type"] : ::Pago::UNSET),
      size: (data.key?("size") ? data["size"] : ::Pago::UNSET),
      storage_version: (data.key?("storage_version") ? data["storage_version"] : ::Pago::UNSET),
      checksum_etag: (data.key?("checksum_etag") ? data["checksum_etag"] : ::Pago::UNSET),
      checksum_sha256_base64: (data.key?("checksum_sha256_base64") ? data["checksum_sha256_base64"] : ::Pago::UNSET),
      checksum_sha256_hex: (data.key?("checksum_sha256_hex") ? data["checksum_sha256_hex"] : ::Pago::UNSET),
      last_modified_at: (data.key?("last_modified_at") ? data["last_modified_at"] : ::Pago::UNSET),
      upload: (data.key?("upload") ? Models::S3FileUploadMultipart.from_json(data["upload"]) : ::Pago::UNSET),
      version: (data.key?("version") ? data["version"] : ::Pago::UNSET),
      is_uploaded: (data.key?("is_uploaded") ? data["is_uploaded"] : ::Pago::UNSET),
      service: (data.key?("service") ? data["service"] : ::Pago::UNSET),
      size_readable: (data.key?("size_readable") ? data["size_readable"] : ::Pago::UNSET)
    ),
    data
  )
end