dor-services-client 14.2.1 → 14.4.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: 606f3a9f544df877a802c3a59bf0cca8cf6ddd6a9cc198281e779d66d07cb10d
4
- data.tar.gz: 734f2682867e0d4041e00e57aba5e22ce44bd136f01cb7df04039ff1ccef4616
3
+ metadata.gz: fd7841c236c50b58fae7790f830fe16ccdf406046be4739d758bba74dd0155aa
4
+ data.tar.gz: 7e6f87de10e9112ce4301ead05ca56115ecc7c956d347f3447856f7afe29882f
5
5
  SHA512:
6
- metadata.gz: 92d294190d9770e9e76c12566080dae122dfb5c6d3fecd8c241dbed957cb7024807d62bb45ee844b14c7ca8efeff563ab0604ea2e46035d5b65e0e2fdb020a20
7
- data.tar.gz: df21da862d586a17487b59da22fc5bc1da0ca8bb0b02702d74f59684d7623cd17068dcb200432050c4d207be2e7b0016a89b92bad499b6eadff8fd838510c9b4
6
+ metadata.gz: ea9ca5c81c500d8782f89b7ec7a8efc615116e4c98d306ee6c8d16d3fd144d6b36b1a162a266adf681c2a91aa48f5bc842dbccbcfe6e334b38641b45d7524240
7
+ data.tar.gz: 20ae566854c4f8eb4f95a6861f6c89d0d4594d3590d979fda9774f2a06d7c8dc1b8be5ddaa016479e54759091bba5c14da761abb48e7c01d6246990d9d395837
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dor-services-client (14.2.1)
4
+ dor-services-client (14.4.0)
5
5
  activesupport (>= 4.2, < 8)
6
6
  cocina-models (~> 0.95.1)
7
7
  deprecation
@@ -27,7 +27,7 @@ GEM
27
27
  ast (2.4.2)
28
28
  attr_extras (7.1.0)
29
29
  base64 (0.2.0)
30
- bigdecimal (3.1.6)
30
+ bigdecimal (3.1.7)
31
31
  byebug (11.1.3)
32
32
  cocina-models (0.95.1)
33
33
  activesupport
@@ -94,14 +94,14 @@ GEM
94
94
  jsonpath (1.1.5)
95
95
  multi_json
96
96
  language_server-protocol (3.17.0.3)
97
- minitest (5.22.2)
97
+ minitest (5.22.3)
98
98
  multi_json (1.15.0)
99
99
  mutex_m (0.2.0)
100
100
  net-http (0.4.1)
101
101
  uri
102
- nokogiri (1.16.2-x86_64-darwin)
102
+ nokogiri (1.16.3-x86_64-darwin)
103
103
  racc (~> 1.4)
104
- nokogiri (1.16.2-x86_64-linux)
104
+ nokogiri (1.16.3-x86_64-linux)
105
105
  racc (~> 1.4)
106
106
  openapi3_parser (0.9.2)
107
107
  commonmarker (~> 0.17)
@@ -134,7 +134,7 @@ GEM
134
134
  rspec-support (3.13.1)
135
135
  rss (0.3.0)
136
136
  rexml
137
- rubocop (1.62.0)
137
+ rubocop (1.62.1)
138
138
  json (~> 2.3)
139
139
  language_server-protocol (>= 3.17.0)
140
140
  parallel (~> 1.10)
data/README.md CHANGED
@@ -145,6 +145,10 @@ object_client.administrative_tags.update(current: 'Current : Tag', new: 'Replace
145
145
  object_client.administrative_tags.destroy(tag: 'Delete : Me')
146
146
  object_client.administrative_tags.list
147
147
 
148
+ # Create and list release tags for an object
149
+ object_client.release_tags.create(tag: Cocina::Models::Tag.new(to: 'Searchworks'))
150
+ object_client.release_tags.list
151
+
148
152
  # Create and list events for an object
149
153
  object_client.events.create(type: type, data: data)
150
154
  object_client.events.list
@@ -30,6 +30,10 @@ module Dor
30
30
  @administrative_tags ||= AdministrativeTags.new(**parent_params)
31
31
  end
32
32
 
33
+ def release_tags
34
+ @release_tags ||= ReleaseTags.new(**parent_params)
35
+ end
36
+
33
37
  def version
34
38
  @version ||= ObjectVersion.new(**parent_params)
35
39
  end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dor
4
+ module Services
5
+ class Client
6
+ # Interact with release tags endpoint for a given object
7
+ class ReleaseTags < VersionedService
8
+ # @param object_identifier [String] the pid for the object
9
+ def initialize(connection:, version:, object_identifier:)
10
+ super(connection: connection, version: version)
11
+ @object_identifier = object_identifier
12
+ end
13
+
14
+ # Create a release tag for an object
15
+ #
16
+ # @param tag [Cocina::Models::ReleaseTag]
17
+ # @return [Boolean] true if successful
18
+ # @raise [NotFoundResponse] when the response is a 404 (object not found)
19
+ # @raise [UnexpectedResponse] if the request is unsuccessful.
20
+ def create(tag:)
21
+ resp = connection.post do |req|
22
+ req.url "#{api_version}/objects/#{object_identifier}/release_tags"
23
+ req.headers['Content-Type'] = 'application/json'
24
+ req.body = tag.to_json
25
+ end
26
+ raise_exception_based_on_response!(resp, object_identifier) unless resp.success?
27
+
28
+ true
29
+ end
30
+
31
+ # List release tags for an object
32
+ #
33
+ # @raise [NotFoundResponse] when the response is a 404 (object not found)
34
+ # @raise [UnexpectedResponse] if the request is unsuccessful.
35
+ # @return [Array<Cocina::Models::ReleaseTag>]
36
+ def list
37
+ resp = connection.get do |req|
38
+ req.url "#{api_version}/objects/#{object_identifier}/release_tags"
39
+ end
40
+
41
+ raise_exception_based_on_response!(resp, object_identifier) unless resp.success?
42
+
43
+ JSON.parse(resp.body).map { |tag_data| Cocina::Models::ReleaseTag.new(tag_data) }
44
+ end
45
+
46
+ private
47
+
48
+ attr_reader :object_identifier
49
+ end
50
+ end
51
+ end
52
+ end
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '14.2.1'
6
+ VERSION = '14.4.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: 14.2.1
4
+ version: 14.4.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-03-11 00:00:00.000000000 Z
12
+ date: 2024-03-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -249,6 +249,7 @@ files:
249
249
  - lib/dor/services/client/object.rb
250
250
  - lib/dor/services/client/object_version.rb
251
251
  - lib/dor/services/client/objects.rb
252
+ - lib/dor/services/client/release_tags.rb
252
253
  - lib/dor/services/client/response_error_formatter.rb
253
254
  - lib/dor/services/client/transfer.rb
254
255
  - lib/dor/services/client/version.rb
@@ -277,7 +278,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
277
278
  - !ruby/object:Gem::Version
278
279
  version: '0'
279
280
  requirements: []
280
- rubygems_version: 3.4.10
281
+ rubygems_version: 3.4.18
281
282
  signing_key:
282
283
  specification_version: 4
283
284
  summary: A client for dor-services-app