dor-services-client 2.6.0 → 2.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb4e61bec082f3dec6a95359d667af8a162c7e3f8d6bd5c5a27fe1350ffb8cb0
4
- data.tar.gz: dda521e88bbf4d133309efe559bf9e66677edcd047e7bb3416a8e13d0b234e8f
3
+ metadata.gz: 837d0e816cb1df5799613665815a452803f643fb780852ac99e097317167e32a
4
+ data.tar.gz: 9319c72918f4f03a9a8d5617734741ec2f1ed03124fd3b8149b23433ceae995b
5
5
  SHA512:
6
- metadata.gz: 9566af655ae58b4617e810afb0b324135a310b8d67371753c325852b7df514b2975979de1422f06d2d4380065719490a65253e67bbf2e589450ac1e9a0145689
7
- data.tar.gz: 2a36b54ecc637e677ac84ba33ff68852392c23aefe2bc23551c9672ec322dcf71d8ffa7a7ea3d46454abfc03aeb6693db6c29a3ad0b7b6aad8ce8af546b71854
6
+ metadata.gz: f02480568fa21b7d716f047bbbbff0043ea03e6368e4c28ab8ef1d8f7365e5a098f1d6448c84ef30463c22488e5749ac0d0e4968ac63882ae40769d6fa469250
7
+ data.tar.gz: cbf5807c4ae86c1ddf752707a975466c7f4b91a72e4310ca9353435dc4a04d9059a80a443876258b560b24fdcd12833c04c3bafc28d84ed58ec9a3a4289ead47
data/README.md CHANGED
@@ -58,8 +58,11 @@ objects_client = Dor::Services::Client.objects
58
58
  # For registering a non-existent object
59
59
  objects_client.register(params: {})
60
60
 
61
+ # For interacting with virtual objects
62
+ virtual_objects_client = Dor::Services::Client.virtual_objects
63
+
61
64
  # Create a batch of virtual objects
62
- objects_client.create_virtual_objects(parent_druid: '', child_druids: [''])
65
+ virtual_objects_client.create(virtual_objects: [{ parent_id: '', child_ids: [''] }])
63
66
 
64
67
  # For performing operations on a known, registered object
65
68
  object_client = Dor::Services::Client.object(object_identifier)
@@ -66,6 +66,11 @@ module Dor
66
66
  @objects ||= Objects.new(connection: connection, version: DEFAULT_VERSION)
67
67
  end
68
68
 
69
+ # @return [Dor::Services::Client::VirtualObjects] an instance of the `Client::VirtualObjects` class
70
+ def virtual_objects
71
+ @virtual_objects ||= VirtualObjects.new(connection: connection, version: DEFAULT_VERSION)
72
+ end
73
+
69
74
  class << self
70
75
  # @param [String] url
71
76
  # @param [String] token a bearer token for HTTP auth
@@ -82,7 +87,7 @@ module Dor
82
87
  self
83
88
  end
84
89
 
85
- delegate :objects, :object, to: :instance
90
+ delegate :objects, :object, :virtual_objects, to: :instance
86
91
  end
87
92
 
88
93
  attr_writer :url, :token, :token_header, :connection
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '2.6.0'
6
+ VERSION = '2.6.1'
7
7
  end
8
8
  end
9
9
  end
@@ -6,16 +6,16 @@ module Dor
6
6
  # API calls around "virtual objects" in DOR
7
7
  class VirtualObjects < VersionedService
8
8
  # Create a batch of virtual objects in DOR
9
- # @param params [Hash] required hash params (see dor-services-app)
9
+ # @param virtual_objects [Array] required array of virtual object params (see dor-services-app)
10
10
  # @raise [NotFoundResponse] when the response is a 404 (object not found)
11
11
  # @raise [UnexpectedResponse] on an unsuccessful response from the server
12
12
  # @return [NilClass] nil if no errors
13
- def create(params:)
13
+ def create(virtual_objects:)
14
14
  resp = connection.post do |req|
15
15
  req.url "#{api_version}/virtual_objects"
16
16
  req.headers['Content-Type'] = 'application/json'
17
17
  req.headers['Accept'] = 'application/json'
18
- req.body = params.to_json
18
+ req.body = { virtual_objects: virtual_objects }.to_json
19
19
  end
20
20
  return if resp.success?
21
21
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dor-services-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne