dor-services-client 7.8.0 → 7.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07df0c2ce071a596c4825052e94a429cda7666fcd1d68e0c12c1476f27843123
|
4
|
+
data.tar.gz: 627aa21d6fe0c5b9599682f4bd182f92a3d56266e488c48a1d23f4f140aaac75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a18c81fce2987d56bb558d5ee0ddb74c561ea873e305aa5ce0982b91575c190b5cbb04aaf1dd1f1a2af9f7ff63878040ad7d8e5f535fde5610bbd3ba8b9d02b1
|
7
|
+
data.tar.gz: 252fc0275a91bf1c254936a1b09ca9b49b10d3c1120b3d7d1b2771efd8398aec4ede5fa3d71de6f2c2c384ba3cd21e7b3fffd696e561de34eb37e4c153d6e690
|
@@ -50,8 +50,8 @@ module Dor
|
|
50
50
|
# Retrieves the Cocina model and response metadata
|
51
51
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
52
52
|
# @raise [UnexpectedResponse] when the response is not successful.
|
53
|
-
# @return [Array<Cocina::Models::DRO,Cocina::Models::Collection,Cocina::Models::AdminPolicy,
|
54
|
-
# the first is the model and the second is a
|
53
|
+
# @return [Array<Cocina::Models::DRO,Cocina::Models::Collection,Cocina::Models::AdminPolicy,ObjectMetadata>] a tuple where
|
54
|
+
# the first is the model and the second is a ObjectMetadata object
|
55
55
|
def find_with_metadata
|
56
56
|
resp = connection.get do |req|
|
57
57
|
req.url object_path
|
@@ -61,7 +61,7 @@ module Dor
|
|
61
61
|
model = Cocina::Models.build(JSON.parse(resp.body))
|
62
62
|
|
63
63
|
# Don't use #slice here as Faraday will downcase the keys.
|
64
|
-
metadata =
|
64
|
+
metadata = ObjectMetadata.new(updated_at: resp.headers['Last-Modified'], created_at: resp.headers['X-Created-At'])
|
65
65
|
[model, metadata]
|
66
66
|
end
|
67
67
|
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'deprecation'
|
4
|
+
|
5
|
+
module Dor
|
6
|
+
module Services
|
7
|
+
class Client
|
8
|
+
# An object representing metadata about the cocina object returned by the object show method
|
9
|
+
class ObjectMetadata
|
10
|
+
extend Deprecation
|
11
|
+
|
12
|
+
attr_reader :created_at, :updated_at
|
13
|
+
|
14
|
+
def initialize(created_at:, updated_at:)
|
15
|
+
@created_at = created_at
|
16
|
+
@updated_at = updated_at
|
17
|
+
end
|
18
|
+
|
19
|
+
def [](key)
|
20
|
+
case key
|
21
|
+
when 'Last-Modified'
|
22
|
+
updated_at
|
23
|
+
when 'X-Created-At'
|
24
|
+
created_at
|
25
|
+
else
|
26
|
+
raise KeyError, 'Unknown key'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
deprecation_deprecate(:[] => 'Hash accessor is no longer used, use object accessor instead')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
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: 7.
|
4
|
+
version: 7.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: 2022-01-
|
12
|
+
date: 2022-01-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -241,6 +241,7 @@ files:
|
|
241
241
|
- lib/dor/services/client/metadata.rb
|
242
242
|
- lib/dor/services/client/mutate.rb
|
243
243
|
- lib/dor/services/client/object.rb
|
244
|
+
- lib/dor/services/client/object_metadata.rb
|
244
245
|
- lib/dor/services/client/object_version.rb
|
245
246
|
- lib/dor/services/client/objects.rb
|
246
247
|
- lib/dor/services/client/response_error_formatter.rb
|
@@ -271,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
271
272
|
- !ruby/object:Gem::Version
|
272
273
|
version: '0'
|
273
274
|
requirements: []
|
274
|
-
rubygems_version: 3.
|
275
|
+
rubygems_version: 3.2.32
|
275
276
|
signing_key:
|
276
277
|
specification_version: 4
|
277
278
|
summary: A client for dor-services-app
|