Class: Worldline::Connect::SDK::V1::Domain::HostedFile

Inherits:
Domain::DataObject show all
Defined in:
lib/worldline/connect/sdk/v1/domain/hosted_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#file_nameString

Returns the current value of file_name.

Returns:

  • (String)

    the current value of file_name



16
17
18
# File 'lib/worldline/connect/sdk/v1/domain/hosted_file.rb', line 16

def file_name
  @file_name
end

#file_sizeString

Returns the current value of file_size.

Returns:

  • (String)

    the current value of file_size



16
17
18
# File 'lib/worldline/connect/sdk/v1/domain/hosted_file.rb', line 16

def file_size
  @file_size
end

#file_typeString

Returns the current value of file_type.

Returns:

  • (String)

    the current value of file_type



16
17
18
# File 'lib/worldline/connect/sdk/v1/domain/hosted_file.rb', line 16

def file_type
  @file_type
end

#idString

Returns the current value of id.

Returns:

  • (String)

    the current value of id



16
17
18
# File 'lib/worldline/connect/sdk/v1/domain/hosted_file.rb', line 16

def id
  @id
end

Instance Method Details

#from_hash(hash) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/worldline/connect/sdk/v1/domain/hosted_file.rb', line 36

def from_hash(hash)
  super
  if hash.has_key? 'fileName'
    @file_name = hash['fileName']
  end
  if hash.has_key? 'fileSize'
    @file_size = hash['fileSize']
  end
  if hash.has_key? 'fileType'
    @file_type = hash['fileType']
  end
  if hash.has_key? 'id'
    @id = hash['id']
  end
end

#to_hHash

Returns:

  • (Hash)


27
28
29
30
31
32
33
34
# File 'lib/worldline/connect/sdk/v1/domain/hosted_file.rb', line 27

def to_h
  hash = super
  hash['fileName'] = @file_name unless @file_name.nil?
  hash['fileSize'] = @file_size unless @file_size.nil?
  hash['fileType'] = @file_type unless @file_type.nil?
  hash['id'] = @id unless @id.nil?
  hash
end