dor-services-client 12.14.0 → 12.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +1 -1
- data/.rubocop.yml +92 -3
- data/.rubocop_todo.yml +11 -13
- data/Gemfile.lock +34 -29
- data/README.md +6 -6
- data/lib/dor/services/client/object.rb +12 -4
- data/lib/dor/services/client/version.rb +1 -1
- metadata +3 -4
- data/lib/dor/services/client/metadata.rb +0 -62
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fe87932d48e8a6840dff66151357c8fc8e9c86c0e0265a55bd023f941d070ac
|
4
|
+
data.tar.gz: e9a45ea67d9e74b2078330905fdb880af3520284a45745a71580a312a49d576b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcda85a815b2f7934b925c9e6e90f5afc41f0d14e9c8186112cc2543d67c6505f616d361d05e91ac4639e2e2ce5437e79c09a5677ebaa94376caa08d750ad1a3
|
7
|
+
data.tar.gz: b771139f84a28dfe35094f9ad4105ec2048243d8369eb60935083d6618a31c1f05d76df93dd7f0748f56bba2323a202e092f7dfe7b4ae60e76b0cadbd51b03ae
|
data/.circleci/config.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -133,7 +133,7 @@ RSpec/IdenticalEqualityAssertion: # new in 2.4
|
|
133
133
|
Enabled: true
|
134
134
|
RSpec/SubjectDeclaration: # new in 2.5
|
135
135
|
Enabled: true
|
136
|
-
|
136
|
+
FactoryBot/SyntaxMethods: # new in 2.7
|
137
137
|
Enabled: true
|
138
138
|
RSpec/Rails/AvoidSetupHook: # new in 2.4
|
139
139
|
Enabled: true
|
@@ -177,7 +177,7 @@ Style/MapCompactWithConditionalBlock: # new in 1.30
|
|
177
177
|
Enabled: true
|
178
178
|
RSpec/ChangeByZero: # new in 2.11.0
|
179
179
|
Enabled: true
|
180
|
-
|
180
|
+
Capybara/SpecificMatcher: # new in 2.12
|
181
181
|
Enabled: false
|
182
182
|
RSpec/Rails/HaveHttpStatus: # new in 2.12
|
183
183
|
Enabled: false
|
@@ -186,5 +186,94 @@ RSpec/ClassCheck: # new in 2.13
|
|
186
186
|
Enabled: true
|
187
187
|
RSpec/NoExpectationExample: # new in 2.13
|
188
188
|
Enabled: true
|
189
|
-
|
189
|
+
Capybara/SpecificFinders: # new in 2.13
|
190
|
+
Enabled: true
|
191
|
+
|
192
|
+
Gemspec/DevelopmentDependencies: # new in 1.44
|
193
|
+
Enabled: false
|
194
|
+
Lint/DuplicateMagicComment: # new in 1.37
|
195
|
+
Enabled: true
|
196
|
+
Lint/DuplicateMatchPattern: # new in 1.50
|
197
|
+
Enabled: true
|
198
|
+
Lint/UselessRescue: # new in 1.43
|
199
|
+
Enabled: true
|
200
|
+
Metrics/CollectionLiteralLength: # new in 1.47
|
201
|
+
Enabled: true
|
202
|
+
Style/ArrayIntersect: # new in 1.40
|
203
|
+
Enabled: true
|
204
|
+
Style/ComparableClamp: # new in 1.44
|
205
|
+
Enabled: true
|
206
|
+
Style/ConcatArrayLiterals: # new in 1.41
|
207
|
+
Enabled: true
|
208
|
+
Style/DataInheritance: # new in 1.49
|
209
|
+
Enabled: true
|
210
|
+
Style/DirEmpty: # new in 1.48
|
211
|
+
Enabled: true
|
212
|
+
Style/ExactRegexpMatch: # new in 1.51
|
213
|
+
Enabled: true
|
214
|
+
Style/FileEmpty: # new in 1.48
|
215
|
+
Enabled: true
|
216
|
+
Style/MapToSet: # new in 1.42
|
217
|
+
Enabled: true
|
218
|
+
Style/MinMaxComparison: # new in 1.42
|
219
|
+
Enabled: true
|
220
|
+
Style/OperatorMethodCall: # new in 1.37
|
221
|
+
Enabled: true
|
222
|
+
Style/RedundantArrayConstructor: # new in 1.52
|
223
|
+
Enabled: true
|
224
|
+
Style/RedundantConstantBase: # new in 1.40
|
225
|
+
Enabled: true
|
226
|
+
Style/RedundantDoubleSplatHashBraces: # new in 1.41
|
227
|
+
Enabled: true
|
228
|
+
Style/RedundantEach: # new in 1.38
|
229
|
+
Enabled: true
|
230
|
+
Style/RedundantFilterChain: # new in 1.52
|
231
|
+
Enabled: true
|
232
|
+
Style/RedundantHeredocDelimiterQuotes: # new in 1.45
|
233
|
+
Enabled: true
|
234
|
+
Style/RedundantLineContinuation: # new in 1.49
|
235
|
+
Enabled: true
|
236
|
+
Style/RedundantRegexpConstructor: # new in 1.52
|
237
|
+
Enabled: true
|
238
|
+
Style/RedundantStringEscape: # new in 1.37
|
239
|
+
Enabled: true
|
240
|
+
Capybara/MatchStyle: # new in 2.17
|
241
|
+
Enabled: true
|
242
|
+
Capybara/NegationMatcher: # new in 2.14
|
243
|
+
Enabled: true
|
244
|
+
Capybara/SpecificActions: # new in 2.14
|
245
|
+
Enabled: true
|
246
|
+
FactoryBot/AssociationStyle: # new in 2.23
|
247
|
+
Enabled: true
|
248
|
+
FactoryBot/ConsistentParenthesesStyle: # new in 2.14
|
249
|
+
Enabled: true
|
250
|
+
FactoryBot/FactoryAssociationWithStrategy: # new in 2.23
|
251
|
+
Enabled: true
|
252
|
+
FactoryBot/FactoryNameStyle: # new in 2.16
|
253
|
+
Enabled: true
|
254
|
+
FactoryBot/RedundantFactoryOption: # new in 2.23
|
255
|
+
Enabled: true
|
256
|
+
RSpec/BeEmpty: # new in 2.20
|
257
|
+
Enabled: true
|
258
|
+
RSpec/ContainExactly: # new in 2.19
|
259
|
+
Enabled: true
|
260
|
+
RSpec/DuplicatedMetadata: # new in 2.16
|
261
|
+
Enabled: true
|
262
|
+
RSpec/IndexedLet: # new in 2.20
|
263
|
+
Enabled: true
|
264
|
+
RSpec/MatchArray: # new in 2.19
|
265
|
+
Enabled: true
|
266
|
+
RSpec/PendingWithoutReason: # new in 2.16
|
267
|
+
Enabled: true
|
268
|
+
RSpec/RedundantAround: # new in 2.19
|
269
|
+
Enabled: true
|
270
|
+
RSpec/SkipBlockInsideExample: # new in 2.19
|
271
|
+
Enabled: true
|
272
|
+
RSpec/SortMetadata: # new in 2.14
|
273
|
+
Enabled: true
|
274
|
+
RSpec/Rails/InferredSpecType: # new in 2.14
|
275
|
+
Enabled: true
|
276
|
+
RSpec/Rails/MinitestAssertions: # new in 2.17
|
277
|
+
Enabled: true
|
278
|
+
RSpec/Rails/TravelAround: # new in 2.19
|
190
279
|
Enabled: true
|
data/.rubocop_todo.yml
CHANGED
@@ -1,28 +1,27 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config --auto-gen-only-exclude`
|
3
|
-
# on
|
3
|
+
# on 2023-06-20 05:36:17 UTC using RuboCop version 1.52.1.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count:
|
10
|
-
# Configuration parameters:
|
9
|
+
# Offense count: 1
|
10
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
|
11
11
|
Metrics/AbcSize:
|
12
12
|
Exclude:
|
13
13
|
- 'lib/dor/services/client/marcxml.rb'
|
14
14
|
|
15
15
|
# Offense count: 1
|
16
|
-
# Configuration parameters: CountComments, Max, CountAsOne,
|
16
|
+
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
|
17
17
|
Metrics/MethodLength:
|
18
18
|
Exclude:
|
19
19
|
- 'lib/dor/services/client/transfer.rb'
|
20
20
|
|
21
|
-
# Offense count:
|
21
|
+
# Offense count: 3
|
22
22
|
RSpec/AnyInstance:
|
23
23
|
Exclude:
|
24
24
|
- 'spec/dor/services/client/async_result_spec.rb'
|
25
|
-
- 'spec/dor/services/client/metadata_spec.rb'
|
26
25
|
- 'spec/dor/services/client/object_version_spec.rb'
|
27
26
|
|
28
27
|
# Offense count: 6
|
@@ -31,18 +30,17 @@ RSpec/IdenticalEqualityAssertion:
|
|
31
30
|
- 'spec/dor/services/client_spec.rb'
|
32
31
|
|
33
32
|
# Offense count: 1
|
34
|
-
#
|
33
|
+
# This cop supports safe autocorrection (--autocorrect).
|
35
34
|
RSpec/MultipleSubjects:
|
36
35
|
Exclude:
|
37
36
|
- 'spec/dor/services/client/object_spec.rb'
|
38
37
|
|
39
|
-
# Offense count:
|
40
|
-
# Configuration parameters: Max.
|
38
|
+
# Offense count: 9
|
39
|
+
# Configuration parameters: Max, AllowedGroups.
|
41
40
|
RSpec/NestedGroups:
|
42
41
|
Exclude:
|
43
42
|
- 'spec/dor/services/client/accession_spec.rb'
|
44
43
|
- 'spec/dor/services/client/background_job_results_spec.rb'
|
45
|
-
- 'spec/dor/services/client/metadata_spec.rb'
|
46
44
|
- 'spec/dor/services/client/objects_spec.rb'
|
47
45
|
- 'spec/dor/services/client_spec.rb'
|
48
46
|
|
@@ -65,9 +63,9 @@ Style/Documentation:
|
|
65
63
|
- 'test/**/*'
|
66
64
|
- 'lib/dor/services/client.rb'
|
67
65
|
|
68
|
-
# Offense count:
|
69
|
-
#
|
70
|
-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives,
|
66
|
+
# Offense count: 47
|
67
|
+
# This cop supports safe autocorrection (--autocorrect).
|
68
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
|
71
69
|
# URISchemes: http, https
|
72
70
|
Layout/LineLength:
|
73
71
|
Max: 164
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dor-services-client (12.
|
4
|
+
dor-services-client (12.15.0)
|
5
5
|
activesupport (>= 4.2, < 8)
|
6
6
|
cocina-models (~> 0.90.0)
|
7
7
|
deprecation
|
@@ -12,12 +12,12 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
activesupport (7.0.
|
15
|
+
activesupport (7.0.6)
|
16
16
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
17
|
i18n (>= 1.6, < 2)
|
18
18
|
minitest (>= 5.1)
|
19
19
|
tzinfo (~> 2.0)
|
20
|
-
addressable (2.8.
|
20
|
+
addressable (2.8.4)
|
21
21
|
public_suffix (>= 2.0.2, < 6.0)
|
22
22
|
ast (2.4.2)
|
23
23
|
attr_extras (7.1.0)
|
@@ -37,7 +37,7 @@ GEM
|
|
37
37
|
super_diff
|
38
38
|
thor
|
39
39
|
zeitwerk (~> 2.1)
|
40
|
-
commonmarker (0.23.
|
40
|
+
commonmarker (0.23.9)
|
41
41
|
concurrent-ruby (1.2.2)
|
42
42
|
crack (0.4.5)
|
43
43
|
rexml
|
@@ -68,74 +68,78 @@ GEM
|
|
68
68
|
activesupport (>= 3.0, < 8.0)
|
69
69
|
equivalent-xml (0.6.0)
|
70
70
|
nokogiri (>= 1.4.3)
|
71
|
-
faraday (2.7.
|
71
|
+
faraday (2.7.10)
|
72
72
|
faraday-net_http (>= 2.0, < 3.1)
|
73
73
|
ruby2_keywords (>= 0.0.4)
|
74
74
|
faraday-net_http (3.0.2)
|
75
|
-
faraday-retry (2.
|
75
|
+
faraday-retry (2.2.0)
|
76
76
|
faraday (~> 2.0)
|
77
77
|
hashdiff (1.0.1)
|
78
|
-
i18n (1.
|
78
|
+
i18n (1.14.1)
|
79
79
|
concurrent-ruby (~> 1.0)
|
80
80
|
ice_nine (0.11.2)
|
81
81
|
json (2.6.3)
|
82
|
-
jsonpath (1.1.
|
82
|
+
jsonpath (1.1.3)
|
83
83
|
multi_json
|
84
|
-
|
85
|
-
minitest (5.18.
|
84
|
+
language_server-protocol (3.17.0.3)
|
85
|
+
minitest (5.18.1)
|
86
86
|
multi_json (1.15.0)
|
87
|
-
nokogiri (1.
|
88
|
-
mini_portile2 (~> 2.8.0)
|
87
|
+
nokogiri (1.15.3-x86_64-darwin)
|
89
88
|
racc (~> 1.4)
|
90
|
-
nokogiri (1.
|
89
|
+
nokogiri (1.15.3-x86_64-linux)
|
91
90
|
racc (~> 1.4)
|
92
91
|
openapi3_parser (0.9.2)
|
93
92
|
commonmarker (~> 0.17)
|
94
93
|
openapi_parser (0.15.0)
|
95
94
|
optimist (3.0.1)
|
96
|
-
parallel (1.
|
97
|
-
parser (3.2.
|
95
|
+
parallel (1.23.0)
|
96
|
+
parser (3.2.2.3)
|
98
97
|
ast (~> 2.4.1)
|
98
|
+
racc
|
99
99
|
patience_diff (1.2.0)
|
100
100
|
optimist (~> 3.0)
|
101
101
|
public_suffix (5.0.1)
|
102
|
-
racc (1.
|
102
|
+
racc (1.7.1)
|
103
103
|
rainbow (3.1.1)
|
104
104
|
rake (13.0.6)
|
105
|
-
regexp_parser (2.
|
105
|
+
regexp_parser (2.8.1)
|
106
106
|
rexml (3.2.5)
|
107
107
|
rspec (3.12.0)
|
108
108
|
rspec-core (~> 3.12.0)
|
109
109
|
rspec-expectations (~> 3.12.0)
|
110
110
|
rspec-mocks (~> 3.12.0)
|
111
|
-
rspec-core (3.12.
|
111
|
+
rspec-core (3.12.2)
|
112
112
|
rspec-support (~> 3.12.0)
|
113
|
-
rspec-expectations (3.12.
|
113
|
+
rspec-expectations (3.12.3)
|
114
114
|
diff-lcs (>= 1.2.0, < 2.0)
|
115
115
|
rspec-support (~> 3.12.0)
|
116
116
|
rspec-mocks (3.12.5)
|
117
117
|
diff-lcs (>= 1.2.0, < 2.0)
|
118
118
|
rspec-support (~> 3.12.0)
|
119
|
-
rspec-support (3.12.
|
119
|
+
rspec-support (3.12.1)
|
120
120
|
rss (0.2.9)
|
121
121
|
rexml
|
122
|
-
rubocop (1.
|
122
|
+
rubocop (1.54.1)
|
123
123
|
json (~> 2.3)
|
124
|
+
language_server-protocol (>= 3.17.0)
|
124
125
|
parallel (~> 1.10)
|
125
|
-
parser (>= 3.2.
|
126
|
+
parser (>= 3.2.2.3)
|
126
127
|
rainbow (>= 2.2.2, < 4.0)
|
127
128
|
regexp_parser (>= 1.8, < 3.0)
|
128
129
|
rexml (>= 3.2.5, < 4.0)
|
129
|
-
rubocop-ast (>= 1.
|
130
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
130
131
|
ruby-progressbar (~> 1.7)
|
131
132
|
unicode-display_width (>= 2.4.0, < 3.0)
|
132
|
-
rubocop-ast (1.
|
133
|
+
rubocop-ast (1.29.0)
|
133
134
|
parser (>= 3.2.1.0)
|
134
|
-
rubocop-capybara (2.
|
135
|
+
rubocop-capybara (2.18.0)
|
135
136
|
rubocop (~> 1.41)
|
136
|
-
rubocop-
|
137
|
+
rubocop-factory_bot (2.23.1)
|
138
|
+
rubocop (~> 1.33)
|
139
|
+
rubocop-rspec (2.22.0)
|
137
140
|
rubocop (~> 1.33)
|
138
141
|
rubocop-capybara (~> 2.17)
|
142
|
+
rubocop-factory_bot (~> 2.22)
|
139
143
|
ruby-progressbar (1.13.0)
|
140
144
|
ruby2_keywords (0.0.5)
|
141
145
|
simplecov (0.22.0)
|
@@ -148,7 +152,7 @@ GEM
|
|
148
152
|
attr_extras (>= 6.2.4)
|
149
153
|
diff-lcs
|
150
154
|
patience_diff
|
151
|
-
thor (1.2.
|
155
|
+
thor (1.2.2)
|
152
156
|
tzinfo (2.0.6)
|
153
157
|
concurrent-ruby (~> 1.0)
|
154
158
|
unicode-display_width (2.4.2)
|
@@ -156,12 +160,13 @@ GEM
|
|
156
160
|
addressable (>= 2.8.0)
|
157
161
|
crack (>= 0.3.2)
|
158
162
|
hashdiff (>= 0.4.0, < 2.0.0)
|
159
|
-
zeitwerk (2.6.
|
163
|
+
zeitwerk (2.6.8)
|
160
164
|
|
161
165
|
PLATFORMS
|
162
166
|
x86_64-darwin-19
|
163
167
|
x86_64-darwin-20
|
164
168
|
x86_64-darwin-21
|
169
|
+
x86_64-darwin-22
|
165
170
|
x86_64-linux
|
166
171
|
|
167
172
|
DEPENDENCIES
|
@@ -176,4 +181,4 @@ DEPENDENCIES
|
|
176
181
|
webmock
|
177
182
|
|
178
183
|
BUNDLED WITH
|
179
|
-
2.
|
184
|
+
2.4.13
|
data/README.md
CHANGED
@@ -114,6 +114,12 @@ object_client.preserve(lane_id: 'low')
|
|
114
114
|
# Update the MARC record (used in the releaseWF)
|
115
115
|
object_client.update_marc_record
|
116
116
|
|
117
|
+
# Update the DOI metadata (used by robot)
|
118
|
+
object_client.update_doi_metadata
|
119
|
+
|
120
|
+
# Update the Orcid work (used by robot)
|
121
|
+
object_client.update_orcid_work
|
122
|
+
|
117
123
|
# Copy metadata from Symphony into descMetadata
|
118
124
|
object_client.refresh_descriptive_metadata_from_ils
|
119
125
|
|
@@ -132,12 +138,6 @@ object_client.version.open(description: 'Changed title', significance: 'minor')
|
|
132
138
|
# see dor-services-app openapi.yml for optional params
|
133
139
|
object_client.version.close
|
134
140
|
|
135
|
-
# Get the Dublin Core XML representation
|
136
|
-
object_client.metadata.dublin_core
|
137
|
-
|
138
|
-
# Get the public descriptive XML representation
|
139
|
-
object_client.metadata.descriptive
|
140
|
-
|
141
141
|
# Return the Cocina metadata
|
142
142
|
object_client.find
|
143
143
|
|
@@ -18,10 +18,6 @@ module Dor
|
|
18
18
|
@object_identifier = object_identifier
|
19
19
|
end
|
20
20
|
|
21
|
-
def metadata
|
22
|
-
@metadata ||= Metadata.new(**parent_params)
|
23
|
-
end
|
24
|
-
|
25
21
|
def events
|
26
22
|
@events ||= Events.new(**parent_params)
|
27
23
|
end
|
@@ -110,6 +106,18 @@ module Dor
|
|
110
106
|
raise_exception_based_on_response!(resp)
|
111
107
|
end
|
112
108
|
|
109
|
+
# Update the ORCID Work
|
110
|
+
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
111
|
+
# @return [Boolean] true on success
|
112
|
+
def update_orcid_work
|
113
|
+
resp = connection.post do |req|
|
114
|
+
req.url "#{object_path}/update_orcid_work"
|
115
|
+
end
|
116
|
+
return true if resp.success?
|
117
|
+
|
118
|
+
raise_exception_based_on_response!(resp)
|
119
|
+
end
|
120
|
+
|
113
121
|
# Notify the external Goobi system for a new object that was registered in DOR
|
114
122
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
115
123
|
# @raise [UnexpectedResponse] when the response is not successful.
|
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: 12.
|
4
|
+
version: 12.15.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: 2023-
|
12
|
+
date: 2023-07-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -247,7 +247,6 @@ files:
|
|
247
247
|
- lib/dor/services/client/events.rb
|
248
248
|
- lib/dor/services/client/marcxml.rb
|
249
249
|
- lib/dor/services/client/members.rb
|
250
|
-
- lib/dor/services/client/metadata.rb
|
251
250
|
- lib/dor/services/client/mutate.rb
|
252
251
|
- lib/dor/services/client/object.rb
|
253
252
|
- lib/dor/services/client/object_version.rb
|
@@ -280,7 +279,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
280
279
|
- !ruby/object:Gem::Version
|
281
280
|
version: '0'
|
282
281
|
requirements: []
|
283
|
-
rubygems_version: 3.
|
282
|
+
rubygems_version: 3.3.7
|
284
283
|
signing_key:
|
285
284
|
specification_version: 4
|
286
285
|
summary: A client for dor-services-app
|
@@ -1,62 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'active_support/json' # required for serializing time as iso8601
|
4
|
-
|
5
|
-
module Dor
|
6
|
-
module Services
|
7
|
-
class Client
|
8
|
-
# API calls that are about retrieving metadata
|
9
|
-
class Metadata < VersionedService
|
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 [String, NilClass] The Dublin Core XML representation of the object or nil if response is 404
|
17
|
-
# @raise [UnexpectedResponse] on an unsuccessful response from the server
|
18
|
-
def dublin_core
|
19
|
-
resp = connection.get do |req|
|
20
|
-
req.url "#{base_path}/dublin_core"
|
21
|
-
end
|
22
|
-
return resp.body if resp.success?
|
23
|
-
return if resp.status == 404
|
24
|
-
|
25
|
-
raise_exception_based_on_response!(resp, object_identifier)
|
26
|
-
end
|
27
|
-
|
28
|
-
# @return [String, NilClass] The public descriptive metadata XML representation of the object or nil if response is 404
|
29
|
-
# @raise [UnexpectedResponse] on an unsuccessful response from the server
|
30
|
-
def descriptive
|
31
|
-
resp = connection.get do |req|
|
32
|
-
req.url "#{base_path}/descriptive"
|
33
|
-
end
|
34
|
-
return resp.body if resp.success?
|
35
|
-
return if resp.status == 404
|
36
|
-
|
37
|
-
raise_exception_based_on_response!(resp, object_identifier)
|
38
|
-
end
|
39
|
-
|
40
|
-
# @return [String, NilClass] the dor object's source MODS XML or nil if response is 404
|
41
|
-
# @raise [UnexpectedResponse] on an unsuccessful response from the server
|
42
|
-
def mods
|
43
|
-
resp = connection.get do |req|
|
44
|
-
req.url "#{base_path}/mods"
|
45
|
-
end
|
46
|
-
return resp.body if resp.success?
|
47
|
-
return if resp.status == 404
|
48
|
-
|
49
|
-
raise_exception_based_on_response!(resp, object_identifier)
|
50
|
-
end
|
51
|
-
|
52
|
-
private
|
53
|
-
|
54
|
-
attr_reader :object_identifier
|
55
|
-
|
56
|
-
def base_path
|
57
|
-
"#{api_version}/objects/#{object_identifier}/metadata"
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|