Module: ZendeskAPI::UpdateMany
Instance Method Summary collapse
-
#update_many!(client, ids_or_attributes, attributes = {}) ⇒ JobStatus
Updates multiple resources using the update_many endpoint.
Instance Method Details
#update_many!(client, ids_or_attributes, attributes = {}) ⇒ JobStatus
Updates multiple resources using the update_many endpoint.
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
# File 'lib/zendesk_api/actions.rb', line 282 def update_many!(client, ids_or_attributes, attributes = {}) association = attributes.delete(:association) || Association.new(:class => self) response = client.connection.put("#{association.generate_path}/update_many") do |req| if attributes == {} req.body = { resource_name => ids_or_attributes } else req.params = { :ids => ids_or_attributes.join(',') } req.body = { singular_resource_name => attributes } end yield req if block_given? end JobStatus.new_from_response(client, response) end |