Class: Pago::V2026_04::Models::SupportCaseAttachmentFileCreate

Inherits:
Model
  • Object
show all
Defined in:
lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs

Overview

Schema to create a file attached to a support case.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  organization_id: "organization_id",
  name: "name",
  mime_type: "mime_type",
  size: "size",
  checksum_sha256_base64: "checksum_sha256_base64",
  upload: "upload",
  service: "service",
  version: "version"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["name", "mime_type", "size", "upload", "service"].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(organization_id: ::Pago::UNSET, name:, mime_type:, size:, checksum_sha256_base64: ::Pago::UNSET, upload:, service:, version: ::Pago::UNSET) ⇒ SupportCaseAttachmentFileCreate

Returns a new instance of SupportCaseAttachmentFileCreate.

Parameters:

  • organization_id: (String, nil) (defaults to: ::Pago::UNSET)
  • name: (String)
  • mime_type: (String)
  • size: (Integer)
  • checksum_sha256_base64: (String, nil) (defaults to: ::Pago::UNSET)
  • upload: (Models::S3FileCreateMultipart)
  • service: (String)
  • version: (String, nil) (defaults to: ::Pago::UNSET)


43235
43236
43237
43238
43239
43240
43241
43242
43243
43244
43245
43246
43247
43248
43249
43250
43251
43252
43253
43254
# File 'lib/pago/v2026_04/models.rb', line 43235

def initialize(
  organization_id: ::Pago::UNSET,
  name:,
  mime_type:,
  size:,
  checksum_sha256_base64: ::Pago::UNSET,
  upload:,
  service:,
  version: ::Pago::UNSET
)
  super()
  assign(:organization_id, organization_id)
  assign(:name, name)
  assign(:mime_type, mime_type)
  assign(:size, size)
  assign(:checksum_sha256_base64, checksum_sha256_base64)
  assign(:upload, upload)
  assign(:service, service)
  assign(:version, version)
end

Instance Attribute Details

#checksum_sha256_base64String? (readonly)

Returns:

  • (String, nil)


43224
43225
43226
# File 'lib/pago/v2026_04/models.rb', line 43224

def checksum_sha256_base64
  @checksum_sha256_base64
end

#mime_typeString (readonly)

MIME type of the file. Images, videos, PDF, CSV, plain text, Word and Excel documents are supported.

Returns:

  • (String)


43217
43218
43219
# File 'lib/pago/v2026_04/models.rb', line 43217

def mime_type
  @mime_type
end

#nameString (readonly)

Returns:

  • (String)


43213
43214
43215
# File 'lib/pago/v2026_04/models.rb', line 43213

def name
  @name
end

#organization_idString? (readonly)

Returns:

  • (String, nil)


43210
43211
43212
# File 'lib/pago/v2026_04/models.rb', line 43210

def organization_id
  @organization_id
end

#serviceString (readonly)

Returns:

  • (String)


43230
43231
43232
# File 'lib/pago/v2026_04/models.rb', line 43230

def service
  @service
end

#sizeInteger (readonly)

Size of the file. A maximum of 250 MB is allowed for this type of file.

Returns:

  • (Integer)


43221
43222
43223
# File 'lib/pago/v2026_04/models.rb', line 43221

def size
  @size
end

#uploadModels::S3FileCreateMultipart (readonly)



43227
43228
43229
# File 'lib/pago/v2026_04/models.rb', line 43227

def upload
  @upload
end

#versionString? (readonly)

Returns:

  • (String, nil)


43233
43234
43235
# File 'lib/pago/v2026_04/models.rb', line 43233

def version
  @version
end

Class Method Details

.from_json(data) ⇒ SupportCaseAttachmentFileCreate?

Parameters:

  • data (Hash, String, nil)

Returns:



43258
43259
43260
43261
43262
43263
43264
43265
43266
43267
43268
43269
43270
43271
43272
43273
43274
43275
43276
# File 'lib/pago/v2026_04/models.rb', line 43258

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(
      organization_id: (data.key?("organization_id") ? data["organization_id"] : ::Pago::UNSET),
      name: (data.key?("name") ? data["name"] : ::Pago::UNSET),
      mime_type: (data.key?("mime_type") ? data["mime_type"] : ::Pago::UNSET),
      size: (data.key?("size") ? data["size"] : ::Pago::UNSET),
      checksum_sha256_base64: (data.key?("checksum_sha256_base64") ? data["checksum_sha256_base64"] : ::Pago::UNSET),
      upload: (data.key?("upload") ? Models::S3FileCreateMultipart.from_json(data["upload"]) : ::Pago::UNSET),
      service: (data.key?("service") ? data["service"] : ::Pago::UNSET),
      version: (data.key?("version") ? data["version"] : ::Pago::UNSET)
    ),
    data
  )
end