class Teamlab::Files

Public Class Methods

new() click to toggle source
# File lib/teamlab/modules/files.rb, line 3
def initialize
  @request = Teamlab::Request.new('files')
end

Public Instance Methods

check_conflict(options = {}) click to toggle source
# File lib/teamlab/modules/files.rb, line 45
def check_conflict(options = {})
  @request.get(%w(fileops move), options)
end
check_conversion_status(fileid) click to toggle source
# File lib/teamlab/modules/files.rb, line 49
def check_conversion_status(fileid)
  @request.get(['file', fileid.to_s, 'checkconversion'])
end
chunked_upload(folder_id, filename, file_size) click to toggle source
# File lib/teamlab/modules/files.rb, line 227
def chunked_upload(folder_id, filename, file_size)
  @request.post([folder_id.to_s, 'upload', 'create_session'], fileName: filename, fileSize: file_size)
end
clear_recycle_bin() click to toggle source
# File lib/teamlab/modules/files.rb, line 74
def clear_recycle_bin
  @request.put(%w(fileops emptytrash))
end
copy_to_folder(dest_folder_id, options = {}) click to toggle source
# File lib/teamlab/modules/files.rb, line 58
def copy_to_folder(dest_folder_id, options = {})
  @request.put(%w(fileops copy), { destFolderId: dest_folder_id }.merge(options))
end
create_file(folder_id, title) click to toggle source
# File lib/teamlab/modules/files.rb, line 33
def create_file(folder_id, title)
  @request.post([folder_id.to_s, 'file'], title: title.to_s)
end
create_html(folder_id, title, content) click to toggle source
# File lib/teamlab/modules/files.rb, line 29
def create_html(folder_id, title, content)
  @request.post([folder_id.to_s, 'html'], title: title.to_s, content: content.to_s)
end
create_html_in_common_docs(title, content) click to toggle source
# File lib/teamlab/modules/files.rb, line 21
def create_html_in_common_docs(title, content)
  @request.post(%w(common html), title: title.to_s, content: content.to_s)
end
create_html_in_my_docs(title, content) click to toggle source
# File lib/teamlab/modules/files.rb, line 13
def create_html_in_my_docs(title, content)
  @request.post(%w(@my html), title: title.to_s, content: content.to_s)
end
create_txt(folder_id, title, content) click to toggle source
# File lib/teamlab/modules/files.rb, line 25
def create_txt(folder_id, title, content)
  @request.post([folder_id.to_s, 'text'], title: title.to_s, content: content.to_s)
end
create_txt_in_common_docs(title, content) click to toggle source
# File lib/teamlab/modules/files.rb, line 17
def create_txt_in_common_docs(title, content)
  @request.post(%w(@common text), title: title.to_s, content: content.to_s)
end
create_txt_in_my_docs(title, content) click to toggle source

region File Creation

# File lib/teamlab/modules/files.rb, line 9
def create_txt_in_my_docs(title, content)
  @request.post(%w(@my text), title: title.to_s, content: content.to_s)
end
delete(options = {}) click to toggle source
# File lib/teamlab/modules/files.rb, line 62
def delete(options = {})
  @request.put(%w(fileops delete), options)
end
delete_file(file_id) click to toggle source
# File lib/teamlab/modules/files.rb, line 106
def delete_file(file_id)
  @request.delete(['file', file_id.to_s])
end
delete_folder(folder_id) click to toggle source
# File lib/teamlab/modules/files.rb, line 155
def delete_folder(folder_id)
  @request.delete(['folder', folder_id.to_s])
end
document_server_info() click to toggle source
# File lib/teamlab/modules/files.rb, line 241
def document_server_info
  @request.get(%w(docservice))
end
finish_all() click to toggle source
# File lib/teamlab/modules/files.rb, line 66
def finish_all
  @request.put(%w(fileops terminate))
end
finish_operations(options = {}) click to toggle source
# File lib/teamlab/modules/files.rb, line 78
def finish_operations(options = {})
  @request.put(%w(fileops bulkdownload), options)
end
get_common_docs() click to toggle source
# File lib/teamlab/modules/files.rb, line 127
def get_common_docs
  @request.get(['@common'])
end
get_file_history(file_id) click to toggle source
# File lib/teamlab/modules/files.rb, line 94
def get_file_history(file_id)
  @request.get(['file', file_id.to_s, 'history'])
end
get_file_info(file_id) click to toggle source

region Files

# File lib/teamlab/modules/files.rb, line 90
def get_file_info(file_id)
  @request.get(['file', file_id.to_s])
end
get_file_operations_list() click to toggle source

region File operations

# File lib/teamlab/modules/files.rb, line 41
def get_file_operations_list
  @request.get(%w(fileops))
end
get_file_sharing(file_id) click to toggle source

region Sharing

# File lib/teamlab/modules/files.rb, line 163
def get_file_sharing(file_id)
  @request.get(['file', file_id.to_s, 'share'])
end
get_folder(folder_id, options = {}) click to toggle source
# File lib/teamlab/modules/files.rb, line 135
def get_folder(folder_id, options = {})
  @request.get([folder_id.to_s], options)
end
get_folder_info(folder_id) click to toggle source
# File lib/teamlab/modules/files.rb, line 139
def get_folder_info(folder_id)
  @request.get(['folder', folder_id.to_s])
end
get_folder_path(folder_id) click to toggle source
# File lib/teamlab/modules/files.rb, line 143
def get_folder_path(folder_id)
  @request.get(['folder', folder_id.to_s, 'path'])
end
get_folder_sharing(folder_id) click to toggle source
# File lib/teamlab/modules/files.rb, line 167
def get_folder_sharing(folder_id)
  @request.get(['folder', folder_id.to_s, 'share'])
end
get_my_docs() click to toggle source

region Folders

# File lib/teamlab/modules/files.rb, line 114
def get_my_docs
  @request.get(['@my'])
end
Also aliased as: get_my_files
get_my_files()
Alias for: get_my_docs
get_projects_folder() click to toggle source
# File lib/teamlab/modules/files.rb, line 131
def get_projects_folder
  @request.get(['@projects'])
end
get_shared_docs() click to toggle source
# File lib/teamlab/modules/files.rb, line 119
def get_shared_docs
  @request.get(['@share'])
end
get_third_party() click to toggle source

region Third-Party Integration

# File lib/teamlab/modules/files.rb, line 187
def get_third_party
  @request.get(%w(thirdparty))
end
get_trash() click to toggle source
# File lib/teamlab/modules/files.rb, line 123
def get_trash
  @request.get(['@trash'])
end
insert_file(folder_id, file, title: File.basename(file), keep_convert_status: false) click to toggle source
# File lib/teamlab/modules/files.rb, line 223
def insert_file(folder_id, file, title: File.basename(file), keep_convert_status: false)
  @request.post([folder_id.to_s, 'insert'], file: File.new(file), title: title, keepConvertStatus: keep_convert_status)
end
insert_to_common_docs(file, title: File.basename(file), keep_convert_status: false) click to toggle source
# File lib/teamlab/modules/files.rb, line 215
def insert_to_common_docs(file, title: File.basename(file), keep_convert_status: false)
  @request.post(%w(@common insert), file: File.new(file), title: title, keepConvertStatus: keep_convert_status)
end
insert_to_my_docs(file, title: File.basename(file), keep_convert_status: false) click to toggle source
# File lib/teamlab/modules/files.rb, line 207
def insert_to_my_docs(file, title: File.basename(file), keep_convert_status: false)
  @request.post(%w(@my insert), file: File.new(file), title: title, keepConvertStatus: keep_convert_status)
end
mark_as_read() click to toggle source
# File lib/teamlab/modules/files.rb, line 70
def mark_as_read
  @request.put(%w(fileops markasread))
end
move_files(dest_folder_id, options = {})
Alias for: move_to_folder
move_to_folder(dest_folder_id, options = {}) click to toggle source
# File lib/teamlab/modules/files.rb, line 53
def move_to_folder(dest_folder_id, options = {})
  @request.put(%w(fileops move), { destFolderId: dest_folder_id }.merge(options))
end
Also aliased as: move_files
new_folder(folder_id, title) click to toggle source
# File lib/teamlab/modules/files.rb, line 147
def new_folder(folder_id, title)
  @request.post(['folder', folder_id.to_s], title: title)
end
remove_third_party_account(provider_id) click to toggle source
# File lib/teamlab/modules/files.rb, line 195
def remove_third_party_account(provider_id)
  @request.delete(['thirdparty', provider_id.to_s])
end
removes_sharing_rights(options = {}) click to toggle source
# File lib/teamlab/modules/files.rb, line 179
def removes_sharing_rights(options = {})
  @request.delete(['share'], options)
end
rename_folder(folder_id, title) click to toggle source
# File lib/teamlab/modules/files.rb, line 151
def rename_folder(folder_id, title)
  @request.put(['folder', folder_id.to_s], title: title)
end
save_third_party(options = {}) click to toggle source
# File lib/teamlab/modules/files.rb, line 191
def save_third_party(options = {})
  @request.post(%w(thirdparty), options)
end
share_file(file_id, user_id, access_type, options = {}) click to toggle source
# File lib/teamlab/modules/files.rb, line 171
def share_file(file_id, user_id, access_type, options = {})
  @request.put(['file', file_id.to_s, 'share'], { share: { shareTo: user_id, Access: access_type } }.merge(options))
end
share_folder(folder_id, user_id, access_type, options = {}) click to toggle source
# File lib/teamlab/modules/files.rb, line 175
def share_folder(folder_id, user_id, access_type, options = {})
  @request.put(['folder', folder_id.to_s, 'share'], { share: { shareTo: user_id, Access: access_type } }.merge(options))
end
start_conversion(file_id, start) click to toggle source
# File lib/teamlab/modules/files.rb, line 82
def start_conversion(file_id, start)
  @request.put(['file', file_id.to_s, 'checkconversion'], start: start)
end
update_file_history(file_id, version, continue_version = false) click to toggle source
# File lib/teamlab/modules/files.rb, line 98
def update_file_history(file_id, version, continue_version = false)
  @request.put(['file', file_id.to_s, 'history'], version: version, continueVersion: continue_version)
end
update_file_info(file_id, title, last_version) click to toggle source
# File lib/teamlab/modules/files.rb, line 102
def update_file_info(file_id, title, last_version)
  @request.put(['file', file_id.to_s], title: title, lastVersion: last_version)
end
upload_to_common_docs(file) click to toggle source
# File lib/teamlab/modules/files.rb, line 211
def upload_to_common_docs(file)
  @request.post(%w(@common upload), somefile: File.new(file))
end
upload_to_folder(folder_id, file) click to toggle source
# File lib/teamlab/modules/files.rb, line 219
def upload_to_folder(folder_id, file)
  @request.post([folder_id.to_s, 'upload'], somefile: File.new(file))
end
upload_to_my_docs(file) click to toggle source

region Uploads

# File lib/teamlab/modules/files.rb, line 203
def upload_to_my_docs(file)
  @request.post(%w(@my upload), somefile: File.new(file))
end