google-shopping-merchant-data_sources-v1beta 0.2.1 → 0.4.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: 8351a68c9d95a2dbbd692dba41c63118c4a0b20d814f1bae6451105a38a435cf
4
- data.tar.gz: bb4b195563629d38ab8098824f04edc4a5b5bc8a294ac69b4729c494eafcab0f
3
+ metadata.gz: 39d602179d562b54e6ff9925b76e43eb2d6be05f321f6a469da420c0ee3861f5
4
+ data.tar.gz: aa513fb4ecd67ecc15af88e1f5394cb364b6d4cea5d85dbc2bff8562ffa3ab82
5
5
  SHA512:
6
- metadata.gz: fa315836b41464d5166474e4237e81bf5fe44f371ed96da8d15d1520a2ac30dd40df6ba4674a93614dd55ee0cff3b247d7b5576895193beb5373e414b8ae894f
7
- data.tar.gz: d8038cb3dd7b59e4c813f49c0bc5e35a9a540482de1927f8c105ab80424da30cde597ff7d7b669715295330d8fcf72c08b5232c7a6b0eb7d414db80f924f46d8
6
+ metadata.gz: 01ca9b3eb44d04fc133fcd58d38bdbea5e8921172ae594bd9b3ba795240c953d5bd834a5103e108e1a74af0c789fb41ecff1b066622e3bae785a881f737b1887
7
+ data.tar.gz: 4cf46b7a7a7b4785dbdc14cb32a5b11b92fa62ad8f741defb10b1e471ddfa2262dba62175c18a03ffcd34cc2a76d1bae8355a890ec8eeea20acdacb7f662cdcf
data/README.md CHANGED
@@ -43,40 +43,50 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://developers.google.com/merchant/api)
44
44
  for general usage information.
45
45
 
46
- ## Enabling Logging
47
-
48
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
- 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)
52
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
-
54
- Configuring a Ruby stdlib logger:
46
+ ## Debug Logging
47
+
48
+ This library comes with opt-in Debug Logging that can help you troubleshoot
49
+ your application's integration with the API. When logging is activated, key
50
+ events such as requests and responses, along with data payloads and metadata
51
+ such as headers and client configuration, are logged to the standard error
52
+ stream.
53
+
54
+ **WARNING:** Client Library Debug Logging includes your data payloads in
55
+ plaintext, which could include sensitive data such as PII for yourself or your
56
+ customers, private keys, or other security data that could be compromising if
57
+ leaked. Always practice good data hygiene with your application logs, and follow
58
+ the principle of least access. Google also recommends that Client Library Debug
59
+ Logging be enabled only temporarily during active debugging, and not used
60
+ permanently in production.
61
+
62
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
63
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
64
+ list of client library gem names. This will select the default logging behavior,
65
+ which writes logs to the standard error stream. On a local workstation, this may
66
+ result in logs appearing on the console. When running on a Google Cloud hosting
67
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
68
+ results in logs appearing alongside your application logs in the
69
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
70
+
71
+ You can customize logging by modifying the `logger` configuration when
72
+ constructing a client object. For example:
55
73
 
56
74
  ```ruby
75
+ require "google/shopping/merchant/data_sources/v1beta"
57
76
  require "logger"
58
77
 
59
- module MyLogger
60
- LOGGER = Logger.new $stderr, level: Logger::WARN
61
- def logger
62
- LOGGER
63
- end
64
- end
65
-
66
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
67
- module GRPC
68
- extend MyLogger
78
+ client = ::Google::Shopping::Merchant::DataSources::V1beta::DataSourcesService::Client.new do |config|
79
+ config.logger = Logger.new "my-app.log"
69
80
  end
70
81
  ```
71
82
 
72
-
73
83
  ## Google Cloud Samples
74
84
 
75
85
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
76
86
 
77
87
  ## Supported Ruby Versions
78
88
 
79
- This library is supported on Ruby 2.7+.
89
+ This library is supported on Ruby 3.0+.
80
90
 
81
91
  Google provides official support for Ruby versions that are actively supported
82
92
  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
+ @data_sources_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
+ @data_sources_service_stub.logger
170
190
  end
171
191
 
172
192
  # Service calls
@@ -252,7 +272,6 @@ module Google
252
272
 
253
273
  @data_sources_service_stub.call_rpc :get_data_source, 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)
@@ -355,7 +374,7 @@ module Google
355
374
  @data_sources_service_stub.call_rpc :list_data_sources, request, options: options do |response, operation|
356
375
  response = ::Gapic::PagedEnumerable.new @data_sources_service_stub, :list_data_sources, request, response, operation, options
357
376
  yield response, operation if block_given?
358
- return response
377
+ throw :response, response
359
378
  end
360
379
  rescue ::GRPC::BadStatus => e
361
380
  raise ::Google::Cloud::Error.from_error(e)
@@ -444,7 +463,6 @@ module Google
444
463
 
445
464
  @data_sources_service_stub.call_rpc :create_data_source, request, options: options do |response, operation|
446
465
  yield response, operation if block_given?
447
- return response
448
466
  end
449
467
  rescue ::GRPC::BadStatus => e
450
468
  raise ::Google::Cloud::Error.from_error(e)
@@ -539,7 +557,6 @@ module Google
539
557
 
540
558
  @data_sources_service_stub.call_rpc :update_data_source, request, options: options do |response, operation|
541
559
  yield response, operation if block_given?
542
- return response
543
560
  end
544
561
  rescue ::GRPC::BadStatus => e
545
562
  raise ::Google::Cloud::Error.from_error(e)
@@ -626,7 +643,6 @@ module Google
626
643
 
627
644
  @data_sources_service_stub.call_rpc :delete_data_source, request, options: options do |response, operation|
628
645
  yield response, operation if block_given?
629
- return response
630
646
  end
631
647
  rescue ::GRPC::BadStatus => e
632
648
  raise ::Google::Cloud::Error.from_error(e)
@@ -717,7 +733,6 @@ module Google
717
733
 
718
734
  @data_sources_service_stub.call_rpc :fetch_data_source, request, options: options do |response, operation|
719
735
  yield response, operation if block_given?
720
- return response
721
736
  end
722
737
  rescue ::GRPC::BadStatus => e
723
738
  raise ::Google::Cloud::Error.from_error(e)
@@ -767,6 +782,13 @@ module Google
767
782
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
768
783
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
769
784
  # * (`nil`) indicating no credentials
785
+ #
786
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
787
+ # external source for authentication to Google Cloud, you must validate it before
788
+ # providing it to a Google API client library. Providing an unvalidated credential
789
+ # configuration to Google APIs can compromise the security of your systems and data.
790
+ # For more information, refer to [Validate credential configurations from external
791
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
770
792
  # @return [::Object]
771
793
  # @!attribute [rw] scope
772
794
  # The OAuth scopes
@@ -806,6 +828,11 @@ module Google
806
828
  # default endpoint URL. The default value of nil uses the environment
807
829
  # universe (usually the default "googleapis.com" universe).
808
830
  # @return [::String,nil]
831
+ # @!attribute [rw] logger
832
+ # A custom logger to use for request/response debug logging, or the value
833
+ # `:default` (the default) to construct a default logger, or `nil` to
834
+ # explicitly disable logging.
835
+ # @return [::Logger,:default,nil]
809
836
  #
810
837
  class Configuration
811
838
  extend ::Gapic::Config
@@ -830,6 +857,7 @@ module Google
830
857
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
831
858
  config_attr :quota_project, nil, ::String, nil
832
859
  config_attr :universe_domain, nil, ::String, nil
860
+ config_attr :logger, :default, ::Logger, nil, :default
833
861
 
834
862
  # @private
835
863
  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
+ @data_sources_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
+ @data_sources_service_stub.logger
163
183
  end
164
184
 
165
185
  # Service calls
@@ -238,7 +258,6 @@ module Google
238
258
 
239
259
  @data_sources_service_stub.get_data_source 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)
@@ -334,7 +353,7 @@ module Google
334
353
  @data_sources_service_stub.list_data_sources request, options do |result, operation|
335
354
  result = ::Gapic::Rest::PagedEnumerable.new @data_sources_service_stub, :list_data_sources, "data_sources", request, result, options
336
355
  yield result, operation if block_given?
337
- return result
356
+ throw :response, result
338
357
  end
339
358
  rescue ::Gapic::Rest::Error => e
340
359
  raise ::Google::Cloud::Error.from_error(e)
@@ -416,7 +435,6 @@ module Google
416
435
 
417
436
  @data_sources_service_stub.create_data_source request, options do |result, operation|
418
437
  yield result, operation if block_given?
419
- return result
420
438
  end
421
439
  rescue ::Gapic::Rest::Error => e
422
440
  raise ::Google::Cloud::Error.from_error(e)
@@ -504,7 +522,6 @@ module Google
504
522
 
505
523
  @data_sources_service_stub.update_data_source request, options do |result, operation|
506
524
  yield result, operation if block_given?
507
- return result
508
525
  end
509
526
  rescue ::Gapic::Rest::Error => e
510
527
  raise ::Google::Cloud::Error.from_error(e)
@@ -584,7 +601,6 @@ module Google
584
601
 
585
602
  @data_sources_service_stub.delete_data_source request, options do |result, operation|
586
603
  yield result, operation if block_given?
587
- return result
588
604
  end
589
605
  rescue ::Gapic::Rest::Error => e
590
606
  raise ::Google::Cloud::Error.from_error(e)
@@ -668,7 +684,6 @@ module Google
668
684
 
669
685
  @data_sources_service_stub.fetch_data_source request, options do |result, operation|
670
686
  yield result, operation if block_given?
671
- return result
672
687
  end
673
688
  rescue ::Gapic::Rest::Error => e
674
689
  raise ::Google::Cloud::Error.from_error(e)
@@ -716,6 +731,13 @@ module Google
716
731
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
717
732
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
718
733
  # * (`nil`) indicating no credentials
734
+ #
735
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
736
+ # external source for authentication to Google Cloud, you must validate it before
737
+ # providing it to a Google API client library. Providing an unvalidated credential
738
+ # configuration to Google APIs can compromise the security of your systems and data.
739
+ # For more information, refer to [Validate credential configurations from external
740
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
719
741
  # @return [::Object]
720
742
  # @!attribute [rw] scope
721
743
  # The OAuth scopes
@@ -748,6 +770,11 @@ module Google
748
770
  # default endpoint URL. The default value of nil uses the environment
749
771
  # universe (usually the default "googleapis.com" universe).
750
772
  # @return [::String,nil]
773
+ # @!attribute [rw] logger
774
+ # A custom logger to use for request/response debug logging, or the value
775
+ # `:default` (the default) to construct a default logger, or `nil` to
776
+ # explicitly disable logging.
777
+ # @return [::Logger,:default,nil]
751
778
  #
752
779
  class Configuration
753
780
  extend ::Gapic::Config
@@ -769,6 +796,7 @@ module Google
769
796
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
770
797
  config_attr :quota_project, nil, ::String, nil
771
798
  config_attr :universe_domain, nil, ::String, nil
799
+ config_attr :logger, :default, ::Logger, nil, :default
772
800
 
773
801
  # @private
774
802
  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_data_source 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_data_source",
94
107
  options: options
95
108
  )
96
109
  operation = ::Gapic::Rest::TransportOperation.new response
97
110
  result = ::Google::Shopping::Merchant::DataSources::V1beta::DataSource.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: "list_data_sources",
132
147
  options: options
133
148
  )
134
149
  operation = ::Gapic::Rest::TransportOperation.new response
135
150
  result = ::Google::Shopping::Merchant::DataSources::V1beta::ListDataSourcesResponse.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: "create_data_source",
170
187
  options: options
171
188
  )
172
189
  operation = ::Gapic::Rest::TransportOperation.new response
173
190
  result = ::Google::Shopping::Merchant::DataSources::V1beta::DataSource.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: "update_data_source",
208
227
  options: options
209
228
  )
210
229
  operation = ::Gapic::Rest::TransportOperation.new response
211
230
  result = ::Google::Shopping::Merchant::DataSources::V1beta::DataSource.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
  ##
@@ -240,16 +260,18 @@ module Google
240
260
 
241
261
  response = @client_stub.make_http_request(
242
262
  verb,
243
- uri: uri,
244
- body: body || "",
245
- params: query_string_params,
263
+ uri: uri,
264
+ body: body || "",
265
+ params: query_string_params,
266
+ method_name: "delete_data_source",
246
267
  options: options
247
268
  )
248
269
  operation = ::Gapic::Rest::TransportOperation.new response
249
270
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
250
-
251
- yield result, operation if block_given?
252
- result
271
+ catch :response do
272
+ yield result, operation if block_given?
273
+ result
274
+ end
253
275
  end
254
276
 
255
277
  ##
@@ -278,16 +300,18 @@ module Google
278
300
 
279
301
  response = @client_stub.make_http_request(
280
302
  verb,
281
- uri: uri,
282
- body: body || "",
283
- params: query_string_params,
303
+ uri: uri,
304
+ body: body || "",
305
+ params: query_string_params,
306
+ method_name: "fetch_data_source",
284
307
  options: options
285
308
  )
286
309
  operation = ::Gapic::Rest::TransportOperation.new response
287
310
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
288
-
289
- yield result, operation if block_given?
290
- result
311
+ catch :response do
312
+ yield result, operation if block_given?
313
+ result
314
+ end
291
315
  end
292
316
 
293
317
  ##
@@ -163,8 +163,28 @@ module Google
163
163
  universe_domain: @config.universe_domain,
164
164
  channel_args: @config.channel_args,
165
165
  interceptors: @config.interceptors,
166
- channel_pool_config: @config.channel_pool
166
+ channel_pool_config: @config.channel_pool,
167
+ logger: @config.logger
167
168
  )
169
+
170
+ @file_uploads_service_stub.stub_logger&.info do |entry|
171
+ entry.set_system_name
172
+ entry.set_service
173
+ entry.message = "Created client for #{entry.service}"
174
+ entry.set_credentials_fields credentials
175
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
176
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
177
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
178
+ end
179
+ end
180
+
181
+ ##
182
+ # The logger used for request/response debug logging.
183
+ #
184
+ # @return [Logger]
185
+ #
186
+ def logger
187
+ @file_uploads_service_stub.logger
168
188
  end
169
189
 
170
190
  # Service calls
@@ -252,7 +272,6 @@ module Google
252
272
 
253
273
  @file_uploads_service_stub.call_rpc :get_file_upload, 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)
@@ -302,6 +321,13 @@ module Google
302
321
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
303
322
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
304
323
  # * (`nil`) indicating no credentials
324
+ #
325
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
326
+ # external source for authentication to Google Cloud, you must validate it before
327
+ # providing it to a Google API client library. Providing an unvalidated credential
328
+ # configuration to Google APIs can compromise the security of your systems and data.
329
+ # For more information, refer to [Validate credential configurations from external
330
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
305
331
  # @return [::Object]
306
332
  # @!attribute [rw] scope
307
333
  # The OAuth scopes
@@ -341,6 +367,11 @@ module Google
341
367
  # default endpoint URL. The default value of nil uses the environment
342
368
  # universe (usually the default "googleapis.com" universe).
343
369
  # @return [::String,nil]
370
+ # @!attribute [rw] logger
371
+ # A custom logger to use for request/response debug logging, or the value
372
+ # `:default` (the default) to construct a default logger, or `nil` to
373
+ # explicitly disable logging.
374
+ # @return [::Logger,:default,nil]
344
375
  #
345
376
  class Configuration
346
377
  extend ::Gapic::Config
@@ -365,6 +396,7 @@ module Google
365
396
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
366
397
  config_attr :quota_project, nil, ::String, nil
367
398
  config_attr :universe_domain, nil, ::String, nil
399
+ config_attr :logger, :default, ::Logger, nil, :default
368
400
 
369
401
  # @private
370
402
  def initialize parent_config = nil
@@ -156,8 +156,28 @@ module Google
156
156
  endpoint: @config.endpoint,
157
157
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
158
158
  universe_domain: @config.universe_domain,
159
- credentials: credentials
159
+ credentials: credentials,
160
+ logger: @config.logger
160
161
  )
162
+
163
+ @file_uploads_service_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
172
+ end
173
+
174
+ ##
175
+ # The logger used for request/response debug logging.
176
+ #
177
+ # @return [Logger]
178
+ #
179
+ def logger
180
+ @file_uploads_service_stub.logger
161
181
  end
162
182
 
163
183
  # Service calls
@@ -238,7 +258,6 @@ module Google
238
258
 
239
259
  @file_uploads_service_stub.get_file_upload 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)
@@ -286,6 +305,13 @@ module Google
286
305
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
287
306
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
288
307
  # * (`nil`) indicating no credentials
308
+ #
309
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
310
+ # external source for authentication to Google Cloud, you must validate it before
311
+ # providing it to a Google API client library. Providing an unvalidated credential
312
+ # configuration to Google APIs can compromise the security of your systems and data.
313
+ # For more information, refer to [Validate credential configurations from external
314
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
289
315
  # @return [::Object]
290
316
  # @!attribute [rw] scope
291
317
  # The OAuth scopes
@@ -318,6 +344,11 @@ module Google
318
344
  # default endpoint URL. The default value of nil uses the environment
319
345
  # universe (usually the default "googleapis.com" universe).
320
346
  # @return [::String,nil]
347
+ # @!attribute [rw] logger
348
+ # A custom logger to use for request/response debug logging, or the value
349
+ # `:default` (the default) to construct a default logger, or `nil` to
350
+ # explicitly disable logging.
351
+ # @return [::Logger,:default,nil]
321
352
  #
322
353
  class Configuration
323
354
  extend ::Gapic::Config
@@ -339,6 +370,7 @@ module Google
339
370
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
340
371
  config_attr :quota_project, nil, ::String, nil
341
372
  config_attr :universe_domain, nil, ::String, nil
373
+ config_attr :logger, :default, ::Logger, nil, :default
342
374
 
343
375
  # @private
344
376
  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_file_upload 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_file_upload",
94
107
  options: options
95
108
  )
96
109
  operation = ::Gapic::Rest::TransportOperation.new response
97
110
  result = ::Google::Shopping::Merchant::DataSources::V1beta::FileUpload.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
  ##
@@ -22,7 +22,7 @@ module Google
22
22
  module Merchant
23
23
  module DataSources
24
24
  module V1beta
25
- VERSION = "0.2.1"
25
+ VERSION = "0.4.0"
26
26
  end
27
27
  end
28
28
  end
@@ -14,7 +14,7 @@ require 'google/shopping/merchant/datasources/v1beta/datasourcetypes_pb'
14
14
  require 'google/shopping/merchant/datasources/v1beta/fileinputs_pb'
15
15
 
16
16
 
17
- descriptor_data = "\n=google/shopping/merchant/datasources/v1beta/datasources.proto\x12+google.shopping.merchant.datasources.v1beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x41google/shopping/merchant/datasources/v1beta/datasourcetypes.proto\x1a<google/shopping/merchant/datasources/v1beta/fileinputs.proto\"\x82\x08\n\nDataSource\x12q\n\x1bprimary_product_data_source\x18\x04 \x01(\x0b\x32\x45.google.shopping.merchant.datasources.v1beta.PrimaryProductDataSourceB\x03\xe0\x41\x02H\x00\x12{\n supplemental_product_data_source\x18\x05 \x01(\x0b\x32J.google.shopping.merchant.datasources.v1beta.SupplementalProductDataSourceB\x03\xe0\x41\x02H\x00\x12q\n\x1blocal_inventory_data_source\x18\x06 \x01(\x0b\x32\x45.google.shopping.merchant.datasources.v1beta.LocalInventoryDataSourceB\x03\xe0\x41\x02H\x00\x12w\n\x1eregional_inventory_data_source\x18\x07 \x01(\x0b\x32H.google.shopping.merchant.datasources.v1beta.RegionalInventoryDataSourceB\x03\xe0\x41\x02H\x00\x12\x66\n\x15promotion_data_source\x18\x08 \x01(\x0b\x32@.google.shopping.merchant.datasources.v1beta.PromotionDataSourceB\x03\xe0\x41\x02H\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1b\n\x0e\x64\x61ta_source_id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12Q\n\x05input\x18\n \x01(\x0e\x32=.google.shopping.merchant.datasources.v1beta.DataSource.InputB\x03\xe0\x41\x03\x12O\n\nfile_input\x18\x0b \x01(\x0b\x32\x36.google.shopping.merchant.datasources.v1beta.FileInputB\x03\xe0\x41\x01\"G\n\x05Input\x12\x15\n\x11INPUT_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41PI\x10\x01\x12\x08\n\x04\x46ILE\x10\x02\x12\x06\n\x02UI\x10\x03\x12\x0c\n\x08\x41UTOFEED\x10\x04:p\xea\x41m\n%merchantapi.googleapis.com/DataSource\x12+accounts/{account}/dataSources/{datasource}*\x0b\x64\x61taSources2\ndataSourceB\x06\n\x04Type\"S\n\x14GetDataSourceRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%merchantapi.googleapis.com/DataSource\"\x88\x01\n\x16ListDataSourcesRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%merchantapi.googleapis.com/DataSource\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x81\x01\n\x17ListDataSourcesResponse\x12M\n\x0c\x64\x61ta_sources\x18\x01 \x03(\x0b\x32\x37.google.shopping.merchant.datasources.v1beta.DataSource\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xab\x01\n\x17\x43reateDataSourceRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%merchantapi.googleapis.com/DataSource\x12Q\n\x0b\x64\x61ta_source\x18\x02 \x01(\x0b\x32\x37.google.shopping.merchant.datasources.v1beta.DataSourceB\x03\xe0\x41\x02\"\xa2\x01\n\x17UpdateDataSourceRequest\x12Q\n\x0b\x64\x61ta_source\x18\x01 \x01(\x0b\x32\x37.google.shopping.merchant.datasources.v1beta.DataSourceB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"U\n\x16\x46\x65tchDataSourceRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%merchantapi.googleapis.com/DataSource\"V\n\x17\x44\x65leteDataSourceRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%merchantapi.googleapis.com/DataSource2\xf9\n\n\x12\x44\x61taSourcesService\x12\xcf\x01\n\rGetDataSource\x12\x41.google.shopping.merchant.datasources.v1beta.GetDataSourceRequest\x1a\x37.google.shopping.merchant.datasources.v1beta.DataSource\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/datasources/v1beta/{name=accounts/*/dataSources/*}\x12\xe2\x01\n\x0fListDataSources\x12\x43.google.shopping.merchant.datasources.v1beta.ListDataSourcesRequest\x1a\x44.google.shopping.merchant.datasources.v1beta.ListDataSourcesResponse\"D\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x35\x12\x33/datasources/v1beta/{parent=accounts/*}/dataSources\x12\xf0\x01\n\x10\x43reateDataSource\x12\x44.google.shopping.merchant.datasources.v1beta.CreateDataSourceRequest\x1a\x37.google.shopping.merchant.datasources.v1beta.DataSource\"]\xda\x41\x12parent,data_source\x82\xd3\xe4\x93\x02\x42\"3/datasources/v1beta/{parent=accounts/*}/dataSources:\x0b\x64\x61ta_source\x12\x81\x02\n\x10UpdateDataSource\x12\x44.google.shopping.merchant.datasources.v1beta.UpdateDataSourceRequest\x1a\x37.google.shopping.merchant.datasources.v1beta.DataSource\"n\xda\x41\x17\x64\x61ta_source,update_mask\x82\xd3\xe4\x93\x02N2?/datasources/v1beta/{data_source.name=accounts/*/dataSources/*}:\x0b\x64\x61ta_source\x12\xb4\x01\n\x10\x44\x65leteDataSource\x12\x44.google.shopping.merchant.datasources.v1beta.DeleteDataSourceRequest\x1a\x16.google.protobuf.Empty\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35*3/datasources/v1beta/{name=accounts/*/dataSources/*}\x12\xb4\x01\n\x0f\x46\x65tchDataSource\x12\x43.google.shopping.merchant.datasources.v1beta.FetchDataSourceRequest\x1a\x16.google.protobuf.Empty\"D\x82\xd3\xe4\x93\x02>\"9/datasources/v1beta/{name=accounts/*/dataSources/*}:fetch:\x01*\x1aG\xca\x41\x1amerchantapi.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/contentB\xbe\x03\n/com.google.shopping.merchant.datasources.v1betaB\x10\x44\x61taSourcesProtoP\x01ZWcloud.google.com/go/shopping/merchant/datasources/apiv1beta/datasourcespb;datasourcespb\xaa\x02+Google.Shopping.Merchant.DataSources.V1Beta\xca\x02+Google\\Shopping\\Merchant\\DataSources\\V1beta\xea\x02/Google::Shopping::Merchant::DataSources::V1beta\xea\x41\x38\n\"merchantapi.googleapis.com/Account\x12\x12\x61\x63\x63ounts/{account}\xea\x41T\n%merchantapi.googleapis.com/Datasource\x12+accounts/{account}/dataSources/{datasource}b\x06proto3"
17
+ descriptor_data = "\n=google/shopping/merchant/datasources/v1beta/datasources.proto\x12+google.shopping.merchant.datasources.v1beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x41google/shopping/merchant/datasources/v1beta/datasourcetypes.proto\x1a<google/shopping/merchant/datasources/v1beta/fileinputs.proto\"\xc3\t\n\nDataSource\x12l\n\x1bprimary_product_data_source\x18\x04 \x01(\x0b\x32\x45.google.shopping.merchant.datasources.v1beta.PrimaryProductDataSourceH\x00\x12v\n supplemental_product_data_source\x18\x05 \x01(\x0b\x32J.google.shopping.merchant.datasources.v1beta.SupplementalProductDataSourceH\x00\x12l\n\x1blocal_inventory_data_source\x18\x06 \x01(\x0b\x32\x45.google.shopping.merchant.datasources.v1beta.LocalInventoryDataSourceH\x00\x12r\n\x1eregional_inventory_data_source\x18\x07 \x01(\x0b\x32H.google.shopping.merchant.datasources.v1beta.RegionalInventoryDataSourceH\x00\x12\x61\n\x15promotion_data_source\x18\x08 \x01(\x0b\x32@.google.shopping.merchant.datasources.v1beta.PromotionDataSourceH\x00\x12j\n\x1aproduct_review_data_source\x18\t \x01(\x0b\x32\x44.google.shopping.merchant.datasources.v1beta.ProductReviewDataSourceH\x00\x12l\n\x1bmerchant_review_data_source\x18\x0c \x01(\x0b\x32\x45.google.shopping.merchant.datasources.v1beta.MerchantReviewDataSourceH\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1b\n\x0e\x64\x61ta_source_id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12Q\n\x05input\x18\n \x01(\x0e\x32=.google.shopping.merchant.datasources.v1beta.DataSource.InputB\x03\xe0\x41\x03\x12O\n\nfile_input\x18\x0b \x01(\x0b\x32\x36.google.shopping.merchant.datasources.v1beta.FileInputB\x03\xe0\x41\x01\"G\n\x05Input\x12\x15\n\x11INPUT_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41PI\x10\x01\x12\x08\n\x04\x46ILE\x10\x02\x12\x06\n\x02UI\x10\x03\x12\x0c\n\x08\x41UTOFEED\x10\x04:p\xea\x41m\n%merchantapi.googleapis.com/DataSource\x12+accounts/{account}/dataSources/{datasource}*\x0b\x64\x61taSources2\ndataSourceB\x06\n\x04Type\"S\n\x14GetDataSourceRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%merchantapi.googleapis.com/DataSource\"\x88\x01\n\x16ListDataSourcesRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%merchantapi.googleapis.com/DataSource\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x81\x01\n\x17ListDataSourcesResponse\x12M\n\x0c\x64\x61ta_sources\x18\x01 \x03(\x0b\x32\x37.google.shopping.merchant.datasources.v1beta.DataSource\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xab\x01\n\x17\x43reateDataSourceRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%merchantapi.googleapis.com/DataSource\x12Q\n\x0b\x64\x61ta_source\x18\x02 \x01(\x0b\x32\x37.google.shopping.merchant.datasources.v1beta.DataSourceB\x03\xe0\x41\x02\"\xa2\x01\n\x17UpdateDataSourceRequest\x12Q\n\x0b\x64\x61ta_source\x18\x01 \x01(\x0b\x32\x37.google.shopping.merchant.datasources.v1beta.DataSourceB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"U\n\x16\x46\x65tchDataSourceRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%merchantapi.googleapis.com/DataSource\"V\n\x17\x44\x65leteDataSourceRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%merchantapi.googleapis.com/DataSource2\xf9\n\n\x12\x44\x61taSourcesService\x12\xcf\x01\n\rGetDataSource\x12\x41.google.shopping.merchant.datasources.v1beta.GetDataSourceRequest\x1a\x37.google.shopping.merchant.datasources.v1beta.DataSource\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/datasources/v1beta/{name=accounts/*/dataSources/*}\x12\xe2\x01\n\x0fListDataSources\x12\x43.google.shopping.merchant.datasources.v1beta.ListDataSourcesRequest\x1a\x44.google.shopping.merchant.datasources.v1beta.ListDataSourcesResponse\"D\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x35\x12\x33/datasources/v1beta/{parent=accounts/*}/dataSources\x12\xf0\x01\n\x10\x43reateDataSource\x12\x44.google.shopping.merchant.datasources.v1beta.CreateDataSourceRequest\x1a\x37.google.shopping.merchant.datasources.v1beta.DataSource\"]\xda\x41\x12parent,data_source\x82\xd3\xe4\x93\x02\x42\"3/datasources/v1beta/{parent=accounts/*}/dataSources:\x0b\x64\x61ta_source\x12\x81\x02\n\x10UpdateDataSource\x12\x44.google.shopping.merchant.datasources.v1beta.UpdateDataSourceRequest\x1a\x37.google.shopping.merchant.datasources.v1beta.DataSource\"n\xda\x41\x17\x64\x61ta_source,update_mask\x82\xd3\xe4\x93\x02N2?/datasources/v1beta/{data_source.name=accounts/*/dataSources/*}:\x0b\x64\x61ta_source\x12\xb4\x01\n\x10\x44\x65leteDataSource\x12\x44.google.shopping.merchant.datasources.v1beta.DeleteDataSourceRequest\x1a\x16.google.protobuf.Empty\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35*3/datasources/v1beta/{name=accounts/*/dataSources/*}\x12\xb4\x01\n\x0f\x46\x65tchDataSource\x12\x43.google.shopping.merchant.datasources.v1beta.FetchDataSourceRequest\x1a\x16.google.protobuf.Empty\"D\x82\xd3\xe4\x93\x02>\"9/datasources/v1beta/{name=accounts/*/dataSources/*}:fetch:\x01*\x1aG\xca\x41\x1amerchantapi.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/contentB\xbe\x03\n/com.google.shopping.merchant.datasources.v1betaB\x10\x44\x61taSourcesProtoP\x01ZWcloud.google.com/go/shopping/merchant/datasources/apiv1beta/datasourcespb;datasourcespb\xaa\x02+Google.Shopping.Merchant.DataSources.V1Beta\xca\x02+Google\\Shopping\\Merchant\\DataSources\\V1beta\xea\x02/Google::Shopping::Merchant::DataSources::V1beta\xea\x41\x38\n\"merchantapi.googleapis.com/Account\x12\x12\x61\x63\x63ounts/{account}\xea\x41T\n%merchantapi.googleapis.com/Datasource\x12+accounts/{account}/dataSources/{datasource}b\x06proto3"
18
18
 
19
19
  pool = Google::Protobuf::DescriptorPool.generated_pool
20
20
 
@@ -7,7 +7,7 @@ require 'google/protobuf'
7
7
  require 'google/api/field_behavior_pb'
8
8
 
9
9
 
10
- descriptor_data = "\nAgoogle/shopping/merchant/datasources/v1beta/datasourcetypes.proto\x12+google.shopping.merchant.datasources.v1beta\x1a\x1fgoogle/api/field_behavior.proto\"\xc5\x04\n\x18PrimaryProductDataSource\x12\x66\n\x07\x63hannel\x18\x03 \x01(\x0e\x32M.google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource.ChannelB\x06\xe0\x41\x02\xe0\x41\x05\x12\x1f\n\nfeed_label\x18\x04 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05H\x00\x88\x01\x01\x12%\n\x10\x63ontent_language\x18\x05 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05H\x01\x88\x01\x01\x12\x16\n\tcountries\x18\x06 \x03(\tB\x03\xe0\x41\x01\x12l\n\x0c\x64\x65\x66\x61ult_rule\x18\x07 \x01(\x0b\x32Q.google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource.DefaultRuleB\x03\xe0\x41\x01\x1at\n\x0b\x44\x65\x66\x61ultRule\x12\x65\n\x16take_from_data_sources\x18\x01 \x03(\x0b\x32@.google.shopping.merchant.datasources.v1beta.DataSourceReferenceB\x03\xe0\x41\x02\"Y\n\x07\x43hannel\x12\x17\n\x13\x43HANNEL_UNSPECIFIED\x10\x00\x12\x13\n\x0fONLINE_PRODUCTS\x10\x01\x12\x12\n\x0eLOCAL_PRODUCTS\x10\x02\x12\x0c\n\x08PRODUCTS\x10\x03\x42\r\n\x0b_feed_labelB\x13\n\x11_content_language\"\xfc\x01\n\x1dSupplementalProductDataSource\x12\x1f\n\nfeed_label\x18\x04 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05H\x00\x88\x01\x01\x12%\n\x10\x63ontent_language\x18\x05 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05H\x01\x88\x01\x01\x12o\n referencing_primary_data_sources\x18\x07 \x03(\x0b\x32@.google.shopping.merchant.datasources.v1beta.DataSourceReferenceB\x03\xe0\x41\x03\x42\r\n\x0b_feed_labelB\x13\n\x11_content_language\"X\n\x18LocalInventoryDataSource\x12\x1a\n\nfeed_label\x18\x04 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12 \n\x10\x63ontent_language\x18\x05 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\"[\n\x1bRegionalInventoryDataSource\x12\x1a\n\nfeed_label\x18\x04 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12 \n\x10\x63ontent_language\x18\x05 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\"W\n\x13PromotionDataSource\x12\x1e\n\x0etarget_country\x18\x01 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12 \n\x10\x63ontent_language\x18\x02 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\"\x8e\x01\n\x13\x44\x61taSourceReference\x12\x0e\n\x04self\x18\x01 \x01(\x08H\x00\x12\'\n\x18primary_data_source_name\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x12,\n\x1dsupplemental_data_source_name\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x00\x42\x10\n\x0e\x64\x61ta_source_idB\xb0\x02\n/com.google.shopping.merchant.datasources.v1betaB\x14\x44\x61tasourcetypesProtoP\x01ZWcloud.google.com/go/shopping/merchant/datasources/apiv1beta/datasourcespb;datasourcespb\xaa\x02+Google.Shopping.Merchant.DataSources.V1Beta\xca\x02+Google\\Shopping\\Merchant\\DataSources\\V1beta\xea\x02/Google::Shopping::Merchant::DataSources::V1betab\x06proto3"
10
+ descriptor_data = "\nAgoogle/shopping/merchant/datasources/v1beta/datasourcetypes.proto\x12+google.shopping.merchant.datasources.v1beta\x1a\x1fgoogle/api/field_behavior.proto\"\xc5\x04\n\x18PrimaryProductDataSource\x12\x66\n\x07\x63hannel\x18\x03 \x01(\x0e\x32M.google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource.ChannelB\x06\xe0\x41\x02\xe0\x41\x05\x12\x1f\n\nfeed_label\x18\x04 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05H\x00\x88\x01\x01\x12%\n\x10\x63ontent_language\x18\x05 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05H\x01\x88\x01\x01\x12\x16\n\tcountries\x18\x06 \x03(\tB\x03\xe0\x41\x01\x12l\n\x0c\x64\x65\x66\x61ult_rule\x18\x07 \x01(\x0b\x32Q.google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource.DefaultRuleB\x03\xe0\x41\x01\x1at\n\x0b\x44\x65\x66\x61ultRule\x12\x65\n\x16take_from_data_sources\x18\x01 \x03(\x0b\x32@.google.shopping.merchant.datasources.v1beta.DataSourceReferenceB\x03\xe0\x41\x02\"Y\n\x07\x43hannel\x12\x17\n\x13\x43HANNEL_UNSPECIFIED\x10\x00\x12\x13\n\x0fONLINE_PRODUCTS\x10\x01\x12\x12\n\x0eLOCAL_PRODUCTS\x10\x02\x12\x0c\n\x08PRODUCTS\x10\x03\x42\r\n\x0b_feed_labelB\x13\n\x11_content_language\"\xfc\x01\n\x1dSupplementalProductDataSource\x12\x1f\n\nfeed_label\x18\x04 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05H\x00\x88\x01\x01\x12%\n\x10\x63ontent_language\x18\x05 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05H\x01\x88\x01\x01\x12o\n referencing_primary_data_sources\x18\x07 \x03(\x0b\x32@.google.shopping.merchant.datasources.v1beta.DataSourceReferenceB\x03\xe0\x41\x03\x42\r\n\x0b_feed_labelB\x13\n\x11_content_language\"X\n\x18LocalInventoryDataSource\x12\x1a\n\nfeed_label\x18\x04 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12 \n\x10\x63ontent_language\x18\x05 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\"[\n\x1bRegionalInventoryDataSource\x12\x1a\n\nfeed_label\x18\x04 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12 \n\x10\x63ontent_language\x18\x05 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\"W\n\x13PromotionDataSource\x12\x1e\n\x0etarget_country\x18\x01 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12 \n\x10\x63ontent_language\x18\x02 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\"\x19\n\x17ProductReviewDataSource\"\x1a\n\x18MerchantReviewDataSource\"\x8e\x01\n\x13\x44\x61taSourceReference\x12\x0e\n\x04self\x18\x01 \x01(\x08H\x00\x12\'\n\x18primary_data_source_name\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x12,\n\x1dsupplemental_data_source_name\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x00\x42\x10\n\x0e\x64\x61ta_source_idB\xb0\x02\n/com.google.shopping.merchant.datasources.v1betaB\x14\x44\x61tasourcetypesProtoP\x01ZWcloud.google.com/go/shopping/merchant/datasources/apiv1beta/datasourcespb;datasourcespb\xaa\x02+Google.Shopping.Merchant.DataSources.V1Beta\xca\x02+Google\\Shopping\\Merchant\\DataSources\\V1beta\xea\x02/Google::Shopping::Merchant::DataSources::V1betab\x06proto3"
11
11
 
12
12
  pool = Google::Protobuf::DescriptorPool.generated_pool
13
13
 
@@ -45,6 +45,8 @@ module Google
45
45
  LocalInventoryDataSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.shopping.merchant.datasources.v1beta.LocalInventoryDataSource").msgclass
46
46
  RegionalInventoryDataSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.shopping.merchant.datasources.v1beta.RegionalInventoryDataSource").msgclass
47
47
  PromotionDataSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.shopping.merchant.datasources.v1beta.PromotionDataSource").msgclass
48
+ ProductReviewDataSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.shopping.merchant.datasources.v1beta.ProductReviewDataSource").msgclass
49
+ MerchantReviewDataSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.shopping.merchant.datasources.v1beta.MerchantReviewDataSource").msgclass
48
50
  DataSourceReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.shopping.merchant.datasources.v1beta.DataSourceReference").msgclass
49
51
  end
50
52
  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
@@ -26,29 +26,53 @@ module Google
26
26
  # the Merchant Center account.
27
27
  # @!attribute [rw] primary_product_data_source
28
28
  # @return [::Google::Shopping::Merchant::DataSources::V1beta::PrimaryProductDataSource]
29
- # Required. The [primary data
29
+ # The [primary data
30
30
  # source](https://support.google.com/merchants/answer/7439058) for local
31
31
  # and online products.
32
+ #
33
+ # Note: The following fields are mutually exclusive: `primary_product_data_source`, `supplemental_product_data_source`, `local_inventory_data_source`, `regional_inventory_data_source`, `promotion_data_source`, `product_review_data_source`, `merchant_review_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
32
34
  # @!attribute [rw] supplemental_product_data_source
33
35
  # @return [::Google::Shopping::Merchant::DataSources::V1beta::SupplementalProductDataSource]
34
- # Required. The [supplemental data
36
+ # The [supplemental data
35
37
  # source](https://support.google.com/merchants/answer/7439058) for local
36
38
  # and online products.
39
+ #
40
+ # Note: The following fields are mutually exclusive: `supplemental_product_data_source`, `primary_product_data_source`, `local_inventory_data_source`, `regional_inventory_data_source`, `promotion_data_source`, `product_review_data_source`, `merchant_review_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
37
41
  # @!attribute [rw] local_inventory_data_source
38
42
  # @return [::Google::Shopping::Merchant::DataSources::V1beta::LocalInventoryDataSource]
39
- # Required. The [local
43
+ # The [local
40
44
  # inventory](https://support.google.com/merchants/answer/7023001) data
41
45
  # source.
46
+ #
47
+ # Note: The following fields are mutually exclusive: `local_inventory_data_source`, `primary_product_data_source`, `supplemental_product_data_source`, `regional_inventory_data_source`, `promotion_data_source`, `product_review_data_source`, `merchant_review_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
42
48
  # @!attribute [rw] regional_inventory_data_source
43
49
  # @return [::Google::Shopping::Merchant::DataSources::V1beta::RegionalInventoryDataSource]
44
- # Required. The [regional
50
+ # The [regional
45
51
  # inventory](https://support.google.com/merchants/answer/7439058) data
46
52
  # source.
53
+ #
54
+ # Note: The following fields are mutually exclusive: `regional_inventory_data_source`, `primary_product_data_source`, `supplemental_product_data_source`, `local_inventory_data_source`, `promotion_data_source`, `product_review_data_source`, `merchant_review_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
47
55
  # @!attribute [rw] promotion_data_source
48
56
  # @return [::Google::Shopping::Merchant::DataSources::V1beta::PromotionDataSource]
49
- # Required. The
57
+ # The
50
58
  # [promotion](https://support.google.com/merchants/answer/2906014) data
51
59
  # source.
60
+ #
61
+ # Note: The following fields are mutually exclusive: `promotion_data_source`, `primary_product_data_source`, `supplemental_product_data_source`, `local_inventory_data_source`, `regional_inventory_data_source`, `product_review_data_source`, `merchant_review_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
62
+ # @!attribute [rw] product_review_data_source
63
+ # @return [::Google::Shopping::Merchant::DataSources::V1beta::ProductReviewDataSource]
64
+ # The [product
65
+ # review](https://support.google.com/merchants/answer/7045996)
66
+ # data source.
67
+ #
68
+ # Note: The following fields are mutually exclusive: `product_review_data_source`, `primary_product_data_source`, `supplemental_product_data_source`, `local_inventory_data_source`, `regional_inventory_data_source`, `promotion_data_source`, `merchant_review_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
69
+ # @!attribute [rw] merchant_review_data_source
70
+ # @return [::Google::Shopping::Merchant::DataSources::V1beta::MerchantReviewDataSource]
71
+ # The [merchant
72
+ # review](https://support.google.com/merchants/answer/7045996)
73
+ # data source.
74
+ #
75
+ # Note: The following fields are mutually exclusive: `merchant_review_data_source`, `primary_product_data_source`, `supplemental_product_data_source`, `local_inventory_data_source`, `regional_inventory_data_source`, `promotion_data_source`, `product_review_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
52
76
  # @!attribute [rw] name
53
77
  # @return [::String]
54
78
  # Identifier. The name of the data source.
@@ -82,10 +82,8 @@ module Google
82
82
  # To link the data source to the default rule, you need to add a
83
83
  # new reference to this list (in sequential order).
84
84
  #
85
- # To unlink the data source from the default rule, you need to remove the
86
- # given reference from this list. To create attribute rules that are
87
- # different from the default rule, see [Set up your attribute
88
- # rules](//support.google.com/merchants/answer/14994083).
85
+ # To unlink the data source from the default rule, you need to
86
+ # remove the given reference from this list.
89
87
  #
90
88
  # Changing the order of this list will result in changing the priority of
91
89
  # data sources in the default rule.
@@ -119,12 +117,9 @@ module Google
119
117
  end
120
118
  end
121
119
 
122
- # The supplemental data source for local and online products. Supplemental API
123
- # data sources must not have `feedLabel` and `contentLanguage` fields set. You
124
- # can only use supplemental data sources to update existing products. For
125
- # information about creating a supplemental data source, see [Create a
126
- # supplemental data source and link it to the primary data
127
- # source](/merchant/api/guides/data-sources/overview#create-supplemental-data-source).
120
+ # The supplemental data source for local and online products. After creation,
121
+ # you should make sure to link the supplemental product data source into one or
122
+ # more primary product data sources.
128
123
  # @!attribute [rw] feed_label
129
124
  # @return [::String]
130
125
  # Optional. Immutable. The feed label that is specified on the data source
@@ -138,7 +133,11 @@ module Google
138
133
  #
139
134
  # `feedLabel` and `contentLanguage` must be either both set or unset for data
140
135
  # sources with product content type.
141
- # They must be set for data sources with a file input.
136
+ #
137
+ # They must be set for data sources with a [file
138
+ # input][google.shopping.merchant.datasources.v1main.FileInput].
139
+ # The fields must be unset for data sources without [file
140
+ # input][google.shopping.merchant.datasources.v1main.FileInput].
142
141
  #
143
142
  # If set, the data source will only accept products matching this
144
143
  # combination. If unset, the data source will accept produts without that
@@ -222,21 +221,39 @@ module Google
222
221
  extend ::Google::Protobuf::MessageExts::ClassMethods
223
222
  end
224
223
 
224
+ # The product review data source.
225
+ class ProductReviewDataSource
226
+ include ::Google::Protobuf::MessageExts
227
+ extend ::Google::Protobuf::MessageExts::ClassMethods
228
+ end
229
+
230
+ # The merchant review data source.
231
+ class MerchantReviewDataSource
232
+ include ::Google::Protobuf::MessageExts
233
+ extend ::Google::Protobuf::MessageExts::ClassMethods
234
+ end
235
+
225
236
  # Data source reference can be used to manage related data sources within the
226
237
  # data source service.
227
238
  # @!attribute [rw] self
228
239
  # @return [::Boolean]
229
240
  # Self should be used to reference the primary data source itself.
241
+ #
242
+ # Note: The following fields are mutually exclusive: `self`, `primary_data_source_name`, `supplemental_data_source_name`. If a field in that set is populated, all other fields in the set will automatically be cleared.
230
243
  # @!attribute [rw] primary_data_source_name
231
244
  # @return [::String]
232
245
  # Optional. The name of the primary data source.
233
246
  # Format:
234
247
  # `accounts/{account}/dataSources/{datasource}`
248
+ #
249
+ # Note: The following fields are mutually exclusive: `primary_data_source_name`, `self`, `supplemental_data_source_name`. If a field in that set is populated, all other fields in the set will automatically be cleared.
235
250
  # @!attribute [rw] supplemental_data_source_name
236
251
  # @return [::String]
237
252
  # Optional. The name of the supplemental data source.
238
253
  # Format:
239
254
  # `accounts/{account}/dataSources/{datasource}`
255
+ #
256
+ # Note: The following fields are mutually exclusive: `supplemental_data_source_name`, `self`, `primary_data_source_name`. If a field in that set is populated, all other fields in the set will automatically be cleared.
240
257
  class DataSourceReference
241
258
  include ::Google::Protobuf::MessageExts
242
259
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -71,14 +71,14 @@ module Google
71
71
  # one of those three protocols. Immutable for Google Sheets files.
72
72
  # @!attribute [rw] username
73
73
  # @return [::String]
74
- # Optional. An optional user name for [fetch
75
- # url][google.shopping.content.bundles.DataSources.FileInput.fetch_url].
74
+ # Optional. An optional user name for
75
+ # {::Google::Shopping::Merchant::DataSources::V1beta::FileInput::FetchSettings#fetch_uri fetch_uri}.
76
76
  # Used for [submitting data sources through
77
77
  # SFTP](https://support.google.com/merchants/answer/13813117).
78
78
  # @!attribute [rw] password
79
79
  # @return [::String]
80
- # Optional. An optional password for [fetch
81
- # url][google.shopping.content.bundles.DataSources.FileInput.fetch_url].
80
+ # Optional. An optional password for
81
+ # {::Google::Shopping::Merchant::DataSources::V1beta::FileInput::FetchSettings#fetch_uri fetch_uri}.
82
82
  # Used for [submitting data sources through
83
83
  # SFTP](https://support.google.com/merchants/answer/13813117).
84
84
  class FetchSettings
@@ -126,11 +126,11 @@ module Google
126
126
  UPLOAD = 1
127
127
 
128
128
  # The file is fetched from the configured
129
- # [fetch_uri][google.shopping.content.bundles.DataSources.FileInput.FetchSettings.fetch_uri].
129
+ # {::Google::Shopping::Merchant::DataSources::V1beta::FileInput::FetchSettings#fetch_uri fetch_uri}.
130
130
  FETCH = 2
131
131
 
132
132
  # The file is fetched from Google Sheets specified in the
133
- # [fetch_uri][google.shopping.content.bundles.DataSources.FileInput.FetchSettings.fetch_uri].
133
+ # {::Google::Shopping::Merchant::DataSources::V1beta::FileInput::FetchSettings#fetch_uri fetch_uri}.
134
134
  GOOGLE_SHEETS = 3
135
135
  end
136
136
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-shopping-merchant-data_sources-v1beta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.4.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-10-15 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
@@ -112,7 +111,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
112
111
  licenses:
113
112
  - Apache-2.0
114
113
  metadata: {}
115
- post_install_message:
116
114
  rdoc_options: []
117
115
  require_paths:
118
116
  - lib
@@ -120,15 +118,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
120
118
  requirements:
121
119
  - - ">="
122
120
  - !ruby/object:Gem::Version
123
- version: '2.7'
121
+ version: '3.0'
124
122
  required_rubygems_version: !ruby/object:Gem::Requirement
125
123
  requirements:
126
124
  - - ">="
127
125
  - !ruby/object:Gem::Version
128
126
  version: '0'
129
127
  requirements: []
130
- rubygems_version: 3.5.21
131
- signing_key:
128
+ rubygems_version: 3.6.2
132
129
  specification_version: 4
133
130
  summary: Programmatically manage your Merchant Center Accounts.
134
131
  test_files: []