Class: Pago::V2026_04::Models::OrganizationAvatarFileCreate

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 to be used as an organization avatar.

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) ⇒ OrganizationAvatarFileCreate

Returns a new instance of OrganizationAvatarFileCreate.

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)


34078
34079
34080
34081
34082
34083
34084
34085
34086
34087
34088
34089
34090
34091
34092
34093
34094
34095
34096
34097
# File 'lib/pago/v2026_04/models.rb', line 34078

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)


34067
34068
34069
# File 'lib/pago/v2026_04/models.rb', line 34067

def checksum_sha256_base64
  @checksum_sha256_base64
end

#mime_typeString (readonly)

MIME type of the file. Only images are supported for this type of file.

Returns:

  • (String)


34060
34061
34062
# File 'lib/pago/v2026_04/models.rb', line 34060

def mime_type
  @mime_type
end

#nameString (readonly)

Returns:

  • (String)


34056
34057
34058
# File 'lib/pago/v2026_04/models.rb', line 34056

def name
  @name
end

#organization_idString? (readonly)

Returns:

  • (String, nil)


34053
34054
34055
# File 'lib/pago/v2026_04/models.rb', line 34053

def organization_id
  @organization_id
end

#serviceString (readonly)

Returns:

  • (String)


34073
34074
34075
# File 'lib/pago/v2026_04/models.rb', line 34073

def service
  @service
end

#sizeInteger (readonly)

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

Returns:

  • (Integer)


34064
34065
34066
# File 'lib/pago/v2026_04/models.rb', line 34064

def size
  @size
end

#uploadModels::S3FileCreateMultipart (readonly)



34070
34071
34072
# File 'lib/pago/v2026_04/models.rb', line 34070

def upload
  @upload
end

#versionString? (readonly)

Returns:

  • (String, nil)


34076
34077
34078
# File 'lib/pago/v2026_04/models.rb', line 34076

def version
  @version
end

Class Method Details

.from_json(data) ⇒ OrganizationAvatarFileCreate?

Parameters:

  • data (Hash, String, nil)

Returns:



34101
34102
34103
34104
34105
34106
34107
34108
34109
34110
34111
34112
34113
34114
34115
34116
34117
34118
34119
# File 'lib/pago/v2026_04/models.rb', line 34101

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