6
7
8
9
10
11
12
13
14
15
|
# File 'lib/vindi/api_operations/update.rb', line 6
def update(id, params = {}, opts = {})
= {}
["Idempotency-Key"] = opts[:idempotency_key] if opts[:idempotency_key]
.merge!(opts[:headers]) if opts[:headers]
response = Client.request(:put, "#{endpoint}/#{id}", params, )
singular_key = endpoint.end_with?("batches") ? endpoint.sub(/es$/, "").to_sym : endpoint.chomp("s").to_sym
resource_attrs = response.key?(singular_key) ? response[singular_key] : response
new(resource_attrs)
end
|