Skip to content

Commit 0e21f3c

Browse files
committed
add move folder method
1 parent 837b7fe commit 0e21f3c

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lib/imagekitio/client.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ def copy_folder(source_folder_path, destination_path)
140140
@file.copy_folder(source_folder_path, destination_path)
141141
end
142142

143+
def move_folder(source_folder_path, destination_path)
144+
@file.move_folder(source_folder_path, destination_path)
145+
end
146+
143147
def phash_distance(first, second)
144148
# Get hamming distance between two phash(image hash) to check
145149
# similarity between images

lib/imagekitio/file.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,15 @@ def copy_folder(source_folder_path, destination_path)
196196
@req_obj.request('post', url, @req_obj.create_headers, payload)
197197
end
198198

199+
def move_folder(source_folder_path, destination_path)
200+
if source_folder_path == '' || source_folder_path.nil? || destination_path == '' || destination_path.nil?
201+
raise ArgumentError, 'parameters required'
202+
end
203+
url = "#{constants.BULK_BASE_URL}/moveFolderr"
204+
payload = { 'sourceFolderPath': source_folder_path, 'destinationPath': destination_path }
205+
@req_obj.request('post', url, @req_obj.create_headers, payload)
206+
end
207+
199208
def validate_upload_options(options)
200209

201210
# Validates upload value, checks if params are valid,

0 commit comments

Comments
 (0)