Class: Dor::Services::Client::VirtualObjects
- Inherits:
-
VersionedService
- Object
- VersionedService
- Dor::Services::Client::VirtualObjects
- Defined in:
- lib/dor/services/client/virtual_objects.rb
Overview
API calls around “virtual objects” in DOR
Constant Summary
Constants inherited from VersionedService
Dor::Services::Client::VersionedService::EXCEPTION_CLASS, Dor::Services::Client::VersionedService::JSON_API_MIME_TYPE
Instance Method Summary collapse
-
#create(virtual_objects:) ⇒ String
Create a batch of virtual objects in DOR.
Methods inherited from VersionedService
#async_result, #initialize, #with_querystring
Constructor Details
This class inherits a constructor from Dor::Services::Client::VersionedService
Instance Method Details
#create(virtual_objects:) ⇒ String
Create a batch of virtual objects in DOR
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/dor/services/client/virtual_objects.rb', line 13 def create(virtual_objects:) resp = connection.post do |req| req.url "#{api_version}/virtual_objects" req.headers['Content-Type'] = 'application/json' req.headers['Accept'] = 'application/json' req.body = { virtual_objects: virtual_objects }.to_json end return resp.headers['Location'] if resp.success? raise_exception_based_on_response!(resp) end |