Skip to content

Commit a387e78

Browse files
committed
add delete custom metadata field method
1 parent 59376d9 commit a387e78

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

lib/imagekitio/client.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ def update_custom_metadata_fields(id, label, schema)
160160
@file.update_custom_metadata(id, label, schema)
161161
end
162162

163+
def delete_custom_metadata_fields(id)
164+
@file.delete_custom_metadata(id)
165+
end
166+
163167
def phash_distance(first, second)
164168
# Get hamming distance between two phash(image hash) to check
165169
# similarity between images

lib/imagekitio/file.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@ def update_custom_metadata(id, label, schema)
238238
@req_obj.request('patch', url, @req_obj.create_headers, payload)
239239
end
240240

241+
def delete_custom_metadata(id)
242+
url = "#{constants.API_BASE_URL}/customMetadataFields/#{id}"
243+
@req_obj.request('delete', url, @req_obj.create_headers)
244+
end
245+
241246
def validate_upload_options(options)
242247

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

0 commit comments

Comments
 (0)