google-shopping-merchant-products-v1beta 0.a → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +122 -0
- data/README.md +143 -8
- data/lib/google/shopping/merchant/products/v1beta/product_inputs_service/client.rb +547 -0
- data/lib/google/shopping/merchant/products/v1beta/product_inputs_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/products/v1beta/product_inputs_service/paths.rb +66 -0
- data/lib/google/shopping/merchant/products/v1beta/product_inputs_service/rest/client.rb +507 -0
- data/lib/google/shopping/merchant/products/v1beta/product_inputs_service/rest/service_stub.rb +190 -0
- data/lib/google/shopping/merchant/products/v1beta/product_inputs_service/rest.rb +55 -0
- data/lib/google/shopping/merchant/products/v1beta/product_inputs_service.rb +58 -0
- data/lib/google/shopping/merchant/products/v1beta/productinputs_pb.rb +56 -0
- data/lib/google/shopping/merchant/products/v1beta/productinputs_services_pb.rb +58 -0
- data/lib/google/shopping/merchant/products/v1beta/products_common_pb.rb +75 -0
- data/lib/google/shopping/merchant/products/v1beta/products_pb.rb +56 -0
- data/lib/google/shopping/merchant/products/v1beta/products_service/client.rb +552 -0
- data/lib/google/shopping/merchant/products/v1beta/products_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/products/v1beta/products_service/paths.rb +66 -0
- data/lib/google/shopping/merchant/products/v1beta/products_service/rest/client.rb +512 -0
- data/lib/google/shopping/merchant/products/v1beta/products_service/rest/service_stub.rb +189 -0
- data/lib/google/shopping/merchant/products/v1beta/products_service/rest.rb +55 -0
- data/lib/google/shopping/merchant/products/v1beta/products_service.rb +58 -0
- data/lib/google/shopping/merchant/products/v1beta/products_services_pb.rb +58 -0
- data/lib/google/shopping/merchant/products/v1beta/rest.rb +40 -0
- data/lib/google/shopping/merchant/products/v1beta/version.rb +7 -2
- data/lib/google/shopping/merchant/products/v1beta.rb +48 -0
- data/lib/google-shopping-merchant-products-v1beta.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +420 -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/timestamp.rb +127 -0
- data/proto_docs/google/shopping/merchant/products/v1beta/productinputs.rb +152 -0
- data/proto_docs/google/shopping/merchant/products/v1beta/products.rb +152 -0
- data/proto_docs/google/shopping/merchant/products/v1beta/products_common.rb +899 -0
- data/proto_docs/google/shopping/type/types.rb +210 -0
- data/proto_docs/google/type/interval.rb +45 -0
- metadata +100 -10
@@ -0,0 +1,507 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2024 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/v1beta/productinputs_pb"
|
21
|
+
require "google/shopping/merchant/products/v1beta/product_inputs_service/rest/service_stub"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Shopping
|
25
|
+
module Merchant
|
26
|
+
module Products
|
27
|
+
module V1beta
|
28
|
+
module ProductInputsService
|
29
|
+
module Rest
|
30
|
+
##
|
31
|
+
# REST client for the ProductInputsService service.
|
32
|
+
#
|
33
|
+
# Service to use ProductInput resource.
|
34
|
+
# This service works for products with online channel only.
|
35
|
+
#
|
36
|
+
class Client
|
37
|
+
# @private
|
38
|
+
API_VERSION = ""
|
39
|
+
|
40
|
+
# @private
|
41
|
+
DEFAULT_ENDPOINT_TEMPLATE = "merchantapi.$UNIVERSE_DOMAIN$"
|
42
|
+
|
43
|
+
include Paths
|
44
|
+
|
45
|
+
# @private
|
46
|
+
attr_reader :product_inputs_service_stub
|
47
|
+
|
48
|
+
##
|
49
|
+
# Configure the ProductInputsService Client class.
|
50
|
+
#
|
51
|
+
# See {::Google::Shopping::Merchant::Products::V1beta::ProductInputsService::Rest::Client::Configuration}
|
52
|
+
# for a description of the configuration fields.
|
53
|
+
#
|
54
|
+
# @example
|
55
|
+
#
|
56
|
+
# # Modify the configuration for all ProductInputsService clients
|
57
|
+
# ::Google::Shopping::Merchant::Products::V1beta::ProductInputsService::Rest::Client.configure do |config|
|
58
|
+
# config.timeout = 10.0
|
59
|
+
# end
|
60
|
+
#
|
61
|
+
# @yield [config] Configure the Client client.
|
62
|
+
# @yieldparam config [Client::Configuration]
|
63
|
+
#
|
64
|
+
# @return [Client::Configuration]
|
65
|
+
#
|
66
|
+
def self.configure
|
67
|
+
@configure ||= begin
|
68
|
+
namespace = ["Google", "Shopping", "Merchant", "Products", "V1beta"]
|
69
|
+
parent_config = while namespace.any?
|
70
|
+
parent_name = namespace.join "::"
|
71
|
+
parent_const = const_get parent_name
|
72
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
73
|
+
namespace.pop
|
74
|
+
end
|
75
|
+
default_config = Client::Configuration.new parent_config
|
76
|
+
|
77
|
+
default_config.timeout = 60.0
|
78
|
+
default_config.retry_policy = {
|
79
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
80
|
+
}
|
81
|
+
|
82
|
+
default_config
|
83
|
+
end
|
84
|
+
yield @configure if block_given?
|
85
|
+
@configure
|
86
|
+
end
|
87
|
+
|
88
|
+
##
|
89
|
+
# Configure the ProductInputsService Client instance.
|
90
|
+
#
|
91
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
92
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
93
|
+
# should be made on {Client.configure}.
|
94
|
+
#
|
95
|
+
# See {::Google::Shopping::Merchant::Products::V1beta::ProductInputsService::Rest::Client::Configuration}
|
96
|
+
# for a description of the configuration fields.
|
97
|
+
#
|
98
|
+
# @yield [config] Configure the Client client.
|
99
|
+
# @yieldparam config [Client::Configuration]
|
100
|
+
#
|
101
|
+
# @return [Client::Configuration]
|
102
|
+
#
|
103
|
+
def configure
|
104
|
+
yield @config if block_given?
|
105
|
+
@config
|
106
|
+
end
|
107
|
+
|
108
|
+
##
|
109
|
+
# The effective universe domain
|
110
|
+
#
|
111
|
+
# @return [String]
|
112
|
+
#
|
113
|
+
def universe_domain
|
114
|
+
@product_inputs_service_stub.universe_domain
|
115
|
+
end
|
116
|
+
|
117
|
+
##
|
118
|
+
# Create a new ProductInputsService REST client object.
|
119
|
+
#
|
120
|
+
# @example
|
121
|
+
#
|
122
|
+
# # Create a client using the default configuration
|
123
|
+
# client = ::Google::Shopping::Merchant::Products::V1beta::ProductInputsService::Rest::Client.new
|
124
|
+
#
|
125
|
+
# # Create a client using a custom configuration
|
126
|
+
# client = ::Google::Shopping::Merchant::Products::V1beta::ProductInputsService::Rest::Client.new do |config|
|
127
|
+
# config.timeout = 10.0
|
128
|
+
# end
|
129
|
+
#
|
130
|
+
# @yield [config] Configure the ProductInputsService client.
|
131
|
+
# @yieldparam config [Client::Configuration]
|
132
|
+
#
|
133
|
+
def initialize
|
134
|
+
# Create the configuration object
|
135
|
+
@config = Configuration.new Client.configure
|
136
|
+
|
137
|
+
# Yield the configuration if needed
|
138
|
+
yield @config if block_given?
|
139
|
+
|
140
|
+
# Create credentials
|
141
|
+
credentials = @config.credentials
|
142
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
143
|
+
# but only if the default endpoint does not have a region prefix.
|
144
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
145
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
146
|
+
!@config.endpoint.split(".").first.include?("-"))
|
147
|
+
credentials ||= Credentials.default scope: @config.scope,
|
148
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
149
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
150
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
151
|
+
end
|
152
|
+
|
153
|
+
@quota_project_id = @config.quota_project
|
154
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
155
|
+
|
156
|
+
@product_inputs_service_stub = ::Google::Shopping::Merchant::Products::V1beta::ProductInputsService::Rest::ServiceStub.new(
|
157
|
+
endpoint: @config.endpoint,
|
158
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
159
|
+
universe_domain: @config.universe_domain,
|
160
|
+
credentials: credentials
|
161
|
+
)
|
162
|
+
end
|
163
|
+
|
164
|
+
# Service calls
|
165
|
+
|
166
|
+
##
|
167
|
+
# Uploads a product input to your Merchant Center account. If an input
|
168
|
+
# with the same contentLanguage, offerId, and dataSource already exists,
|
169
|
+
# this method replaces that entry.
|
170
|
+
#
|
171
|
+
# After inserting, updating, or deleting a product input, it may take several
|
172
|
+
# minutes before the processed product can be retrieved.
|
173
|
+
#
|
174
|
+
# @overload insert_product_input(request, options = nil)
|
175
|
+
# Pass arguments to `insert_product_input` via a request object, either of type
|
176
|
+
# {::Google::Shopping::Merchant::Products::V1beta::InsertProductInputRequest} or an equivalent Hash.
|
177
|
+
#
|
178
|
+
# @param request [::Google::Shopping::Merchant::Products::V1beta::InsertProductInputRequest, ::Hash]
|
179
|
+
# A request object representing the call parameters. Required. To specify no
|
180
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
181
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
182
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
183
|
+
#
|
184
|
+
# @overload insert_product_input(parent: nil, product_input: nil, data_source: nil)
|
185
|
+
# Pass arguments to `insert_product_input` via keyword arguments. Note that at
|
186
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
187
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
188
|
+
#
|
189
|
+
# @param parent [::String]
|
190
|
+
# Required. The account where this product will be inserted.
|
191
|
+
# Format: accounts/\\{account}
|
192
|
+
# @param product_input [::Google::Shopping::Merchant::Products::V1beta::ProductInput, ::Hash]
|
193
|
+
# Required. The product input to insert.
|
194
|
+
# @param data_source [::String]
|
195
|
+
# Required. The primary or supplemental product data source name. If the
|
196
|
+
# product already exists and data source provided is different, then the
|
197
|
+
# product will be moved to a new data source. Format:
|
198
|
+
# `accounts/{account}/dataSources/{datasource}`.
|
199
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
200
|
+
# @yieldparam result [::Google::Shopping::Merchant::Products::V1beta::ProductInput]
|
201
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
202
|
+
#
|
203
|
+
# @return [::Google::Shopping::Merchant::Products::V1beta::ProductInput]
|
204
|
+
#
|
205
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
206
|
+
#
|
207
|
+
# @example Basic example
|
208
|
+
# require "google/shopping/merchant/products/v1beta"
|
209
|
+
#
|
210
|
+
# # Create a client object. The client can be reused for multiple calls.
|
211
|
+
# client = Google::Shopping::Merchant::Products::V1beta::ProductInputsService::Rest::Client.new
|
212
|
+
#
|
213
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
214
|
+
# request = Google::Shopping::Merchant::Products::V1beta::InsertProductInputRequest.new
|
215
|
+
#
|
216
|
+
# # Call the insert_product_input method.
|
217
|
+
# result = client.insert_product_input request
|
218
|
+
#
|
219
|
+
# # The returned object is of type Google::Shopping::Merchant::Products::V1beta::ProductInput.
|
220
|
+
# p result
|
221
|
+
#
|
222
|
+
def insert_product_input request, options = nil
|
223
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
224
|
+
|
225
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Products::V1beta::InsertProductInputRequest
|
226
|
+
|
227
|
+
# Converts hash and nil to an options object
|
228
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
229
|
+
|
230
|
+
# Customize the options with defaults
|
231
|
+
call_metadata = @config.rpcs.insert_product_input.metadata.to_h
|
232
|
+
|
233
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
234
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
235
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
236
|
+
gapic_version: ::Google::Shopping::Merchant::Products::V1beta::VERSION,
|
237
|
+
transports_version_send: [:rest]
|
238
|
+
|
239
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
240
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
241
|
+
|
242
|
+
options.apply_defaults timeout: @config.rpcs.insert_product_input.timeout,
|
243
|
+
metadata: call_metadata,
|
244
|
+
retry_policy: @config.rpcs.insert_product_input.retry_policy
|
245
|
+
|
246
|
+
options.apply_defaults timeout: @config.timeout,
|
247
|
+
metadata: @config.metadata,
|
248
|
+
retry_policy: @config.retry_policy
|
249
|
+
|
250
|
+
@product_inputs_service_stub.insert_product_input request, options do |result, operation|
|
251
|
+
yield result, operation if block_given?
|
252
|
+
return result
|
253
|
+
end
|
254
|
+
rescue ::Gapic::Rest::Error => e
|
255
|
+
raise ::Google::Cloud::Error.from_error(e)
|
256
|
+
end
|
257
|
+
|
258
|
+
##
|
259
|
+
# Deletes a product input from your Merchant Center account.
|
260
|
+
#
|
261
|
+
# After inserting, updating, or deleting a product input, it may take several
|
262
|
+
# minutes before the processed product can be retrieved.
|
263
|
+
#
|
264
|
+
# @overload delete_product_input(request, options = nil)
|
265
|
+
# Pass arguments to `delete_product_input` via a request object, either of type
|
266
|
+
# {::Google::Shopping::Merchant::Products::V1beta::DeleteProductInputRequest} or an equivalent Hash.
|
267
|
+
#
|
268
|
+
# @param request [::Google::Shopping::Merchant::Products::V1beta::DeleteProductInputRequest, ::Hash]
|
269
|
+
# A request object representing the call parameters. Required. To specify no
|
270
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
271
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
272
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
273
|
+
#
|
274
|
+
# @overload delete_product_input(name: nil, data_source: nil)
|
275
|
+
# Pass arguments to `delete_product_input` via keyword arguments. Note that at
|
276
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
277
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
278
|
+
#
|
279
|
+
# @param name [::String]
|
280
|
+
# Required. The name of the product input resource to delete.
|
281
|
+
# Format: accounts/\\{account}/productInputs/\\{product}
|
282
|
+
# @param data_source [::String]
|
283
|
+
# Required. The primary or supplemental data source from which the product
|
284
|
+
# input should be deleted. Format:
|
285
|
+
# `accounts/{account}/dataSources/{datasource}`.
|
286
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
287
|
+
# @yieldparam result [::Google::Protobuf::Empty]
|
288
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
289
|
+
#
|
290
|
+
# @return [::Google::Protobuf::Empty]
|
291
|
+
#
|
292
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
293
|
+
#
|
294
|
+
# @example Basic example
|
295
|
+
# require "google/shopping/merchant/products/v1beta"
|
296
|
+
#
|
297
|
+
# # Create a client object. The client can be reused for multiple calls.
|
298
|
+
# client = Google::Shopping::Merchant::Products::V1beta::ProductInputsService::Rest::Client.new
|
299
|
+
#
|
300
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
301
|
+
# request = Google::Shopping::Merchant::Products::V1beta::DeleteProductInputRequest.new
|
302
|
+
#
|
303
|
+
# # Call the delete_product_input method.
|
304
|
+
# result = client.delete_product_input request
|
305
|
+
#
|
306
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
307
|
+
# p result
|
308
|
+
#
|
309
|
+
def delete_product_input request, options = nil
|
310
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
311
|
+
|
312
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Products::V1beta::DeleteProductInputRequest
|
313
|
+
|
314
|
+
# Converts hash and nil to an options object
|
315
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
316
|
+
|
317
|
+
# Customize the options with defaults
|
318
|
+
call_metadata = @config.rpcs.delete_product_input.metadata.to_h
|
319
|
+
|
320
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
321
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
322
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
323
|
+
gapic_version: ::Google::Shopping::Merchant::Products::V1beta::VERSION,
|
324
|
+
transports_version_send: [:rest]
|
325
|
+
|
326
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
327
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
328
|
+
|
329
|
+
options.apply_defaults timeout: @config.rpcs.delete_product_input.timeout,
|
330
|
+
metadata: call_metadata,
|
331
|
+
retry_policy: @config.rpcs.delete_product_input.retry_policy
|
332
|
+
|
333
|
+
options.apply_defaults timeout: @config.timeout,
|
334
|
+
metadata: @config.metadata,
|
335
|
+
retry_policy: @config.retry_policy
|
336
|
+
|
337
|
+
@product_inputs_service_stub.delete_product_input request, options do |result, operation|
|
338
|
+
yield result, operation if block_given?
|
339
|
+
return result
|
340
|
+
end
|
341
|
+
rescue ::Gapic::Rest::Error => e
|
342
|
+
raise ::Google::Cloud::Error.from_error(e)
|
343
|
+
end
|
344
|
+
|
345
|
+
##
|
346
|
+
# Configuration class for the ProductInputsService REST API.
|
347
|
+
#
|
348
|
+
# This class represents the configuration for ProductInputsService REST,
|
349
|
+
# providing control over timeouts, retry behavior, logging, transport
|
350
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
351
|
+
# applied individually to specific RPCs. See
|
352
|
+
# {::Google::Shopping::Merchant::Products::V1beta::ProductInputsService::Rest::Client::Configuration::Rpcs}
|
353
|
+
# for a list of RPCs that can be configured independently.
|
354
|
+
#
|
355
|
+
# Configuration can be applied globally to all clients, or to a single client
|
356
|
+
# on construction.
|
357
|
+
#
|
358
|
+
# @example
|
359
|
+
#
|
360
|
+
# # Modify the global config, setting the timeout for
|
361
|
+
# # insert_product_input to 20 seconds,
|
362
|
+
# # and all remaining timeouts to 10 seconds.
|
363
|
+
# ::Google::Shopping::Merchant::Products::V1beta::ProductInputsService::Rest::Client.configure do |config|
|
364
|
+
# config.timeout = 10.0
|
365
|
+
# config.rpcs.insert_product_input.timeout = 20.0
|
366
|
+
# end
|
367
|
+
#
|
368
|
+
# # Apply the above configuration only to a new client.
|
369
|
+
# client = ::Google::Shopping::Merchant::Products::V1beta::ProductInputsService::Rest::Client.new do |config|
|
370
|
+
# config.timeout = 10.0
|
371
|
+
# config.rpcs.insert_product_input.timeout = 20.0
|
372
|
+
# end
|
373
|
+
#
|
374
|
+
# @!attribute [rw] endpoint
|
375
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
376
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
377
|
+
# @return [::String,nil]
|
378
|
+
# @!attribute [rw] credentials
|
379
|
+
# Credentials to send with calls. You may provide any of the following types:
|
380
|
+
# * (`String`) The path to a service account key file in JSON format
|
381
|
+
# * (`Hash`) A service account key as a Hash
|
382
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
383
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
384
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
385
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
386
|
+
# * (`nil`) indicating no credentials
|
387
|
+
# @return [::Object]
|
388
|
+
# @!attribute [rw] scope
|
389
|
+
# The OAuth scopes
|
390
|
+
# @return [::Array<::String>]
|
391
|
+
# @!attribute [rw] lib_name
|
392
|
+
# The library name as recorded in instrumentation and logging
|
393
|
+
# @return [::String]
|
394
|
+
# @!attribute [rw] lib_version
|
395
|
+
# The library version as recorded in instrumentation and logging
|
396
|
+
# @return [::String]
|
397
|
+
# @!attribute [rw] timeout
|
398
|
+
# The call timeout in seconds.
|
399
|
+
# @return [::Numeric]
|
400
|
+
# @!attribute [rw] metadata
|
401
|
+
# Additional headers to be sent with the call.
|
402
|
+
# @return [::Hash{::Symbol=>::String}]
|
403
|
+
# @!attribute [rw] retry_policy
|
404
|
+
# The retry policy. The value is a hash with the following keys:
|
405
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
406
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
407
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
408
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
409
|
+
# trigger a retry.
|
410
|
+
# @return [::Hash]
|
411
|
+
# @!attribute [rw] quota_project
|
412
|
+
# A separate project against which to charge quota.
|
413
|
+
# @return [::String]
|
414
|
+
# @!attribute [rw] universe_domain
|
415
|
+
# The universe domain within which to make requests. This determines the
|
416
|
+
# default endpoint URL. The default value of nil uses the environment
|
417
|
+
# universe (usually the default "googleapis.com" universe).
|
418
|
+
# @return [::String,nil]
|
419
|
+
#
|
420
|
+
class Configuration
|
421
|
+
extend ::Gapic::Config
|
422
|
+
|
423
|
+
# @private
|
424
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
425
|
+
DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
|
426
|
+
|
427
|
+
config_attr :endpoint, nil, ::String, nil
|
428
|
+
config_attr :credentials, nil do |value|
|
429
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
430
|
+
allowed.any? { |klass| klass === value }
|
431
|
+
end
|
432
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
433
|
+
config_attr :lib_name, nil, ::String, nil
|
434
|
+
config_attr :lib_version, nil, ::String, nil
|
435
|
+
config_attr :timeout, nil, ::Numeric, nil
|
436
|
+
config_attr :metadata, nil, ::Hash, nil
|
437
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
438
|
+
config_attr :quota_project, nil, ::String, nil
|
439
|
+
config_attr :universe_domain, nil, ::String, nil
|
440
|
+
|
441
|
+
# @private
|
442
|
+
def initialize parent_config = nil
|
443
|
+
@parent_config = parent_config unless parent_config.nil?
|
444
|
+
|
445
|
+
yield self if block_given?
|
446
|
+
end
|
447
|
+
|
448
|
+
##
|
449
|
+
# Configurations for individual RPCs
|
450
|
+
# @return [Rpcs]
|
451
|
+
#
|
452
|
+
def rpcs
|
453
|
+
@rpcs ||= begin
|
454
|
+
parent_rpcs = nil
|
455
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
456
|
+
Rpcs.new parent_rpcs
|
457
|
+
end
|
458
|
+
end
|
459
|
+
|
460
|
+
##
|
461
|
+
# Configuration RPC class for the ProductInputsService API.
|
462
|
+
#
|
463
|
+
# Includes fields providing the configuration for each RPC in this service.
|
464
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
465
|
+
# the following configuration fields:
|
466
|
+
#
|
467
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
468
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
469
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
470
|
+
# include the following keys:
|
471
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
472
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
473
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
474
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
475
|
+
# trigger a retry.
|
476
|
+
#
|
477
|
+
class Rpcs
|
478
|
+
##
|
479
|
+
# RPC-specific configuration for `insert_product_input`
|
480
|
+
# @return [::Gapic::Config::Method]
|
481
|
+
#
|
482
|
+
attr_reader :insert_product_input
|
483
|
+
##
|
484
|
+
# RPC-specific configuration for `delete_product_input`
|
485
|
+
# @return [::Gapic::Config::Method]
|
486
|
+
#
|
487
|
+
attr_reader :delete_product_input
|
488
|
+
|
489
|
+
# @private
|
490
|
+
def initialize parent_rpcs = nil
|
491
|
+
insert_product_input_config = parent_rpcs.insert_product_input if parent_rpcs.respond_to? :insert_product_input
|
492
|
+
@insert_product_input = ::Gapic::Config::Method.new insert_product_input_config
|
493
|
+
delete_product_input_config = parent_rpcs.delete_product_input if parent_rpcs.respond_to? :delete_product_input
|
494
|
+
@delete_product_input = ::Gapic::Config::Method.new delete_product_input_config
|
495
|
+
|
496
|
+
yield self if block_given?
|
497
|
+
end
|
498
|
+
end
|
499
|
+
end
|
500
|
+
end
|
501
|
+
end
|
502
|
+
end
|
503
|
+
end
|
504
|
+
end
|
505
|
+
end
|
506
|
+
end
|
507
|
+
end
|