google-shopping-merchant-accounts-v1beta 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b2139c4da1bfe8624e4b1f6f7e6e397c84f8ec07257d63391d4bd9fbcdd20f6
4
- data.tar.gz: 50d4bc9052db101c8f0bd3687e42ddd6d12004f1cdb8294bc54581bc93f5d739
3
+ metadata.gz: a156116d723c9db5cb8540924d278e7881bf712794f0fe98e0f3a4182ae1fcdc
4
+ data.tar.gz: e47443f731aecef4c88e3c5fa5f427f0990f54839ccd35612a403c7e718b9a99
5
5
  SHA512:
6
- metadata.gz: a01dcd45c14fc3699b651218084f259617cbafc028d9ecdd15a8de0cebcc7c7eab397f8c191a473c6fd3dacc93015a30977a7547dac55d7980f35c570c0e2f4e
7
- data.tar.gz: 3a4915c1032c12ea022ec3b5e82dd7f6fee947775f1efbbed4d9e07c9fd9421c306fce42db75dfd7491fbb26a5da29c0ad97a2c08fd3b092d61de45cdbbf51e7
6
+ metadata.gz: ea9b3cbb1b6ae98d2f6ff11e915a50dd8d5ace09d007324a05d0ea23a7c5e817f4ad7d900c29ea69aec5d8469cd86874cbb75c851450214aecb96e62d5f7eda9
7
+ data.tar.gz: 24e444e271f4766bd3e6b44c8714dff8204c165270aadedcb2bed0baef5870bcc13224dc321a37f727256657e083afdf0a9f0e607fa1fb1e8190e8308f6ce233
@@ -0,0 +1,570 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/shopping/merchant/accounts/v1beta/automaticimprovements_pb"
21
+
22
+ module Google
23
+ module Shopping
24
+ module Merchant
25
+ module Accounts
26
+ module V1beta
27
+ module AutomaticImprovementsService
28
+ ##
29
+ # Client for the AutomaticImprovementsService service.
30
+ #
31
+ # Service to manage the automatic improvements of an account. The automatic
32
+ # improvements of the account can be used to automatically update products,
33
+ # improve images and shipping.
34
+ #
35
+ class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
39
+ # @private
40
+ DEFAULT_ENDPOINT_TEMPLATE = "merchantapi.$UNIVERSE_DOMAIN$"
41
+
42
+ include Paths
43
+
44
+ # @private
45
+ attr_reader :automatic_improvements_service_stub
46
+
47
+ ##
48
+ # Configure the AutomaticImprovementsService Client class.
49
+ #
50
+ # See {::Google::Shopping::Merchant::Accounts::V1beta::AutomaticImprovementsService::Client::Configuration}
51
+ # for a description of the configuration fields.
52
+ #
53
+ # @example
54
+ #
55
+ # # Modify the configuration for all AutomaticImprovementsService clients
56
+ # ::Google::Shopping::Merchant::Accounts::V1beta::AutomaticImprovementsService::Client.configure do |config|
57
+ # config.timeout = 10.0
58
+ # end
59
+ #
60
+ # @yield [config] Configure the Client client.
61
+ # @yieldparam config [Client::Configuration]
62
+ #
63
+ # @return [Client::Configuration]
64
+ #
65
+ def self.configure
66
+ @configure ||= begin
67
+ namespace = ["Google", "Shopping", "Merchant", "Accounts", "V1beta"]
68
+ parent_config = while namespace.any?
69
+ parent_name = namespace.join "::"
70
+ parent_const = const_get parent_name
71
+ break parent_const.configure if parent_const.respond_to? :configure
72
+ namespace.pop
73
+ end
74
+ default_config = Client::Configuration.new parent_config
75
+
76
+ default_config.timeout = 60.0
77
+ default_config.retry_policy = {
78
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
79
+ }
80
+
81
+ default_config
82
+ end
83
+ yield @configure if block_given?
84
+ @configure
85
+ end
86
+
87
+ ##
88
+ # Configure the AutomaticImprovementsService Client instance.
89
+ #
90
+ # The configuration is set to the derived mode, meaning that values can be changed,
91
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
92
+ # should be made on {Client.configure}.
93
+ #
94
+ # See {::Google::Shopping::Merchant::Accounts::V1beta::AutomaticImprovementsService::Client::Configuration}
95
+ # for a description of the configuration fields.
96
+ #
97
+ # @yield [config] Configure the Client client.
98
+ # @yieldparam config [Client::Configuration]
99
+ #
100
+ # @return [Client::Configuration]
101
+ #
102
+ def configure
103
+ yield @config if block_given?
104
+ @config
105
+ end
106
+
107
+ ##
108
+ # The effective universe domain
109
+ #
110
+ # @return [String]
111
+ #
112
+ def universe_domain
113
+ @automatic_improvements_service_stub.universe_domain
114
+ end
115
+
116
+ ##
117
+ # Create a new AutomaticImprovementsService client object.
118
+ #
119
+ # @example
120
+ #
121
+ # # Create a client using the default configuration
122
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::AutomaticImprovementsService::Client.new
123
+ #
124
+ # # Create a client using a custom configuration
125
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::AutomaticImprovementsService::Client.new do |config|
126
+ # config.timeout = 10.0
127
+ # end
128
+ #
129
+ # @yield [config] Configure the AutomaticImprovementsService client.
130
+ # @yieldparam config [Client::Configuration]
131
+ #
132
+ def initialize
133
+ # These require statements are intentionally placed here to initialize
134
+ # the gRPC module only when it's required.
135
+ # See https://github.com/googleapis/toolkit/issues/446
136
+ require "gapic/grpc"
137
+ require "google/shopping/merchant/accounts/v1beta/automaticimprovements_services_pb"
138
+
139
+ # Create the configuration object
140
+ @config = Configuration.new Client.configure
141
+
142
+ # Yield the configuration if needed
143
+ yield @config if block_given?
144
+
145
+ # Create credentials
146
+ credentials = @config.credentials
147
+ # Use self-signed JWT if the endpoint is unchanged from default,
148
+ # but only if the default endpoint does not have a region prefix.
149
+ enable_self_signed_jwt = @config.endpoint.nil? ||
150
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
151
+ !@config.endpoint.split(".").first.include?("-"))
152
+ credentials ||= Credentials.default scope: @config.scope,
153
+ enable_self_signed_jwt: enable_self_signed_jwt
154
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
155
+ credentials = Credentials.new credentials, scope: @config.scope
156
+ end
157
+ @quota_project_id = @config.quota_project
158
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
159
+
160
+ @automatic_improvements_service_stub = ::Gapic::ServiceStub.new(
161
+ ::Google::Shopping::Merchant::Accounts::V1beta::AutomaticImprovementsService::Stub,
162
+ credentials: credentials,
163
+ endpoint: @config.endpoint,
164
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
165
+ universe_domain: @config.universe_domain,
166
+ channel_args: @config.channel_args,
167
+ interceptors: @config.interceptors,
168
+ channel_pool_config: @config.channel_pool,
169
+ logger: @config.logger
170
+ )
171
+
172
+ @automatic_improvements_service_stub.stub_logger&.info do |entry|
173
+ entry.set_system_name
174
+ entry.set_service
175
+ entry.message = "Created client for #{entry.service}"
176
+ entry.set_credentials_fields credentials
177
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
178
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
179
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
180
+ end
181
+ end
182
+
183
+ ##
184
+ # The logger used for request/response debug logging.
185
+ #
186
+ # @return [Logger]
187
+ #
188
+ def logger
189
+ @automatic_improvements_service_stub.logger
190
+ end
191
+
192
+ # Service calls
193
+
194
+ ##
195
+ # Retrieves the automatic improvements of an account.
196
+ #
197
+ # @overload get_automatic_improvements(request, options = nil)
198
+ # Pass arguments to `get_automatic_improvements` via a request object, either of type
199
+ # {::Google::Shopping::Merchant::Accounts::V1beta::GetAutomaticImprovementsRequest} or an equivalent Hash.
200
+ #
201
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::GetAutomaticImprovementsRequest, ::Hash]
202
+ # A request object representing the call parameters. Required. To specify no
203
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
204
+ # @param options [::Gapic::CallOptions, ::Hash]
205
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
206
+ #
207
+ # @overload get_automatic_improvements(name: nil)
208
+ # Pass arguments to `get_automatic_improvements` via keyword arguments. Note that at
209
+ # least one keyword argument is required. To specify no parameters, or to keep all
210
+ # the default parameter values, pass an empty Hash as a request object (see above).
211
+ #
212
+ # @param name [::String]
213
+ # Required. The resource name of the automatic improvements.
214
+ # Format: `accounts/{account}/automaticImprovements`
215
+ #
216
+ # @yield [response, operation] Access the result along with the RPC operation
217
+ # @yieldparam response [::Google::Shopping::Merchant::Accounts::V1beta::AutomaticImprovements]
218
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
219
+ #
220
+ # @return [::Google::Shopping::Merchant::Accounts::V1beta::AutomaticImprovements]
221
+ #
222
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
223
+ #
224
+ # @example Basic example
225
+ # require "google/shopping/merchant/accounts/v1beta"
226
+ #
227
+ # # Create a client object. The client can be reused for multiple calls.
228
+ # client = Google::Shopping::Merchant::Accounts::V1beta::AutomaticImprovementsService::Client.new
229
+ #
230
+ # # Create a request. To set request fields, pass in keyword arguments.
231
+ # request = Google::Shopping::Merchant::Accounts::V1beta::GetAutomaticImprovementsRequest.new
232
+ #
233
+ # # Call the get_automatic_improvements method.
234
+ # result = client.get_automatic_improvements request
235
+ #
236
+ # # The returned object is of type Google::Shopping::Merchant::Accounts::V1beta::AutomaticImprovements.
237
+ # p result
238
+ #
239
+ def get_automatic_improvements request, options = nil
240
+ raise ::ArgumentError, "request must be provided" if request.nil?
241
+
242
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::GetAutomaticImprovementsRequest
243
+
244
+ # Converts hash and nil to an options object
245
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
246
+
247
+ # Customize the options with defaults
248
+ metadata = @config.rpcs.get_automatic_improvements.metadata.to_h
249
+
250
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
251
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
252
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
253
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
254
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
255
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
256
+
257
+ header_params = {}
258
+ if request.name
259
+ header_params["name"] = request.name
260
+ end
261
+
262
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
263
+ metadata[:"x-goog-request-params"] ||= request_params_header
264
+
265
+ options.apply_defaults timeout: @config.rpcs.get_automatic_improvements.timeout,
266
+ metadata: metadata,
267
+ retry_policy: @config.rpcs.get_automatic_improvements.retry_policy
268
+
269
+ options.apply_defaults timeout: @config.timeout,
270
+ metadata: @config.metadata,
271
+ retry_policy: @config.retry_policy
272
+
273
+ @automatic_improvements_service_stub.call_rpc :get_automatic_improvements, request, options: options do |response, operation|
274
+ yield response, operation if block_given?
275
+ end
276
+ rescue ::GRPC::BadStatus => e
277
+ raise ::Google::Cloud::Error.from_error(e)
278
+ end
279
+
280
+ ##
281
+ # Updates the automatic improvements of an account.
282
+ #
283
+ # @overload update_automatic_improvements(request, options = nil)
284
+ # Pass arguments to `update_automatic_improvements` via a request object, either of type
285
+ # {::Google::Shopping::Merchant::Accounts::V1beta::UpdateAutomaticImprovementsRequest} or an equivalent Hash.
286
+ #
287
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::UpdateAutomaticImprovementsRequest, ::Hash]
288
+ # A request object representing the call parameters. Required. To specify no
289
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
290
+ # @param options [::Gapic::CallOptions, ::Hash]
291
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
292
+ #
293
+ # @overload update_automatic_improvements(automatic_improvements: nil, update_mask: nil)
294
+ # Pass arguments to `update_automatic_improvements` via keyword arguments. Note that at
295
+ # least one keyword argument is required. To specify no parameters, or to keep all
296
+ # the default parameter values, pass an empty Hash as a request object (see above).
297
+ #
298
+ # @param automatic_improvements [::Google::Shopping::Merchant::Accounts::V1beta::AutomaticImprovements, ::Hash]
299
+ # Required. The new version of the automatic imrovements.
300
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
301
+ # Required. List of fields being updated.
302
+ # The following fields are supported (in both `snake_case` and
303
+ # `lowerCamelCase`):
304
+ #
305
+ # - `item_updates`
306
+ # - `item_updates.account_level_settings`
307
+ # - `image_improvements`
308
+ # - `image_improvements.account_level_settings`
309
+ # - `shipping_improvements`
310
+ # - `shipping_improvements.allow_shipping_improvements`
311
+ #
312
+ # @yield [response, operation] Access the result along with the RPC operation
313
+ # @yieldparam response [::Google::Shopping::Merchant::Accounts::V1beta::AutomaticImprovements]
314
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
315
+ #
316
+ # @return [::Google::Shopping::Merchant::Accounts::V1beta::AutomaticImprovements]
317
+ #
318
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
319
+ #
320
+ # @example Basic example
321
+ # require "google/shopping/merchant/accounts/v1beta"
322
+ #
323
+ # # Create a client object. The client can be reused for multiple calls.
324
+ # client = Google::Shopping::Merchant::Accounts::V1beta::AutomaticImprovementsService::Client.new
325
+ #
326
+ # # Create a request. To set request fields, pass in keyword arguments.
327
+ # request = Google::Shopping::Merchant::Accounts::V1beta::UpdateAutomaticImprovementsRequest.new
328
+ #
329
+ # # Call the update_automatic_improvements method.
330
+ # result = client.update_automatic_improvements request
331
+ #
332
+ # # The returned object is of type Google::Shopping::Merchant::Accounts::V1beta::AutomaticImprovements.
333
+ # p result
334
+ #
335
+ def update_automatic_improvements request, options = nil
336
+ raise ::ArgumentError, "request must be provided" if request.nil?
337
+
338
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::UpdateAutomaticImprovementsRequest
339
+
340
+ # Converts hash and nil to an options object
341
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
342
+
343
+ # Customize the options with defaults
344
+ metadata = @config.rpcs.update_automatic_improvements.metadata.to_h
345
+
346
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
347
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
348
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
349
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
350
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
351
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
352
+
353
+ header_params = {}
354
+ if request.automatic_improvements&.name
355
+ header_params["automatic_improvements.name"] = request.automatic_improvements.name
356
+ end
357
+
358
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
359
+ metadata[:"x-goog-request-params"] ||= request_params_header
360
+
361
+ options.apply_defaults timeout: @config.rpcs.update_automatic_improvements.timeout,
362
+ metadata: metadata,
363
+ retry_policy: @config.rpcs.update_automatic_improvements.retry_policy
364
+
365
+ options.apply_defaults timeout: @config.timeout,
366
+ metadata: @config.metadata,
367
+ retry_policy: @config.retry_policy
368
+
369
+ @automatic_improvements_service_stub.call_rpc :update_automatic_improvements, request, options: options do |response, operation|
370
+ yield response, operation if block_given?
371
+ end
372
+ rescue ::GRPC::BadStatus => e
373
+ raise ::Google::Cloud::Error.from_error(e)
374
+ end
375
+
376
+ ##
377
+ # Configuration class for the AutomaticImprovementsService API.
378
+ #
379
+ # This class represents the configuration for AutomaticImprovementsService,
380
+ # providing control over timeouts, retry behavior, logging, transport
381
+ # parameters, and other low-level controls. Certain parameters can also be
382
+ # applied individually to specific RPCs. See
383
+ # {::Google::Shopping::Merchant::Accounts::V1beta::AutomaticImprovementsService::Client::Configuration::Rpcs}
384
+ # for a list of RPCs that can be configured independently.
385
+ #
386
+ # Configuration can be applied globally to all clients, or to a single client
387
+ # on construction.
388
+ #
389
+ # @example
390
+ #
391
+ # # Modify the global config, setting the timeout for
392
+ # # get_automatic_improvements to 20 seconds,
393
+ # # and all remaining timeouts to 10 seconds.
394
+ # ::Google::Shopping::Merchant::Accounts::V1beta::AutomaticImprovementsService::Client.configure do |config|
395
+ # config.timeout = 10.0
396
+ # config.rpcs.get_automatic_improvements.timeout = 20.0
397
+ # end
398
+ #
399
+ # # Apply the above configuration only to a new client.
400
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::AutomaticImprovementsService::Client.new do |config|
401
+ # config.timeout = 10.0
402
+ # config.rpcs.get_automatic_improvements.timeout = 20.0
403
+ # end
404
+ #
405
+ # @!attribute [rw] endpoint
406
+ # A custom service endpoint, as a hostname or hostname:port. The default is
407
+ # nil, indicating to use the default endpoint in the current universe domain.
408
+ # @return [::String,nil]
409
+ # @!attribute [rw] credentials
410
+ # Credentials to send with calls. You may provide any of the following types:
411
+ # * (`String`) The path to a service account key file in JSON format
412
+ # * (`Hash`) A service account key as a Hash
413
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
414
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
415
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
416
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
417
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
418
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
419
+ # * (`nil`) indicating no credentials
420
+ #
421
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
422
+ # external source for authentication to Google Cloud, you must validate it before
423
+ # providing it to a Google API client library. Providing an unvalidated credential
424
+ # configuration to Google APIs can compromise the security of your systems and data.
425
+ # For more information, refer to [Validate credential configurations from external
426
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
427
+ # @return [::Object]
428
+ # @!attribute [rw] scope
429
+ # The OAuth scopes
430
+ # @return [::Array<::String>]
431
+ # @!attribute [rw] lib_name
432
+ # The library name as recorded in instrumentation and logging
433
+ # @return [::String]
434
+ # @!attribute [rw] lib_version
435
+ # The library version as recorded in instrumentation and logging
436
+ # @return [::String]
437
+ # @!attribute [rw] channel_args
438
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
439
+ # `GRPC::Core::Channel` object is provided as the credential.
440
+ # @return [::Hash]
441
+ # @!attribute [rw] interceptors
442
+ # An array of interceptors that are run before calls are executed.
443
+ # @return [::Array<::GRPC::ClientInterceptor>]
444
+ # @!attribute [rw] timeout
445
+ # The call timeout in seconds.
446
+ # @return [::Numeric]
447
+ # @!attribute [rw] metadata
448
+ # Additional gRPC headers to be sent with the call.
449
+ # @return [::Hash{::Symbol=>::String}]
450
+ # @!attribute [rw] retry_policy
451
+ # The retry policy. The value is a hash with the following keys:
452
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
453
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
454
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
455
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
456
+ # trigger a retry.
457
+ # @return [::Hash]
458
+ # @!attribute [rw] quota_project
459
+ # A separate project against which to charge quota.
460
+ # @return [::String]
461
+ # @!attribute [rw] universe_domain
462
+ # The universe domain within which to make requests. This determines the
463
+ # default endpoint URL. The default value of nil uses the environment
464
+ # universe (usually the default "googleapis.com" universe).
465
+ # @return [::String,nil]
466
+ # @!attribute [rw] logger
467
+ # A custom logger to use for request/response debug logging, or the value
468
+ # `:default` (the default) to construct a default logger, or `nil` to
469
+ # explicitly disable logging.
470
+ # @return [::Logger,:default,nil]
471
+ #
472
+ class Configuration
473
+ extend ::Gapic::Config
474
+
475
+ # @private
476
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
477
+ DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
478
+
479
+ config_attr :endpoint, nil, ::String, nil
480
+ config_attr :credentials, nil do |value|
481
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
482
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
483
+ allowed.any? { |klass| klass === value }
484
+ end
485
+ config_attr :scope, nil, ::String, ::Array, nil
486
+ config_attr :lib_name, nil, ::String, nil
487
+ config_attr :lib_version, nil, ::String, nil
488
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
489
+ config_attr :interceptors, nil, ::Array, nil
490
+ config_attr :timeout, nil, ::Numeric, nil
491
+ config_attr :metadata, nil, ::Hash, nil
492
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
493
+ config_attr :quota_project, nil, ::String, nil
494
+ config_attr :universe_domain, nil, ::String, nil
495
+ config_attr :logger, :default, ::Logger, nil, :default
496
+
497
+ # @private
498
+ def initialize parent_config = nil
499
+ @parent_config = parent_config unless parent_config.nil?
500
+
501
+ yield self if block_given?
502
+ end
503
+
504
+ ##
505
+ # Configurations for individual RPCs
506
+ # @return [Rpcs]
507
+ #
508
+ def rpcs
509
+ @rpcs ||= begin
510
+ parent_rpcs = nil
511
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
512
+ Rpcs.new parent_rpcs
513
+ end
514
+ end
515
+
516
+ ##
517
+ # Configuration for the channel pool
518
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
519
+ #
520
+ def channel_pool
521
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
522
+ end
523
+
524
+ ##
525
+ # Configuration RPC class for the AutomaticImprovementsService API.
526
+ #
527
+ # Includes fields providing the configuration for each RPC in this service.
528
+ # Each configuration object is of type `Gapic::Config::Method` and includes
529
+ # the following configuration fields:
530
+ #
531
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
532
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
533
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
534
+ # include the following keys:
535
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
536
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
537
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
538
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
539
+ # trigger a retry.
540
+ #
541
+ class Rpcs
542
+ ##
543
+ # RPC-specific configuration for `get_automatic_improvements`
544
+ # @return [::Gapic::Config::Method]
545
+ #
546
+ attr_reader :get_automatic_improvements
547
+ ##
548
+ # RPC-specific configuration for `update_automatic_improvements`
549
+ # @return [::Gapic::Config::Method]
550
+ #
551
+ attr_reader :update_automatic_improvements
552
+
553
+ # @private
554
+ def initialize parent_rpcs = nil
555
+ get_automatic_improvements_config = parent_rpcs.get_automatic_improvements if parent_rpcs.respond_to? :get_automatic_improvements
556
+ @get_automatic_improvements = ::Gapic::Config::Method.new get_automatic_improvements_config
557
+ update_automatic_improvements_config = parent_rpcs.update_automatic_improvements if parent_rpcs.respond_to? :update_automatic_improvements
558
+ @update_automatic_improvements = ::Gapic::Config::Method.new update_automatic_improvements_config
559
+
560
+ yield self if block_given?
561
+ end
562
+ end
563
+ end
564
+ end
565
+ end
566
+ end
567
+ end
568
+ end
569
+ end
570
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "googleauth"
20
+
21
+ module Google
22
+ module Shopping
23
+ module Merchant
24
+ module Accounts
25
+ module V1beta
26
+ module AutomaticImprovementsService
27
+ # Credentials for the AutomaticImprovementsService 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