dor-services-client 14.8.0 → 14.9.0

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: 3798160cbee5f498c2dcf18ce6304974ad6f93c32a4eee9bd41273d59e902b62
4
- data.tar.gz: 3905de84edd954d62a9a14b5fb519551324f08ce45386e6546f424d4f03acb97
3
+ metadata.gz: 5843a507e487e1da137d521f9248440a4c8680a6fdbdcfcd8791a17788aeac3d
4
+ data.tar.gz: ca2900a871814c6e9f3921dc319505e0edde39f6fe28ac437ff8e967d229fa06
5
5
  SHA512:
6
- metadata.gz: d7e7053d66ead2fda66a24bfbde91391beedf301dbf7f93e9c5e68898a73658cf8b2739d85cfcea977d2e1228bfe7f804f39cad877587eb95fe73e159aeb62c5
7
- data.tar.gz: d0fd6b0504df2de67b082cd1b8dfa5b4c282210b14ad8c6d613a34287b0f0df517228c04aac81acb69e4bb5b18ce649f1727216db7a847b261e4f533b8d3ee39
6
+ metadata.gz: 1e663d3d99e82b8b5775d7a1f99bf0db9a4e2f5cb9684d4207c79d2181450e14ad8237dad041e21731aa0785512e0877dc6c358268fcfec2b925d9f6f4d1e225
7
+ data.tar.gz: 3faa6fc0dff1ad7297d4b73075cad8deb23858fdce1cba4f0645cb346897d81a448159876314552d4df3688b35054110f0ce4844f063ad66558ea37298349b51
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dor-services-client (14.8.0)
4
+ dor-services-client (14.9.0)
5
5
  activesupport (>= 4.2, < 8)
6
6
  cocina-models (~> 0.96.0)
7
7
  deprecation
@@ -38,6 +38,10 @@ module Dor
38
38
  @version ||= ObjectVersion.new(**parent_params)
39
39
  end
40
40
 
41
+ def user_version
42
+ @user_version ||= UserVersion.new(**parent_params)
43
+ end
44
+
41
45
  def accession(params = {})
42
46
  @accession ||= Accession.new(**parent_params.merge(params))
43
47
  end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dor
4
+ module Services
5
+ class Client
6
+ # API calls that are about user versions
7
+ class UserVersion < VersionedService
8
+ Version = Struct.new(:version, :userVersion, keyword_init: true)
9
+
10
+ # @param object_identifier [String] the pid for the object
11
+ def initialize(connection:, version:, object_identifier:)
12
+ super(connection: connection, version: version)
13
+ @object_identifier = object_identifier
14
+ end
15
+
16
+ # @return [Array] a list of the user versions
17
+ # @raise [UnexpectedResponse] on an unsuccessful response from the server
18
+ def inventory
19
+ resp = connection.get do |req|
20
+ req.url base_path
21
+ end
22
+ raise_exception_based_on_response!(resp, object_identifier) unless resp.success?
23
+
24
+ JSON.parse(resp.body).fetch('user_versions').map { |params| Version.new(**params.symbolize_keys!) }
25
+ end
26
+
27
+ private
28
+
29
+ attr_reader :object_identifier
30
+
31
+ def object_path
32
+ "#{api_version}/objects/#{object_identifier}"
33
+ end
34
+
35
+ def base_path
36
+ "#{object_path}/user_versions"
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '14.8.0'
6
+ VERSION = '14.9.0'
7
7
  end
8
8
  end
9
9
  end
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: 14.8.0
4
+ version: 14.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-05-14 00:00:00.000000000 Z
12
+ date: 2024-05-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -252,6 +252,7 @@ files:
252
252
  - lib/dor/services/client/release_tags.rb
253
253
  - lib/dor/services/client/response_error_formatter.rb
254
254
  - lib/dor/services/client/transfer.rb
255
+ - lib/dor/services/client/user_version.rb
255
256
  - lib/dor/services/client/version.rb
256
257
  - lib/dor/services/client/versioned_service.rb
257
258
  - lib/dor/services/client/virtual_objects.rb
@@ -278,7 +279,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
278
279
  - !ruby/object:Gem::Version
279
280
  version: '0'
280
281
  requirements: []
281
- rubygems_version: 3.5.9
282
+ rubygems_version: 3.4.19
282
283
  signing_key:
283
284
  specification_version: 4
284
285
  summary: A client for dor-services-app