google-shopping-merchant-products-v1beta 0.a → 0.1.2
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 +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,512 @@
|
|
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/products_pb"
|
21
|
+
require "google/shopping/merchant/products/v1beta/products_service/rest/service_stub"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Shopping
|
25
|
+
module Merchant
|
26
|
+
module Products
|
27
|
+
module V1beta
|
28
|
+
module ProductsService
|
29
|
+
module Rest
|
30
|
+
##
|
31
|
+
# REST client for the ProductsService service.
|
32
|
+
#
|
33
|
+
# Service to use Product 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 :products_service_stub
|
47
|
+
|
48
|
+
##
|
49
|
+
# Configure the ProductsService Client class.
|
50
|
+
#
|
51
|
+
# See {::Google::Shopping::Merchant::Products::V1beta::ProductsService::Rest::Client::Configuration}
|
52
|
+
# for a description of the configuration fields.
|
53
|
+
#
|
54
|
+
# @example
|
55
|
+
#
|
56
|
+
# # Modify the configuration for all ProductsService clients
|
57
|
+
# ::Google::Shopping::Merchant::Products::V1beta::ProductsService::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 ProductsService 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::ProductsService::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
|
+
@products_service_stub.universe_domain
|
115
|
+
end
|
116
|
+
|
117
|
+
##
|
118
|
+
# Create a new ProductsService REST client object.
|
119
|
+
#
|
120
|
+
# @example
|
121
|
+
#
|
122
|
+
# # Create a client using the default configuration
|
123
|
+
# client = ::Google::Shopping::Merchant::Products::V1beta::ProductsService::Rest::Client.new
|
124
|
+
#
|
125
|
+
# # Create a client using a custom configuration
|
126
|
+
# client = ::Google::Shopping::Merchant::Products::V1beta::ProductsService::Rest::Client.new do |config|
|
127
|
+
# config.timeout = 10.0
|
128
|
+
# end
|
129
|
+
#
|
130
|
+
# @yield [config] Configure the ProductsService 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
|
+
@products_service_stub = ::Google::Shopping::Merchant::Products::V1beta::ProductsService::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
|
+
# Retrieves the processed product from your Merchant Center account.
|
168
|
+
#
|
169
|
+
# After inserting, updating, or deleting a product input, it may take several
|
170
|
+
# minutes before the updated final product can be retrieved.
|
171
|
+
#
|
172
|
+
# @overload get_product(request, options = nil)
|
173
|
+
# Pass arguments to `get_product` via a request object, either of type
|
174
|
+
# {::Google::Shopping::Merchant::Products::V1beta::GetProductRequest} or an equivalent Hash.
|
175
|
+
#
|
176
|
+
# @param request [::Google::Shopping::Merchant::Products::V1beta::GetProductRequest, ::Hash]
|
177
|
+
# A request object representing the call parameters. Required. To specify no
|
178
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
179
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
180
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
181
|
+
#
|
182
|
+
# @overload get_product(name: nil)
|
183
|
+
# Pass arguments to `get_product` via keyword arguments. Note that at
|
184
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
185
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
186
|
+
#
|
187
|
+
# @param name [::String]
|
188
|
+
# Required. The name of the product to retrieve.
|
189
|
+
# Format: `accounts/{account}/products/{product}`
|
190
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
191
|
+
# @yieldparam result [::Google::Shopping::Merchant::Products::V1beta::Product]
|
192
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
193
|
+
#
|
194
|
+
# @return [::Google::Shopping::Merchant::Products::V1beta::Product]
|
195
|
+
#
|
196
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
197
|
+
#
|
198
|
+
# @example Basic example
|
199
|
+
# require "google/shopping/merchant/products/v1beta"
|
200
|
+
#
|
201
|
+
# # Create a client object. The client can be reused for multiple calls.
|
202
|
+
# client = Google::Shopping::Merchant::Products::V1beta::ProductsService::Rest::Client.new
|
203
|
+
#
|
204
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
205
|
+
# request = Google::Shopping::Merchant::Products::V1beta::GetProductRequest.new
|
206
|
+
#
|
207
|
+
# # Call the get_product method.
|
208
|
+
# result = client.get_product request
|
209
|
+
#
|
210
|
+
# # The returned object is of type Google::Shopping::Merchant::Products::V1beta::Product.
|
211
|
+
# p result
|
212
|
+
#
|
213
|
+
def get_product request, options = nil
|
214
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
215
|
+
|
216
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Products::V1beta::GetProductRequest
|
217
|
+
|
218
|
+
# Converts hash and nil to an options object
|
219
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
220
|
+
|
221
|
+
# Customize the options with defaults
|
222
|
+
call_metadata = @config.rpcs.get_product.metadata.to_h
|
223
|
+
|
224
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
225
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
226
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
227
|
+
gapic_version: ::Google::Shopping::Merchant::Products::V1beta::VERSION,
|
228
|
+
transports_version_send: [:rest]
|
229
|
+
|
230
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
231
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
232
|
+
|
233
|
+
options.apply_defaults timeout: @config.rpcs.get_product.timeout,
|
234
|
+
metadata: call_metadata,
|
235
|
+
retry_policy: @config.rpcs.get_product.retry_policy
|
236
|
+
|
237
|
+
options.apply_defaults timeout: @config.timeout,
|
238
|
+
metadata: @config.metadata,
|
239
|
+
retry_policy: @config.retry_policy
|
240
|
+
|
241
|
+
@products_service_stub.get_product request, options do |result, operation|
|
242
|
+
yield result, operation if block_given?
|
243
|
+
return result
|
244
|
+
end
|
245
|
+
rescue ::Gapic::Rest::Error => e
|
246
|
+
raise ::Google::Cloud::Error.from_error(e)
|
247
|
+
end
|
248
|
+
|
249
|
+
##
|
250
|
+
# Lists the processed products in your Merchant Center account. The response
|
251
|
+
# might contain fewer items than specified by pageSize. Rely on pageToken to
|
252
|
+
# determine if there are more items to be requested.
|
253
|
+
#
|
254
|
+
# After inserting, updating, or deleting a product input, it may take several
|
255
|
+
# minutes before the updated processed product can be retrieved.
|
256
|
+
#
|
257
|
+
# @overload list_products(request, options = nil)
|
258
|
+
# Pass arguments to `list_products` via a request object, either of type
|
259
|
+
# {::Google::Shopping::Merchant::Products::V1beta::ListProductsRequest} or an equivalent Hash.
|
260
|
+
#
|
261
|
+
# @param request [::Google::Shopping::Merchant::Products::V1beta::ListProductsRequest, ::Hash]
|
262
|
+
# A request object representing the call parameters. Required. To specify no
|
263
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
264
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
265
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
266
|
+
#
|
267
|
+
# @overload list_products(parent: nil, page_size: nil, page_token: nil)
|
268
|
+
# Pass arguments to `list_products` via keyword arguments. Note that at
|
269
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
270
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
271
|
+
#
|
272
|
+
# @param parent [::String]
|
273
|
+
# Required. The account to list processed products for.
|
274
|
+
# Format: accounts/\\{account}
|
275
|
+
# @param page_size [::Integer]
|
276
|
+
# The maximum number of products to return. The service may return fewer than
|
277
|
+
# this value.
|
278
|
+
# The maximum value is 1000; values above 1000 will be coerced to 1000.
|
279
|
+
# If unspecified, the maximum number of products will be returned.
|
280
|
+
# @param page_token [::String]
|
281
|
+
# A page token, received from a previous `ListProducts` call.
|
282
|
+
# Provide this to retrieve the subsequent page.
|
283
|
+
#
|
284
|
+
# When paginating, all other parameters provided to `ListProducts` must
|
285
|
+
# match the call that provided the page token.
|
286
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
287
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Shopping::Merchant::Products::V1beta::Product>]
|
288
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
289
|
+
#
|
290
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Shopping::Merchant::Products::V1beta::Product>]
|
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::ProductsService::Rest::Client.new
|
299
|
+
#
|
300
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
301
|
+
# request = Google::Shopping::Merchant::Products::V1beta::ListProductsRequest.new
|
302
|
+
#
|
303
|
+
# # Call the list_products method.
|
304
|
+
# result = client.list_products request
|
305
|
+
#
|
306
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
307
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
308
|
+
# result.each do |item|
|
309
|
+
# # Each element is of type ::Google::Shopping::Merchant::Products::V1beta::Product.
|
310
|
+
# p item
|
311
|
+
# end
|
312
|
+
#
|
313
|
+
def list_products request, options = nil
|
314
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
315
|
+
|
316
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Products::V1beta::ListProductsRequest
|
317
|
+
|
318
|
+
# Converts hash and nil to an options object
|
319
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
320
|
+
|
321
|
+
# Customize the options with defaults
|
322
|
+
call_metadata = @config.rpcs.list_products.metadata.to_h
|
323
|
+
|
324
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
325
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
326
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
327
|
+
gapic_version: ::Google::Shopping::Merchant::Products::V1beta::VERSION,
|
328
|
+
transports_version_send: [:rest]
|
329
|
+
|
330
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
331
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
332
|
+
|
333
|
+
options.apply_defaults timeout: @config.rpcs.list_products.timeout,
|
334
|
+
metadata: call_metadata,
|
335
|
+
retry_policy: @config.rpcs.list_products.retry_policy
|
336
|
+
|
337
|
+
options.apply_defaults timeout: @config.timeout,
|
338
|
+
metadata: @config.metadata,
|
339
|
+
retry_policy: @config.retry_policy
|
340
|
+
|
341
|
+
@products_service_stub.list_products request, options do |result, operation|
|
342
|
+
result = ::Gapic::Rest::PagedEnumerable.new @products_service_stub, :list_products, "products", request, result, options
|
343
|
+
yield result, operation if block_given?
|
344
|
+
return result
|
345
|
+
end
|
346
|
+
rescue ::Gapic::Rest::Error => e
|
347
|
+
raise ::Google::Cloud::Error.from_error(e)
|
348
|
+
end
|
349
|
+
|
350
|
+
##
|
351
|
+
# Configuration class for the ProductsService REST API.
|
352
|
+
#
|
353
|
+
# This class represents the configuration for ProductsService REST,
|
354
|
+
# providing control over timeouts, retry behavior, logging, transport
|
355
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
356
|
+
# applied individually to specific RPCs. See
|
357
|
+
# {::Google::Shopping::Merchant::Products::V1beta::ProductsService::Rest::Client::Configuration::Rpcs}
|
358
|
+
# for a list of RPCs that can be configured independently.
|
359
|
+
#
|
360
|
+
# Configuration can be applied globally to all clients, or to a single client
|
361
|
+
# on construction.
|
362
|
+
#
|
363
|
+
# @example
|
364
|
+
#
|
365
|
+
# # Modify the global config, setting the timeout for
|
366
|
+
# # get_product to 20 seconds,
|
367
|
+
# # and all remaining timeouts to 10 seconds.
|
368
|
+
# ::Google::Shopping::Merchant::Products::V1beta::ProductsService::Rest::Client.configure do |config|
|
369
|
+
# config.timeout = 10.0
|
370
|
+
# config.rpcs.get_product.timeout = 20.0
|
371
|
+
# end
|
372
|
+
#
|
373
|
+
# # Apply the above configuration only to a new client.
|
374
|
+
# client = ::Google::Shopping::Merchant::Products::V1beta::ProductsService::Rest::Client.new do |config|
|
375
|
+
# config.timeout = 10.0
|
376
|
+
# config.rpcs.get_product.timeout = 20.0
|
377
|
+
# end
|
378
|
+
#
|
379
|
+
# @!attribute [rw] endpoint
|
380
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
381
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
382
|
+
# @return [::String,nil]
|
383
|
+
# @!attribute [rw] credentials
|
384
|
+
# Credentials to send with calls. You may provide any of the following types:
|
385
|
+
# * (`String`) The path to a service account key file in JSON format
|
386
|
+
# * (`Hash`) A service account key as a Hash
|
387
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
388
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
389
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
390
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
391
|
+
# * (`nil`) indicating no credentials
|
392
|
+
# @return [::Object]
|
393
|
+
# @!attribute [rw] scope
|
394
|
+
# The OAuth scopes
|
395
|
+
# @return [::Array<::String>]
|
396
|
+
# @!attribute [rw] lib_name
|
397
|
+
# The library name as recorded in instrumentation and logging
|
398
|
+
# @return [::String]
|
399
|
+
# @!attribute [rw] lib_version
|
400
|
+
# The library version as recorded in instrumentation and logging
|
401
|
+
# @return [::String]
|
402
|
+
# @!attribute [rw] timeout
|
403
|
+
# The call timeout in seconds.
|
404
|
+
# @return [::Numeric]
|
405
|
+
# @!attribute [rw] metadata
|
406
|
+
# Additional headers to be sent with the call.
|
407
|
+
# @return [::Hash{::Symbol=>::String}]
|
408
|
+
# @!attribute [rw] retry_policy
|
409
|
+
# The retry policy. The value is a hash with the following keys:
|
410
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
411
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
412
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
413
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
414
|
+
# trigger a retry.
|
415
|
+
# @return [::Hash]
|
416
|
+
# @!attribute [rw] quota_project
|
417
|
+
# A separate project against which to charge quota.
|
418
|
+
# @return [::String]
|
419
|
+
# @!attribute [rw] universe_domain
|
420
|
+
# The universe domain within which to make requests. This determines the
|
421
|
+
# default endpoint URL. The default value of nil uses the environment
|
422
|
+
# universe (usually the default "googleapis.com" universe).
|
423
|
+
# @return [::String,nil]
|
424
|
+
#
|
425
|
+
class Configuration
|
426
|
+
extend ::Gapic::Config
|
427
|
+
|
428
|
+
# @private
|
429
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
430
|
+
DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
|
431
|
+
|
432
|
+
config_attr :endpoint, nil, ::String, nil
|
433
|
+
config_attr :credentials, nil do |value|
|
434
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
435
|
+
allowed.any? { |klass| klass === value }
|
436
|
+
end
|
437
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
438
|
+
config_attr :lib_name, nil, ::String, nil
|
439
|
+
config_attr :lib_version, nil, ::String, nil
|
440
|
+
config_attr :timeout, nil, ::Numeric, nil
|
441
|
+
config_attr :metadata, nil, ::Hash, nil
|
442
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
443
|
+
config_attr :quota_project, nil, ::String, nil
|
444
|
+
config_attr :universe_domain, nil, ::String, nil
|
445
|
+
|
446
|
+
# @private
|
447
|
+
def initialize parent_config = nil
|
448
|
+
@parent_config = parent_config unless parent_config.nil?
|
449
|
+
|
450
|
+
yield self if block_given?
|
451
|
+
end
|
452
|
+
|
453
|
+
##
|
454
|
+
# Configurations for individual RPCs
|
455
|
+
# @return [Rpcs]
|
456
|
+
#
|
457
|
+
def rpcs
|
458
|
+
@rpcs ||= begin
|
459
|
+
parent_rpcs = nil
|
460
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
461
|
+
Rpcs.new parent_rpcs
|
462
|
+
end
|
463
|
+
end
|
464
|
+
|
465
|
+
##
|
466
|
+
# Configuration RPC class for the ProductsService API.
|
467
|
+
#
|
468
|
+
# Includes fields providing the configuration for each RPC in this service.
|
469
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
470
|
+
# the following configuration fields:
|
471
|
+
#
|
472
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
473
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
474
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
475
|
+
# include the following keys:
|
476
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
477
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
478
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
479
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
480
|
+
# trigger a retry.
|
481
|
+
#
|
482
|
+
class Rpcs
|
483
|
+
##
|
484
|
+
# RPC-specific configuration for `get_product`
|
485
|
+
# @return [::Gapic::Config::Method]
|
486
|
+
#
|
487
|
+
attr_reader :get_product
|
488
|
+
##
|
489
|
+
# RPC-specific configuration for `list_products`
|
490
|
+
# @return [::Gapic::Config::Method]
|
491
|
+
#
|
492
|
+
attr_reader :list_products
|
493
|
+
|
494
|
+
# @private
|
495
|
+
def initialize parent_rpcs = nil
|
496
|
+
get_product_config = parent_rpcs.get_product if parent_rpcs.respond_to? :get_product
|
497
|
+
@get_product = ::Gapic::Config::Method.new get_product_config
|
498
|
+
list_products_config = parent_rpcs.list_products if parent_rpcs.respond_to? :list_products
|
499
|
+
@list_products = ::Gapic::Config::Method.new list_products_config
|
500
|
+
|
501
|
+
yield self if block_given?
|
502
|
+
end
|
503
|
+
end
|
504
|
+
end
|
505
|
+
end
|
506
|
+
end
|
507
|
+
end
|
508
|
+
end
|
509
|
+
end
|
510
|
+
end
|
511
|
+
end
|
512
|
+
end
|