Last active
September 27, 2018 13:51
-
-
Save groupdocscloud/efe67e20dac7c956c2a22b2d80bfa941 to your computer and use it in GitHub Desktop.
This Gist contains Ruby examples of GroupDocs.Storage Cloud
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Storage-Ruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative '..\lib\GroupDocs\Storage\api\storage_api' | |
#TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
@config = GroupDocsStorageCloud::Configuration.new | |
@config.api_key['api_key'] = 'xxxxx' # Put your's api_key and app_sid | |
@config.api_key['app_sid'] = 'xxxxx' | |
@config.host='https://api.groupdocs.cloud' | |
@api_client = GroupDocsStorageCloud::ApiClient.new @config | |
@storage_api = GroupDocsStorageCloud::StorageApi.new @api_client | |
$storage = 'MyStorage' | |
$request = GroupDocsStorageCloud::GetDiscUsageRequest.new($storage) | |
$result = @storage_api.get_disc_usage($request) | |
puts $result | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# APIs | |
require_relative '..\lib\GroupDocs\Storage\api\storage_api' | |
@config = GroupDocsStorageCloud::Configuration.new | |
@config.api_key['api_key'] = 'xxx-xx' # Put your's api_key and app_sid | |
@config.api_key['app_sid'] = 'xxxx' | |
@config.host='https://api.groupdocs.cloud' | |
@api_client = GroupDocsStorageCloud::ApiClient.new @config | |
@storage_api = GroupDocsStorageCloud::StorageApi.new @api_client | |
$path = 'conversions/result.docx' | |
$versionId = nil | |
$storage = 'MyStorage' | |
$request = GroupDocsStorageCloud::GetIsExistRequest.new($path, $versionId, $storage) | |
$result = @storage_api.get_is_exist($request) | |
#$result.fileExist != nil | |
puts $result | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# APIs | |
require_relative '..\lib\GroupDocs\Storage\api\storage_api' | |
#TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
@config = GroupDocsStorageCloud::Configuration.new | |
@config.api_key['api_key'] = 'xxx-xx' # Put your's api_key and app_sid | |
@config.api_key['app_sid'] = 'xxxx' | |
@config.host='https://api.groupdocs.cloud' | |
@api_client = GroupDocsStorageCloud::ApiClient.new @config | |
@storage_api = GroupDocsStorageCloud::StorageApi.new @api_client | |
$path = 'comparisons' | |
$storage = 'MyStorage' | |
$request = GroupDocsStorageCloud::GetListFilesRequest.new($path, $storage) | |
$result = @storage_api.get_list_files($request) | |
puts $result | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative '..\lib\GroupDocs\Storage\api\storage_api' | |
#TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
@config = GroupDocsStorageCloud::Configuration.new | |
@config.api_key['api_key'] = 'xxxxx' # Put your's api_key and app_sid | |
@config.api_key['app_sid'] = 'xxxxx' | |
@config.host='https://api.groupdocs.cloud' | |
@api_client = GroupDocsStorageCloud::ApiClient.new @config | |
@storage_api = GroupDocsStorageCloud::StorageApi.new @api_client | |
$path = 'comparisons/outpu.docx' | |
$storage = 'MyStorage' | |
$request = GroupDocsStorageCloud::GetListFileVersionsRequest.new($path, $storage) | |
$result = @storage_api.get_list_file_versions($request) | |
puts $result | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative '..\lib\GroupDocs\Storage\api\storage_api' | |
#TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
@config = GroupDocsStorageCloud::Configuration.new | |
@config.api_key['api_key'] = 'xxxxx' # Put your's api_key and app_sid | |
@config.api_key['app_sid'] = 'xxxxx' | |
@config.host='https://api.groupdocs.cloud' | |
@api_client = GroupDocsStorageCloud::ApiClient.new @config | |
@storage_api = GroupDocsStorageCloud::StorageApi.new @api_client | |
$path = 'conversions' | |
$versionId = nil | |
$storage = 'MyStorage' | |
$request = GroupDocsStorageCloud::GetIsExistRequest.new($storage) | |
$result = @storage_api.get_is_exist($request) | |
puts $result | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative '..\lib\GroupDocs\Storage\api\storage_api' | |
#TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
@config = GroupDocsStorageCloud::Configuration.new | |
@config.api_key['api_key'] = 'xxxxx' # Put your's api_key and app_sid | |
@config.api_key['app_sid'] = 'xxxxx' | |
@config.host='https://api.groupdocs.cloud' | |
@api_client = GroupDocsStorageCloud::ApiClient.new @config | |
@storage_api = GroupDocsStorageCloud::StorageApi.new @api_client | |
$path = 'conversions/sample.docx' | |
$versionId = nil | |
$storage = 'MyStorage' | |
$request = GroupDocsStorageCloud::GetIsStorageExistRequest.new($storage) | |
$result = @storage_api.get_is_storage_exist($request) | |
puts $result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative '..\lib\GroupDocs\Storage\api\storage_api' | |
#TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
@config = GroupDocsStorageCloud::Configuration.new | |
@config.api_key['api_key'] = 'xxxxx' # Put your's api_key and app_sid | |
@config.api_key['app_sid'] = 'xxxxx' | |
@config.host='https://api.groupdocs.cloud' | |
@api_client = GroupDocsStorageCloud::ApiClient.new @config | |
@storage_api = GroupDocsStorageCloud::StorageApi.new @api_client | |
$path = 'comparions/result.docx' | |
$newdest = 'conversions/my' | |
$versionId = nil | |
$storage = 'MyStorage' | |
$dest_storage = 'MyStorage' | |
$request = GroupDocsStorageCloud::PutCopyRequest.new($path, $newdest, $versionId, $storage, $dest_storage) | |
$result = @storage_api.put_copy($request) | |
puts $result | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative '..\lib\GroupDocs\Storage\api\storage_api' | |
#TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
@config = GroupDocsStorageCloud::Configuration.new | |
@config.api_key['api_key'] = 'xxxxx' # Put your's api_key and app_sid | |
@config.api_key['app_sid'] = 'xxxxx' | |
@config.host='https://api.groupdocs.cloud' | |
@api_client = GroupDocsStorageCloud::ApiClient.new @config | |
@storage_api = GroupDocsStorageCloud::StorageApi.new @api_client | |
$path = 'Conversions' | |
$newdest = 'Comparisons/folder5' | |
$storage = 'MyStorage' | |
$dest_storage = 'MyStorage' | |
$request = GroupDocsStorageCloud::PutCopyFolderRequest.new($path, $newdest, $storage, $dest_storage) | |
$result = @storage_api.put_copy_folder($request) | |
puts $result | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative '..\lib\GroupDocs\Storage\api\storage_api' | |
#TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
@config = GroupDocsStorageCloud::Configuration.new | |
@config.api_key['api_key'] = 'xxxxx' # Put your's api_key and app_sid | |
@config.api_key['app_sid'] = 'xxxxx' | |
@config.host='https://api.groupdocs.cloud' | |
@api_client = GroupDocsStorageCloud::ApiClient.new @config | |
@storage_api = GroupDocsStorageCloud::StorageApi.new @api_client | |
$path = 'folder1/FileTest.pdf' | |
$versionId = nil | |
$storage = 'MyStorage' | |
$request = GroupDocsStorageCloud::DeleteFileRequest.new($path, $storage, $recursive) | |
$result = @storage_api.delete_file($request) | |
puts $result | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative '..\lib\GroupDocs\Storage\api\storage_api' | |
#TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
@config = GroupDocsStorageCloud::Configuration.new | |
@config.api_key['api_key'] = 'xxxxx' # Put your's api_key and app_sid | |
@config.api_key['app_sid'] = 'xxxxx' | |
@config.host='https://api.groupdocs.cloud' | |
@api_client = GroupDocsStorageCloud::ApiClient.new @config | |
@storage_api = GroupDocsStorageCloud::StorageApi.new @api_client | |
$path = 'folder4' | |
$recursive = true | |
$storage = 'MyStorage' | |
$request = GroupDocsStorageCloud::DeleteFolderRequest.new($path, $storage, $recursive) | |
$result = @storage_api.delete_folder($request) | |
puts $result | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative '..\lib\GroupDocs\Storage\api\storage_api' | |
#TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
@config = GroupDocsStorageCloud::Configuration.new | |
@config.api_key['api_key'] = 'xxx-xx' # Put your's api_key and app_sid | |
@config.api_key['app_sid'] = 'xxxxx' | |
@config.host='https://api.groupdocs.cloud' | |
@api_client = GroupDocsStorageCloud::ApiClient.new @config | |
@storage_api = GroupDocsStorageCloud::StorageApi.new @api_client | |
$src = 'Comparisons/output.docx' | |
$dest = 'conversions/output.docx' | |
$versionId = nil | |
$storage = 'MyStorage' | |
$destStorage = 'MyStorage' | |
$request = GroupDocsStorageCloud::PostMoveFileRequest.new($src, $dest, $versionId, $storage, $destStorage) | |
$result = @storage_api.post_move_file($request) | |
puts $result | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative '..\lib\GroupDocs\Storage\api\storage_api' | |
#TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
@config = GroupDocsStorageCloud::Configuration.new | |
@config.api_key['api_key'] = 'xxxxx' # Put your's api_key and app_sid | |
@config.api_key['app_sid'] = 'xxxxx' | |
@config.host='https://api.groupdocs.cloud' | |
@api_client = GroupDocsStorageCloud::ApiClient.new @config | |
@storage_api = GroupDocsStorageCloud::StorageApi.new @api_client | |
$path = 'Conversions' | |
$newdest = 'Comparisons/output' | |
$storage = 'MyStorage' | |
$dest_storage = 'MyStorage' | |
$request = GroupDocsStorageCloud::PostMoveFolderRequest.new($path, $newdest, $storage, $dest_storage) | |
$result = @storage_api.post_move_folder($request) | |
puts $result | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# APIs | |
require_relative '..\lib\GroupDocs\Storage\api\storage_api' | |
#TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
@config = GroupDocsStorageCloud::Configuration.new | |
@config.api_key['api_key'] = 'xxx-xx' # Put your's api_key and app_sid | |
@config.api_key['app_sid'] = 'xxxx' | |
@config.host='https://api.groupdocs.cloud' | |
@api_client = GroupDocsStorageCloud::ApiClient.new @config | |
@storage_api = GroupDocsStorageCloud::StorageApi.new @api_client | |
$path = 'comparisons/source.docx' | |
$versionId = nil | |
$storage = 'MyStorage' | |
$request = GroupDocsStorageCloud::GetDownloadRequest.new($path, $versionId, $storage) | |
$result = @storage_api.get_download($request) | |
$file = $result | |
$path = 'rizwanresult.docx' | |
$versionId = nil | |
$storage = 'MyStorage' | |
$request = GroupDocsStorageCloud::PutCreateRequest.new($file, $path, $versionId, $storage) | |
$result = @storage_api.put_create($request) | |
puts $result | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# APIs | |
require_relative '..\lib\GroupDocs\Storage\api\storage_api' | |
#TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
@config = GroupDocsStorageCloud::Configuration.new | |
@config.api_key['api_key'] = 'xxx-xx' # Put your's api_key and app_sid | |
@config.api_key['app_sid'] = 'xxxx' | |
@config.host='https://api.groupdocs.cloud' | |
@api_client = GroupDocsStorageCloud::ApiClient.new @config | |
@storage_api = GroupDocsStorageCloud::StorageApi.new @api_client | |
$path = 'comparisons/source.docx' | |
$versionId = nil | |
$storage = 'MyStorage' | |
$request = GroupDocsStorageCloud::GetDownloadRequest.new($path, $versionId, $storage) | |
$result = @storage_api.get_download($request) | |
$file = $result | |
$path = 'rizwanresult.docx' | |
$versionId = nil | |
$storage = 'RizwanStorage' | |
$request = GroupDocsStorageCloud::PutCreateRequest.new($file, $path, $versionId, $storage) | |
$result = @storage_api.put_create($request) | |
puts $result | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative '..\lib\GroupDocs\Storage\api\storage_api' | |
#TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
@config = GroupDocsStorageCloud::Configuration.new | |
@config.api_key['api_key'] = 'xxx-xx' # Put your's api_key and app_sid | |
@config.api_key['app_sid'] = 'xxxxx' | |
@config.host='https://api.groupdocs.cloud' | |
@api_client = GroupDocsStorageCloud::ApiClient.new @config | |
@storage_api = GroupDocsStorageCloud::StorageApi.new @api_client | |
$path = 'comparisons23' | |
$storage = 'MyStorage' | |
$request = GroupDocsStorageCloud::PutCreateFolderRequest.new($path, $storage) | |
$result = @storage_api.put_create_folder($request) | |
puts $result | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# APIs | |
require_relative '..\lib\GroupDocs\Storage\api\storage_api' | |
#TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
@config = GroupDocsStorageCloud::Configuration.new | |
@config.api_key['api_key'] = 'xxx-xx' # Put your's api_key and app_sid | |
@config.api_key['app_sid'] = 'xxxx' | |
@config.host='https://api.groupdocs.cloud' | |
@api_client = GroupDocsStorageCloud::ApiClient.new @config | |
@storage_api = GroupDocsStorageCloud::StorageApi.new @api_client | |
$path = 'comparisons/result.docx' | |
$versionId = nil | |
$storage = 'MyStorage' | |
$request = GroupDocsStorageCloud::GetDownloadRequest.new($path, $versionId, $storage) | |
$result = @storage_api.get_download($request) | |
puts $result | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment