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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/dor/services/client/object.rb +4 -0
- data/lib/dor/services/client/user_version.rb +41 -0
- data/lib/dor/services/client/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5843a507e487e1da137d521f9248440a4c8680a6fdbdcfcd8791a17788aeac3d
|
4
|
+
data.tar.gz: ca2900a871814c6e9f3921dc319505e0edde39f6fe28ac437ff8e967d229fa06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e663d3d99e82b8b5775d7a1f99bf0db9a4e2f5cb9684d4207c79d2181450e14ad8237dad041e21731aa0785512e0877dc6c358268fcfec2b925d9f6f4d1e225
|
7
|
+
data.tar.gz: 3faa6fc0dff1ad7297d4b73075cad8deb23858fdce1cba4f0645cb346897d81a448159876314552d4df3688b35054110f0ce4844f063ad66558ea37298349b51
|
data/Gemfile.lock
CHANGED
@@ -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
|
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.
|
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-
|
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.
|
282
|
+
rubygems_version: 3.4.19
|
282
283
|
signing_key:
|
283
284
|
specification_version: 4
|
284
285
|
summary: A client for dor-services-app
|