Skip to content

Commit 5790e2c

Browse files
committed
add get custom metadata field method
1 parent 7a9f01b commit 5790e2c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/imagekitio/client.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@ def bulk_job_status(job_id)
149149
end
150150

151151
def create_custom_metadata_fields(name, label, schema)
152-
@file.create_custom_metadata_fields(name, label, schema)
152+
@file.create_custom_metadata(name, label, schema)
153+
end
154+
155+
def get_custom_metadata(options = {})
156+
@file.get_custom_metadata(options)
153157
end
154158

155159
def phash_distance(first, second)

lib/imagekitio/file.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,12 @@ def create_custom_metadata(name, label, schema)
226226
@req_obj.request('post', url, @req_obj.create_headers, payload)
227227
end
228228

229+
def get_custom_metadata(options)
230+
url = "#{constants.API_BASE_URL}/customMetadataFields"
231+
payload = request_formatter(options)
232+
@req_obj.request('get', url, @req_obj.create_headers, payload)
233+
end
234+
229235
def validate_upload_options(options)
230236

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

0 commit comments

Comments
 (0)