gapic-common 1.0.0 → 1.1.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: 780d9d8bf815864f7a6074a368a30594dd92143b0e5842bc511a9f9d7aea1fd5
4
- data.tar.gz: 80a0287351754d6e3a80440e16fb4ddeb4cc79a72c761f6673309c43abfac5c1
3
+ metadata.gz: 60aaabc0d8c0eaa4e66bcf895bd40e8d03c5a58c87ba645824d0926adc7058d0
4
+ data.tar.gz: c57f415a2047a35d4ef62323335d55e01849ea535697048be99fdfef24de7cfd
5
5
  SHA512:
6
- metadata.gz: 61a3cd4ae5539ec36ed6972d02261beb91711db6e6ed7069eec654e6fdd009b2c6ff673596c2fc17688ddba45e2b90438d033bff526f93a836ec4771a57c6e83
7
- data.tar.gz: 24aad16e19d8a7d0411481169b0b0235d9de530bc41e232904e9901fe30e3a2bf3df4a6801938e6cd30af1aab8a9634ededd4bc8a36ff8b0f73342195834c137
6
+ metadata.gz: bee8cbd671cdb5c750c5d09587b315d1604e3c02403341a8a22c76d0bd9e111c4a42fd48055a151bab9e56aed1c0453315b9b7de5f5d2c68d7ff8afa198414a9
7
+ data.tar.gz: b61fd7704867b28dc8bc0ab9340a4428dd1921da49c28b3f45be936bde4a061a71e76156d45781fe68aa9ba8bc3841d97915b7347340662537a5296fcd7c16fe
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Release History
2
2
 
3
+ ### 1.1.0 (2025-08-11)
4
+
5
+ #### Features
6
+
7
+ * add http binding configuration ([#38](https://github.com/googleapis/ruby-core-libraries/issues/38))
8
+
9
+ ### 1.0.1 (2025-07-17)
10
+
11
+ #### Bug Fixes
12
+
13
+ * Removed log preprocessing of large payload data when logging is disabled ([#35](https://github.com/googleapis/ruby-core-libraries/issues/35))
14
+
3
15
  ### 1.0.0 (2025-04-30)
4
16
 
5
17
  #### Features
@@ -14,6 +14,6 @@
14
14
 
15
15
  module Gapic
16
16
  module Common
17
- VERSION = "1.0.0".freeze
17
+ VERSION = "1.1.0".freeze
18
18
  end
19
19
  end
@@ -183,7 +183,7 @@ module Gapic
183
183
  end
184
184
 
185
185
  def log_request request, metadata, try_number
186
- return request unless @stub_logger
186
+ return request unless @stub_logger&.enabled?
187
187
  @stub_logger.info do |entry|
188
188
  entry.set_system_name
189
189
  entry.set_service
@@ -221,7 +221,7 @@ module Gapic
221
221
  end
222
222
 
223
223
  def log_response response, try_number
224
- return response unless @stub_logger
224
+ return response unless @stub_logger&.enabled?
225
225
  @stub_logger.info do |entry|
226
226
  entry.set_system_name
227
227
  entry.set_service
@@ -42,6 +42,10 @@ module Gapic
42
42
  @kwargs = kwargs
43
43
  end
44
44
 
45
+ def enabled?
46
+ !!@logger
47
+ end
48
+
45
49
  def log severity
46
50
  return unless @logger
47
51
  locations = caller_locations
@@ -278,7 +278,7 @@ module Gapic
278
278
  end
279
279
 
280
280
  def log_request method_name, request_id, try_number, body, metadata
281
- return unless stub_logger
281
+ return unless stub_logger&.enabled?
282
282
  stub_logger.info do |entry|
283
283
  entry.set_system_name
284
284
  entry.set_service
@@ -299,7 +299,7 @@ module Gapic
299
299
  end
300
300
 
301
301
  def log_response method_name, request_id, try_number, response, is_server_streaming
302
- return unless stub_logger
302
+ return unless stub_logger&.enabled?
303
303
  stub_logger.info do |entry|
304
304
  entry.set_system_name
305
305
  entry.set_service
@@ -0,0 +1,48 @@
1
+ # Copyright 2025 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require "gapic/config"
16
+
17
+ module Gapic
18
+ module Rest
19
+ ##
20
+ # @private
21
+ # A specialized Configuration class to use when generating
22
+ # package-level binding override configuration.
23
+ #
24
+ # This configuration is for internal use of the client library classes,
25
+ # and it is not intended that the end-users will read or change it.
26
+ #
27
+ # @attribute [rw] bindings_override
28
+ # Overrides for http bindings for the RPC of the mixins for the given package.
29
+ # return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
30
+ #
31
+ class HttpBindingOverrideConfiguration
32
+ extend ::Gapic::Config
33
+
34
+ # @private
35
+ # Overrides for http bindings for the RPC of the mixins for the given package.
36
+ # Services in the package should use these when creating clients for the mixin services.
37
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
38
+ config_attr :bindings_override, {}, ::Hash, nil
39
+
40
+ # @private
41
+ def initialize parent_config = nil
42
+ @parent_config = parent_config unless parent_config.nil?
43
+
44
+ yield self if block_given?
45
+ end
46
+ end
47
+ end
48
+ end
data/lib/gapic/rest.rb CHANGED
@@ -25,6 +25,7 @@ require "gapic/rest/client_stub"
25
25
  require "gapic/rest/error"
26
26
  require "gapic/rest/faraday_middleware"
27
27
  require "gapic/rest/grpc_transcoder"
28
+ require "gapic/rest/http_binding_override_configuration"
28
29
  require "gapic/rest/operation"
29
30
  require "gapic/rest/paged_enumerable"
30
31
  require "gapic/rest/server_stream"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gapic-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google API Authors
@@ -200,6 +200,7 @@ files:
200
200
  - lib/gapic/rest/faraday_middleware.rb
201
201
  - lib/gapic/rest/grpc_transcoder.rb
202
202
  - lib/gapic/rest/grpc_transcoder/http_binding.rb
203
+ - lib/gapic/rest/http_binding_override_configuration.rb
203
204
  - lib/gapic/rest/operation.rb
204
205
  - lib/gapic/rest/paged_enumerable.rb
205
206
  - lib/gapic/rest/server_stream.rb
@@ -225,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
225
226
  - !ruby/object:Gem::Version
226
227
  version: '0'
227
228
  requirements: []
228
- rubygems_version: 3.6.8
229
+ rubygems_version: 3.6.9
229
230
  specification_version: 4
230
231
  summary: Common code for GAPIC-generated API clients
231
232
  test_files: []