55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
# File 'lib/notion_ruby_mapping/objects/file_upload_object.rb', line 55
def single_file_upload(fname = @fname, part_number = 0)
if @number_of_parts > 1
options = {"part_number" => part_number}
status = "pending"
else
options = {}
status = "uploaded"
end
nc = NotionRubyMapping::NotionCache.instance
response = nc.send_file_upload_request fname, @id, options
return if nc.hex_id(response["id"]) == @id && response["status"] == status
raise StandardError, "File upload failed: #{response}"
end
|