dor-services-client 15.29.0 → 15.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +3 -0
- data/lib/dor/services/client/object.rb +11 -0
- data/lib/dor/services/client/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bcc0e43718d388d9c03d17a6838017f61e601fb52009a12f00bdc98c08f2bec6
|
|
4
|
+
data.tar.gz: 0c794f62685e9a8eab1d57d2974582304f1e65c679e58b000f16a018a9c611d7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c2ffd5f8701aab5f1ff1d9b89af477552605eb6299457643bd21b324432e2a975457227bfbc28b3a526ee13c949bf7b88e55037282aca8408d34eae61ce2efbd
|
|
7
|
+
data.tar.gz: 463c4f4c914cd046325b98654426682d3d8b07a119c8f6afde7cdf1068a152ac264417f10d393e1c2fef62f5b45234e4bdceb9f097acc7f11637f3972d816a62
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -127,6 +127,9 @@ object_client.find
|
|
|
127
127
|
# Returns "lite" Cocina metadata (excluding specified attributes)
|
|
128
128
|
object_client.find_lite(structural: false, geographic: false)
|
|
129
129
|
|
|
130
|
+
# Return the lock (ETag) for the object
|
|
131
|
+
object_client.lock
|
|
132
|
+
|
|
130
133
|
# Query for an object's collections
|
|
131
134
|
object_client.collections
|
|
132
135
|
|
|
@@ -80,6 +80,17 @@ module Dor
|
|
|
80
80
|
build_cocina_from_response(JSON.parse(resp.body), headers: resp.headers, validate: validate)
|
|
81
81
|
end
|
|
82
82
|
|
|
83
|
+
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
|
84
|
+
# @raise [UnexpectedResponse] when the response is not successful.
|
|
85
|
+
# @return [String] the ETag value for the object
|
|
86
|
+
def lock
|
|
87
|
+
resp = connection.head do |req|
|
|
88
|
+
req.url object_path
|
|
89
|
+
end
|
|
90
|
+
raise_exception_based_on_response!(resp) unless resp.success?
|
|
91
|
+
resp.headers['ETag']
|
|
92
|
+
end
|
|
93
|
+
|
|
83
94
|
BASE_ALLOWED_FIELDS = %i[external_identifier cocina_version label version administrative description].freeze
|
|
84
95
|
DRO_ALLOWED_FIELDS = BASE_ALLOWED_FIELDS + %i[content_type access identification structural geographic]
|
|
85
96
|
|