Skip to content

Commit edb4c4d

Browse files
committed
chore: Regen goldens
1 parent 71d17b7 commit edb4c4d

File tree

190 files changed

+4287
-1915
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+4287
-1915
lines changed

shared/output/ads/googleads/lib/google/ads/google_ads/v15/services/campaign_service/client.rb

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,28 @@ def initialize
151151
universe_domain: @config.universe_domain,
152152
channel_args: @config.channel_args,
153153
interceptors: @config.interceptors,
154-
channel_pool_config: @config.channel_pool
154+
channel_pool_config: @config.channel_pool,
155+
logger: @config.logger
155156
)
157+
158+
@campaign_service_stub.stub_logger&.info do |entry|
159+
entry.set_system_name
160+
entry.set_service
161+
entry.message = "Created client for #{entry.service}"
162+
entry.set_credentials_fields credentials
163+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
164+
entry.set "defaultTimeout", @config.timeout if @config.timeout
165+
entry.set "quotaProject", @quota_project_id if @quota_project_id
166+
end
167+
end
168+
169+
##
170+
# The logger used for request/response debug logging.
171+
#
172+
# @return [Logger]
173+
#
174+
def logger
175+
@campaign_service_stub.logger
156176
end
157177

158178
# Service calls
@@ -288,7 +308,6 @@ def mutate_campaigns request, options = nil
288308

289309
@campaign_service_stub.call_rpc :mutate_campaigns, request, options: options do |response, operation|
290310
yield response, operation if block_given?
291-
return response
292311
end
293312
# rescue GRPC::BadStatus => grpc_error
294313
# raise Google::Ads::GoogleAds::Error.new grpc_error.message
@@ -377,6 +396,11 @@ def mutate_campaigns request, options = nil
377396
# default endpoint URL. The default value of nil uses the environment
378397
# universe (usually the default "googleapis.com" universe).
379398
# @return [::String,nil]
399+
# @!attribute [rw] logger
400+
# A custom logger to use for request/response debug logging, or the value
401+
# `:default` (the default) to construct a default logger, or `nil` to
402+
# explicitly disable logging.
403+
# @return [::Logger,:default,nil]
380404
#
381405
class Configuration
382406
extend ::Gapic::Config
@@ -402,6 +426,7 @@ class Configuration
402426
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
403427
config_attr :quota_project, nil, ::String, nil
404428
config_attr :universe_domain, nil, ::String, nil
429+
config_attr :logger, :default, ::Logger, nil, :default
405430

406431
# @private
407432
def initialize parent_config = nil

shared/output/cloud/compute_small/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,42 @@ response = client.aggregated_list request
3333
View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest)
3434
for class and method documentation.
3535

36+
## Debug Logging
37+
38+
This library comes with opt-in Debug Logging that can help you troubleshoot
39+
your application's integration with the API. When logging is activated, key
40+
events such as requests and responses, along with data payloads and metadata
41+
such as headers and client configuration, are logged to the standard error
42+
stream.
43+
44+
**WARNING:** Client Library Debug Logging includes your data payloads in
45+
plaintext, which could include sensitive data such as PII for yourself or your
46+
customers, private keys, or other security data that could be compromising if
47+
leaked. Always practice good data hygiene with your application logs, and follow
48+
the principle of least access. Google also recommends that Client Library Debug
49+
Logging be enabled only temporarily during active debugging, and not used
50+
permanently in production.
51+
52+
To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
53+
to the value `all`. Alternatively, you can set the value to a comma-delimited
54+
list of client library gem names. This will select the default logging behavior,
55+
which writes logs to the standard error stream. On a local workstation, this may
56+
result in logs appearing on the console. When running on a Google Cloud hosting
57+
service such as [Google Cloud Run](https://cloud.google.com/run), this generally
58+
results in logs appearing alongside your application logs in the
59+
[Google Cloud Logging](https://cloud.google.com/logging/) service.
60+
61+
You can customize logging by modifying the `logger` configuration when
62+
constructing a client object. For example:
63+
64+
```ruby
65+
require "google/cloud/compute/v1"
66+
require "logger"
67+
68+
client = ::Google::Cloud::Compute::V1::Addresses::Rest::Client.new do |config|
69+
config.logger = Logger.new "my-app.log"
70+
end
71+
```
3672

3773
## Google Cloud Samples
3874

shared/output/cloud/compute_small/lib/google/cloud/compute/v1/addresses/rest/client.rb

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,19 @@ def initialize
156156
endpoint: @config.endpoint,
157157
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
158158
universe_domain: @config.universe_domain,
159-
credentials: credentials
159+
credentials: credentials,
160+
logger: @config.logger
160161
)
162+
163+
@addresses_stub.logger(stub: true)&.info do |entry|
164+
entry.set_system_name
165+
entry.set_service
166+
entry.message = "Created client for #{entry.service}"
167+
entry.set_credentials_fields credentials
168+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
169+
entry.set "defaultTimeout", @config.timeout if @config.timeout
170+
entry.set "quotaProject", @quota_project_id if @quota_project_id
171+
end
161172
end
162173

163174
##
@@ -167,6 +178,15 @@ def initialize
167178
#
168179
attr_reader :region_operations
169180

181+
##
182+
# The logger used for request/response debug logging.
183+
#
184+
# @return [Logger]
185+
#
186+
def logger
187+
@addresses_stub.logger
188+
end
189+
170190
# Service calls
171191

172192
##
@@ -265,7 +285,7 @@ def aggregated_list request, options = nil
265285
@addresses_stub.aggregated_list request, options do |result, operation|
266286
result = ::Gapic::Rest::PagedEnumerable.new @addresses_stub, :aggregated_list, "items", request, result, options
267287
yield result, operation if block_given?
268-
return result
288+
throw :response, result
269289
end
270290
rescue ::Gapic::Rest::Error => e
271291
raise ::Google::Cloud::Error.from_error(e)
@@ -363,7 +383,7 @@ def delete request, options = nil
363383
options: options
364384
)
365385
yield result, response if block_given?
366-
return result
386+
result
367387
end
368388
rescue ::Gapic::Rest::Error => e
369389
raise ::Google::Cloud::Error.from_error(e)
@@ -446,7 +466,6 @@ def get request, options = nil
446466

447467
@addresses_stub.get request, options do |result, operation|
448468
yield result, operation if block_given?
449-
return result
450469
end
451470
rescue ::Gapic::Rest::Error => e
452471
raise ::Google::Cloud::Error.from_error(e)
@@ -544,7 +563,7 @@ def insert request, options = nil
544563
options: options
545564
)
546565
yield result, response if block_given?
547-
return result
566+
result
548567
end
549568
rescue ::Gapic::Rest::Error => e
550569
raise ::Google::Cloud::Error.from_error(e)
@@ -646,7 +665,7 @@ def list request, options = nil
646665
@addresses_stub.list request, options do |result, operation|
647666
result = ::Gapic::Rest::PagedEnumerable.new @addresses_stub, :list, "items", request, result, options
648667
yield result, operation if block_given?
649-
return result
668+
throw :response, result
650669
end
651670
rescue ::Gapic::Rest::Error => e
652671
raise ::Google::Cloud::Error.from_error(e)
@@ -726,6 +745,11 @@ def list request, options = nil
726745
# default endpoint URL. The default value of nil uses the environment
727746
# universe (usually the default "googleapis.com" universe).
728747
# @return [::String,nil]
748+
# @!attribute [rw] logger
749+
# A custom logger to use for request/response debug logging, or the value
750+
# `:default` (the default) to construct a default logger, or `nil` to
751+
# explicitly disable logging.
752+
# @return [::Logger,:default,nil]
729753
#
730754
class Configuration
731755
extend ::Gapic::Config
@@ -747,6 +771,7 @@ class Configuration
747771
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
748772
config_attr :quota_project, nil, ::String, nil
749773
config_attr :universe_domain, nil, ::String, nil
774+
config_attr :logger, :default, ::Logger, nil, :default
750775

751776
# @private
752777
def initialize parent_config = nil

shared/output/cloud/compute_small/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb

Lines changed: 54 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ module Rest
3030
# including transcoding, making the REST call, and deserialing the response.
3131
#
3232
class ServiceStub
33-
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33+
# @private
34+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
3435
# These require statements are intentionally placed here to initialize
3536
# the REST modules only when it's required.
3637
require "gapic/rest"
@@ -40,7 +41,9 @@ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
4041
universe_domain: universe_domain,
4142
credentials: credentials,
4243
numeric_enums: false,
43-
raise_faraday_errors: false
44+
service_name: self.class,
45+
raise_faraday_errors: false,
46+
logger: logger
4447
end
4548

4649
##
@@ -61,6 +64,15 @@ def endpoint
6164
@client_stub.endpoint
6265
end
6366

67+
##
68+
# The logger used for request/response debug logging.
69+
#
70+
# @return [Logger]
71+
#
72+
def logger stub: false
73+
stub ? @client_stub.stub_logger : @client_stub.logger
74+
end
75+
6476
##
6577
# Baseline implementation for the aggregated_list REST call
6678
#
@@ -87,16 +99,18 @@ def aggregated_list request_pb, options = nil
8799

88100
response = @client_stub.make_http_request(
89101
verb,
90-
uri: uri,
91-
body: body || "",
92-
params: query_string_params,
102+
uri: uri,
103+
body: body || "",
104+
params: query_string_params,
105+
method_name: "aggregated_list",
93106
options: options
94107
)
95108
operation = ::Gapic::Rest::TransportOperation.new response
96109
result = ::Google::Cloud::Compute::V1::AddressAggregatedList.decode_json response.body, ignore_unknown_fields: true
97-
98-
yield result, operation if block_given?
99-
result
110+
catch :response do
111+
yield result, operation if block_given?
112+
result
113+
end
100114
end
101115

102116
##
@@ -125,16 +139,18 @@ def delete request_pb, options = nil
125139

126140
response = @client_stub.make_http_request(
127141
verb,
128-
uri: uri,
129-
body: body || "",
130-
params: query_string_params,
142+
uri: uri,
143+
body: body || "",
144+
params: query_string_params,
145+
method_name: "delete",
131146
options: options
132147
)
133148
operation = ::Gapic::Rest::TransportOperation.new response
134149
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
135-
136-
yield result, operation if block_given?
137-
result
150+
catch :response do
151+
yield result, operation if block_given?
152+
result
153+
end
138154
end
139155

140156
##
@@ -163,16 +179,18 @@ def get request_pb, options = nil
163179

164180
response = @client_stub.make_http_request(
165181
verb,
166-
uri: uri,
167-
body: body || "",
168-
params: query_string_params,
182+
uri: uri,
183+
body: body || "",
184+
params: query_string_params,
185+
method_name: "get",
169186
options: options
170187
)
171188
operation = ::Gapic::Rest::TransportOperation.new response
172189
result = ::Google::Cloud::Compute::V1::Address.decode_json response.body, ignore_unknown_fields: true
173-
174-
yield result, operation if block_given?
175-
result
190+
catch :response do
191+
yield result, operation if block_given?
192+
result
193+
end
176194
end
177195

178196
##
@@ -201,16 +219,18 @@ def insert request_pb, options = nil
201219

202220
response = @client_stub.make_http_request(
203221
verb,
204-
uri: uri,
205-
body: body || "",
206-
params: query_string_params,
222+
uri: uri,
223+
body: body || "",
224+
params: query_string_params,
225+
method_name: "insert",
207226
options: options
208227
)
209228
operation = ::Gapic::Rest::TransportOperation.new response
210229
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
211-
212-
yield result, operation if block_given?
213-
result
230+
catch :response do
231+
yield result, operation if block_given?
232+
result
233+
end
214234
end
215235

216236
##
@@ -239,16 +259,18 @@ def list request_pb, options = nil
239259

240260
response = @client_stub.make_http_request(
241261
verb,
242-
uri: uri,
243-
body: body || "",
244-
params: query_string_params,
262+
uri: uri,
263+
body: body || "",
264+
params: query_string_params,
265+
method_name: "list",
245266
options: options
246267
)
247268
operation = ::Gapic::Rest::TransportOperation.new response
248269
result = ::Google::Cloud::Compute::V1::AddressList.decode_json response.body, ignore_unknown_fields: true
249-
250-
yield result, operation if block_given?
251-
result
270+
catch :response do
271+
yield result, operation if block_given?
272+
result
273+
end
252274
end
253275

254276
##

0 commit comments

Comments
 (0)