Method: Cloudinary::Api.update
- Defined in:
- lib/cloudinary/api.rb
.update(public_id, options = {}) ⇒ Cloudinary::Api::Response
Updates details of an existing asset.
Update one or more of the attributes associated with a specified asset. Note that you can also update most attributes of an existing asset using the Uploader::explicit method, which is not rate limited.
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 |
# File 'lib/cloudinary/api.rb', line 271 def self.update(public_id, ={}) resource_type = [:resource_type] || "image" type = [:type] || "upload" uri = "resources/#{resource_type}/#{type}/#{public_id}" = { :access_control => Cloudinary::Utils.json_array_param([:access_control]), :asset_folder => [:asset_folder], :auto_tagging => [:auto_tagging] && [:auto_tagging].to_f, :background_removal => [:background_removal], :categorization => [:categorization], :context => Cloudinary::Utils.encode_context([:context]), :custom_coordinates => Cloudinary::Utils.encode_double_array([:custom_coordinates]), :detection => [:detection], :display_name => [:display_name], :face_coordinates => Cloudinary::Utils.encode_double_array([:face_coordinates]), :metadata => Cloudinary::Utils.encode_context([:metadata]), :moderation_status => [:moderation_status], :notification_url => [:notification_url], :quality_override => [:quality_override], :ocr => [:ocr], :raw_convert => [:raw_convert], :similarity_search => [:similarity_search], :tags => [:tags] && Cloudinary::Utils.build_array([:tags]).join(","), :clear_invalid => Cloudinary::Utils.as_safe_bool([:clear_invalid]), :unique_display_name=> [:unique_display_name] } call_api(:post, uri, , ) end |