google-apis-core 0.8.0 → 0.9.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: 0e3d4a94e6fc85bf5b6a94cc7d579c3e32be968dfa8df1c56e71232ee3030bbe
4
- data.tar.gz: d8a593392db24783f8e31785996f90108f67d13d950d7c7f82e669caae65c0a8
3
+ metadata.gz: 39e8c0ee69956045fad35dd99b60187bee9a559e66c31141784f69c938b828da
4
+ data.tar.gz: 2bc2f65430050943360436b018b2149f876bdb190d8d637e42d1ac5c908aee41
5
5
  SHA512:
6
- metadata.gz: 286116c08612e28eedc00886eee6bdf96b85fd6b7e8b2fa7287b66504c84458bc98936cb9893451db7843cbce6c4bdc797e726678c16241832f1ce467ab01eb0
7
- data.tar.gz: 81c3a46b26d25a587c558d089f8f2f2d36ddceffd381df969d4296d111b75f54dff592c59680171ebbf8c6641723f5bfeb2613bd939a54c28d1b556acd42e550
6
+ metadata.gz: 26a81d876d54cd42e9e84a4c057297ccd77a1cfebe481de646504f8e30d08496b72141581532dfeae03d3dcb9ff955330b7e94c81bc9bb555130e501fc2879f2
7
+ data.tar.gz: 2c1242fd64e8e66e82b04aa2a4f4c0fb0979e7a0a53f8162836a90a58242f1d46d4b8660101a15c9e82b6b6e48819cdffe5053f90894a9cf1dd5040de2c21db0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 0.9.0 (2022-09-18)
4
+
5
+ #### Features
6
+
7
+ * add support to have invocation-id header ([#11655](https://github.com/googleapis/google-api-ruby-client/issues/11655))
8
+
3
9
  ### 0.8.0 (2022-09-16)
4
10
 
5
11
  #### Features
@@ -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
@@ -16,7 +16,7 @@ module Google
16
16
  module Apis
17
17
  module Core
18
18
  # Core version
19
- VERSION = "0.8.0".freeze
19
+ VERSION = "0.9.0".freeze
20
20
  end
21
21
  end
22
22
  end
@@ -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.8.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-16 00:00:00.000000000 Z
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.8.0
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: []