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