dor-services-client 3.5.0 → 3.6.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: 6e698ec62b7dcceba6c335032d1ccf993c02bee7945cf5865c617c41bb00fa9e
4
- data.tar.gz: 290957e4e5d96d0b44ffe4e9ccdfcf921947a49e809433139a979f5090176fe6
3
+ metadata.gz: e2d62ed8726e31d71908dd15fdf8f3921cd1c60004f35ffa6904dc5e7483503b
4
+ data.tar.gz: 79e3ad53f98986817f63dcaaa78abc41775cbdfdd0ac938ac5c46383a9d8ba29
5
5
  SHA512:
6
- metadata.gz: cd790382965aa0d8ead2bbcc73a699ddce26bdb7f623932753208ead6bb8484f36668e94bde69474cace9e40e376629ca5f38cd1dfad0d82294de791fcce6cdb
7
- data.tar.gz: 3ca07906e522ce83ae5046147b752100d02914b2b1fb8ca511c1bbdb8b100dc11faafa9c6593b21b6128f429167acca1cc96e5f5425acbe3b05561e8bf7411a6
6
+ metadata.gz: 7a4347ee57212280a53a7b9160ec0093ac3174e183e911b3afda52be6bc9840530b0f09427bfa59723fa9a952b84a32fcaf6489f54ddf1e86a1334ba451ea8e4
7
+ data.tar.gz: eb336cffbd79e45fe420b0dff38a580bbbfc7ab18a716480f3fd2e079def6269fd25f5484ab1f88c56ea649eea973627b67f7c62b871966a600222dcd3cd756d
data/README.md CHANGED
@@ -127,14 +127,14 @@ object_client.workspace.reset
127
127
  object_client.embargo.update(embargo_date: date_string, requesting_user: username_string)
128
128
  ```
129
129
 
130
- ## Asynchonous results
130
+ ## Asynchronous results
131
131
 
132
132
  Some operations are asynchronous and they return a `Location` header that displays the
133
133
  result of the job. These jobs can be monitored by using `AsyncResult`.
134
134
 
135
- ```
135
+ ```ruby
136
136
  background_result_url = virtual_objects_client.create(virtual_objects: [{ parent_id: '', child_ids: [''] }])
137
- result = AsyncResult.new(url: background_result_url)
137
+ result = virtual_objects_client.async_result(url: background_result_url)
138
138
 
139
139
  # Checks the result one time
140
140
  result.complete?
@@ -7,6 +7,8 @@ module Dor
7
7
  class Client
8
8
  # A helper for monitoring asynchonous jobs
9
9
  class AsyncResult
10
+ attr_reader :url
11
+
10
12
  # @param [String] url the url of the background result
11
13
  def initialize(url:)
12
14
  @url = url
@@ -30,8 +32,6 @@ module Dor
30
32
  @results[:output][:errors]
31
33
  end
32
34
 
33
- attr_reader :url, :seconds_between_requests, :timeout_in_seconds
34
-
35
35
  private
36
36
 
37
37
  def poll_until_complete(seconds_between_requests, timeout_in_seconds)
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '3.5.0'
6
+ VERSION = '3.6.0'
7
7
  end
8
8
  end
9
9
  end
@@ -10,6 +10,11 @@ module Dor
10
10
  @api_version = version
11
11
  end
12
12
 
13
+ # Common interface for handling asynchronous results
14
+ def async_result(url:)
15
+ AsyncResult.new(url: url)
16
+ end
17
+
13
18
  private
14
19
 
15
20
  attr_reader :connection, :api_version
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: 3.5.0
4
+ version: 3.6.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: 2019-10-30 00:00:00.000000000 Z
12
+ date: 2019-10-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -256,7 +256,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
256
  - !ruby/object:Gem::Version
257
257
  version: '0'
258
258
  requirements: []
259
- rubygems_version: 3.0.3
259
+ rubyforge_project:
260
+ rubygems_version: 2.7.8
260
261
  signing_key:
261
262
  specification_version: 4
262
263
  summary: A client for dor-services-app