google-shopping-merchant-lfp-v1beta 0.1.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a1f9a34bf1ed4b305df6ed8575d3c5a4d4a88e59108848e404559f8d47d0669
4
- data.tar.gz: 7cc5d176bf05c74147f99a44bff0936c422475869a7e92617129b7a7cd0ade97
3
+ metadata.gz: e951aa25c4a01b55a25a67dc2cb72e9e9bd32b67774111308404482e1a3f9f4d
4
+ data.tar.gz: f4564b3252950aab0ef0b812bcde04e468be7fe7116e7df614605c9b355076ea
5
5
  SHA512:
6
- metadata.gz: 7f5a730a076bc0ac263bdf4dcefa2dd10df96f0eab6987752ca8a541480e2157046757b33c10ec83c9eba2b70a4dc10c5c405ad8f46d42bede6c4679d03e3919
7
- data.tar.gz: 82819c20764a1d4b955bc1767fe92a397ce883d66681dfacbc7892c9d751a3ef518b3a811ed3d06e8b35a7e7ea435d6ad351a77ca92a012fd3a1743d78f82b41
6
+ metadata.gz: 3e73f56dd1fd5fd44cce8c11b3c00a581c992faf98e08da147643876231e6ce4139c2e9171d1b20c14bb3f7cd63618e5d5fa8a6016f3f354c1de07e5205e5883
7
+ data.tar.gz: ac586f12f5d1cddf7921f4c5090b84647b23fe33ad2afd74a2b342f23e143a5317a2388e52f15216efa10fda13bbaf03f38e5a9270ded433e819ba2f7f744454
data/README.md CHANGED
@@ -42,40 +42,50 @@ for class and method documentation.
42
42
  See also the [Product Documentation](https://developers.google.com/merchant/api)
43
43
  for general usage information.
44
44
 
45
- ## Enabling Logging
46
-
47
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
48
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
49
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
50
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
51
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
52
-
53
- Configuring a Ruby stdlib logger:
45
+ ## Debug Logging
46
+
47
+ This library comes with opt-in Debug Logging that can help you troubleshoot
48
+ your application's integration with the API. When logging is activated, key
49
+ events such as requests and responses, along with data payloads and metadata
50
+ such as headers and client configuration, are logged to the standard error
51
+ stream.
52
+
53
+ **WARNING:** Client Library Debug Logging includes your data payloads in
54
+ plaintext, which could include sensitive data such as PII for yourself or your
55
+ customers, private keys, or other security data that could be compromising if
56
+ leaked. Always practice good data hygiene with your application logs, and follow
57
+ the principle of least access. Google also recommends that Client Library Debug
58
+ Logging be enabled only temporarily during active debugging, and not used
59
+ permanently in production.
60
+
61
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
62
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
63
+ list of client library gem names. This will select the default logging behavior,
64
+ which writes logs to the standard error stream. On a local workstation, this may
65
+ result in logs appearing on the console. When running on a Google Cloud hosting
66
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
67
+ results in logs appearing alongside your application logs in the
68
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
69
+
70
+ You can customize logging by modifying the `logger` configuration when
71
+ constructing a client object. For example:
54
72
 
55
73
  ```ruby
74
+ require "google/shopping/merchant/lfp/v1beta"
56
75
  require "logger"
57
76
 
58
- module MyLogger
59
- LOGGER = Logger.new $stderr, level: Logger::WARN
60
- def logger
61
- LOGGER
62
- end
63
- end
64
-
65
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
66
- module GRPC
67
- extend MyLogger
77
+ client = ::Google::Shopping::Merchant::Lfp::V1beta::LfpInventoryService::Client.new do |config|
78
+ config.logger = Logger.new "my-app.log"
68
79
  end
69
80
  ```
70
81
 
71
-
72
82
  ## Google Cloud Samples
73
83
 
74
84
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
75
85
 
76
86
  ## Supported Ruby Versions
77
87
 
78
- This library is supported on Ruby 2.7+.
88
+ This library is supported on Ruby 3.0+.
79
89
 
80
90
  Google provides official support for Ruby versions that are actively supported
81
91
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -165,8 +165,28 @@ module Google
165
165
  universe_domain: @config.universe_domain,
166
166
  channel_args: @config.channel_args,
167
167
  interceptors: @config.interceptors,
168
- channel_pool_config: @config.channel_pool
168
+ channel_pool_config: @config.channel_pool,
169
+ logger: @config.logger
169
170
  )
171
+
172
+ @lfp_inventory_service_stub.stub_logger&.info do |entry|
173
+ entry.set_system_name
174
+ entry.set_service
175
+ entry.message = "Created client for #{entry.service}"
176
+ entry.set_credentials_fields credentials
177
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
178
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
179
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
180
+ end
181
+ end
182
+
183
+ ##
184
+ # The logger used for request/response debug logging.
185
+ #
186
+ # @return [Logger]
187
+ #
188
+ def logger
189
+ @lfp_inventory_service_stub.logger
170
190
  end
171
191
 
172
192
  # Service calls
@@ -256,7 +276,6 @@ module Google
256
276
 
257
277
  @lfp_inventory_service_stub.call_rpc :insert_lfp_inventory, request, options: options do |response, operation|
258
278
  yield response, operation if block_given?
259
- return response
260
279
  end
261
280
  rescue ::GRPC::BadStatus => e
262
281
  raise ::Google::Cloud::Error.from_error(e)
@@ -306,6 +325,13 @@ module Google
306
325
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
307
326
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
308
327
  # * (`nil`) indicating no credentials
328
+ #
329
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
330
+ # external source for authentication to Google Cloud, you must validate it before
331
+ # providing it to a Google API client library. Providing an unvalidated credential
332
+ # configuration to Google APIs can compromise the security of your systems and data.
333
+ # For more information, refer to [Validate credential configurations from external
334
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
309
335
  # @return [::Object]
310
336
  # @!attribute [rw] scope
311
337
  # The OAuth scopes
@@ -345,6 +371,11 @@ module Google
345
371
  # default endpoint URL. The default value of nil uses the environment
346
372
  # universe (usually the default "googleapis.com" universe).
347
373
  # @return [::String,nil]
374
+ # @!attribute [rw] logger
375
+ # A custom logger to use for request/response debug logging, or the value
376
+ # `:default` (the default) to construct a default logger, or `nil` to
377
+ # explicitly disable logging.
378
+ # @return [::Logger,:default,nil]
348
379
  #
349
380
  class Configuration
350
381
  extend ::Gapic::Config
@@ -369,6 +400,7 @@ module Google
369
400
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
370
401
  config_attr :quota_project, nil, ::String, nil
371
402
  config_attr :universe_domain, nil, ::String, nil
403
+ config_attr :logger, :default, ::Logger, nil, :default
372
404
 
373
405
  # @private
374
406
  def initialize parent_config = nil
@@ -158,8 +158,28 @@ module Google
158
158
  endpoint: @config.endpoint,
159
159
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
160
160
  universe_domain: @config.universe_domain,
161
- credentials: credentials
161
+ credentials: credentials,
162
+ logger: @config.logger
162
163
  )
164
+
165
+ @lfp_inventory_service_stub.logger(stub: true)&.info do |entry|
166
+ entry.set_system_name
167
+ entry.set_service
168
+ entry.message = "Created client for #{entry.service}"
169
+ entry.set_credentials_fields credentials
170
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
171
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
172
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
173
+ end
174
+ end
175
+
176
+ ##
177
+ # The logger used for request/response debug logging.
178
+ #
179
+ # @return [Logger]
180
+ #
181
+ def logger
182
+ @lfp_inventory_service_stub.logger
163
183
  end
164
184
 
165
185
  # Service calls
@@ -242,7 +262,6 @@ module Google
242
262
 
243
263
  @lfp_inventory_service_stub.insert_lfp_inventory request, options do |result, operation|
244
264
  yield result, operation if block_given?
245
- return result
246
265
  end
247
266
  rescue ::Gapic::Rest::Error => e
248
267
  raise ::Google::Cloud::Error.from_error(e)
@@ -290,6 +309,13 @@ module Google
290
309
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
291
310
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
292
311
  # * (`nil`) indicating no credentials
312
+ #
313
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
314
+ # external source for authentication to Google Cloud, you must validate it before
315
+ # providing it to a Google API client library. Providing an unvalidated credential
316
+ # configuration to Google APIs can compromise the security of your systems and data.
317
+ # For more information, refer to [Validate credential configurations from external
318
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
293
319
  # @return [::Object]
294
320
  # @!attribute [rw] scope
295
321
  # The OAuth scopes
@@ -322,6 +348,11 @@ module Google
322
348
  # default endpoint URL. The default value of nil uses the environment
323
349
  # universe (usually the default "googleapis.com" universe).
324
350
  # @return [::String,nil]
351
+ # @!attribute [rw] logger
352
+ # A custom logger to use for request/response debug logging, or the value
353
+ # `:default` (the default) to construct a default logger, or `nil` to
354
+ # explicitly disable logging.
355
+ # @return [::Logger,:default,nil]
325
356
  #
326
357
  class Configuration
327
358
  extend ::Gapic::Config
@@ -343,6 +374,7 @@ module Google
343
374
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
344
375
  config_attr :quota_project, nil, ::String, nil
345
376
  config_attr :universe_domain, nil, ::String, nil
377
+ config_attr :logger, :default, ::Logger, nil, :default
346
378
 
347
379
  # @private
348
380
  def initialize parent_config = nil
@@ -31,7 +31,8 @@ module Google
31
31
  # including transcoding, making the REST call, and deserialing the response.
32
32
  #
33
33
  class ServiceStub
34
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
+ # @private
35
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
35
36
  # These require statements are intentionally placed here to initialize
36
37
  # the REST modules only when it's required.
37
38
  require "gapic/rest"
@@ -41,7 +42,9 @@ module Google
41
42
  universe_domain: universe_domain,
42
43
  credentials: credentials,
43
44
  numeric_enums: true,
44
- raise_faraday_errors: false
45
+ service_name: self.class,
46
+ raise_faraday_errors: false,
47
+ logger: logger
45
48
  end
46
49
 
47
50
  ##
@@ -62,6 +65,15 @@ module Google
62
65
  @client_stub.endpoint
63
66
  end
64
67
 
68
+ ##
69
+ # The logger used for request/response debug logging.
70
+ #
71
+ # @return [Logger]
72
+ #
73
+ def logger stub: false
74
+ stub ? @client_stub.stub_logger : @client_stub.logger
75
+ end
76
+
65
77
  ##
66
78
  # Baseline implementation for the insert_lfp_inventory REST call
67
79
  #
@@ -88,16 +100,18 @@ module Google
88
100
 
89
101
  response = @client_stub.make_http_request(
90
102
  verb,
91
- uri: uri,
92
- body: body || "",
93
- params: query_string_params,
103
+ uri: uri,
104
+ body: body || "",
105
+ params: query_string_params,
106
+ method_name: "insert_lfp_inventory",
94
107
  options: options
95
108
  )
96
109
  operation = ::Gapic::Rest::TransportOperation.new response
97
110
  result = ::Google::Shopping::Merchant::Lfp::V1beta::LfpInventory.decode_json response.body, ignore_unknown_fields: true
98
-
99
- yield result, operation if block_given?
100
- result
111
+ catch :response do
112
+ yield result, operation if block_given?
113
+ result
114
+ end
101
115
  end
102
116
 
103
117
  ##
@@ -165,8 +165,28 @@ module Google
165
165
  universe_domain: @config.universe_domain,
166
166
  channel_args: @config.channel_args,
167
167
  interceptors: @config.interceptors,
168
- channel_pool_config: @config.channel_pool
168
+ channel_pool_config: @config.channel_pool,
169
+ logger: @config.logger
169
170
  )
171
+
172
+ @lfp_sale_service_stub.stub_logger&.info do |entry|
173
+ entry.set_system_name
174
+ entry.set_service
175
+ entry.message = "Created client for #{entry.service}"
176
+ entry.set_credentials_fields credentials
177
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
178
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
179
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
180
+ end
181
+ end
182
+
183
+ ##
184
+ # The logger used for request/response debug logging.
185
+ #
186
+ # @return [Logger]
187
+ #
188
+ def logger
189
+ @lfp_sale_service_stub.logger
170
190
  end
171
191
 
172
192
  # Service calls
@@ -254,7 +274,6 @@ module Google
254
274
 
255
275
  @lfp_sale_service_stub.call_rpc :insert_lfp_sale, request, options: options do |response, operation|
256
276
  yield response, operation if block_given?
257
- return response
258
277
  end
259
278
  rescue ::GRPC::BadStatus => e
260
279
  raise ::Google::Cloud::Error.from_error(e)
@@ -304,6 +323,13 @@ module Google
304
323
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
305
324
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
306
325
  # * (`nil`) indicating no credentials
326
+ #
327
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
328
+ # external source for authentication to Google Cloud, you must validate it before
329
+ # providing it to a Google API client library. Providing an unvalidated credential
330
+ # configuration to Google APIs can compromise the security of your systems and data.
331
+ # For more information, refer to [Validate credential configurations from external
332
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
307
333
  # @return [::Object]
308
334
  # @!attribute [rw] scope
309
335
  # The OAuth scopes
@@ -343,6 +369,11 @@ module Google
343
369
  # default endpoint URL. The default value of nil uses the environment
344
370
  # universe (usually the default "googleapis.com" universe).
345
371
  # @return [::String,nil]
372
+ # @!attribute [rw] logger
373
+ # A custom logger to use for request/response debug logging, or the value
374
+ # `:default` (the default) to construct a default logger, or `nil` to
375
+ # explicitly disable logging.
376
+ # @return [::Logger,:default,nil]
346
377
  #
347
378
  class Configuration
348
379
  extend ::Gapic::Config
@@ -367,6 +398,7 @@ module Google
367
398
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
368
399
  config_attr :quota_project, nil, ::String, nil
369
400
  config_attr :universe_domain, nil, ::String, nil
401
+ config_attr :logger, :default, ::Logger, nil, :default
370
402
 
371
403
  # @private
372
404
  def initialize parent_config = nil
@@ -158,8 +158,28 @@ module Google
158
158
  endpoint: @config.endpoint,
159
159
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
160
160
  universe_domain: @config.universe_domain,
161
- credentials: credentials
161
+ credentials: credentials,
162
+ logger: @config.logger
162
163
  )
164
+
165
+ @lfp_sale_service_stub.logger(stub: true)&.info do |entry|
166
+ entry.set_system_name
167
+ entry.set_service
168
+ entry.message = "Created client for #{entry.service}"
169
+ entry.set_credentials_fields credentials
170
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
171
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
172
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
173
+ end
174
+ end
175
+
176
+ ##
177
+ # The logger used for request/response debug logging.
178
+ #
179
+ # @return [Logger]
180
+ #
181
+ def logger
182
+ @lfp_sale_service_stub.logger
163
183
  end
164
184
 
165
185
  # Service calls
@@ -240,7 +260,6 @@ module Google
240
260
 
241
261
  @lfp_sale_service_stub.insert_lfp_sale request, options do |result, operation|
242
262
  yield result, operation if block_given?
243
- return result
244
263
  end
245
264
  rescue ::Gapic::Rest::Error => e
246
265
  raise ::Google::Cloud::Error.from_error(e)
@@ -288,6 +307,13 @@ module Google
288
307
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
289
308
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
290
309
  # * (`nil`) indicating no credentials
310
+ #
311
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
312
+ # external source for authentication to Google Cloud, you must validate it before
313
+ # providing it to a Google API client library. Providing an unvalidated credential
314
+ # configuration to Google APIs can compromise the security of your systems and data.
315
+ # For more information, refer to [Validate credential configurations from external
316
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
291
317
  # @return [::Object]
292
318
  # @!attribute [rw] scope
293
319
  # The OAuth scopes
@@ -320,6 +346,11 @@ module Google
320
346
  # default endpoint URL. The default value of nil uses the environment
321
347
  # universe (usually the default "googleapis.com" universe).
322
348
  # @return [::String,nil]
349
+ # @!attribute [rw] logger
350
+ # A custom logger to use for request/response debug logging, or the value
351
+ # `:default` (the default) to construct a default logger, or `nil` to
352
+ # explicitly disable logging.
353
+ # @return [::Logger,:default,nil]
323
354
  #
324
355
  class Configuration
325
356
  extend ::Gapic::Config
@@ -341,6 +372,7 @@ module Google
341
372
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
342
373
  config_attr :quota_project, nil, ::String, nil
343
374
  config_attr :universe_domain, nil, ::String, nil
375
+ config_attr :logger, :default, ::Logger, nil, :default
344
376
 
345
377
  # @private
346
378
  def initialize parent_config = nil
@@ -31,7 +31,8 @@ module Google
31
31
  # including transcoding, making the REST call, and deserialing the response.
32
32
  #
33
33
  class ServiceStub
34
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
+ # @private
35
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
35
36
  # These require statements are intentionally placed here to initialize
36
37
  # the REST modules only when it's required.
37
38
  require "gapic/rest"
@@ -41,7 +42,9 @@ module Google
41
42
  universe_domain: universe_domain,
42
43
  credentials: credentials,
43
44
  numeric_enums: true,
44
- raise_faraday_errors: false
45
+ service_name: self.class,
46
+ raise_faraday_errors: false,
47
+ logger: logger
45
48
  end
46
49
 
47
50
  ##
@@ -62,6 +65,15 @@ module Google
62
65
  @client_stub.endpoint
63
66
  end
64
67
 
68
+ ##
69
+ # The logger used for request/response debug logging.
70
+ #
71
+ # @return [Logger]
72
+ #
73
+ def logger stub: false
74
+ stub ? @client_stub.stub_logger : @client_stub.logger
75
+ end
76
+
65
77
  ##
66
78
  # Baseline implementation for the insert_lfp_sale REST call
67
79
  #
@@ -88,16 +100,18 @@ module Google
88
100
 
89
101
  response = @client_stub.make_http_request(
90
102
  verb,
91
- uri: uri,
92
- body: body || "",
93
- params: query_string_params,
103
+ uri: uri,
104
+ body: body || "",
105
+ params: query_string_params,
106
+ method_name: "insert_lfp_sale",
94
107
  options: options
95
108
  )
96
109
  operation = ::Gapic::Rest::TransportOperation.new response
97
110
  result = ::Google::Shopping::Merchant::Lfp::V1beta::LfpSale.decode_json response.body, ignore_unknown_fields: true
98
-
99
- yield result, operation if block_given?
100
- result
111
+ catch :response do
112
+ yield result, operation if block_given?
113
+ result
114
+ end
101
115
  end
102
116
 
103
117
  ##
@@ -165,8 +165,28 @@ module Google
165
165
  universe_domain: @config.universe_domain,
166
166
  channel_args: @config.channel_args,
167
167
  interceptors: @config.interceptors,
168
- channel_pool_config: @config.channel_pool
168
+ channel_pool_config: @config.channel_pool,
169
+ logger: @config.logger
169
170
  )
171
+
172
+ @lfp_store_service_stub.stub_logger&.info do |entry|
173
+ entry.set_system_name
174
+ entry.set_service
175
+ entry.message = "Created client for #{entry.service}"
176
+ entry.set_credentials_fields credentials
177
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
178
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
179
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
180
+ end
181
+ end
182
+
183
+ ##
184
+ # The logger used for request/response debug logging.
185
+ #
186
+ # @return [Logger]
187
+ #
188
+ def logger
189
+ @lfp_store_service_stub.logger
170
190
  end
171
191
 
172
192
  # Service calls
@@ -252,7 +272,6 @@ module Google
252
272
 
253
273
  @lfp_store_service_stub.call_rpc :get_lfp_store, request, options: options do |response, operation|
254
274
  yield response, operation if block_given?
255
- return response
256
275
  end
257
276
  rescue ::GRPC::BadStatus => e
258
277
  raise ::Google::Cloud::Error.from_error(e)
@@ -342,7 +361,6 @@ module Google
342
361
 
343
362
  @lfp_store_service_stub.call_rpc :insert_lfp_store, request, options: options do |response, operation|
344
363
  yield response, operation if block_given?
345
- return response
346
364
  end
347
365
  rescue ::GRPC::BadStatus => e
348
366
  raise ::Google::Cloud::Error.from_error(e)
@@ -429,7 +447,6 @@ module Google
429
447
 
430
448
  @lfp_store_service_stub.call_rpc :delete_lfp_store, request, options: options do |response, operation|
431
449
  yield response, operation if block_given?
432
- return response
433
450
  end
434
451
  rescue ::GRPC::BadStatus => e
435
452
  raise ::Google::Cloud::Error.from_error(e)
@@ -537,7 +554,7 @@ module Google
537
554
  @lfp_store_service_stub.call_rpc :list_lfp_stores, request, options: options do |response, operation|
538
555
  response = ::Gapic::PagedEnumerable.new @lfp_store_service_stub, :list_lfp_stores, request, response, operation, options
539
556
  yield response, operation if block_given?
540
- return response
557
+ throw :response, response
541
558
  end
542
559
  rescue ::GRPC::BadStatus => e
543
560
  raise ::Google::Cloud::Error.from_error(e)
@@ -587,6 +604,13 @@ module Google
587
604
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
588
605
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
589
606
  # * (`nil`) indicating no credentials
607
+ #
608
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
609
+ # external source for authentication to Google Cloud, you must validate it before
610
+ # providing it to a Google API client library. Providing an unvalidated credential
611
+ # configuration to Google APIs can compromise the security of your systems and data.
612
+ # For more information, refer to [Validate credential configurations from external
613
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
590
614
  # @return [::Object]
591
615
  # @!attribute [rw] scope
592
616
  # The OAuth scopes
@@ -626,6 +650,11 @@ module Google
626
650
  # default endpoint URL. The default value of nil uses the environment
627
651
  # universe (usually the default "googleapis.com" universe).
628
652
  # @return [::String,nil]
653
+ # @!attribute [rw] logger
654
+ # A custom logger to use for request/response debug logging, or the value
655
+ # `:default` (the default) to construct a default logger, or `nil` to
656
+ # explicitly disable logging.
657
+ # @return [::Logger,:default,nil]
629
658
  #
630
659
  class Configuration
631
660
  extend ::Gapic::Config
@@ -650,6 +679,7 @@ module Google
650
679
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
651
680
  config_attr :quota_project, nil, ::String, nil
652
681
  config_attr :universe_domain, nil, ::String, nil
682
+ config_attr :logger, :default, ::Logger, nil, :default
653
683
 
654
684
  # @private
655
685
  def initialize parent_config = nil
@@ -158,8 +158,28 @@ module Google
158
158
  endpoint: @config.endpoint,
159
159
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
160
160
  universe_domain: @config.universe_domain,
161
- credentials: credentials
161
+ credentials: credentials,
162
+ logger: @config.logger
162
163
  )
164
+
165
+ @lfp_store_service_stub.logger(stub: true)&.info do |entry|
166
+ entry.set_system_name
167
+ entry.set_service
168
+ entry.message = "Created client for #{entry.service}"
169
+ entry.set_credentials_fields credentials
170
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
171
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
172
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
173
+ end
174
+ end
175
+
176
+ ##
177
+ # The logger used for request/response debug logging.
178
+ #
179
+ # @return [Logger]
180
+ #
181
+ def logger
182
+ @lfp_store_service_stub.logger
163
183
  end
164
184
 
165
185
  # Service calls
@@ -238,7 +258,6 @@ module Google
238
258
 
239
259
  @lfp_store_service_stub.get_lfp_store request, options do |result, operation|
240
260
  yield result, operation if block_given?
241
- return result
242
261
  end
243
262
  rescue ::Gapic::Rest::Error => e
244
263
  raise ::Google::Cloud::Error.from_error(e)
@@ -321,7 +340,6 @@ module Google
321
340
 
322
341
  @lfp_store_service_stub.insert_lfp_store request, options do |result, operation|
323
342
  yield result, operation if block_given?
324
- return result
325
343
  end
326
344
  rescue ::Gapic::Rest::Error => e
327
345
  raise ::Google::Cloud::Error.from_error(e)
@@ -401,7 +419,6 @@ module Google
401
419
 
402
420
  @lfp_store_service_stub.delete_lfp_store request, options do |result, operation|
403
421
  yield result, operation if block_given?
404
- return result
405
422
  end
406
423
  rescue ::Gapic::Rest::Error => e
407
424
  raise ::Google::Cloud::Error.from_error(e)
@@ -502,7 +519,7 @@ module Google
502
519
  @lfp_store_service_stub.list_lfp_stores request, options do |result, operation|
503
520
  result = ::Gapic::Rest::PagedEnumerable.new @lfp_store_service_stub, :list_lfp_stores, "lfp_stores", request, result, options
504
521
  yield result, operation if block_given?
505
- return result
522
+ throw :response, result
506
523
  end
507
524
  rescue ::Gapic::Rest::Error => e
508
525
  raise ::Google::Cloud::Error.from_error(e)
@@ -550,6 +567,13 @@ module Google
550
567
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
551
568
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
552
569
  # * (`nil`) indicating no credentials
570
+ #
571
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
572
+ # external source for authentication to Google Cloud, you must validate it before
573
+ # providing it to a Google API client library. Providing an unvalidated credential
574
+ # configuration to Google APIs can compromise the security of your systems and data.
575
+ # For more information, refer to [Validate credential configurations from external
576
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
553
577
  # @return [::Object]
554
578
  # @!attribute [rw] scope
555
579
  # The OAuth scopes
@@ -582,6 +606,11 @@ module Google
582
606
  # default endpoint URL. The default value of nil uses the environment
583
607
  # universe (usually the default "googleapis.com" universe).
584
608
  # @return [::String,nil]
609
+ # @!attribute [rw] logger
610
+ # A custom logger to use for request/response debug logging, or the value
611
+ # `:default` (the default) to construct a default logger, or `nil` to
612
+ # explicitly disable logging.
613
+ # @return [::Logger,:default,nil]
585
614
  #
586
615
  class Configuration
587
616
  extend ::Gapic::Config
@@ -603,6 +632,7 @@ module Google
603
632
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
604
633
  config_attr :quota_project, nil, ::String, nil
605
634
  config_attr :universe_domain, nil, ::String, nil
635
+ config_attr :logger, :default, ::Logger, nil, :default
606
636
 
607
637
  # @private
608
638
  def initialize parent_config = nil
@@ -31,7 +31,8 @@ module Google
31
31
  # including transcoding, making the REST call, and deserialing the response.
32
32
  #
33
33
  class ServiceStub
34
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
+ # @private
35
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
35
36
  # These require statements are intentionally placed here to initialize
36
37
  # the REST modules only when it's required.
37
38
  require "gapic/rest"
@@ -41,7 +42,9 @@ module Google
41
42
  universe_domain: universe_domain,
42
43
  credentials: credentials,
43
44
  numeric_enums: true,
44
- raise_faraday_errors: false
45
+ service_name: self.class,
46
+ raise_faraday_errors: false,
47
+ logger: logger
45
48
  end
46
49
 
47
50
  ##
@@ -62,6 +65,15 @@ module Google
62
65
  @client_stub.endpoint
63
66
  end
64
67
 
68
+ ##
69
+ # The logger used for request/response debug logging.
70
+ #
71
+ # @return [Logger]
72
+ #
73
+ def logger stub: false
74
+ stub ? @client_stub.stub_logger : @client_stub.logger
75
+ end
76
+
65
77
  ##
66
78
  # Baseline implementation for the get_lfp_store REST call
67
79
  #
@@ -88,16 +100,18 @@ module Google
88
100
 
89
101
  response = @client_stub.make_http_request(
90
102
  verb,
91
- uri: uri,
92
- body: body || "",
93
- params: query_string_params,
103
+ uri: uri,
104
+ body: body || "",
105
+ params: query_string_params,
106
+ method_name: "get_lfp_store",
94
107
  options: options
95
108
  )
96
109
  operation = ::Gapic::Rest::TransportOperation.new response
97
110
  result = ::Google::Shopping::Merchant::Lfp::V1beta::LfpStore.decode_json response.body, ignore_unknown_fields: true
98
-
99
- yield result, operation if block_given?
100
- result
111
+ catch :response do
112
+ yield result, operation if block_given?
113
+ result
114
+ end
101
115
  end
102
116
 
103
117
  ##
@@ -126,16 +140,18 @@ module Google
126
140
 
127
141
  response = @client_stub.make_http_request(
128
142
  verb,
129
- uri: uri,
130
- body: body || "",
131
- params: query_string_params,
143
+ uri: uri,
144
+ body: body || "",
145
+ params: query_string_params,
146
+ method_name: "insert_lfp_store",
132
147
  options: options
133
148
  )
134
149
  operation = ::Gapic::Rest::TransportOperation.new response
135
150
  result = ::Google::Shopping::Merchant::Lfp::V1beta::LfpStore.decode_json response.body, ignore_unknown_fields: true
136
-
137
- yield result, operation if block_given?
138
- result
151
+ catch :response do
152
+ yield result, operation if block_given?
153
+ result
154
+ end
139
155
  end
140
156
 
141
157
  ##
@@ -164,16 +180,18 @@ module Google
164
180
 
165
181
  response = @client_stub.make_http_request(
166
182
  verb,
167
- uri: uri,
168
- body: body || "",
169
- params: query_string_params,
183
+ uri: uri,
184
+ body: body || "",
185
+ params: query_string_params,
186
+ method_name: "delete_lfp_store",
170
187
  options: options
171
188
  )
172
189
  operation = ::Gapic::Rest::TransportOperation.new response
173
190
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
174
-
175
- yield result, operation if block_given?
176
- result
191
+ catch :response do
192
+ yield result, operation if block_given?
193
+ result
194
+ end
177
195
  end
178
196
 
179
197
  ##
@@ -202,16 +220,18 @@ module Google
202
220
 
203
221
  response = @client_stub.make_http_request(
204
222
  verb,
205
- uri: uri,
206
- body: body || "",
207
- params: query_string_params,
223
+ uri: uri,
224
+ body: body || "",
225
+ params: query_string_params,
226
+ method_name: "list_lfp_stores",
208
227
  options: options
209
228
  )
210
229
  operation = ::Gapic::Rest::TransportOperation.new response
211
230
  result = ::Google::Shopping::Merchant::Lfp::V1beta::ListLfpStoresResponse.decode_json response.body, ignore_unknown_fields: true
212
-
213
- yield result, operation if block_given?
214
- result
231
+ catch :response do
232
+ yield result, operation if block_given?
233
+ result
234
+ end
215
235
  end
216
236
 
217
237
  ##
@@ -22,7 +22,7 @@ module Google
22
22
  module Merchant
23
23
  module Lfp
24
24
  module V1beta
25
- VERSION = "0.1.3"
25
+ VERSION = "0.3.0"
26
26
  end
27
27
  end
28
28
  end
@@ -28,6 +28,9 @@ module Google
28
28
  # @!attribute [rw] destinations
29
29
  # @return [::Array<::Google::Api::ClientLibraryDestination>]
30
30
  # The destination where API teams want this client library to be published.
31
+ # @!attribute [rw] selective_gapic_generation
32
+ # @return [::Google::Api::SelectiveGapicGeneration]
33
+ # Configuration for which RPCs should be generated in the GAPIC client.
31
34
  class CommonLanguageSettings
32
35
  include ::Google::Protobuf::MessageExts
33
36
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -212,6 +215,12 @@ module Google
212
215
  # enabled. By default, asynchronous REST clients will not be generated.
213
216
  # This feature will be enabled by default 1 month after launching the
214
217
  # feature in preview packages.
218
+ # @!attribute [rw] protobuf_pythonic_types_enabled
219
+ # @return [::Boolean]
220
+ # Enables generation of protobuf code using new types that are more
221
+ # Pythonic which are included in `protobuf>=5.29.x`. This feature will be
222
+ # enabled by default 1 month after launching the feature in preview
223
+ # packages.
215
224
  class ExperimentalFeatures
216
225
  include ::Google::Protobuf::MessageExts
217
226
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -297,9 +306,28 @@ module Google
297
306
  # @!attribute [rw] common
298
307
  # @return [::Google::Api::CommonLanguageSettings]
299
308
  # Some settings.
309
+ # @!attribute [rw] renamed_services
310
+ # @return [::Google::Protobuf::Map{::String => ::String}]
311
+ # Map of service names to renamed services. Keys are the package relative
312
+ # service names and values are the name to be used for the service client
313
+ # and call options.
314
+ #
315
+ # publishing:
316
+ # go_settings:
317
+ # renamed_services:
318
+ # Publisher: TopicAdmin
300
319
  class GoSettings
301
320
  include ::Google::Protobuf::MessageExts
302
321
  extend ::Google::Protobuf::MessageExts::ClassMethods
322
+
323
+ # @!attribute [rw] key
324
+ # @return [::String]
325
+ # @!attribute [rw] value
326
+ # @return [::String]
327
+ class RenamedServicesEntry
328
+ include ::Google::Protobuf::MessageExts
329
+ extend ::Google::Protobuf::MessageExts::ClassMethods
330
+ end
303
331
  end
304
332
 
305
333
  # Describes the generator configuration for a method.
@@ -375,6 +403,17 @@ module Google
375
403
  end
376
404
  end
377
405
 
406
+ # This message is used to configure the generation of a subset of the RPCs in
407
+ # a service for client libraries.
408
+ # @!attribute [rw] methods
409
+ # @return [::Array<::String>]
410
+ # An allowlist of the fully qualified names of RPCs that should be included
411
+ # on public client surfaces.
412
+ class SelectiveGapicGeneration
413
+ include ::Google::Protobuf::MessageExts
414
+ extend ::Google::Protobuf::MessageExts::ClassMethods
415
+ end
416
+
378
417
  # The organization for which the client libraries are being published.
379
418
  # Affects the url where generated docs are published, etc.
380
419
  module ClientLibraryOrganization
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-shopping-merchant-lfp-v1beta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-08-30 00:00:00.000000000 Z
10
+ date: 2025-01-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: gapic-common
@@ -16,7 +15,7 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: 0.21.1
18
+ version: 0.25.0
20
19
  - - "<"
21
20
  - !ruby/object:Gem::Version
22
21
  version: 2.a
@@ -26,7 +25,7 @@ dependencies:
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- version: 0.21.1
28
+ version: 0.25.0
30
29
  - - "<"
31
30
  - !ruby/object:Gem::Version
32
31
  version: 2.a
@@ -125,7 +124,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
125
124
  licenses:
126
125
  - Apache-2.0
127
126
  metadata: {}
128
- post_install_message:
129
127
  rdoc_options: []
130
128
  require_paths:
131
129
  - lib
@@ -133,15 +131,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
133
131
  requirements:
134
132
  - - ">="
135
133
  - !ruby/object:Gem::Version
136
- version: '2.7'
134
+ version: '3.0'
137
135
  required_rubygems_version: !ruby/object:Gem::Requirement
138
136
  requirements:
139
137
  - - ">="
140
138
  - !ruby/object:Gem::Version
141
139
  version: '0'
142
140
  requirements: []
143
- rubygems_version: 3.5.6
144
- signing_key:
141
+ rubygems_version: 3.6.2
145
142
  specification_version: 4
146
143
  summary: Programmatically manage your Merchant Center accounts.
147
144
  test_files: []