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.
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 |
# File 'lib/zendesk_api/actions.rb', line 317 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 |