Class: GroupDocsConversionCloud::FolderApi

Inherits:
Object
  • Object
show all
Defined in:
lib/groupdocs_conversion_cloud/api/folder_api.rb

Overview

GroupDocs.Conversion Cloud API

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ FolderApi

Initializes new instance of FolderApi

Parameters:



43
44
45
46
47
# File 'lib/groupdocs_conversion_cloud/api/folder_api.rb', line 43

def initialize(config)
  @config = config
  @api_client = ApiClient.new(config)
  @access_token = nil
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



34
35
36
# File 'lib/groupdocs_conversion_cloud/api/folder_api.rb', line 34

def config
  @config
end

Class Method Details

.from_config(config) ⇒ FolderApi

Initializes new instance of FolderApi

Parameters:

Returns:



63
64
65
# File 'lib/groupdocs_conversion_cloud/api/folder_api.rb', line 63

def self.from_config(config)
  return new(config)
end

.from_keys(app_sid, app_key) ⇒ FolderApi

Initializes new instance of FolderApi

Parameters:

  • Application (app_sid)

    identifier (App SID)

  • Application (app_key)

    private key (App Key)

Returns:



54
55
56
57
# File 'lib/groupdocs_conversion_cloud/api/folder_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

#copy_folder(request) ⇒ nil

Copy folder

Parameters:

  • request

    copy_folder_request

Returns:

  • (nil)


71
72
73
74
# File 'lib/groupdocs_conversion_cloud/api/folder_api.rb', line 71

def copy_folder(request)
  copy_folder_with_http_info(request)
  nil
end

#copy_folder_with_http_info(request) ⇒ Array<(nil, Fixnum, Hash)>

Copy folder

nil, response status code and response headers

Parameters:

  • request

    copy_folder_request

Returns:

  • (Array<(nil, Fixnum, Hash)>)

Raises:

  • (ArgumentError)


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
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/groupdocs_conversion_cloud/api/folder_api.rb', line 81

def copy_folder_with_http_info(request)
  raise ArgumentError, 'Incorrect request type' unless request.is_a? CopyFolderRequest

  @api_client.config.logger.debug 'Calling API: FolderApi.copy_folder ...' if @api_client.config.debugging
  # verify the required parameter 'src_path' is set
  raise ArgumentError, 'Missing the required parameter src_path when calling FolderApi.copy_folder' if @api_client.config.client_side_validation && request.src_path.nil?
  # verify the required parameter 'dest_path' is set
  raise ArgumentError, 'Missing the required parameter dest_path when calling FolderApi.copy_folder' if @api_client.config.client_side_validation && request.dest_path.nil?
  # resource path
  local_var_path = '/conversion/storage/folder/copy/{srcPath}'
  local_var_path = local_var_path.sub('{' + downcase_first_letter('srcPath') + '}', request.src_path.to_s)

  # query parameters
  query_params = {}
  query_params[downcase_first_letter('destPath')] = request.dest_path

  if local_var_path.include? ('{' + downcase_first_letter('srcStorageName') + '}')
    local_var_path = local_var_path.sub('{' + downcase_first_letter('srcStorageName') + '}', request.src_storage_name.to_s)
  else
    query_params[downcase_first_letter('srcStorageName')] = request.src_storage_name unless request.src_storage_name.nil?
  end
  if local_var_path.include? ('{' + downcase_first_letter('destStorageName') + '}')
    local_var_path = local_var_path.sub('{' + downcase_first_letter('destStorageName') + '}', request.dest_storage_name.to_s)
  else
    query_params[downcase_first_letter('destStorageName')] = request.dest_storage_name unless request.dest_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(:PUT, local_var_path,
                                                    header_params: header_params,
                                                    query_params: query_params,
                                                    form_params: form_params,
                                                    body: post_body,
                                                    access_token: get_access_token)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called:
    FolderApi#copy_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#create_folder(request) ⇒ nil

Create the folder

Parameters:

  • request

    create_folder_request

Returns:

  • (nil)


137
138
139
140
# File 'lib/groupdocs_conversion_cloud/api/folder_api.rb', line 137

def create_folder(request)
  create_folder_with_http_info(request)
  nil
end

#create_folder_with_http_info(request) ⇒ Array<(nil, Fixnum, Hash)>

Create the folder

nil, response status code and response headers

Parameters:

  • request

    create_folder_request

Returns:

  • (Array<(nil, Fixnum, Hash)>)

Raises:

  • (ArgumentError)


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
179
180
181
182
183
184
185
186
187
188
# File 'lib/groupdocs_conversion_cloud/api/folder_api.rb', line 147

def create_folder_with_http_info(request)
  raise ArgumentError, 'Incorrect request type' unless request.is_a? CreateFolderRequest

  @api_client.config.logger.debug 'Calling API: FolderApi.create_folder ...' if @api_client.config.debugging
  # verify the required parameter 'path' is set
  raise ArgumentError, 'Missing the required parameter path when calling FolderApi.create_folder' if @api_client.config.client_side_validation && request.path.nil?
  # resource path
  local_var_path = '/conversion/storage/folder/{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(:PUT, local_var_path,
                                                    header_params: header_params,
                                                    query_params: query_params,
                                                    form_params: form_params,
                                                    body: post_body,
                                                    access_token: get_access_token)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called:
    FolderApi#create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#delete_folder(request) ⇒ nil

Delete folder

Parameters:

  • request

    delete_folder_request

Returns:

  • (nil)


194
195
196
197
# File 'lib/groupdocs_conversion_cloud/api/folder_api.rb', line 194

def delete_folder(request)
  delete_folder_with_http_info(request)
  nil
end

#delete_folder_with_http_info(request) ⇒ Array<(nil, Fixnum, Hash)>

Delete folder

nil, response status code and response headers

Parameters:

  • request

    delete_folder_request

Returns:

  • (Array<(nil, Fixnum, Hash)>)

Raises:

  • (ArgumentError)


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
242
243
244
245
246
247
248
249
250
# File 'lib/groupdocs_conversion_cloud/api/folder_api.rb', line 204

def delete_folder_with_http_info(request)
  raise ArgumentError, 'Incorrect request type' unless request.is_a? DeleteFolderRequest

  @api_client.config.logger.debug 'Calling API: FolderApi.delete_folder ...' if @api_client.config.debugging
  # verify the required parameter 'path' is set
  raise ArgumentError, 'Missing the required parameter path when calling FolderApi.delete_folder' if @api_client.config.client_side_validation && request.path.nil?
  # resource path
  local_var_path = '/conversion/storage/folder/{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('recursive') + '}')
    local_var_path = local_var_path.sub('{' + downcase_first_letter('recursive') + '}', request.recursive.to_s)
  else
    query_params[downcase_first_letter('recursive')] = request.recursive unless request.recursive.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(:DELETE, local_var_path,
                                                    header_params: header_params,
                                                    query_params: query_params,
                                                    form_params: form_params,
                                                    body: post_body,
                                                    access_token: get_access_token)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called:
    FolderApi#delete_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#get_files_list(request) ⇒ FilesList

Get all files and folders within a folder

Parameters:

  • request

    get_files_list_request

Returns:



256
257
258
259
# File 'lib/groupdocs_conversion_cloud/api/folder_api.rb', line 256

def get_files_list(request)
  data, _status_code, _headers = get_files_list_with_http_info(request)
  data
end

#get_files_list_with_http_info(request) ⇒ Array<(FilesList, Fixnum, Hash)>

Get all files and folders within a folder

FilesList data, response status code and response headers

Parameters:

  • request

    get_files_list_request

Returns:

Raises:

  • (ArgumentError)


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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# File 'lib/groupdocs_conversion_cloud/api/folder_api.rb', line 266

def get_files_list_with_http_info(request)
  raise ArgumentError, 'Incorrect request type' unless request.is_a? GetFilesListRequest

  @api_client.config.logger.debug 'Calling API: FolderApi.get_files_list ...' if @api_client.config.debugging
  # verify the required parameter 'path' is set
  raise ArgumentError, 'Missing the required parameter path when calling FolderApi.get_files_list' if @api_client.config.client_side_validation && request.path.nil?
  # resource path
  local_var_path = '/conversion/storage/folder/{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: 'FilesList')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called:
    FolderApi#get_files_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#move_folder(request) ⇒ nil

Move folder

Parameters:

  • request

    move_folder_request

Returns:

  • (nil)


314
315
316
317
# File 'lib/groupdocs_conversion_cloud/api/folder_api.rb', line 314

def move_folder(request)
  move_folder_with_http_info(request)
  nil
end

#move_folder_with_http_info(request) ⇒ Array<(nil, Fixnum, Hash)>

Move folder

nil, response status code and response headers

Parameters:

  • request

    move_folder_request

Returns:

  • (Array<(nil, Fixnum, Hash)>)

Raises:

  • (ArgumentError)


324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# File 'lib/groupdocs_conversion_cloud/api/folder_api.rb', line 324

def move_folder_with_http_info(request)
  raise ArgumentError, 'Incorrect request type' unless request.is_a? MoveFolderRequest

  @api_client.config.logger.debug 'Calling API: FolderApi.move_folder ...' if @api_client.config.debugging
  # verify the required parameter 'src_path' is set
  raise ArgumentError, 'Missing the required parameter src_path when calling FolderApi.move_folder' if @api_client.config.client_side_validation && request.src_path.nil?
  # verify the required parameter 'dest_path' is set
  raise ArgumentError, 'Missing the required parameter dest_path when calling FolderApi.move_folder' if @api_client.config.client_side_validation && request.dest_path.nil?
  # resource path
  local_var_path = '/conversion/storage/folder/move/{srcPath}'
  local_var_path = local_var_path.sub('{' + downcase_first_letter('srcPath') + '}', request.src_path.to_s)

  # query parameters
  query_params = {}
  query_params[downcase_first_letter('destPath')] = request.dest_path

  if local_var_path.include? ('{' + downcase_first_letter('srcStorageName') + '}')
    local_var_path = local_var_path.sub('{' + downcase_first_letter('srcStorageName') + '}', request.src_storage_name.to_s)
  else
    query_params[downcase_first_letter('srcStorageName')] = request.src_storage_name unless request.src_storage_name.nil?
  end
  if local_var_path.include? ('{' + downcase_first_letter('destStorageName') + '}')
    local_var_path = local_var_path.sub('{' + downcase_first_letter('destStorageName') + '}', request.dest_storage_name.to_s)
  else
    query_params[downcase_first_letter('destStorageName')] = request.dest_storage_name unless request.dest_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(:PUT, local_var_path,
                                                    header_params: header_params,
                                                    query_params: query_params,
                                                    form_params: form_params,
                                                    body: post_body,
                                                    access_token: get_access_token)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called:
    FolderApi#move_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end