Class: Api2Convert::Model::InputFile

Inherits:
Object
  • Object
show all
Defined in:
lib/api2convert/model/input_file.rb

Overview

An input file attached to a job.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: nil, type: "", source: nil, status: nil, filename: nil, size: nil, content_type: nil, options: {}) ⇒ InputFile

Returns a new instance of InputFile.



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/api2convert/model/input_file.rb', line 9

def initialize(id: nil, type: "", source: nil, status: nil, filename: nil,
               size: nil, content_type: nil, options: {})
  @id = id
  @type = type
  @source = source
  @status = status
  @filename = filename
  @size = size
  @content_type = content_type
  @options = options
  freeze
end

Instance Attribute Details

#content_typeObject (readonly)

Returns the value of attribute content_type.



7
8
9
# File 'lib/api2convert/model/input_file.rb', line 7

def content_type
  @content_type
end

#filenameObject (readonly)

Returns the value of attribute filename.



7
8
9
# File 'lib/api2convert/model/input_file.rb', line 7

def filename
  @filename
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/api2convert/model/input_file.rb', line 7

def id
  @id
end

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'lib/api2convert/model/input_file.rb', line 7

def options
  @options
end

#sizeObject (readonly)

Returns the value of attribute size.



7
8
9
# File 'lib/api2convert/model/input_file.rb', line 7

def size
  @size
end

#sourceObject (readonly)

Returns the value of attribute source.



7
8
9
# File 'lib/api2convert/model/input_file.rb', line 7

def source
  @source
end

#statusObject (readonly)

Returns the value of attribute status.



7
8
9
# File 'lib/api2convert/model/input_file.rb', line 7

def status
  @status
end

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/api2convert/model/input_file.rb', line 7

def type
  @type
end

Class Method Details

.from_hash(data) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/api2convert/model/input_file.rb', line 22

def self.from_hash(data)
  d = Support::Data.as_object(data)
  new(
    id: Support::Data.nullable_str(d["id"]),
    type: Support::Data.as_str(d["type"]),
    source: Support::Data.nullable_str(d["source"]),
    status: Support::Data.nullable_str(d["status"]),
    filename: Support::Data.nullable_str(d["filename"]),
    size: Support::Data.nullable_int(d["size"]),
    content_type: Support::Data.nullable_str(d["content_type"]),
    options: Support::Data.as_object(d["options"])
  )
end