gapic-common 0.4.3 → 0.5.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: c317dee8aa769cec71d8bbac90f2dda4d550d5f499e2fe57cdd8ebc8c1f1e8f8
4
- data.tar.gz: 6be1ba8f2f3c9cb6247b951e72516313ead43250463c5dc90939cc294dcbcea2
3
+ metadata.gz: f181f3deefc2a5b42d783327db4c51a7e415cd7d5e58e16354ea2703cdb89293
4
+ data.tar.gz: 8aebd8ac22c5f770c551a69a82e5bfc74d5d72c13448e8d66d12a182d1ff77b0
5
5
  SHA512:
6
- metadata.gz: b9f631f39da2577cf557c6ad617fefd56615274028e226bf68dcbb7bb56f3a1642a29a0bebe8c949b37c95360ce869c18d09a64bd8b8baaeee86be8a3918451f
7
- data.tar.gz: 247fffcdbf8ef5571de60395600122ac408d89e68d9afa17e33afc2a58434311b6b523d0ae089175787906779ee7abe0247f45f67ba4e87a56b56cd36da896ac
6
+ metadata.gz: 1d8353989aaf3874d554ff160ee3d2504fa50f68a5627fb7bdb2b6b3f12941c3fb9ef677475ac0714fb7905750582ff3780ed7e6e976a890970e3ee12bdfa90b
7
+ data.tar.gz: 3c867837b3b3aaa608f0b456536cd6b091e865ef3f2e5e882662545b31d1f6da95853486ec5b1544493c16edf5b6634f0e69dc87bf7cff8244b61f5c16c05c60
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release History
2
2
 
3
+ ### 0.5.0 / 2021-06-15
4
+
5
+ * Provide a way to create `x-goog-api-client` headers with rest library version and/or without grpc library version
6
+
3
7
  ### 0.4.3 / 2021-06-10
4
8
 
5
9
  * Fix file permissions.
@@ -14,6 +14,6 @@
14
14
 
15
15
  module Gapic
16
16
  module Common
17
- VERSION = "0.4.3".freeze
17
+ VERSION = "0.5.0".freeze
18
18
  end
19
19
  end
data/lib/gapic/headers.rb CHANGED
@@ -26,17 +26,27 @@ module Gapic
26
26
  # @param gax_version [String] The Gapic version. Defaults to `Gapic::Common::VERSION`.
27
27
  # @param gapic_version [String] The Gapic version.
28
28
  # @param grpc_version [String] The GRPC version. Defaults to `GRPC::VERSION`.
29
- def self.x_goog_api_client ruby_version: nil, lib_name: nil, lib_version: nil,
30
- gax_version: nil, gapic_version: nil, grpc_version: nil
29
+ # @param rest_version [String] The Rest Library (Faraday) version. Defaults to `Faraday::VERSION`.
30
+ # @param transports_version_send [Array] Which transports to send versions for.
31
+ # Allowed values to contain are:
32
+ # `:grpc` to send the GRPC library version (if defined)
33
+ # `:rest` to send the REST library version (if defined)
34
+ # Defaults to `[:grpc]`
35
+ def self.x_goog_api_client ruby_version: nil, lib_name: nil, lib_version: nil, gax_version: nil,
36
+ gapic_version: nil, grpc_version: nil, rest_version: nil,
37
+ transports_version_send: [:grpc]
38
+
31
39
  ruby_version ||= ::RUBY_VERSION
32
40
  gax_version ||= ::Gapic::Common::VERSION
33
41
  grpc_version ||= ::GRPC::VERSION if defined? ::GRPC
42
+ rest_version ||= ::Faraday::VERSION if defined? ::Faraday
34
43
 
35
44
  x_goog_api_client_header = ["gl-ruby/#{ruby_version}"]
36
45
  x_goog_api_client_header << "#{lib_name}/#{lib_version}" if lib_name
37
46
  x_goog_api_client_header << "gax/#{gax_version}"
38
47
  x_goog_api_client_header << "gapic/#{gapic_version}" if gapic_version
39
- x_goog_api_client_header << "grpc/#{grpc_version}" if grpc_version
48
+ x_goog_api_client_header << "grpc/#{grpc_version}" if grpc_version && transports_version_send.include?(:grpc)
49
+ x_goog_api_client_header << "rest/#{rest_version}" if rest_version && transports_version_send.include?(:rest)
40
50
  x_goog_api_client_header.join " ".freeze
41
51
  end
42
52
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gapic-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google API Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-10 00:00:00.000000000 Z
11
+ date: 2021-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday