google-apis-core 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -8
- data/OVERVIEW.md +2 -2
- data/lib/google/apis/core/base_service.rb +1 -1
- data/lib/google/apis/core/http_command.rb +4 -2
- data/lib/google/apis/core/version.rb +1 -1
- data/lib/google/apis/options.rb +17 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b0d661c88385398896b7cca5ae223f6dc366d1f94d73ba016d23c7dc3817a96
|
4
|
+
data.tar.gz: 50b2726dc4c02d38fe61ec1f44f6b95691eda96b6a7d68ee4a4e4b8eb6e9bf9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65127d75756ca4211aea26ad7923bdc17dca795e4d39d19c763b9577dcc6a492a6935c278e64b1132de3c26fd903bc0444f1e80e9dd0080f1fc3f15e22cfba65
|
7
|
+
data.tar.gz: fc7fd5fbd313851c222505fbb68b81094ab94c9eb7e27eb40ab71d6bb39096f0dbeffcf1acad8092412b3fb2f40678bf6a425a0e35914e00af6bdeb21015a0e0
|
data/CHANGELOG.md
CHANGED
@@ -1,21 +1,36 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
-
|
3
|
+
### 0.5.0 (2022-05-15)
|
4
4
|
|
5
|
-
|
5
|
+
#### Features
|
6
|
+
|
7
|
+
* Add support for retry options to be configurable
|
8
|
+
|
9
|
+
### 0.4.2 (2022-01-21)
|
10
|
+
|
11
|
+
#### Bug Fixes
|
12
|
+
|
13
|
+
* Support for max elapsed time configuration.
|
6
14
|
|
7
|
-
|
15
|
+
### 0.4.1 (2021-07-19)
|
16
|
+
|
17
|
+
* FIX: Prevent duplicated pagination when a response returns an empty string as the next page token.
|
18
|
+
|
19
|
+
### 0.4.0 (2021-06-28)
|
20
|
+
|
21
|
+
* Expanded googleauth dependency to include future 1.x versions
|
8
22
|
|
9
|
-
###
|
23
|
+
### 0.3.0 (2021-03-07)
|
10
24
|
|
11
|
-
|
25
|
+
#### Features
|
12
26
|
|
13
|
-
|
27
|
+
* Drop support for Ruby 2.4 and add support for Ruby 3.0
|
14
28
|
|
29
|
+
### 0.2.1 (2021-01-25)
|
15
30
|
|
16
|
-
|
31
|
+
#### Bug Fixes
|
17
32
|
|
18
|
-
*
|
33
|
+
* Add webrick to the gem dependencies, for Ruby 3 compatibility
|
19
34
|
|
20
35
|
### 0.2.0 (2021-01-06)
|
21
36
|
|
data/OVERVIEW.md
CHANGED
@@ -8,8 +8,8 @@ need to install it by itself.
|
|
8
8
|
|
9
9
|
More detailed descriptions of the Google legacy REST clients are available in two documents.
|
10
10
|
|
11
|
-
* The [Usage Guide](https://github.com/googleapis/google-api-ruby-client/blob/
|
12
|
-
* The [Auth Guide](https://github.com/googleapis/google-api-ruby-client/blob/
|
11
|
+
* The [Usage Guide](https://github.com/googleapis/google-api-ruby-client/blob/main/docs/usage-guide.md) discusses how to make API calls, how to use the provided data structures, and how to work the various features of the client library, including media upload and download, error handling, retries, pagination, and logging.
|
12
|
+
* The [Auth Guide](https://github.com/googleapis/google-api-ruby-client/blob/main/docs/auth-guide.md) discusses authentication in the client libraries, including API keys, OAuth 2.0, service accounts, and environment variables.
|
13
13
|
|
14
14
|
For reference information on specific calls in the clients, see the {Google::Apis class reference docs}.
|
15
15
|
|
@@ -82,7 +82,7 @@ module Google
|
|
82
82
|
end
|
83
83
|
break if @max && item_count >= @max
|
84
84
|
next_page_token = @last_result.send(@response_page_token_field)
|
85
|
-
break if next_page_token.
|
85
|
+
break if next_page_token.to_s.empty? || next_page_token == page_token
|
86
86
|
page_token = next_page_token
|
87
87
|
end
|
88
88
|
end
|
@@ -100,8 +100,10 @@ module Google
|
|
100
100
|
opencensus_begin_span
|
101
101
|
begin
|
102
102
|
Retriable.retriable tries: options.retries + 1,
|
103
|
-
|
104
|
-
|
103
|
+
max_elapsed_time: options.max_elapsed_time,
|
104
|
+
base_interval: options.base_interval,
|
105
|
+
max_interval: options.max_interval,
|
106
|
+
multiplier: options.multiplier,
|
105
107
|
on: RETRIABLE_ERRORS do |try|
|
106
108
|
# This 2nd level retriable only catches auth errors, and supports 1 retry, which allows
|
107
109
|
# auth to be re-attempted without having to retry all sorts of other failures like
|
data/lib/google/apis/options.rb
CHANGED
@@ -28,6 +28,10 @@ module Google
|
|
28
28
|
RequestOptions = Struct.new(
|
29
29
|
:authorization,
|
30
30
|
:retries,
|
31
|
+
:max_elapsed_time,
|
32
|
+
:base_interval,
|
33
|
+
:max_interval,
|
34
|
+
:multiplier,
|
31
35
|
:header,
|
32
36
|
:normalize_unicode,
|
33
37
|
:skip_serialization,
|
@@ -66,6 +70,15 @@ module Google
|
|
66
70
|
# @return [Signet::OAuth2::Client, #apply(Hash)] OAuth2 credentials.
|
67
71
|
# @!attribute [rw] retries
|
68
72
|
# @return [Fixnum] Number of times to retry requests on server error.
|
73
|
+
# @!attribute [rw] max_elapsed_time
|
74
|
+
# @return [Fixnum] Total time in seconds that requests are allowed to keep being retried.
|
75
|
+
# @!attribute [rw] base_interval
|
76
|
+
# @return [Float] The initial interval in seconds between tries.
|
77
|
+
# @!attribute [rw] max_interval
|
78
|
+
# @return [Fixnum] The maximum interval in seconds that any individual retry can reach.
|
79
|
+
# @!attribute [rw] multiplier
|
80
|
+
# @return [rw] Each successive interval grows by this factor. A multipler of 1.5 means the next interval
|
81
|
+
# will be 1.5x the current interval.
|
69
82
|
# @!attribute [rw] header
|
70
83
|
# @return [Hash<String,String>] Additional HTTP headers to include in requests.
|
71
84
|
# @!attribute [rw] normalize_unicode
|
@@ -106,6 +119,10 @@ module Google
|
|
106
119
|
ClientOptions.default.application_version = '0.0.0'
|
107
120
|
ClientOptions.default.transparent_gzip_decompression = true
|
108
121
|
RequestOptions.default.retries = 0
|
122
|
+
RequestOptions.default.max_elapsed_time = 900
|
123
|
+
RequestOptions.default.base_interval = 1
|
124
|
+
RequestOptions.default.max_interval = 60
|
125
|
+
RequestOptions.default.multiplier = 2
|
109
126
|
RequestOptions.default.normalize_unicode = false
|
110
127
|
RequestOptions.default.skip_serialization = false
|
111
128
|
RequestOptions.default.skip_deserialization = false
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-apis-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: representable
|
@@ -183,9 +183,9 @@ licenses:
|
|
183
183
|
- Apache-2.0
|
184
184
|
metadata:
|
185
185
|
bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
|
186
|
-
changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/
|
187
|
-
documentation_uri: https://googleapis.dev/ruby/google-apis-core/v0.
|
188
|
-
source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/
|
186
|
+
changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/google-apis-core/CHANGELOG.md
|
187
|
+
documentation_uri: https://googleapis.dev/ruby/google-apis-core/v0.5.0
|
188
|
+
source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/google-apis-core
|
189
189
|
post_install_message:
|
190
190
|
rdoc_options: []
|
191
191
|
require_paths:
|
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
201
|
- !ruby/object:Gem::Version
|
202
202
|
version: '0'
|
203
203
|
requirements: []
|
204
|
-
rubygems_version: 3.
|
204
|
+
rubygems_version: 3.3.5
|
205
205
|
signing_key:
|
206
206
|
specification_version: 4
|
207
207
|
summary: Common utility and base classes for legacy Google REST clients
|