google-apis-core 0.8.0 → 0.9.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 +6 -0
- data/lib/google/apis/core/api_command.rb +6 -0
- data/lib/google/apis/core/version.rb +1 -1
- data/lib/google/apis/options.rb +5 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39e8c0ee69956045fad35dd99b60187bee9a559e66c31141784f69c938b828da
|
4
|
+
data.tar.gz: 2bc2f65430050943360436b018b2149f876bdb190d8d637e42d1ac5c908aee41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26a81d876d54cd42e9e84a4c057297ccd77a1cfebe481de646504f8e30d08496b72141581532dfeae03d3dcb9ff955330b7e94c81bc9bb555130e501fc2879f2
|
7
|
+
data.tar.gz: 2c1242fd64e8e66e82b04aa2a4f4c0fb0979e7a0a53f8162836a90a58242f1d46d4b8660101a15c9e82b6b6e48819cdffe5053f90894a9cf1dd5040de2c21db0
|
data/CHANGELOG.md
CHANGED
@@ -18,6 +18,7 @@ require 'google/apis/core/http_command'
|
|
18
18
|
require 'google/apis/errors'
|
19
19
|
require 'json'
|
20
20
|
require 'retriable'
|
21
|
+
require "securerandom"
|
21
22
|
|
22
23
|
module Google
|
23
24
|
module Apis
|
@@ -161,6 +162,7 @@ module Google
|
|
161
162
|
xgac = "gl-ruby/#{RUBY_VERSION} gdcl/#{munged_client_version}"
|
162
163
|
xgac = old_xgac.empty? ? xgac : "#{old_xgac} #{xgac}"
|
163
164
|
header.delete_if { |k, v| k.downcase == 'x-goog-api-client' }
|
165
|
+
xgac.concat(" ",invocation_id_header) if options.add_invocation_id_header
|
164
166
|
header['X-Goog-Api-Client'] = xgac
|
165
167
|
end
|
166
168
|
|
@@ -172,6 +174,10 @@ module Google
|
|
172
174
|
header['X-Goog-User-Project'] = quota_project_id if quota_project_id
|
173
175
|
end
|
174
176
|
|
177
|
+
def invocation_id_header
|
178
|
+
"gccl-invocation-id/#{SecureRandom.uuid}"
|
179
|
+
end
|
180
|
+
|
175
181
|
# Attempt to parse a JSON error message
|
176
182
|
# @param [String] body
|
177
183
|
# HTTP response body
|
data/lib/google/apis/options.rb
CHANGED
@@ -39,7 +39,8 @@ module Google
|
|
39
39
|
:api_format_version,
|
40
40
|
:use_opencensus,
|
41
41
|
:quota_project,
|
42
|
-
:query
|
42
|
+
:query,
|
43
|
+
:add_invocation_id_header)
|
43
44
|
|
44
45
|
# General client options
|
45
46
|
class ClientOptions
|
@@ -95,6 +96,8 @@ module Google
|
|
95
96
|
# @return [String] Project ID to charge quota, or `nil` to default to the credentials-specified project.
|
96
97
|
# @!attribute [rw] query
|
97
98
|
# @return [Hash<String,String>] Additional HTTP URL query parameters to include in requests.
|
99
|
+
# @!attribute [rw] add_invocation_id_header
|
100
|
+
# @return [Boolean] True if the header gccl-invocation-id need to be set
|
98
101
|
|
99
102
|
# Get the default options
|
100
103
|
# @return [Google::Apis::RequestOptions]
|
@@ -129,5 +132,6 @@ module Google
|
|
129
132
|
RequestOptions.default.api_format_version = nil
|
130
133
|
RequestOptions.default.use_opencensus = true
|
131
134
|
RequestOptions.default.quota_project = nil
|
135
|
+
RequestOptions.default.add_invocation_id_header = false
|
132
136
|
end
|
133
137
|
end
|
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.9.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: 2022-09-
|
11
|
+
date: 2022-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: representable
|
@@ -186,7 +186,7 @@ licenses:
|
|
186
186
|
metadata:
|
187
187
|
bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
|
188
188
|
changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/google-apis-core/CHANGELOG.md
|
189
|
-
documentation_uri: https://googleapis.dev/ruby/google-apis-core/v0.
|
189
|
+
documentation_uri: https://googleapis.dev/ruby/google-apis-core/v0.9.0
|
190
190
|
source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/google-apis-core
|
191
191
|
post_install_message:
|
192
192
|
rdoc_options: []
|