google-shopping-merchant-products-v1 0.a → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +154 -8
  5. data/lib/google/shopping/merchant/products/v1/product_inputs_service/client.rb +715 -0
  6. data/lib/google/shopping/merchant/products/v1/product_inputs_service/credentials.rb +49 -0
  7. data/lib/google/shopping/merchant/products/v1/product_inputs_service/paths.rb +66 -0
  8. data/lib/google/shopping/merchant/products/v1/product_inputs_service/rest/client.rb +668 -0
  9. data/lib/google/shopping/merchant/products/v1/product_inputs_service/rest/service_stub.rb +268 -0
  10. data/lib/google/shopping/merchant/products/v1/product_inputs_service/rest.rb +54 -0
  11. data/lib/google/shopping/merchant/products/v1/product_inputs_service.rb +57 -0
  12. data/lib/google/shopping/merchant/products/v1/productinputs_pb.rb +59 -0
  13. data/lib/google/shopping/merchant/products/v1/productinputs_services_pb.rb +69 -0
  14. data/lib/google/shopping/merchant/products/v1/products_common_pb.rb +91 -0
  15. data/lib/google/shopping/merchant/products/v1/products_pb.rb +56 -0
  16. data/lib/google/shopping/merchant/products/v1/products_service/client.rb +591 -0
  17. data/lib/google/shopping/merchant/products/v1/products_service/credentials.rb +49 -0
  18. data/lib/google/shopping/merchant/products/v1/products_service/paths.rb +66 -0
  19. data/lib/google/shopping/merchant/products/v1/products_service/rest/client.rb +551 -0
  20. data/lib/google/shopping/merchant/products/v1/products_service/rest/service_stub.rb +205 -0
  21. data/lib/google/shopping/merchant/products/v1/products_service/rest.rb +54 -0
  22. data/lib/google/shopping/merchant/products/v1/products_service.rb +57 -0
  23. data/lib/google/shopping/merchant/products/v1/products_services_pb.rb +57 -0
  24. data/lib/google/shopping/merchant/products/v1/rest.rb +40 -0
  25. data/lib/google/shopping/merchant/products/v1/version.rb +7 -2
  26. data/lib/google/shopping/merchant/products/v1.rb +48 -0
  27. data/lib/google-shopping-merchant-products-v1.rb +21 -0
  28. data/proto_docs/README.md +4 -0
  29. data/proto_docs/google/api/client.rb +473 -0
  30. data/proto_docs/google/api/field_behavior.rb +85 -0
  31. data/proto_docs/google/api/launch_stage.rb +71 -0
  32. data/proto_docs/google/api/resource.rb +227 -0
  33. data/proto_docs/google/protobuf/duration.rb +98 -0
  34. data/proto_docs/google/protobuf/empty.rb +34 -0
  35. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  36. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  37. data/proto_docs/google/shopping/merchant/products/v1/productinputs.rb +221 -0
  38. data/proto_docs/google/shopping/merchant/products/v1/products.rb +175 -0
  39. data/proto_docs/google/shopping/merchant/products/v1/products_common.rb +1303 -0
  40. data/proto_docs/google/shopping/type/types.rb +210 -0
  41. data/proto_docs/google/type/interval.rb +45 -0
  42. metadata +100 -9
@@ -0,0 +1,715 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/shopping/merchant/products/v1/productinputs_pb"
21
+
22
+ module Google
23
+ module Shopping
24
+ module Merchant
25
+ module Products
26
+ module V1
27
+ module ProductInputsService
28
+ ##
29
+ # Client for the ProductInputsService service.
30
+ #
31
+ # Service to use ProductInput resource.
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "merchantapi.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :product_inputs_service_stub
44
+
45
+ ##
46
+ # Configure the ProductInputsService Client class.
47
+ #
48
+ # See {::Google::Shopping::Merchant::Products::V1::ProductInputsService::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all ProductInputsService clients
54
+ # ::Google::Shopping::Merchant::Products::V1::ProductInputsService::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Shopping", "Merchant", "Products", "V1"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config.timeout = 60.0
75
+ default_config.retry_policy = {
76
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
77
+ }
78
+
79
+ default_config
80
+ end
81
+ yield @configure if block_given?
82
+ @configure
83
+ end
84
+
85
+ ##
86
+ # Configure the ProductInputsService Client instance.
87
+ #
88
+ # The configuration is set to the derived mode, meaning that values can be changed,
89
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
90
+ # should be made on {Client.configure}.
91
+ #
92
+ # See {::Google::Shopping::Merchant::Products::V1::ProductInputsService::Client::Configuration}
93
+ # for a description of the configuration fields.
94
+ #
95
+ # @yield [config] Configure the Client client.
96
+ # @yieldparam config [Client::Configuration]
97
+ #
98
+ # @return [Client::Configuration]
99
+ #
100
+ def configure
101
+ yield @config if block_given?
102
+ @config
103
+ end
104
+
105
+ ##
106
+ # The effective universe domain
107
+ #
108
+ # @return [String]
109
+ #
110
+ def universe_domain
111
+ @product_inputs_service_stub.universe_domain
112
+ end
113
+
114
+ ##
115
+ # Create a new ProductInputsService client object.
116
+ #
117
+ # @example
118
+ #
119
+ # # Create a client using the default configuration
120
+ # client = ::Google::Shopping::Merchant::Products::V1::ProductInputsService::Client.new
121
+ #
122
+ # # Create a client using a custom configuration
123
+ # client = ::Google::Shopping::Merchant::Products::V1::ProductInputsService::Client.new do |config|
124
+ # config.timeout = 10.0
125
+ # end
126
+ #
127
+ # @yield [config] Configure the ProductInputsService client.
128
+ # @yieldparam config [Client::Configuration]
129
+ #
130
+ def initialize
131
+ # These require statements are intentionally placed here to initialize
132
+ # the gRPC module only when it's required.
133
+ # See https://github.com/googleapis/toolkit/issues/446
134
+ require "gapic/grpc"
135
+ require "google/shopping/merchant/products/v1/productinputs_services_pb"
136
+
137
+ # Create the configuration object
138
+ @config = Configuration.new Client.configure
139
+
140
+ # Yield the configuration if needed
141
+ yield @config if block_given?
142
+
143
+ # Create credentials
144
+ credentials = @config.credentials
145
+ # Use self-signed JWT if the endpoint is unchanged from default,
146
+ # but only if the default endpoint does not have a region prefix.
147
+ enable_self_signed_jwt = @config.endpoint.nil? ||
148
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
149
+ !@config.endpoint.split(".").first.include?("-"))
150
+ credentials ||= Credentials.default scope: @config.scope,
151
+ enable_self_signed_jwt: enable_self_signed_jwt
152
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
153
+ credentials = Credentials.new credentials, scope: @config.scope
154
+ end
155
+ @quota_project_id = @config.quota_project
156
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
157
+
158
+ @product_inputs_service_stub = ::Gapic::ServiceStub.new(
159
+ ::Google::Shopping::Merchant::Products::V1::ProductInputsService::Stub,
160
+ credentials: credentials,
161
+ endpoint: @config.endpoint,
162
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
163
+ universe_domain: @config.universe_domain,
164
+ channel_args: @config.channel_args,
165
+ interceptors: @config.interceptors,
166
+ channel_pool_config: @config.channel_pool,
167
+ logger: @config.logger
168
+ )
169
+
170
+ @product_inputs_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
+ @product_inputs_service_stub.logger
188
+ end
189
+
190
+ # Service calls
191
+
192
+ ##
193
+ # [Uploads a product input to your Merchant Center
194
+ # account](/merchant/api/guides/products/overview#upload-product-input). You
195
+ # must have a products [data
196
+ # source](/merchant/api/guides/data-sources/overview) to be able to insert a
197
+ # product. The unique identifier of the data source is passed as a query
198
+ # parameter in the request URL.
199
+ #
200
+ # If a product input with the same contentLanguage, offerId, and dataSource
201
+ # already exists, then the product input inserted by this method replaces
202
+ # that entry.
203
+ #
204
+ # After inserting, updating, or deleting a product input, it may take several
205
+ # minutes before the processed product can be retrieved.
206
+ #
207
+ # @overload insert_product_input(request, options = nil)
208
+ # Pass arguments to `insert_product_input` via a request object, either of type
209
+ # {::Google::Shopping::Merchant::Products::V1::InsertProductInputRequest} or an equivalent Hash.
210
+ #
211
+ # @param request [::Google::Shopping::Merchant::Products::V1::InsertProductInputRequest, ::Hash]
212
+ # A request object representing the call parameters. Required. To specify no
213
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
214
+ # @param options [::Gapic::CallOptions, ::Hash]
215
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
216
+ #
217
+ # @overload insert_product_input(parent: nil, product_input: nil, data_source: nil)
218
+ # Pass arguments to `insert_product_input` via keyword arguments. Note that at
219
+ # least one keyword argument is required. To specify no parameters, or to keep all
220
+ # the default parameter values, pass an empty Hash as a request object (see above).
221
+ #
222
+ # @param parent [::String]
223
+ # Required. The account where this product will be inserted.
224
+ # Format: `accounts/{account}`
225
+ # @param product_input [::Google::Shopping::Merchant::Products::V1::ProductInput, ::Hash]
226
+ # Required. The product input to insert.
227
+ # @param data_source [::String]
228
+ # Required. The primary or supplemental product data source name. If the
229
+ # product already exists and data source provided is different, then the
230
+ # product will be moved to a new data source. For more information, see
231
+ # [Overview of Data sources
232
+ # sub-API](/merchant/api/guides/data-sources/overview).
233
+ #
234
+ # Only API data sources are supported.
235
+ #
236
+ # Format: `accounts/{account}/dataSources/{datasource}`. For example,
237
+ # `accounts/123456/dataSources/104628`.
238
+ #
239
+ # @yield [response, operation] Access the result along with the RPC operation
240
+ # @yieldparam response [::Google::Shopping::Merchant::Products::V1::ProductInput]
241
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
242
+ #
243
+ # @return [::Google::Shopping::Merchant::Products::V1::ProductInput]
244
+ #
245
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
246
+ #
247
+ # @example Basic example
248
+ # require "google/shopping/merchant/products/v1"
249
+ #
250
+ # # Create a client object. The client can be reused for multiple calls.
251
+ # client = Google::Shopping::Merchant::Products::V1::ProductInputsService::Client.new
252
+ #
253
+ # # Create a request. To set request fields, pass in keyword arguments.
254
+ # request = Google::Shopping::Merchant::Products::V1::InsertProductInputRequest.new
255
+ #
256
+ # # Call the insert_product_input method.
257
+ # result = client.insert_product_input request
258
+ #
259
+ # # The returned object is of type Google::Shopping::Merchant::Products::V1::ProductInput.
260
+ # p result
261
+ #
262
+ def insert_product_input request, options = nil
263
+ raise ::ArgumentError, "request must be provided" if request.nil?
264
+
265
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Products::V1::InsertProductInputRequest
266
+
267
+ # Converts hash and nil to an options object
268
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
269
+
270
+ # Customize the options with defaults
271
+ metadata = @config.rpcs.insert_product_input.metadata.to_h
272
+
273
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
274
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
275
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
276
+ gapic_version: ::Google::Shopping::Merchant::Products::V1::VERSION
277
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
278
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
279
+
280
+ header_params = {}
281
+ if request.parent
282
+ header_params["parent"] = request.parent
283
+ end
284
+
285
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
286
+ metadata[:"x-goog-request-params"] ||= request_params_header
287
+
288
+ options.apply_defaults timeout: @config.rpcs.insert_product_input.timeout,
289
+ metadata: metadata,
290
+ retry_policy: @config.rpcs.insert_product_input.retry_policy
291
+
292
+ options.apply_defaults timeout: @config.timeout,
293
+ metadata: @config.metadata,
294
+ retry_policy: @config.retry_policy
295
+
296
+ @product_inputs_service_stub.call_rpc :insert_product_input, request, options: options do |response, operation|
297
+ yield response, operation if block_given?
298
+ end
299
+ rescue ::GRPC::BadStatus => e
300
+ raise ::Google::Cloud::Error.from_error(e)
301
+ end
302
+
303
+ ##
304
+ # Updates the existing product input in your Merchant Center account.
305
+ #
306
+ # After inserting, updating, or deleting a product input, it may take several
307
+ # minutes before the processed product can be retrieved.
308
+ #
309
+ # @overload update_product_input(request, options = nil)
310
+ # Pass arguments to `update_product_input` via a request object, either of type
311
+ # {::Google::Shopping::Merchant::Products::V1::UpdateProductInputRequest} or an equivalent Hash.
312
+ #
313
+ # @param request [::Google::Shopping::Merchant::Products::V1::UpdateProductInputRequest, ::Hash]
314
+ # A request object representing the call parameters. Required. To specify no
315
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
316
+ # @param options [::Gapic::CallOptions, ::Hash]
317
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
318
+ #
319
+ # @overload update_product_input(product_input: nil, update_mask: nil, data_source: nil)
320
+ # Pass arguments to `update_product_input` via keyword arguments. Note that at
321
+ # least one keyword argument is required. To specify no parameters, or to keep all
322
+ # the default parameter values, pass an empty Hash as a request object (see above).
323
+ #
324
+ # @param product_input [::Google::Shopping::Merchant::Products::V1::ProductInput, ::Hash]
325
+ # Required. The product input resource to update. Information you submit will
326
+ # be applied to the processed product as well.
327
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
328
+ # Optional. The list of product attributes to be updated.
329
+ #
330
+ # If the update mask is omitted, then it is treated as implied field mask
331
+ # equivalent to all fields that are populated (have a non-empty value).
332
+ #
333
+ # Attributes specified in the update mask without a value specified in the
334
+ # body will be deleted from the product.
335
+ #
336
+ # Update mask can only be specified for top level fields in
337
+ # attributes and custom attributes.
338
+ #
339
+ # To specify the update mask for custom attributes you need to add the
340
+ # `custom_attribute.` prefix.
341
+ #
342
+ # Providing special "*" value for full product replacement is not supported.
343
+ # @param data_source [::String]
344
+ # Required. The primary or supplemental product data source where
345
+ # `data_source` name identifies the product input to be updated.
346
+ #
347
+ # Only API data sources are supported.
348
+ #
349
+ # Format: `accounts/{account}/dataSources/{datasource}`. For example,
350
+ # `accounts/123456/dataSources/104628`.
351
+ #
352
+ # @yield [response, operation] Access the result along with the RPC operation
353
+ # @yieldparam response [::Google::Shopping::Merchant::Products::V1::ProductInput]
354
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
355
+ #
356
+ # @return [::Google::Shopping::Merchant::Products::V1::ProductInput]
357
+ #
358
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
359
+ #
360
+ # @example Basic example
361
+ # require "google/shopping/merchant/products/v1"
362
+ #
363
+ # # Create a client object. The client can be reused for multiple calls.
364
+ # client = Google::Shopping::Merchant::Products::V1::ProductInputsService::Client.new
365
+ #
366
+ # # Create a request. To set request fields, pass in keyword arguments.
367
+ # request = Google::Shopping::Merchant::Products::V1::UpdateProductInputRequest.new
368
+ #
369
+ # # Call the update_product_input method.
370
+ # result = client.update_product_input request
371
+ #
372
+ # # The returned object is of type Google::Shopping::Merchant::Products::V1::ProductInput.
373
+ # p result
374
+ #
375
+ def update_product_input request, options = nil
376
+ raise ::ArgumentError, "request must be provided" if request.nil?
377
+
378
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Products::V1::UpdateProductInputRequest
379
+
380
+ # Converts hash and nil to an options object
381
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
382
+
383
+ # Customize the options with defaults
384
+ metadata = @config.rpcs.update_product_input.metadata.to_h
385
+
386
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
387
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
388
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
389
+ gapic_version: ::Google::Shopping::Merchant::Products::V1::VERSION
390
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
391
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
392
+
393
+ header_params = {}
394
+ if request.product_input&.name
395
+ header_params["product_input.name"] = request.product_input.name
396
+ end
397
+
398
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
399
+ metadata[:"x-goog-request-params"] ||= request_params_header
400
+
401
+ options.apply_defaults timeout: @config.rpcs.update_product_input.timeout,
402
+ metadata: metadata,
403
+ retry_policy: @config.rpcs.update_product_input.retry_policy
404
+
405
+ options.apply_defaults timeout: @config.timeout,
406
+ metadata: @config.metadata,
407
+ retry_policy: @config.retry_policy
408
+
409
+ @product_inputs_service_stub.call_rpc :update_product_input, request, options: options do |response, operation|
410
+ yield response, operation if block_given?
411
+ end
412
+ rescue ::GRPC::BadStatus => e
413
+ raise ::Google::Cloud::Error.from_error(e)
414
+ end
415
+
416
+ ##
417
+ # Deletes a product input from your Merchant Center account.
418
+ #
419
+ # After inserting, updating, or deleting a product input, it may take several
420
+ # minutes before the processed product can be retrieved.
421
+ #
422
+ # @overload delete_product_input(request, options = nil)
423
+ # Pass arguments to `delete_product_input` via a request object, either of type
424
+ # {::Google::Shopping::Merchant::Products::V1::DeleteProductInputRequest} or an equivalent Hash.
425
+ #
426
+ # @param request [::Google::Shopping::Merchant::Products::V1::DeleteProductInputRequest, ::Hash]
427
+ # A request object representing the call parameters. Required. To specify no
428
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
429
+ # @param options [::Gapic::CallOptions, ::Hash]
430
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
431
+ #
432
+ # @overload delete_product_input(name: nil, data_source: nil)
433
+ # Pass arguments to `delete_product_input` via keyword arguments. Note that at
434
+ # least one keyword argument is required. To specify no parameters, or to keep all
435
+ # the default parameter values, pass an empty Hash as a request object (see above).
436
+ #
437
+ # @param name [::String]
438
+ # Required. The name of the product input resource to delete.
439
+ # Format: `accounts/{account}/productInputs/{product}`
440
+ # where the last section `product` consists of:
441
+ # `content_language~feed_label~offer_id`
442
+ # example for product name is
443
+ # `accounts/123/productInputs/en~US~sku123`.
444
+ # @param data_source [::String]
445
+ # Required. The primary or supplemental data source from which the product
446
+ # input should be deleted. Format:
447
+ # `accounts/{account}/dataSources/{datasource}`. For example,
448
+ # `accounts/123456/dataSources/104628`.
449
+ #
450
+ # @yield [response, operation] Access the result along with the RPC operation
451
+ # @yieldparam response [::Google::Protobuf::Empty]
452
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
453
+ #
454
+ # @return [::Google::Protobuf::Empty]
455
+ #
456
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
457
+ #
458
+ # @example Basic example
459
+ # require "google/shopping/merchant/products/v1"
460
+ #
461
+ # # Create a client object. The client can be reused for multiple calls.
462
+ # client = Google::Shopping::Merchant::Products::V1::ProductInputsService::Client.new
463
+ #
464
+ # # Create a request. To set request fields, pass in keyword arguments.
465
+ # request = Google::Shopping::Merchant::Products::V1::DeleteProductInputRequest.new
466
+ #
467
+ # # Call the delete_product_input method.
468
+ # result = client.delete_product_input request
469
+ #
470
+ # # The returned object is of type Google::Protobuf::Empty.
471
+ # p result
472
+ #
473
+ def delete_product_input request, options = nil
474
+ raise ::ArgumentError, "request must be provided" if request.nil?
475
+
476
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Products::V1::DeleteProductInputRequest
477
+
478
+ # Converts hash and nil to an options object
479
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
480
+
481
+ # Customize the options with defaults
482
+ metadata = @config.rpcs.delete_product_input.metadata.to_h
483
+
484
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
485
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
486
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
487
+ gapic_version: ::Google::Shopping::Merchant::Products::V1::VERSION
488
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
489
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
490
+
491
+ header_params = {}
492
+ if request.name
493
+ header_params["name"] = request.name
494
+ end
495
+
496
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
497
+ metadata[:"x-goog-request-params"] ||= request_params_header
498
+
499
+ options.apply_defaults timeout: @config.rpcs.delete_product_input.timeout,
500
+ metadata: metadata,
501
+ retry_policy: @config.rpcs.delete_product_input.retry_policy
502
+
503
+ options.apply_defaults timeout: @config.timeout,
504
+ metadata: @config.metadata,
505
+ retry_policy: @config.retry_policy
506
+
507
+ @product_inputs_service_stub.call_rpc :delete_product_input, request, options: options do |response, operation|
508
+ yield response, operation if block_given?
509
+ end
510
+ rescue ::GRPC::BadStatus => e
511
+ raise ::Google::Cloud::Error.from_error(e)
512
+ end
513
+
514
+ ##
515
+ # Configuration class for the ProductInputsService API.
516
+ #
517
+ # This class represents the configuration for ProductInputsService,
518
+ # providing control over timeouts, retry behavior, logging, transport
519
+ # parameters, and other low-level controls. Certain parameters can also be
520
+ # applied individually to specific RPCs. See
521
+ # {::Google::Shopping::Merchant::Products::V1::ProductInputsService::Client::Configuration::Rpcs}
522
+ # for a list of RPCs that can be configured independently.
523
+ #
524
+ # Configuration can be applied globally to all clients, or to a single client
525
+ # on construction.
526
+ #
527
+ # @example
528
+ #
529
+ # # Modify the global config, setting the timeout for
530
+ # # insert_product_input to 20 seconds,
531
+ # # and all remaining timeouts to 10 seconds.
532
+ # ::Google::Shopping::Merchant::Products::V1::ProductInputsService::Client.configure do |config|
533
+ # config.timeout = 10.0
534
+ # config.rpcs.insert_product_input.timeout = 20.0
535
+ # end
536
+ #
537
+ # # Apply the above configuration only to a new client.
538
+ # client = ::Google::Shopping::Merchant::Products::V1::ProductInputsService::Client.new do |config|
539
+ # config.timeout = 10.0
540
+ # config.rpcs.insert_product_input.timeout = 20.0
541
+ # end
542
+ #
543
+ # @!attribute [rw] endpoint
544
+ # A custom service endpoint, as a hostname or hostname:port. The default is
545
+ # nil, indicating to use the default endpoint in the current universe domain.
546
+ # @return [::String,nil]
547
+ # @!attribute [rw] credentials
548
+ # Credentials to send with calls. You may provide any of the following types:
549
+ # * (`String`) The path to a service account key file in JSON format
550
+ # * (`Hash`) A service account key as a Hash
551
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
552
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
553
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
554
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
555
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
556
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
557
+ # * (`nil`) indicating no credentials
558
+ #
559
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
560
+ # external source for authentication to Google Cloud, you must validate it before
561
+ # providing it to a Google API client library. Providing an unvalidated credential
562
+ # configuration to Google APIs can compromise the security of your systems and data.
563
+ # For more information, refer to [Validate credential configurations from external
564
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
565
+ # @return [::Object]
566
+ # @!attribute [rw] scope
567
+ # The OAuth scopes
568
+ # @return [::Array<::String>]
569
+ # @!attribute [rw] lib_name
570
+ # The library name as recorded in instrumentation and logging
571
+ # @return [::String]
572
+ # @!attribute [rw] lib_version
573
+ # The library version as recorded in instrumentation and logging
574
+ # @return [::String]
575
+ # @!attribute [rw] channel_args
576
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
577
+ # `GRPC::Core::Channel` object is provided as the credential.
578
+ # @return [::Hash]
579
+ # @!attribute [rw] interceptors
580
+ # An array of interceptors that are run before calls are executed.
581
+ # @return [::Array<::GRPC::ClientInterceptor>]
582
+ # @!attribute [rw] timeout
583
+ # The call timeout in seconds.
584
+ # @return [::Numeric]
585
+ # @!attribute [rw] metadata
586
+ # Additional gRPC headers to be sent with the call.
587
+ # @return [::Hash{::Symbol=>::String}]
588
+ # @!attribute [rw] retry_policy
589
+ # The retry policy. The value is a hash with the following keys:
590
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
591
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
592
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
593
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
594
+ # trigger a retry.
595
+ # @return [::Hash]
596
+ # @!attribute [rw] quota_project
597
+ # A separate project against which to charge quota.
598
+ # @return [::String]
599
+ # @!attribute [rw] universe_domain
600
+ # The universe domain within which to make requests. This determines the
601
+ # default endpoint URL. The default value of nil uses the environment
602
+ # universe (usually the default "googleapis.com" universe).
603
+ # @return [::String,nil]
604
+ # @!attribute [rw] logger
605
+ # A custom logger to use for request/response debug logging, or the value
606
+ # `:default` (the default) to construct a default logger, or `nil` to
607
+ # explicitly disable logging.
608
+ # @return [::Logger,:default,nil]
609
+ #
610
+ class Configuration
611
+ extend ::Gapic::Config
612
+
613
+ # @private
614
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
615
+ DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
616
+
617
+ config_attr :endpoint, nil, ::String, nil
618
+ config_attr :credentials, nil do |value|
619
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
620
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
621
+ allowed.any? { |klass| klass === value }
622
+ end
623
+ config_attr :scope, nil, ::String, ::Array, nil
624
+ config_attr :lib_name, nil, ::String, nil
625
+ config_attr :lib_version, nil, ::String, nil
626
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
627
+ config_attr :interceptors, nil, ::Array, nil
628
+ config_attr :timeout, nil, ::Numeric, nil
629
+ config_attr :metadata, nil, ::Hash, nil
630
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
631
+ config_attr :quota_project, nil, ::String, nil
632
+ config_attr :universe_domain, nil, ::String, nil
633
+ config_attr :logger, :default, ::Logger, nil, :default
634
+
635
+ # @private
636
+ def initialize parent_config = nil
637
+ @parent_config = parent_config unless parent_config.nil?
638
+
639
+ yield self if block_given?
640
+ end
641
+
642
+ ##
643
+ # Configurations for individual RPCs
644
+ # @return [Rpcs]
645
+ #
646
+ def rpcs
647
+ @rpcs ||= begin
648
+ parent_rpcs = nil
649
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
650
+ Rpcs.new parent_rpcs
651
+ end
652
+ end
653
+
654
+ ##
655
+ # Configuration for the channel pool
656
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
657
+ #
658
+ def channel_pool
659
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
660
+ end
661
+
662
+ ##
663
+ # Configuration RPC class for the ProductInputsService API.
664
+ #
665
+ # Includes fields providing the configuration for each RPC in this service.
666
+ # Each configuration object is of type `Gapic::Config::Method` and includes
667
+ # the following configuration fields:
668
+ #
669
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
670
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
671
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
672
+ # include the following keys:
673
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
674
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
675
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
676
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
677
+ # trigger a retry.
678
+ #
679
+ class Rpcs
680
+ ##
681
+ # RPC-specific configuration for `insert_product_input`
682
+ # @return [::Gapic::Config::Method]
683
+ #
684
+ attr_reader :insert_product_input
685
+ ##
686
+ # RPC-specific configuration for `update_product_input`
687
+ # @return [::Gapic::Config::Method]
688
+ #
689
+ attr_reader :update_product_input
690
+ ##
691
+ # RPC-specific configuration for `delete_product_input`
692
+ # @return [::Gapic::Config::Method]
693
+ #
694
+ attr_reader :delete_product_input
695
+
696
+ # @private
697
+ def initialize parent_rpcs = nil
698
+ insert_product_input_config = parent_rpcs.insert_product_input if parent_rpcs.respond_to? :insert_product_input
699
+ @insert_product_input = ::Gapic::Config::Method.new insert_product_input_config
700
+ update_product_input_config = parent_rpcs.update_product_input if parent_rpcs.respond_to? :update_product_input
701
+ @update_product_input = ::Gapic::Config::Method.new update_product_input_config
702
+ delete_product_input_config = parent_rpcs.delete_product_input if parent_rpcs.respond_to? :delete_product_input
703
+ @delete_product_input = ::Gapic::Config::Method.new delete_product_input_config
704
+
705
+ yield self if block_given?
706
+ end
707
+ end
708
+ end
709
+ end
710
+ end
711
+ end
712
+ end
713
+ end
714
+ end
715
+ end