dor-services-client 14.3.0 → 14.5.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: dc68f7d750dc81e4b321c1e18e20982084fc65e9a4282f5c0e3b2bce8674f107
4
- data.tar.gz: 84c9e262f5fcb42b52ed09ce8a67ee08580fcce73e1dc2177d3029b30d20e338
3
+ metadata.gz: b8ee28c0d6503ac6cc8e3c39aca64fd7d191cc6f6a7bac04ef4f7424bf92a760
4
+ data.tar.gz: cf304665caa7b4f9e5412da754e784205b493e99add1e88dede7f37d34529819
5
5
  SHA512:
6
- metadata.gz: dbc3b77fff70d1ee722c63b31e1eac894b0e659186bb078237c31ca047d8ea84a75aa0fff8d336938143915484c856ffc64fe861377e40ddfebb78465c79671b
7
- data.tar.gz: 755f7ecbe52cb1fd7bbcff3d5332e923ba391136204045689a2bf2cff966d8e390635282c11e9d495719679ae32f330b5d4e801e17971e8cdc38eeeabf5e3498
6
+ metadata.gz: 04f1f79f78d69c6e150e875fd962b95e61bf52f73aff4abc6471df993ff1969e5b7121e8d3e6a437329768df227ef326485361a945df827ac71ce0bc73d999e0
7
+ data.tar.gz: 4508c1c0e766235e898d40c0a7da1609ba1e203350141c0f091be66508205a07a5b530271479dd7048143b63736adbe0e8989b4492395dee2632107c0b7c711d
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dor-services-client (14.3.0)
4
+ dor-services-client (14.5.0)
5
5
  activesupport (>= 4.2, < 8)
6
- cocina-models (~> 0.95.1)
6
+ cocina-models (~> 0.96.0)
7
7
  deprecation
8
8
  faraday (~> 2.0)
9
9
  faraday-retry
@@ -29,7 +29,7 @@ GEM
29
29
  base64 (0.2.0)
30
30
  bigdecimal (3.1.7)
31
31
  byebug (11.1.3)
32
- cocina-models (0.95.1)
32
+ cocina-models (0.96.0)
33
33
  activesupport
34
34
  deprecation
35
35
  dry-struct (~> 1.0)
data/README.md CHANGED
@@ -122,7 +122,7 @@ object_client.version.inventory
122
122
  object_client.version.current
123
123
  object_client.version.openable?
124
124
  # see dor-services-app openapi.yml for optional params
125
- object_client.version.open(description: 'Changed title', significance: 'minor')
125
+ object_client.version.open(description: 'Changed title')
126
126
  # see dor-services-app openapi.yml for optional params
127
127
  object_client.version.close
128
128
 
@@ -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
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.required_ruby_version = '>= 3.0', '< 4'
26
26
 
27
27
  spec.add_dependency 'activesupport', '>= 4.2', '< 8'
28
- spec.add_dependency 'cocina-models', '~> 0.95.1'
28
+ spec.add_dependency 'cocina-models', '~> 0.96.0'
29
29
  spec.add_dependency 'deprecation', '>= 0'
30
30
  spec.add_dependency 'faraday', '~> 2.0'
31
31
  spec.add_dependency 'faraday-retry'
@@ -15,7 +15,6 @@ module Dor
15
15
 
16
16
  # Start accession on an object (start specified workflow, assemblyWF by default, and version if needed)
17
17
  # @param params [Hash<Symbol,String>] optional parameter hash
18
- # @option params [String] :significance set significance (major/minor/patch) of version change - required
19
18
  # @option params [String] :description set description of version change - required
20
19
  # @option params [String] :opening_user_name add opening username to the event - optional
21
20
  # @option params [String] :workflow the workflow to start - defaults to 'assemblyWF'
@@ -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
@@ -51,7 +51,6 @@ module Dor
51
51
 
52
52
  # Open new version for an object
53
53
  # @param description [String] a description of the object version being opened - required
54
- # @param significance [String] 'major' 'minor' or 'admin' - required
55
54
  # @param opening_user_name [String] sunetid - defaults to nil
56
55
  # @param assume_accessioned [Boolean] if true, does not check whether object has been accessioned; defaults to false
57
56
  # @raise [NotFoundResponse] when the response is a 404 (object not found)
@@ -70,7 +69,6 @@ module Dor
70
69
 
71
70
  # Close current version for an object
72
71
  # @param description [String] (optional) - a description of the object version being opened
73
- # @param significance [String] (optional) - 'major' 'minor' or 'admin'
74
72
  # @param user_name [String] (optional) - sunetid
75
73
  # @param start_accession [Boolean] (optional) - whether to start accessioning workflow; defaults to true
76
74
  # @raise [NotFoundResponse] when the response is a 404 (object not found)
@@ -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.3.0'
6
+ VERSION = '14.5.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.3.0
4
+ version: 14.5.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-25 00:00:00.000000000 Z
12
+ date: 2024-03-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -37,14 +37,14 @@ dependencies:
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.95.1
40
+ version: 0.96.0
41
41
  type: :runtime
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.95.1
47
+ version: 0.96.0
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: deprecation
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -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.14
281
+ rubygems_version: 3.5.6
281
282
  signing_key:
282
283
  specification_version: 4
283
284
  summary: A client for dor-services-app