Class: GroupDocsEditorCloud::StorageApi
- Inherits:
-
Object
- Object
- GroupDocsEditorCloud::StorageApi
- Defined in:
- lib/groupdocs_editor_cloud/api/storage_api.rb
Overview
GroupDocs.Editor Cloud API
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
Class Method Summary collapse
-
.from_config(config) ⇒ StorageApi
Initializes new instance of StorageApi.
-
.from_keys(app_sid, app_key) ⇒ StorageApi
Initializes new instance of StorageApi.
Instance Method Summary collapse
-
#get_disc_usage(request) ⇒ DiscUsage
Get disc usage.
-
#get_disc_usage_with_http_info(request) ⇒ Array<(DiscUsage, Fixnum, Hash)>
Get disc usage.
-
#get_file_versions(request) ⇒ FileVersions
Get file versions.
-
#get_file_versions_with_http_info(request) ⇒ Array<(FileVersions, Fixnum, Hash)>
Get file versions.
-
#initialize(config) ⇒ StorageApi
constructor
Initializes new instance of StorageApi.
-
#object_exists(request) ⇒ ObjectExist
Check if file or folder exists.
-
#object_exists_with_http_info(request) ⇒ Array<(ObjectExist, Fixnum, Hash)>
Check if file or folder exists.
-
#storage_exists(request) ⇒ StorageExist
Check if storage exists.
-
#storage_exists_with_http_info(request) ⇒ Array<(StorageExist, Fixnum, Hash)>
Check if storage exists.
Constructor Details
#initialize(config) ⇒ StorageApi
Initializes new instance of StorageApi
43 44 45 46 47 |
# File 'lib/groupdocs_editor_cloud/api/storage_api.rb', line 43 def initialize(config) @config = config @api_client = ApiClient.new(config) @access_token = nil end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
34 35 36 |
# File 'lib/groupdocs_editor_cloud/api/storage_api.rb', line 34 def config @config end |
Class Method Details
.from_config(config) ⇒ StorageApi
Initializes new instance of StorageApi
63 64 65 |
# File 'lib/groupdocs_editor_cloud/api/storage_api.rb', line 63 def self.from_config(config) return new(config) end |
.from_keys(app_sid, app_key) ⇒ StorageApi
Initializes new instance of StorageApi
54 55 56 57 |
# File 'lib/groupdocs_editor_cloud/api/storage_api.rb', line 54 def self.from_keys(app_sid, app_key) config = Configuration.new(app_sid, app_key) return new(config) end |
Instance Method Details
#get_disc_usage(request) ⇒ DiscUsage
Get disc usage
71 72 73 74 |
# File 'lib/groupdocs_editor_cloud/api/storage_api.rb', line 71 def get_disc_usage(request) data, _status_code, _headers = get_disc_usage_with_http_info(request) data end |
#get_disc_usage_with_http_info(request) ⇒ Array<(DiscUsage, Fixnum, Hash)>
Get disc usage
DiscUsage data, response status code and response headers
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/groupdocs_editor_cloud/api/storage_api.rb', line 81 def get_disc_usage_with_http_info(request) raise ArgumentError, 'Incorrect request type' unless request.is_a? GetDiscUsageRequest @api_client.config.logger.debug 'Calling API: StorageApi.get_disc_usage ...' if @api_client.config.debugging # resource path local_var_path = '/editor/storage/disc' # query parameters query_params = {} if local_var_path.include? ('{' + downcase_first_letter('storageName') + '}') local_var_path = local_var_path.sub('{' + downcase_first_letter('storageName') + '}', request.storage_name.to_s) else query_params[downcase_first_letter('storageName')] = request.storage_name unless request.storage_name.nil? end # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil data, status_code, headers = @api_client.call_api(:GET, local_var_path, header_params: header_params, query_params: query_params, form_params: form_params, body: post_body, access_token: get_access_token, return_type: 'DiscUsage') if @api_client.config.debugging @api_client.config.logger.debug "API called: StorageApi#get_disc_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end |
#get_file_versions(request) ⇒ FileVersions
Get file versions
126 127 128 129 |
# File 'lib/groupdocs_editor_cloud/api/storage_api.rb', line 126 def get_file_versions(request) data, _status_code, _headers = get_file_versions_with_http_info(request) data end |
#get_file_versions_with_http_info(request) ⇒ Array<(FileVersions, Fixnum, Hash)>
Get file versions
FileVersions data, response status code and response headers
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/groupdocs_editor_cloud/api/storage_api.rb', line 136 def get_file_versions_with_http_info(request) raise ArgumentError, 'Incorrect request type' unless request.is_a? GetFileVersionsRequest @api_client.config.logger.debug 'Calling API: StorageApi.get_file_versions ...' if @api_client.config.debugging # verify the required parameter 'path' is set raise ArgumentError, 'Missing the required parameter path when calling StorageApi.get_file_versions' if @api_client.config.client_side_validation && request.path.nil? # resource path local_var_path = '/editor/storage/version/{path}' local_var_path = local_var_path.sub('{' + downcase_first_letter('path') + '}', request.path.to_s) # query parameters query_params = {} if local_var_path.include? ('{' + downcase_first_letter('storageName') + '}') local_var_path = local_var_path.sub('{' + downcase_first_letter('storageName') + '}', request.storage_name.to_s) else query_params[downcase_first_letter('storageName')] = request.storage_name unless request.storage_name.nil? end # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil data, status_code, headers = @api_client.call_api(:GET, local_var_path, header_params: header_params, query_params: query_params, form_params: form_params, body: post_body, access_token: get_access_token, return_type: 'FileVersions') if @api_client.config.debugging @api_client.config.logger.debug "API called: StorageApi#get_file_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end |
#object_exists(request) ⇒ ObjectExist
Check if file or folder exists
184 185 186 187 |
# File 'lib/groupdocs_editor_cloud/api/storage_api.rb', line 184 def object_exists(request) data, _status_code, _headers = object_exists_with_http_info(request) data end |
#object_exists_with_http_info(request) ⇒ Array<(ObjectExist, Fixnum, Hash)>
Check if file or folder exists
ObjectExist data, response status code and response headers
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
# File 'lib/groupdocs_editor_cloud/api/storage_api.rb', line 194 def object_exists_with_http_info(request) raise ArgumentError, 'Incorrect request type' unless request.is_a? ObjectExistsRequest @api_client.config.logger.debug 'Calling API: StorageApi.object_exists ...' if @api_client.config.debugging # verify the required parameter 'path' is set raise ArgumentError, 'Missing the required parameter path when calling StorageApi.object_exists' if @api_client.config.client_side_validation && request.path.nil? # resource path local_var_path = '/editor/storage/exist/{path}' local_var_path = local_var_path.sub('{' + downcase_first_letter('path') + '}', request.path.to_s) # query parameters query_params = {} if local_var_path.include? ('{' + downcase_first_letter('storageName') + '}') local_var_path = local_var_path.sub('{' + downcase_first_letter('storageName') + '}', request.storage_name.to_s) else query_params[downcase_first_letter('storageName')] = request.storage_name unless request.storage_name.nil? end if local_var_path.include? ('{' + downcase_first_letter('versionId') + '}') local_var_path = local_var_path.sub('{' + downcase_first_letter('versionId') + '}', request.version_id.to_s) else query_params[downcase_first_letter('versionId')] = request.version_id unless request.version_id.nil? end # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil data, status_code, headers = @api_client.call_api(:GET, local_var_path, header_params: header_params, query_params: query_params, form_params: form_params, body: post_body, access_token: get_access_token, return_type: 'ObjectExist') if @api_client.config.debugging @api_client.config.logger.debug "API called: StorageApi#object_exists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end |
#storage_exists(request) ⇒ StorageExist
Check if storage exists
247 248 249 250 |
# File 'lib/groupdocs_editor_cloud/api/storage_api.rb', line 247 def storage_exists(request) data, _status_code, _headers = storage_exists_with_http_info(request) data end |
#storage_exists_with_http_info(request) ⇒ Array<(StorageExist, Fixnum, Hash)>
Check if storage exists
StorageExist data, response status code and response headers
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
# File 'lib/groupdocs_editor_cloud/api/storage_api.rb', line 257 def storage_exists_with_http_info(request) raise ArgumentError, 'Incorrect request type' unless request.is_a? StorageExistsRequest @api_client.config.logger.debug 'Calling API: StorageApi.storage_exists ...' if @api_client.config.debugging # verify the required parameter 'storage_name' is set raise ArgumentError, 'Missing the required parameter storage_name when calling StorageApi.storage_exists' if @api_client.config.client_side_validation && request.storage_name.nil? # resource path local_var_path = '/editor/storage/{storageName}/exist' local_var_path = local_var_path.sub('{' + downcase_first_letter('storageName') + '}', request.storage_name.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil data, status_code, headers = @api_client.call_api(:GET, local_var_path, header_params: header_params, query_params: query_params, form_params: form_params, body: post_body, access_token: get_access_token, return_type: 'StorageExist') if @api_client.config.debugging @api_client.config.logger.debug "API called: StorageApi#storage_exists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end |