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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/shopping/merchant/products/v1beta/product_inputs_service/client.rb +547 -0
  6. data/lib/google/shopping/merchant/products/v1beta/product_inputs_service/credentials.rb +49 -0
  7. data/lib/google/shopping/merchant/products/v1beta/product_inputs_service/paths.rb +66 -0
  8. data/lib/google/shopping/merchant/products/v1beta/product_inputs_service/rest/client.rb +507 -0
  9. data/lib/google/shopping/merchant/products/v1beta/product_inputs_service/rest/service_stub.rb +190 -0
  10. data/lib/google/shopping/merchant/products/v1beta/product_inputs_service/rest.rb +55 -0
  11. data/lib/google/shopping/merchant/products/v1beta/product_inputs_service.rb +58 -0
  12. data/lib/google/shopping/merchant/products/v1beta/productinputs_pb.rb +56 -0
  13. data/lib/google/shopping/merchant/products/v1beta/productinputs_services_pb.rb +58 -0
  14. data/lib/google/shopping/merchant/products/v1beta/products_common_pb.rb +75 -0
  15. data/lib/google/shopping/merchant/products/v1beta/products_pb.rb +56 -0
  16. data/lib/google/shopping/merchant/products/v1beta/products_service/client.rb +552 -0
  17. data/lib/google/shopping/merchant/products/v1beta/products_service/credentials.rb +49 -0
  18. data/lib/google/shopping/merchant/products/v1beta/products_service/paths.rb +66 -0
  19. data/lib/google/shopping/merchant/products/v1beta/products_service/rest/client.rb +512 -0
  20. data/lib/google/shopping/merchant/products/v1beta/products_service/rest/service_stub.rb +189 -0
  21. data/lib/google/shopping/merchant/products/v1beta/products_service/rest.rb +55 -0
  22. data/lib/google/shopping/merchant/products/v1beta/products_service.rb +58 -0
  23. data/lib/google/shopping/merchant/products/v1beta/products_services_pb.rb +58 -0
  24. data/lib/google/shopping/merchant/products/v1beta/rest.rb +40 -0
  25. data/lib/google/shopping/merchant/products/v1beta/version.rb +7 -2
  26. data/lib/google/shopping/merchant/products/v1beta.rb +48 -0
  27. data/lib/google-shopping-merchant-products-v1beta.rb +21 -0
  28. data/proto_docs/README.md +4 -0
  29. data/proto_docs/google/api/client.rb +399 -0
  30. data/proto_docs/google/api/field_behavior.rb +85 -0
  31. data/proto_docs/google/api/launch_stage.rb +71 -0
  32. data/proto_docs/google/api/resource.rb +222 -0
  33. data/proto_docs/google/protobuf/duration.rb +98 -0
  34. data/proto_docs/google/protobuf/empty.rb +34 -0
  35. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  36. data/proto_docs/google/shopping/merchant/products/v1beta/productinputs.rb +152 -0
  37. data/proto_docs/google/shopping/merchant/products/v1beta/products.rb +152 -0
  38. data/proto_docs/google/shopping/merchant/products/v1beta/products_common.rb +899 -0
  39. data/proto_docs/google/shopping/type/types.rb +210 -0
  40. data/proto_docs/google/type/interval.rb +45 -0
  41. metadata +100 -10
@@ -0,0 +1,547 @@
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
+
22
+ module Google
23
+ module Shopping
24
+ module Merchant
25
+ module Products
26
+ module V1beta
27
+ module ProductInputsService
28
+ ##
29
+ # Client for the ProductInputsService service.
30
+ #
31
+ # Service to use ProductInput 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 :product_inputs_service_stub
45
+
46
+ ##
47
+ # Configure the ProductInputsService Client class.
48
+ #
49
+ # See {::Google::Shopping::Merchant::Products::V1beta::ProductInputsService::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all ProductInputsService clients
55
+ # ::Google::Shopping::Merchant::Products::V1beta::ProductInputsService::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 ProductInputsService 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::ProductInputsService::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
+ @product_inputs_service_stub.universe_domain
113
+ end
114
+
115
+ ##
116
+ # Create a new ProductInputsService client object.
117
+ #
118
+ # @example
119
+ #
120
+ # # Create a client using the default configuration
121
+ # client = ::Google::Shopping::Merchant::Products::V1beta::ProductInputsService::Client.new
122
+ #
123
+ # # Create a client using a custom configuration
124
+ # client = ::Google::Shopping::Merchant::Products::V1beta::ProductInputsService::Client.new do |config|
125
+ # config.timeout = 10.0
126
+ # end
127
+ #
128
+ # @yield [config] Configure the ProductInputsService 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/productinputs_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
+ @product_inputs_service_stub = ::Gapic::ServiceStub.new(
160
+ ::Google::Shopping::Merchant::Products::V1beta::ProductInputsService::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
+ # Uploads a product input to your Merchant Center account. If an input
175
+ # with the same contentLanguage, offerId, and dataSource already exists,
176
+ # this method replaces that entry.
177
+ #
178
+ # After inserting, updating, or deleting a product input, it may take several
179
+ # minutes before the processed product can be retrieved.
180
+ #
181
+ # @overload insert_product_input(request, options = nil)
182
+ # Pass arguments to `insert_product_input` via a request object, either of type
183
+ # {::Google::Shopping::Merchant::Products::V1beta::InsertProductInputRequest} or an equivalent Hash.
184
+ #
185
+ # @param request [::Google::Shopping::Merchant::Products::V1beta::InsertProductInputRequest, ::Hash]
186
+ # A request object representing the call parameters. Required. To specify no
187
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
188
+ # @param options [::Gapic::CallOptions, ::Hash]
189
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
190
+ #
191
+ # @overload insert_product_input(parent: nil, product_input: nil, data_source: nil)
192
+ # Pass arguments to `insert_product_input` via keyword arguments. Note that at
193
+ # least one keyword argument is required. To specify no parameters, or to keep all
194
+ # the default parameter values, pass an empty Hash as a request object (see above).
195
+ #
196
+ # @param parent [::String]
197
+ # Required. The account where this product will be inserted.
198
+ # Format: accounts/\\{account}
199
+ # @param product_input [::Google::Shopping::Merchant::Products::V1beta::ProductInput, ::Hash]
200
+ # Required. The product input to insert.
201
+ # @param data_source [::String]
202
+ # Required. The primary or supplemental product data source name. If the
203
+ # product already exists and data source provided is different, then the
204
+ # product will be moved to a new data source. Format:
205
+ # `accounts/{account}/dataSources/{datasource}`.
206
+ #
207
+ # @yield [response, operation] Access the result along with the RPC operation
208
+ # @yieldparam response [::Google::Shopping::Merchant::Products::V1beta::ProductInput]
209
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
210
+ #
211
+ # @return [::Google::Shopping::Merchant::Products::V1beta::ProductInput]
212
+ #
213
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
214
+ #
215
+ # @example Basic example
216
+ # require "google/shopping/merchant/products/v1beta"
217
+ #
218
+ # # Create a client object. The client can be reused for multiple calls.
219
+ # client = Google::Shopping::Merchant::Products::V1beta::ProductInputsService::Client.new
220
+ #
221
+ # # Create a request. To set request fields, pass in keyword arguments.
222
+ # request = Google::Shopping::Merchant::Products::V1beta::InsertProductInputRequest.new
223
+ #
224
+ # # Call the insert_product_input method.
225
+ # result = client.insert_product_input request
226
+ #
227
+ # # The returned object is of type Google::Shopping::Merchant::Products::V1beta::ProductInput.
228
+ # p result
229
+ #
230
+ def insert_product_input request, options = nil
231
+ raise ::ArgumentError, "request must be provided" if request.nil?
232
+
233
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Products::V1beta::InsertProductInputRequest
234
+
235
+ # Converts hash and nil to an options object
236
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
237
+
238
+ # Customize the options with defaults
239
+ metadata = @config.rpcs.insert_product_input.metadata.to_h
240
+
241
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
242
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
243
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
244
+ gapic_version: ::Google::Shopping::Merchant::Products::V1beta::VERSION
245
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
246
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
247
+
248
+ header_params = {}
249
+ if request.parent
250
+ header_params["parent"] = request.parent
251
+ end
252
+
253
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
254
+ metadata[:"x-goog-request-params"] ||= request_params_header
255
+
256
+ options.apply_defaults timeout: @config.rpcs.insert_product_input.timeout,
257
+ metadata: metadata,
258
+ retry_policy: @config.rpcs.insert_product_input.retry_policy
259
+
260
+ options.apply_defaults timeout: @config.timeout,
261
+ metadata: @config.metadata,
262
+ retry_policy: @config.retry_policy
263
+
264
+ @product_inputs_service_stub.call_rpc :insert_product_input, request, options: options do |response, operation|
265
+ yield response, operation if block_given?
266
+ return response
267
+ end
268
+ rescue ::GRPC::BadStatus => e
269
+ raise ::Google::Cloud::Error.from_error(e)
270
+ end
271
+
272
+ ##
273
+ # Deletes a product input from your Merchant Center account.
274
+ #
275
+ # After inserting, updating, or deleting a product input, it may take several
276
+ # minutes before the processed product can be retrieved.
277
+ #
278
+ # @overload delete_product_input(request, options = nil)
279
+ # Pass arguments to `delete_product_input` via a request object, either of type
280
+ # {::Google::Shopping::Merchant::Products::V1beta::DeleteProductInputRequest} or an equivalent Hash.
281
+ #
282
+ # @param request [::Google::Shopping::Merchant::Products::V1beta::DeleteProductInputRequest, ::Hash]
283
+ # A request object representing the call parameters. Required. To specify no
284
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
285
+ # @param options [::Gapic::CallOptions, ::Hash]
286
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
287
+ #
288
+ # @overload delete_product_input(name: nil, data_source: nil)
289
+ # Pass arguments to `delete_product_input` via keyword arguments. Note that at
290
+ # least one keyword argument is required. To specify no parameters, or to keep all
291
+ # the default parameter values, pass an empty Hash as a request object (see above).
292
+ #
293
+ # @param name [::String]
294
+ # Required. The name of the product input resource to delete.
295
+ # Format: accounts/\\{account}/productInputs/\\{product}
296
+ # @param data_source [::String]
297
+ # Required. The primary or supplemental data source from which the product
298
+ # input should be deleted. Format:
299
+ # `accounts/{account}/dataSources/{datasource}`.
300
+ #
301
+ # @yield [response, operation] Access the result along with the RPC operation
302
+ # @yieldparam response [::Google::Protobuf::Empty]
303
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
304
+ #
305
+ # @return [::Google::Protobuf::Empty]
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::ProductInputsService::Client.new
314
+ #
315
+ # # Create a request. To set request fields, pass in keyword arguments.
316
+ # request = Google::Shopping::Merchant::Products::V1beta::DeleteProductInputRequest.new
317
+ #
318
+ # # Call the delete_product_input method.
319
+ # result = client.delete_product_input request
320
+ #
321
+ # # The returned object is of type Google::Protobuf::Empty.
322
+ # p result
323
+ #
324
+ def delete_product_input request, options = nil
325
+ raise ::ArgumentError, "request must be provided" if request.nil?
326
+
327
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Products::V1beta::DeleteProductInputRequest
328
+
329
+ # Converts hash and nil to an options object
330
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
331
+
332
+ # Customize the options with defaults
333
+ metadata = @config.rpcs.delete_product_input.metadata.to_h
334
+
335
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
336
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
337
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
338
+ gapic_version: ::Google::Shopping::Merchant::Products::V1beta::VERSION
339
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
340
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
341
+
342
+ header_params = {}
343
+ if request.name
344
+ header_params["name"] = request.name
345
+ end
346
+
347
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
348
+ metadata[:"x-goog-request-params"] ||= request_params_header
349
+
350
+ options.apply_defaults timeout: @config.rpcs.delete_product_input.timeout,
351
+ metadata: metadata,
352
+ retry_policy: @config.rpcs.delete_product_input.retry_policy
353
+
354
+ options.apply_defaults timeout: @config.timeout,
355
+ metadata: @config.metadata,
356
+ retry_policy: @config.retry_policy
357
+
358
+ @product_inputs_service_stub.call_rpc :delete_product_input, request, options: options do |response, operation|
359
+ yield response, operation if block_given?
360
+ return response
361
+ end
362
+ rescue ::GRPC::BadStatus => e
363
+ raise ::Google::Cloud::Error.from_error(e)
364
+ end
365
+
366
+ ##
367
+ # Configuration class for the ProductInputsService API.
368
+ #
369
+ # This class represents the configuration for ProductInputsService,
370
+ # providing control over timeouts, retry behavior, logging, transport
371
+ # parameters, and other low-level controls. Certain parameters can also be
372
+ # applied individually to specific RPCs. See
373
+ # {::Google::Shopping::Merchant::Products::V1beta::ProductInputsService::Client::Configuration::Rpcs}
374
+ # for a list of RPCs that can be configured independently.
375
+ #
376
+ # Configuration can be applied globally to all clients, or to a single client
377
+ # on construction.
378
+ #
379
+ # @example
380
+ #
381
+ # # Modify the global config, setting the timeout for
382
+ # # insert_product_input to 20 seconds,
383
+ # # and all remaining timeouts to 10 seconds.
384
+ # ::Google::Shopping::Merchant::Products::V1beta::ProductInputsService::Client.configure do |config|
385
+ # config.timeout = 10.0
386
+ # config.rpcs.insert_product_input.timeout = 20.0
387
+ # end
388
+ #
389
+ # # Apply the above configuration only to a new client.
390
+ # client = ::Google::Shopping::Merchant::Products::V1beta::ProductInputsService::Client.new do |config|
391
+ # config.timeout = 10.0
392
+ # config.rpcs.insert_product_input.timeout = 20.0
393
+ # end
394
+ #
395
+ # @!attribute [rw] endpoint
396
+ # A custom service endpoint, as a hostname or hostname:port. The default is
397
+ # nil, indicating to use the default endpoint in the current universe domain.
398
+ # @return [::String,nil]
399
+ # @!attribute [rw] credentials
400
+ # Credentials to send with calls. You may provide any of the following types:
401
+ # * (`String`) The path to a service account key file in JSON format
402
+ # * (`Hash`) A service account key as a Hash
403
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
404
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
405
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
406
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
407
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
408
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
409
+ # * (`nil`) indicating no credentials
410
+ # @return [::Object]
411
+ # @!attribute [rw] scope
412
+ # The OAuth scopes
413
+ # @return [::Array<::String>]
414
+ # @!attribute [rw] lib_name
415
+ # The library name as recorded in instrumentation and logging
416
+ # @return [::String]
417
+ # @!attribute [rw] lib_version
418
+ # The library version as recorded in instrumentation and logging
419
+ # @return [::String]
420
+ # @!attribute [rw] channel_args
421
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
422
+ # `GRPC::Core::Channel` object is provided as the credential.
423
+ # @return [::Hash]
424
+ # @!attribute [rw] interceptors
425
+ # An array of interceptors that are run before calls are executed.
426
+ # @return [::Array<::GRPC::ClientInterceptor>]
427
+ # @!attribute [rw] timeout
428
+ # The call timeout in seconds.
429
+ # @return [::Numeric]
430
+ # @!attribute [rw] metadata
431
+ # Additional gRPC headers to be sent with the call.
432
+ # @return [::Hash{::Symbol=>::String}]
433
+ # @!attribute [rw] retry_policy
434
+ # The retry policy. The value is a hash with the following keys:
435
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
436
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
437
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
438
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
439
+ # trigger a retry.
440
+ # @return [::Hash]
441
+ # @!attribute [rw] quota_project
442
+ # A separate project against which to charge quota.
443
+ # @return [::String]
444
+ # @!attribute [rw] universe_domain
445
+ # The universe domain within which to make requests. This determines the
446
+ # default endpoint URL. The default value of nil uses the environment
447
+ # universe (usually the default "googleapis.com" universe).
448
+ # @return [::String,nil]
449
+ #
450
+ class Configuration
451
+ extend ::Gapic::Config
452
+
453
+ # @private
454
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
455
+ DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
456
+
457
+ config_attr :endpoint, nil, ::String, nil
458
+ config_attr :credentials, nil do |value|
459
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
460
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
461
+ allowed.any? { |klass| klass === value }
462
+ end
463
+ config_attr :scope, nil, ::String, ::Array, nil
464
+ config_attr :lib_name, nil, ::String, nil
465
+ config_attr :lib_version, nil, ::String, nil
466
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
467
+ config_attr :interceptors, nil, ::Array, nil
468
+ config_attr :timeout, nil, ::Numeric, nil
469
+ config_attr :metadata, nil, ::Hash, nil
470
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
471
+ config_attr :quota_project, nil, ::String, nil
472
+ config_attr :universe_domain, nil, ::String, nil
473
+
474
+ # @private
475
+ def initialize parent_config = nil
476
+ @parent_config = parent_config unless parent_config.nil?
477
+
478
+ yield self if block_given?
479
+ end
480
+
481
+ ##
482
+ # Configurations for individual RPCs
483
+ # @return [Rpcs]
484
+ #
485
+ def rpcs
486
+ @rpcs ||= begin
487
+ parent_rpcs = nil
488
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
489
+ Rpcs.new parent_rpcs
490
+ end
491
+ end
492
+
493
+ ##
494
+ # Configuration for the channel pool
495
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
496
+ #
497
+ def channel_pool
498
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
499
+ end
500
+
501
+ ##
502
+ # Configuration RPC class for the ProductInputsService API.
503
+ #
504
+ # Includes fields providing the configuration for each RPC in this service.
505
+ # Each configuration object is of type `Gapic::Config::Method` and includes
506
+ # the following configuration fields:
507
+ #
508
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
509
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
510
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
511
+ # include the following keys:
512
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
513
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
514
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
515
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
516
+ # trigger a retry.
517
+ #
518
+ class Rpcs
519
+ ##
520
+ # RPC-specific configuration for `insert_product_input`
521
+ # @return [::Gapic::Config::Method]
522
+ #
523
+ attr_reader :insert_product_input
524
+ ##
525
+ # RPC-specific configuration for `delete_product_input`
526
+ # @return [::Gapic::Config::Method]
527
+ #
528
+ attr_reader :delete_product_input
529
+
530
+ # @private
531
+ def initialize parent_rpcs = nil
532
+ insert_product_input_config = parent_rpcs.insert_product_input if parent_rpcs.respond_to? :insert_product_input
533
+ @insert_product_input = ::Gapic::Config::Method.new insert_product_input_config
534
+ delete_product_input_config = parent_rpcs.delete_product_input if parent_rpcs.respond_to? :delete_product_input
535
+ @delete_product_input = ::Gapic::Config::Method.new delete_product_input_config
536
+
537
+ yield self if block_given?
538
+ end
539
+ end
540
+ end
541
+ end
542
+ end
543
+ end
544
+ end
545
+ end
546
+ end
547
+ 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 ProductInputsService
27
+ # Credentials for the ProductInputsService 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 ProductInputsService
26
+ # Path helper methods for the ProductInputsService 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 ProductInput resource string.
44
+ #
45
+ # The resource will be in the following format:
46
+ #
47
+ # `accounts/{account}/productInputs/{productinput}`
48
+ #
49
+ # @param account [String]
50
+ # @param productinput [String]
51
+ #
52
+ # @return [::String]
53
+ def product_input_path account:, productinput:
54
+ raise ::ArgumentError, "account cannot contain /" if account.to_s.include? "/"
55
+
56
+ "accounts/#{account}/productInputs/#{productinput}"
57
+ end
58
+
59
+ extend self
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end