Class: GroupDocsPlatformCloud::FolderApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ FolderApi

Returns a new instance of FolderApi.



19
20
21
# File 'lib/groupdocs_platform_cloud/api/folder_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/groupdocs_platform_cloud/api/folder_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#folder_delete_folder(path, opts = {}) ⇒ RemoveFolderResponse

Remove a specific folder. Parameters: path - folder path e.g. /Folder1, storage - user’s storage name, recursive - is subfolders and files must be deleted for specified path.

Parameters:

  • path
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)
  • :recursive (BOOLEAN) — default: default to false

Returns:



30
31
32
33
# File 'lib/groupdocs_platform_cloud/api/folder_api.rb', line 30

def folder_delete_folder(path, opts = {})
  data, _status_code, _headers = folder_delete_folder_with_http_info(path, opts)
  return data
end

#folder_delete_folder_with_http_info(path, opts = {}) ⇒ Array<(RemoveFolderResponse, Fixnum, Hash)>

Remove a specific folder. Parameters: path - folder path e.g. /Folder1, storage - user&#39;s storage name, recursive - is subfolders and files must be deleted for specified path.

Parameters:

  • path
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)
  • :recursive (BOOLEAN)

Returns:

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

    RemoveFolderResponse data, response status code and response headers



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/groupdocs_platform_cloud/api/folder_api.rb', line 42

def folder_delete_folder_with_http_info(path, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FolderApi.folder_delete_folder ..."
  end
  # verify the required parameter 'path' is set
  if @api_client.config.client_side_validation && path.nil?
    fail ArgumentError, "Missing the required parameter 'path' when calling FolderApi.folder_delete_folder"
  end
  # resource path
  local_var_path = "/storage/folder/{path}".sub('{' + 'path' + '}', path.to_s)

  # query parameters
  query_params = {}
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
  query_params[:'recursive'] = opts[:'recursive'] if !opts[:'recursive'].nil?

  # 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
  auth_names = []
  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,
    :auth_names => auth_names,
    :return_type => 'RemoveFolderResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FolderApi#folder_delete_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#folder_get_list_files(path, opts = {}) ⇒ FolderResponse

Get the file listing of a specific folder. Parametres: path - start with name of storage e.g. root folder ‘/’or some folder ‘/folder1/..’, storage - user’s storage name.

Parameters:

  • path
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)

Returns:



90
91
92
93
# File 'lib/groupdocs_platform_cloud/api/folder_api.rb', line 90

def folder_get_list_files(path, opts = {})
  data, _status_code, _headers = folder_get_list_files_with_http_info(path, opts)
  return data
end

#folder_get_list_files_with_http_info(path, opts = {}) ⇒ Array<(FolderResponse, Fixnum, Hash)>

Get the file listing of a specific folder. Parametres: path - start with name of storage e.g. root folder &#39;/&#39;or some folder &#39;/folder1/..&#39;, storage - user&#39;s storage name.

Parameters:

  • path
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)

Returns:

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

    FolderResponse data, response status code and response headers



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
132
133
134
135
136
137
138
139
140
# File 'lib/groupdocs_platform_cloud/api/folder_api.rb', line 101

def folder_get_list_files_with_http_info(path, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FolderApi.folder_get_list_files ..."
  end
  # verify the required parameter 'path' is set
  if @api_client.config.client_side_validation && path.nil?
    fail ArgumentError, "Missing the required parameter 'path' when calling FolderApi.folder_get_list_files"
  end
  # resource path
  local_var_path = "/storage/folder/{path}".sub('{' + 'path' + '}', path.to_s)

  # query parameters
  query_params = {}
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?

  # 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
  auth_names = []
  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,
    :auth_names => auth_names,
    :return_type => 'FolderResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FolderApi#folder_get_list_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#folder_post_move_folder(path, dest, opts = {}) ⇒ MoveFolderResponse

Move a specific folder. Parameters: path - source folder path e.g. /Folder1, storage - user’s source storage name, dest - destination folder path e.g. /Folder2, destStorage - user’s destination storage name.

Parameters:

  • path
  • dest
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)
  • :dest_storage (String)

Returns:



150
151
152
153
# File 'lib/groupdocs_platform_cloud/api/folder_api.rb', line 150

def folder_post_move_folder(path, dest, opts = {})
  data, _status_code, _headers = folder_post_move_folder_with_http_info(path, dest, opts)
  return data
end

#folder_post_move_folder_with_http_info(path, dest, opts = {}) ⇒ Array<(MoveFolderResponse, Fixnum, Hash)>

Move a specific folder. Parameters: path - source folder path e.g. /Folder1, storage - user&#39;s source storage name, dest - destination folder path e.g. /Folder2, destStorage - user&#39;s destination storage name.

Parameters:

  • path
  • dest
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)
  • :dest_storage (String)

Returns:

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

    MoveFolderResponse data, response status code and response headers



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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/groupdocs_platform_cloud/api/folder_api.rb', line 163

def folder_post_move_folder_with_http_info(path, dest, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FolderApi.folder_post_move_folder ..."
  end
  # verify the required parameter 'path' is set
  if @api_client.config.client_side_validation && path.nil?
    fail ArgumentError, "Missing the required parameter 'path' when calling FolderApi.folder_post_move_folder"
  end
  # verify the required parameter 'dest' is set
  if @api_client.config.client_side_validation && dest.nil?
    fail ArgumentError, "Missing the required parameter 'dest' when calling FolderApi.folder_post_move_folder"
  end
  # resource path
  local_var_path = "/storage/folder/{path}".sub('{' + 'path' + '}', path.to_s)

  # query parameters
  query_params = {}
  query_params[:'dest'] = dest
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
  query_params[:'destStorage'] = opts[:'dest_storage'] if !opts[:'dest_storage'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'MoveFolderResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FolderApi#folder_post_move_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#folder_put_create_folder(path, opts = {}) ⇒ SaaSposeResponse

Create the folder. Parameters: path - source folder path e.g. /Folder1, storage - user’s source storage name, newdest - destination folder path e.g. /Folder2, destStorage - user’s destination storage name.

Parameters:

  • path
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)
  • :dest_storage (String)

Returns:



215
216
217
218
# File 'lib/groupdocs_platform_cloud/api/folder_api.rb', line 215

def folder_put_create_folder(path, opts = {})
  data, _status_code, _headers = folder_put_create_folder_with_http_info(path, opts)
  return data
end

#folder_put_create_folder_with_http_info(path, opts = {}) ⇒ Array<(SaaSposeResponse, Fixnum, Hash)>

Create the folder. Parameters: path - source folder path e.g. /Folder1, storage - user&#39;s source storage name, newdest - destination folder path e.g. /Folder2, destStorage - user&#39;s destination storage name.

Parameters:

  • path
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)
  • :dest_storage (String)

Returns:

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

    SaaSposeResponse data, response status code and response headers



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# File 'lib/groupdocs_platform_cloud/api/folder_api.rb', line 227

def folder_put_create_folder_with_http_info(path, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FolderApi.folder_put_create_folder ..."
  end
  # verify the required parameter 'path' is set
  if @api_client.config.client_side_validation && path.nil?
    fail ArgumentError, "Missing the required parameter 'path' when calling FolderApi.folder_put_create_folder"
  end
  # resource path
  local_var_path = "/storage/folder/{path}".sub('{' + 'path' + '}', path.to_s)

  # query parameters
  query_params = {}
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
  query_params[:'destStorage'] = opts[:'dest_storage'] if !opts[:'dest_storage'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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,
    :auth_names => auth_names,
    :return_type => 'SaaSposeResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FolderApi#folder_put_create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end