dor-services-client 7.9.0 → 7.10.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07df0c2ce071a596c4825052e94a429cda7666fcd1d68e0c12c1476f27843123
4
- data.tar.gz: 627aa21d6fe0c5b9599682f4bd182f92a3d56266e488c48a1d23f4f140aaac75
3
+ metadata.gz: 247737e90861ec22f94636b9936d5ba4fb6c9d9a590230a9960a5fc516ae1032
4
+ data.tar.gz: d9f21704c7da9cc694b2030efc6e5790ab30150ac3a6303cff3fb45bcd49eb0e
5
5
  SHA512:
6
- metadata.gz: a18c81fce2987d56bb558d5ee0ddb74c561ea873e305aa5ce0982b91575c190b5cbb04aaf1dd1f1a2af9f7ff63878040ad7d8e5f535fde5610bbd3ba8b9d02b1
7
- data.tar.gz: 252fc0275a91bf1c254936a1b09ca9b49b10d3c1120b3d7d1b2771efd8398aec4ede5fa3d71de6f2c2c384ba3cd21e7b3fffd696e561de34eb37e4c153d6e690
6
+ metadata.gz: 52b93852476f4a7893e3d4e56e471dd262d674a62cf0172745546e0b08a7aea65b861bd28b1e48f86c9f3e1da261c9527e4b5aa3206b919e83c6e2451af44d84
7
+ data.tar.gz: 27c897c3f1bc2fef7bb7f7494292df2320f9768df5c8822b10eff38b28b818a9087e438b693f74a7fb307731dd02be688c827557ff631e93b997330f8a306086
data/README.md CHANGED
@@ -112,7 +112,7 @@ object_client.preserve(lane_id: 'low')
112
112
  object_client.update_marc_record
113
113
 
114
114
  # Copy metadata from Symphony into descMetadata
115
- object_client.refresh_metadata
115
+ object_client.refresh_descriptive_metadata_from_ils
116
116
 
117
117
  # Apply defaults from the item's AdminPolicy to the item itself
118
118
  object_client.apply_admin_policy_defaults
@@ -87,6 +87,20 @@ module Dor
87
87
  raise_exception_based_on_response!(resp, object_identifier)
88
88
  end
89
89
 
90
+ # Update the MODS XML metadata
91
+ # @raise [NotFoundResponse] when the response is a 404 (object not found)
92
+ # @return [boolean] true on success
93
+ def update_mods(mods_xml)
94
+ resp = connection.put do |req|
95
+ req.url "#{base_path}/mods"
96
+ req.headers['Content-Type'] = 'application/xml'
97
+ req.body = mods_xml
98
+ end
99
+ return if resp.success?
100
+
101
+ raise_exception_based_on_response!(resp, object_identifier)
102
+ end
103
+
90
104
  # rubocop:disable Lint/StructNewOverride
91
105
  Datastream = Struct.new(:label, :dsid, :pid, :size, :mimeType, :versionId, keyword_init: true)
92
106
  # rubocop:enable Lint/StructNewOverride
@@ -26,7 +26,7 @@ module Dor
26
26
  end
27
27
 
28
28
  # Updates the object
29
- # @param [Cocina::Models::RequestDRO,Cocina::Models::RequestCollection,Cocina::Models::RequestAPO] params model object
29
+ # @param [Cocina::Models::DRO,Cocina::Models::Collection,Cocina::Models::AdminPolicy] params model object
30
30
  # @raise [NotFoundResponse] when the response is a 404 (object not found)
31
31
  # @raise [UnexpectedResponse] when the response is not successful.
32
32
  # @return [Cocina::Models::DRO,Cocina::Models::Collection,Cocina::Models::AdminPolicy] the returned model
@@ -48,7 +48,7 @@ module Dor
48
48
  # @raise [NotFoundResponse] when the response is a 404 (object not found)
49
49
  # @raise [UnexpectedResponse] when the response is not successful.
50
50
  # @return [boolean] true on success
51
- def refresh_metadata
51
+ def refresh_descriptive_metadata_from_ils
52
52
  resp = connection.post do |req|
53
53
  req.url "#{object_path}/refresh_metadata"
54
54
  end
@@ -1,10 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'deprecation'
4
+
3
5
  module Dor
4
6
  module Services
5
7
  class Client
6
8
  # API calls that are about a repository object
7
9
  class Object < VersionedService
10
+ extend Deprecation
8
11
  attr_reader :object_identifier
9
12
 
10
13
  # @param object_identifier [String] the pid for the object
@@ -89,7 +92,10 @@ module Dor
89
92
  Mutate.new(**parent_params)
90
93
  end
91
94
 
92
- delegate :refresh_metadata, :update, :destroy, :apply_admin_policy_defaults, to: :mutate
95
+ delegate :refresh_descriptive_metadata_from_ils, :update, :destroy, :apply_admin_policy_defaults, to: :mutate
96
+
97
+ alias refresh_metadata refresh_descriptive_metadata_from_ils
98
+ deprecation_deprecate refresh_metadata: 'Use refresh_descriptive_metadata_from_ils instead'
93
99
 
94
100
  # Update the marc record for the given object
95
101
  # @raise [NotFoundResponse] when the response is a 404 (object not found)
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '7.9.0'
6
+ VERSION = '7.10.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: 7.9.0
4
+ version: 7.10.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-31 00:00:00.000000000 Z
12
+ date: 2022-02-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport