google-shopping-merchant-products-v1beta 0.a → 0.1.0
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 +144 -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 +399 -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 +222 -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,552 @@
|
|
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
|
+
|
22
|
+
module Google
|
23
|
+
module Shopping
|
24
|
+
module Merchant
|
25
|
+
module Products
|
26
|
+
module V1beta
|
27
|
+
module ProductsService
|
28
|
+
##
|
29
|
+
# Client for the ProductsService service.
|
30
|
+
#
|
31
|
+
# Service to use Product resource.
|
32
|
+
# This service works for products with online channel only.
|
33
|
+
#
|
34
|
+
class Client
|
35
|
+
# @private
|
36
|
+
API_VERSION = ""
|
37
|
+
|
38
|
+
# @private
|
39
|
+
DEFAULT_ENDPOINT_TEMPLATE = "merchantapi.$UNIVERSE_DOMAIN$"
|
40
|
+
|
41
|
+
include Paths
|
42
|
+
|
43
|
+
# @private
|
44
|
+
attr_reader :products_service_stub
|
45
|
+
|
46
|
+
##
|
47
|
+
# Configure the ProductsService Client class.
|
48
|
+
#
|
49
|
+
# See {::Google::Shopping::Merchant::Products::V1beta::ProductsService::Client::Configuration}
|
50
|
+
# for a description of the configuration fields.
|
51
|
+
#
|
52
|
+
# @example
|
53
|
+
#
|
54
|
+
# # Modify the configuration for all ProductsService clients
|
55
|
+
# ::Google::Shopping::Merchant::Products::V1beta::ProductsService::Client.configure do |config|
|
56
|
+
# config.timeout = 10.0
|
57
|
+
# end
|
58
|
+
#
|
59
|
+
# @yield [config] Configure the Client client.
|
60
|
+
# @yieldparam config [Client::Configuration]
|
61
|
+
#
|
62
|
+
# @return [Client::Configuration]
|
63
|
+
#
|
64
|
+
def self.configure
|
65
|
+
@configure ||= begin
|
66
|
+
namespace = ["Google", "Shopping", "Merchant", "Products", "V1beta"]
|
67
|
+
parent_config = while namespace.any?
|
68
|
+
parent_name = namespace.join "::"
|
69
|
+
parent_const = const_get parent_name
|
70
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
71
|
+
namespace.pop
|
72
|
+
end
|
73
|
+
default_config = Client::Configuration.new parent_config
|
74
|
+
|
75
|
+
default_config.timeout = 60.0
|
76
|
+
default_config.retry_policy = {
|
77
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
78
|
+
}
|
79
|
+
|
80
|
+
default_config
|
81
|
+
end
|
82
|
+
yield @configure if block_given?
|
83
|
+
@configure
|
84
|
+
end
|
85
|
+
|
86
|
+
##
|
87
|
+
# Configure the ProductsService Client instance.
|
88
|
+
#
|
89
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
90
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
91
|
+
# should be made on {Client.configure}.
|
92
|
+
#
|
93
|
+
# See {::Google::Shopping::Merchant::Products::V1beta::ProductsService::Client::Configuration}
|
94
|
+
# for a description of the configuration fields.
|
95
|
+
#
|
96
|
+
# @yield [config] Configure the Client client.
|
97
|
+
# @yieldparam config [Client::Configuration]
|
98
|
+
#
|
99
|
+
# @return [Client::Configuration]
|
100
|
+
#
|
101
|
+
def configure
|
102
|
+
yield @config if block_given?
|
103
|
+
@config
|
104
|
+
end
|
105
|
+
|
106
|
+
##
|
107
|
+
# The effective universe domain
|
108
|
+
#
|
109
|
+
# @return [String]
|
110
|
+
#
|
111
|
+
def universe_domain
|
112
|
+
@products_service_stub.universe_domain
|
113
|
+
end
|
114
|
+
|
115
|
+
##
|
116
|
+
# Create a new ProductsService client object.
|
117
|
+
#
|
118
|
+
# @example
|
119
|
+
#
|
120
|
+
# # Create a client using the default configuration
|
121
|
+
# client = ::Google::Shopping::Merchant::Products::V1beta::ProductsService::Client.new
|
122
|
+
#
|
123
|
+
# # Create a client using a custom configuration
|
124
|
+
# client = ::Google::Shopping::Merchant::Products::V1beta::ProductsService::Client.new do |config|
|
125
|
+
# config.timeout = 10.0
|
126
|
+
# end
|
127
|
+
#
|
128
|
+
# @yield [config] Configure the ProductsService client.
|
129
|
+
# @yieldparam config [Client::Configuration]
|
130
|
+
#
|
131
|
+
def initialize
|
132
|
+
# These require statements are intentionally placed here to initialize
|
133
|
+
# the gRPC module only when it's required.
|
134
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
135
|
+
require "gapic/grpc"
|
136
|
+
require "google/shopping/merchant/products/v1beta/products_services_pb"
|
137
|
+
|
138
|
+
# Create the configuration object
|
139
|
+
@config = Configuration.new Client.configure
|
140
|
+
|
141
|
+
# Yield the configuration if needed
|
142
|
+
yield @config if block_given?
|
143
|
+
|
144
|
+
# Create credentials
|
145
|
+
credentials = @config.credentials
|
146
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
147
|
+
# but only if the default endpoint does not have a region prefix.
|
148
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
149
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
150
|
+
!@config.endpoint.split(".").first.include?("-"))
|
151
|
+
credentials ||= Credentials.default scope: @config.scope,
|
152
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
153
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
154
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
155
|
+
end
|
156
|
+
@quota_project_id = @config.quota_project
|
157
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
158
|
+
|
159
|
+
@products_service_stub = ::Gapic::ServiceStub.new(
|
160
|
+
::Google::Shopping::Merchant::Products::V1beta::ProductsService::Stub,
|
161
|
+
credentials: credentials,
|
162
|
+
endpoint: @config.endpoint,
|
163
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
164
|
+
universe_domain: @config.universe_domain,
|
165
|
+
channel_args: @config.channel_args,
|
166
|
+
interceptors: @config.interceptors,
|
167
|
+
channel_pool_config: @config.channel_pool
|
168
|
+
)
|
169
|
+
end
|
170
|
+
|
171
|
+
# Service calls
|
172
|
+
|
173
|
+
##
|
174
|
+
# Retrieves the processed product from your Merchant Center account.
|
175
|
+
#
|
176
|
+
# After inserting, updating, or deleting a product input, it may take several
|
177
|
+
# minutes before the updated final product can be retrieved.
|
178
|
+
#
|
179
|
+
# @overload get_product(request, options = nil)
|
180
|
+
# Pass arguments to `get_product` via a request object, either of type
|
181
|
+
# {::Google::Shopping::Merchant::Products::V1beta::GetProductRequest} or an equivalent Hash.
|
182
|
+
#
|
183
|
+
# @param request [::Google::Shopping::Merchant::Products::V1beta::GetProductRequest, ::Hash]
|
184
|
+
# A request object representing the call parameters. Required. To specify no
|
185
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
186
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
187
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
188
|
+
#
|
189
|
+
# @overload get_product(name: nil)
|
190
|
+
# Pass arguments to `get_product` via keyword arguments. Note that at
|
191
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
192
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
193
|
+
#
|
194
|
+
# @param name [::String]
|
195
|
+
# Required. The name of the product to retrieve.
|
196
|
+
# Format: `accounts/{account}/products/{product}`
|
197
|
+
#
|
198
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
199
|
+
# @yieldparam response [::Google::Shopping::Merchant::Products::V1beta::Product]
|
200
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
201
|
+
#
|
202
|
+
# @return [::Google::Shopping::Merchant::Products::V1beta::Product]
|
203
|
+
#
|
204
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
205
|
+
#
|
206
|
+
# @example Basic example
|
207
|
+
# require "google/shopping/merchant/products/v1beta"
|
208
|
+
#
|
209
|
+
# # Create a client object. The client can be reused for multiple calls.
|
210
|
+
# client = Google::Shopping::Merchant::Products::V1beta::ProductsService::Client.new
|
211
|
+
#
|
212
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
213
|
+
# request = Google::Shopping::Merchant::Products::V1beta::GetProductRequest.new
|
214
|
+
#
|
215
|
+
# # Call the get_product method.
|
216
|
+
# result = client.get_product request
|
217
|
+
#
|
218
|
+
# # The returned object is of type Google::Shopping::Merchant::Products::V1beta::Product.
|
219
|
+
# p result
|
220
|
+
#
|
221
|
+
def get_product request, options = nil
|
222
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
223
|
+
|
224
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Products::V1beta::GetProductRequest
|
225
|
+
|
226
|
+
# Converts hash and nil to an options object
|
227
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
228
|
+
|
229
|
+
# Customize the options with defaults
|
230
|
+
metadata = @config.rpcs.get_product.metadata.to_h
|
231
|
+
|
232
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
233
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
234
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
235
|
+
gapic_version: ::Google::Shopping::Merchant::Products::V1beta::VERSION
|
236
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
237
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
238
|
+
|
239
|
+
header_params = {}
|
240
|
+
if request.name
|
241
|
+
header_params["name"] = request.name
|
242
|
+
end
|
243
|
+
|
244
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
245
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
246
|
+
|
247
|
+
options.apply_defaults timeout: @config.rpcs.get_product.timeout,
|
248
|
+
metadata: metadata,
|
249
|
+
retry_policy: @config.rpcs.get_product.retry_policy
|
250
|
+
|
251
|
+
options.apply_defaults timeout: @config.timeout,
|
252
|
+
metadata: @config.metadata,
|
253
|
+
retry_policy: @config.retry_policy
|
254
|
+
|
255
|
+
@products_service_stub.call_rpc :get_product, request, options: options do |response, operation|
|
256
|
+
yield response, operation if block_given?
|
257
|
+
return response
|
258
|
+
end
|
259
|
+
rescue ::GRPC::BadStatus => e
|
260
|
+
raise ::Google::Cloud::Error.from_error(e)
|
261
|
+
end
|
262
|
+
|
263
|
+
##
|
264
|
+
# Lists the processed products in your Merchant Center account. The response
|
265
|
+
# might contain fewer items than specified by pageSize. Rely on pageToken to
|
266
|
+
# determine if there are more items to be requested.
|
267
|
+
#
|
268
|
+
# After inserting, updating, or deleting a product input, it may take several
|
269
|
+
# minutes before the updated processed product can be retrieved.
|
270
|
+
#
|
271
|
+
# @overload list_products(request, options = nil)
|
272
|
+
# Pass arguments to `list_products` via a request object, either of type
|
273
|
+
# {::Google::Shopping::Merchant::Products::V1beta::ListProductsRequest} or an equivalent Hash.
|
274
|
+
#
|
275
|
+
# @param request [::Google::Shopping::Merchant::Products::V1beta::ListProductsRequest, ::Hash]
|
276
|
+
# A request object representing the call parameters. Required. To specify no
|
277
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
278
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
279
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
280
|
+
#
|
281
|
+
# @overload list_products(parent: nil, page_size: nil, page_token: nil)
|
282
|
+
# Pass arguments to `list_products` via keyword arguments. Note that at
|
283
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
284
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
285
|
+
#
|
286
|
+
# @param parent [::String]
|
287
|
+
# Required. The account to list processed products for.
|
288
|
+
# Format: accounts/\\{account}
|
289
|
+
# @param page_size [::Integer]
|
290
|
+
# The maximum number of products to return. The service may return fewer than
|
291
|
+
# this value.
|
292
|
+
# The maximum value is 1000; values above 1000 will be coerced to 1000.
|
293
|
+
# If unspecified, the maximum number of products will be returned.
|
294
|
+
# @param page_token [::String]
|
295
|
+
# A page token, received from a previous `ListProducts` call.
|
296
|
+
# Provide this to retrieve the subsequent page.
|
297
|
+
#
|
298
|
+
# When paginating, all other parameters provided to `ListProducts` must
|
299
|
+
# match the call that provided the page token.
|
300
|
+
#
|
301
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
302
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Shopping::Merchant::Products::V1beta::Product>]
|
303
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
304
|
+
#
|
305
|
+
# @return [::Gapic::PagedEnumerable<::Google::Shopping::Merchant::Products::V1beta::Product>]
|
306
|
+
#
|
307
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
308
|
+
#
|
309
|
+
# @example Basic example
|
310
|
+
# require "google/shopping/merchant/products/v1beta"
|
311
|
+
#
|
312
|
+
# # Create a client object. The client can be reused for multiple calls.
|
313
|
+
# client = Google::Shopping::Merchant::Products::V1beta::ProductsService::Client.new
|
314
|
+
#
|
315
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
316
|
+
# request = Google::Shopping::Merchant::Products::V1beta::ListProductsRequest.new
|
317
|
+
#
|
318
|
+
# # Call the list_products method.
|
319
|
+
# result = client.list_products request
|
320
|
+
#
|
321
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
322
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
323
|
+
# result.each do |item|
|
324
|
+
# # Each element is of type ::Google::Shopping::Merchant::Products::V1beta::Product.
|
325
|
+
# p item
|
326
|
+
# end
|
327
|
+
#
|
328
|
+
def list_products request, options = nil
|
329
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
330
|
+
|
331
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Products::V1beta::ListProductsRequest
|
332
|
+
|
333
|
+
# Converts hash and nil to an options object
|
334
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
335
|
+
|
336
|
+
# Customize the options with defaults
|
337
|
+
metadata = @config.rpcs.list_products.metadata.to_h
|
338
|
+
|
339
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
340
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
341
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
342
|
+
gapic_version: ::Google::Shopping::Merchant::Products::V1beta::VERSION
|
343
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
344
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
345
|
+
|
346
|
+
header_params = {}
|
347
|
+
if request.parent
|
348
|
+
header_params["parent"] = request.parent
|
349
|
+
end
|
350
|
+
|
351
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
352
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
353
|
+
|
354
|
+
options.apply_defaults timeout: @config.rpcs.list_products.timeout,
|
355
|
+
metadata: metadata,
|
356
|
+
retry_policy: @config.rpcs.list_products.retry_policy
|
357
|
+
|
358
|
+
options.apply_defaults timeout: @config.timeout,
|
359
|
+
metadata: @config.metadata,
|
360
|
+
retry_policy: @config.retry_policy
|
361
|
+
|
362
|
+
@products_service_stub.call_rpc :list_products, request, options: options do |response, operation|
|
363
|
+
response = ::Gapic::PagedEnumerable.new @products_service_stub, :list_products, request, response, operation, options
|
364
|
+
yield response, operation if block_given?
|
365
|
+
return response
|
366
|
+
end
|
367
|
+
rescue ::GRPC::BadStatus => e
|
368
|
+
raise ::Google::Cloud::Error.from_error(e)
|
369
|
+
end
|
370
|
+
|
371
|
+
##
|
372
|
+
# Configuration class for the ProductsService API.
|
373
|
+
#
|
374
|
+
# This class represents the configuration for ProductsService,
|
375
|
+
# providing control over timeouts, retry behavior, logging, transport
|
376
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
377
|
+
# applied individually to specific RPCs. See
|
378
|
+
# {::Google::Shopping::Merchant::Products::V1beta::ProductsService::Client::Configuration::Rpcs}
|
379
|
+
# for a list of RPCs that can be configured independently.
|
380
|
+
#
|
381
|
+
# Configuration can be applied globally to all clients, or to a single client
|
382
|
+
# on construction.
|
383
|
+
#
|
384
|
+
# @example
|
385
|
+
#
|
386
|
+
# # Modify the global config, setting the timeout for
|
387
|
+
# # get_product to 20 seconds,
|
388
|
+
# # and all remaining timeouts to 10 seconds.
|
389
|
+
# ::Google::Shopping::Merchant::Products::V1beta::ProductsService::Client.configure do |config|
|
390
|
+
# config.timeout = 10.0
|
391
|
+
# config.rpcs.get_product.timeout = 20.0
|
392
|
+
# end
|
393
|
+
#
|
394
|
+
# # Apply the above configuration only to a new client.
|
395
|
+
# client = ::Google::Shopping::Merchant::Products::V1beta::ProductsService::Client.new do |config|
|
396
|
+
# config.timeout = 10.0
|
397
|
+
# config.rpcs.get_product.timeout = 20.0
|
398
|
+
# end
|
399
|
+
#
|
400
|
+
# @!attribute [rw] endpoint
|
401
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
402
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
403
|
+
# @return [::String,nil]
|
404
|
+
# @!attribute [rw] credentials
|
405
|
+
# Credentials to send with calls. You may provide any of the following types:
|
406
|
+
# * (`String`) The path to a service account key file in JSON format
|
407
|
+
# * (`Hash`) A service account key as a Hash
|
408
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
409
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
410
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
411
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
412
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
413
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
414
|
+
# * (`nil`) indicating no credentials
|
415
|
+
# @return [::Object]
|
416
|
+
# @!attribute [rw] scope
|
417
|
+
# The OAuth scopes
|
418
|
+
# @return [::Array<::String>]
|
419
|
+
# @!attribute [rw] lib_name
|
420
|
+
# The library name as recorded in instrumentation and logging
|
421
|
+
# @return [::String]
|
422
|
+
# @!attribute [rw] lib_version
|
423
|
+
# The library version as recorded in instrumentation and logging
|
424
|
+
# @return [::String]
|
425
|
+
# @!attribute [rw] channel_args
|
426
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
427
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
428
|
+
# @return [::Hash]
|
429
|
+
# @!attribute [rw] interceptors
|
430
|
+
# An array of interceptors that are run before calls are executed.
|
431
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
432
|
+
# @!attribute [rw] timeout
|
433
|
+
# The call timeout in seconds.
|
434
|
+
# @return [::Numeric]
|
435
|
+
# @!attribute [rw] metadata
|
436
|
+
# Additional gRPC headers to be sent with the call.
|
437
|
+
# @return [::Hash{::Symbol=>::String}]
|
438
|
+
# @!attribute [rw] retry_policy
|
439
|
+
# The retry policy. The value is a hash with the following keys:
|
440
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
441
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
442
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
443
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
444
|
+
# trigger a retry.
|
445
|
+
# @return [::Hash]
|
446
|
+
# @!attribute [rw] quota_project
|
447
|
+
# A separate project against which to charge quota.
|
448
|
+
# @return [::String]
|
449
|
+
# @!attribute [rw] universe_domain
|
450
|
+
# The universe domain within which to make requests. This determines the
|
451
|
+
# default endpoint URL. The default value of nil uses the environment
|
452
|
+
# universe (usually the default "googleapis.com" universe).
|
453
|
+
# @return [::String,nil]
|
454
|
+
#
|
455
|
+
class Configuration
|
456
|
+
extend ::Gapic::Config
|
457
|
+
|
458
|
+
# @private
|
459
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
460
|
+
DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
|
461
|
+
|
462
|
+
config_attr :endpoint, nil, ::String, nil
|
463
|
+
config_attr :credentials, nil do |value|
|
464
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
465
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
466
|
+
allowed.any? { |klass| klass === value }
|
467
|
+
end
|
468
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
469
|
+
config_attr :lib_name, nil, ::String, nil
|
470
|
+
config_attr :lib_version, nil, ::String, nil
|
471
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
472
|
+
config_attr :interceptors, nil, ::Array, nil
|
473
|
+
config_attr :timeout, nil, ::Numeric, nil
|
474
|
+
config_attr :metadata, nil, ::Hash, nil
|
475
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
476
|
+
config_attr :quota_project, nil, ::String, nil
|
477
|
+
config_attr :universe_domain, nil, ::String, nil
|
478
|
+
|
479
|
+
# @private
|
480
|
+
def initialize parent_config = nil
|
481
|
+
@parent_config = parent_config unless parent_config.nil?
|
482
|
+
|
483
|
+
yield self if block_given?
|
484
|
+
end
|
485
|
+
|
486
|
+
##
|
487
|
+
# Configurations for individual RPCs
|
488
|
+
# @return [Rpcs]
|
489
|
+
#
|
490
|
+
def rpcs
|
491
|
+
@rpcs ||= begin
|
492
|
+
parent_rpcs = nil
|
493
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
494
|
+
Rpcs.new parent_rpcs
|
495
|
+
end
|
496
|
+
end
|
497
|
+
|
498
|
+
##
|
499
|
+
# Configuration for the channel pool
|
500
|
+
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
|
501
|
+
#
|
502
|
+
def channel_pool
|
503
|
+
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
|
504
|
+
end
|
505
|
+
|
506
|
+
##
|
507
|
+
# Configuration RPC class for the ProductsService API.
|
508
|
+
#
|
509
|
+
# Includes fields providing the configuration for each RPC in this service.
|
510
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
511
|
+
# the following configuration fields:
|
512
|
+
#
|
513
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
514
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
515
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
516
|
+
# include the following keys:
|
517
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
518
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
519
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
520
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
521
|
+
# trigger a retry.
|
522
|
+
#
|
523
|
+
class Rpcs
|
524
|
+
##
|
525
|
+
# RPC-specific configuration for `get_product`
|
526
|
+
# @return [::Gapic::Config::Method]
|
527
|
+
#
|
528
|
+
attr_reader :get_product
|
529
|
+
##
|
530
|
+
# RPC-specific configuration for `list_products`
|
531
|
+
# @return [::Gapic::Config::Method]
|
532
|
+
#
|
533
|
+
attr_reader :list_products
|
534
|
+
|
535
|
+
# @private
|
536
|
+
def initialize parent_rpcs = nil
|
537
|
+
get_product_config = parent_rpcs.get_product if parent_rpcs.respond_to? :get_product
|
538
|
+
@get_product = ::Gapic::Config::Method.new get_product_config
|
539
|
+
list_products_config = parent_rpcs.list_products if parent_rpcs.respond_to? :list_products
|
540
|
+
@list_products = ::Gapic::Config::Method.new list_products_config
|
541
|
+
|
542
|
+
yield self if block_given?
|
543
|
+
end
|
544
|
+
end
|
545
|
+
end
|
546
|
+
end
|
547
|
+
end
|
548
|
+
end
|
549
|
+
end
|
550
|
+
end
|
551
|
+
end
|
552
|
+
end
|
@@ -0,0 +1,49 @@
|
|
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 "googleauth"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Shopping
|
23
|
+
module Merchant
|
24
|
+
module Products
|
25
|
+
module V1beta
|
26
|
+
module ProductsService
|
27
|
+
# Credentials for the ProductsService API.
|
28
|
+
class Credentials < ::Google::Auth::Credentials
|
29
|
+
self.scope = [
|
30
|
+
"https://www.googleapis.com/auth/content"
|
31
|
+
]
|
32
|
+
self.env_vars = [
|
33
|
+
"GOOGLE_CLOUD_CREDENTIALS",
|
34
|
+
"GOOGLE_CLOUD_KEYFILE",
|
35
|
+
"GCLOUD_KEYFILE",
|
36
|
+
"GOOGLE_CLOUD_CREDENTIALS_JSON",
|
37
|
+
"GOOGLE_CLOUD_KEYFILE_JSON",
|
38
|
+
"GCLOUD_KEYFILE_JSON"
|
39
|
+
]
|
40
|
+
self.paths = [
|
41
|
+
"~/.config/google_cloud/application_default_credentials.json"
|
42
|
+
]
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,66 @@
|
|
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
|
+
|
20
|
+
module Google
|
21
|
+
module Shopping
|
22
|
+
module Merchant
|
23
|
+
module Products
|
24
|
+
module V1beta
|
25
|
+
module ProductsService
|
26
|
+
# Path helper methods for the ProductsService API.
|
27
|
+
module Paths
|
28
|
+
##
|
29
|
+
# Create a fully-qualified Account resource string.
|
30
|
+
#
|
31
|
+
# The resource will be in the following format:
|
32
|
+
#
|
33
|
+
# `accounts/{account}`
|
34
|
+
#
|
35
|
+
# @param account [String]
|
36
|
+
#
|
37
|
+
# @return [::String]
|
38
|
+
def account_path account:
|
39
|
+
"accounts/#{account}"
|
40
|
+
end
|
41
|
+
|
42
|
+
##
|
43
|
+
# Create a fully-qualified Product resource string.
|
44
|
+
#
|
45
|
+
# The resource will be in the following format:
|
46
|
+
#
|
47
|
+
# `accounts/{account}/products/{product}`
|
48
|
+
#
|
49
|
+
# @param account [String]
|
50
|
+
# @param product [String]
|
51
|
+
#
|
52
|
+
# @return [::String]
|
53
|
+
def product_path account:, product:
|
54
|
+
raise ::ArgumentError, "account cannot contain /" if account.to_s.include? "/"
|
55
|
+
|
56
|
+
"accounts/#{account}/products/#{product}"
|
57
|
+
end
|
58
|
+
|
59
|
+
extend self
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|