google-shopping-merchant-issue_resolution-v1beta 0.a → 0.1.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.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +154 -8
  5. data/lib/google/shopping/merchant/issue_resolution/v1beta/issue_resolution_service/client.rb +692 -0
  6. data/lib/google/shopping/merchant/issue_resolution/v1beta/issue_resolution_service/credentials.rb +49 -0
  7. data/lib/google/shopping/merchant/issue_resolution/v1beta/issue_resolution_service/paths.rb +66 -0
  8. data/lib/google/shopping/merchant/issue_resolution/v1beta/issue_resolution_service/rest/client.rb +645 -0
  9. data/lib/google/shopping/merchant/issue_resolution/v1beta/issue_resolution_service/rest/service_stub.rb +269 -0
  10. data/lib/google/shopping/merchant/issue_resolution/v1beta/issue_resolution_service/rest.rb +55 -0
  11. data/lib/google/shopping/merchant/issue_resolution/v1beta/issue_resolution_service.rb +58 -0
  12. data/lib/google/shopping/merchant/issue_resolution/v1beta/rest.rb +39 -0
  13. data/lib/google/shopping/merchant/issue_resolution/v1beta/version.rb +7 -2
  14. data/lib/google/shopping/merchant/issue_resolution/v1beta.rb +47 -0
  15. data/lib/google/shopping/merchant/issueresolution/v1beta/issueresolution_pb.rb +87 -0
  16. data/lib/google/shopping/merchant/issueresolution/v1beta/issueresolution_services_pb.rb +66 -0
  17. data/lib/google-shopping-merchant-issue_resolution-v1beta.rb +21 -0
  18. data/proto_docs/README.md +4 -0
  19. data/proto_docs/google/api/client.rb +473 -0
  20. data/proto_docs/google/api/field_behavior.rb +85 -0
  21. data/proto_docs/google/api/launch_stage.rb +71 -0
  22. data/proto_docs/google/api/resource.rb +227 -0
  23. data/proto_docs/google/protobuf/duration.rb +98 -0
  24. data/proto_docs/google/shopping/merchant/issueresolution/v1beta/issueresolution.rb +954 -0
  25. metadata +69 -9
@@ -0,0 +1,692 @@
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/issueresolution/v1beta/issueresolution_pb"
21
+
22
+ module Google
23
+ module Shopping
24
+ module Merchant
25
+ module IssueResolution
26
+ module V1beta
27
+ module IssueResolutionService
28
+ ##
29
+ # Client for the IssueResolutionService service.
30
+ #
31
+ # Service to provide an issue resolution content for account issues and product
32
+ # issues.
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 :issue_resolution_service_stub
45
+
46
+ ##
47
+ # Configure the IssueResolutionService Client class.
48
+ #
49
+ # See {::Google::Shopping::Merchant::IssueResolution::V1beta::IssueResolutionService::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all IssueResolutionService clients
55
+ # ::Google::Shopping::Merchant::IssueResolution::V1beta::IssueResolutionService::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", "IssueResolution", "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 IssueResolutionService 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::IssueResolution::V1beta::IssueResolutionService::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
+ @issue_resolution_service_stub.universe_domain
113
+ end
114
+
115
+ ##
116
+ # Create a new IssueResolutionService client object.
117
+ #
118
+ # @example
119
+ #
120
+ # # Create a client using the default configuration
121
+ # client = ::Google::Shopping::Merchant::IssueResolution::V1beta::IssueResolutionService::Client.new
122
+ #
123
+ # # Create a client using a custom configuration
124
+ # client = ::Google::Shopping::Merchant::IssueResolution::V1beta::IssueResolutionService::Client.new do |config|
125
+ # config.timeout = 10.0
126
+ # end
127
+ #
128
+ # @yield [config] Configure the IssueResolutionService 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/issueresolution/v1beta/issueresolution_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
+ @issue_resolution_service_stub = ::Gapic::ServiceStub.new(
160
+ ::Google::Shopping::Merchant::IssueResolution::V1beta::IssueResolutionService::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
+ logger: @config.logger
169
+ )
170
+
171
+ @issue_resolution_service_stub.stub_logger&.info do |entry|
172
+ entry.set_system_name
173
+ entry.set_service
174
+ entry.message = "Created client for #{entry.service}"
175
+ entry.set_credentials_fields credentials
176
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
177
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
178
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
179
+ end
180
+ end
181
+
182
+ ##
183
+ # The logger used for request/response debug logging.
184
+ #
185
+ # @return [Logger]
186
+ #
187
+ def logger
188
+ @issue_resolution_service_stub.logger
189
+ end
190
+
191
+ # Service calls
192
+
193
+ ##
194
+ # Provide a list of business's account issues with an issue resolution
195
+ # content and available actions. This content and actions are meant to be
196
+ # rendered and shown in third-party applications.
197
+ #
198
+ # @overload render_account_issues(request, options = nil)
199
+ # Pass arguments to `render_account_issues` via a request object, either of type
200
+ # {::Google::Shopping::Merchant::IssueResolution::V1beta::RenderAccountIssuesRequest} or an equivalent Hash.
201
+ #
202
+ # @param request [::Google::Shopping::Merchant::IssueResolution::V1beta::RenderAccountIssuesRequest, ::Hash]
203
+ # A request object representing the call parameters. Required. To specify no
204
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
205
+ # @param options [::Gapic::CallOptions, ::Hash]
206
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
207
+ #
208
+ # @overload render_account_issues(name: nil, language_code: nil, time_zone: nil, payload: nil)
209
+ # Pass arguments to `render_account_issues` via keyword arguments. Note that at
210
+ # least one keyword argument is required. To specify no parameters, or to keep all
211
+ # the default parameter values, pass an empty Hash as a request object (see above).
212
+ #
213
+ # @param name [::String]
214
+ # Required. The account to fetch issues for.
215
+ # Format: `accounts/{account}`
216
+ # @param language_code [::String]
217
+ # Optional. The [IETF BCP-47](https://tools.ietf.org/html/bcp47) language
218
+ # code used to localize issue resolution content. If not set, the result will
219
+ # be in default language `en-US`.
220
+ # @param time_zone [::String]
221
+ # Optional. The [IANA](https://www.iana.org/time-zones) timezone used to
222
+ # localize times in an issue resolution content. For example
223
+ # 'America/Los_Angeles'. If not set, results will use as a default UTC.
224
+ # @param payload [::Google::Shopping::Merchant::IssueResolution::V1beta::RenderIssuesRequestPayload, ::Hash]
225
+ # Optional. The payload for configuring how the content should be rendered.
226
+ #
227
+ # @yield [response, operation] Access the result along with the RPC operation
228
+ # @yieldparam response [::Google::Shopping::Merchant::IssueResolution::V1beta::RenderAccountIssuesResponse]
229
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
230
+ #
231
+ # @return [::Google::Shopping::Merchant::IssueResolution::V1beta::RenderAccountIssuesResponse]
232
+ #
233
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
234
+ #
235
+ # @example Basic example
236
+ # require "google/shopping/merchant/issue_resolution/v1beta"
237
+ #
238
+ # # Create a client object. The client can be reused for multiple calls.
239
+ # client = Google::Shopping::Merchant::IssueResolution::V1beta::IssueResolutionService::Client.new
240
+ #
241
+ # # Create a request. To set request fields, pass in keyword arguments.
242
+ # request = Google::Shopping::Merchant::IssueResolution::V1beta::RenderAccountIssuesRequest.new
243
+ #
244
+ # # Call the render_account_issues method.
245
+ # result = client.render_account_issues request
246
+ #
247
+ # # The returned object is of type Google::Shopping::Merchant::IssueResolution::V1beta::RenderAccountIssuesResponse.
248
+ # p result
249
+ #
250
+ def render_account_issues request, options = nil
251
+ raise ::ArgumentError, "request must be provided" if request.nil?
252
+
253
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::IssueResolution::V1beta::RenderAccountIssuesRequest
254
+
255
+ # Converts hash and nil to an options object
256
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
257
+
258
+ # Customize the options with defaults
259
+ metadata = @config.rpcs.render_account_issues.metadata.to_h
260
+
261
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
262
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
263
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
264
+ gapic_version: ::Google::Shopping::Merchant::IssueResolution::V1beta::VERSION
265
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
266
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
267
+
268
+ header_params = {}
269
+ if request.name
270
+ header_params["name"] = request.name
271
+ end
272
+
273
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
274
+ metadata[:"x-goog-request-params"] ||= request_params_header
275
+
276
+ options.apply_defaults timeout: @config.rpcs.render_account_issues.timeout,
277
+ metadata: metadata,
278
+ retry_policy: @config.rpcs.render_account_issues.retry_policy
279
+
280
+ options.apply_defaults timeout: @config.timeout,
281
+ metadata: @config.metadata,
282
+ retry_policy: @config.retry_policy
283
+
284
+ @issue_resolution_service_stub.call_rpc :render_account_issues, request, options: options do |response, operation|
285
+ yield response, operation if block_given?
286
+ end
287
+ rescue ::GRPC::BadStatus => e
288
+ raise ::Google::Cloud::Error.from_error(e)
289
+ end
290
+
291
+ ##
292
+ # Provide a list of issues for business's product with an issue resolution
293
+ # content and available actions. This content and actions are meant to be
294
+ # rendered and shown in third-party applications.
295
+ #
296
+ # @overload render_product_issues(request, options = nil)
297
+ # Pass arguments to `render_product_issues` via a request object, either of type
298
+ # {::Google::Shopping::Merchant::IssueResolution::V1beta::RenderProductIssuesRequest} or an equivalent Hash.
299
+ #
300
+ # @param request [::Google::Shopping::Merchant::IssueResolution::V1beta::RenderProductIssuesRequest, ::Hash]
301
+ # A request object representing the call parameters. Required. To specify no
302
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
303
+ # @param options [::Gapic::CallOptions, ::Hash]
304
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
305
+ #
306
+ # @overload render_product_issues(name: nil, language_code: nil, time_zone: nil, payload: nil)
307
+ # Pass arguments to `render_product_issues` via keyword arguments. Note that at
308
+ # least one keyword argument is required. To specify no parameters, or to keep all
309
+ # the default parameter values, pass an empty Hash as a request object (see above).
310
+ #
311
+ # @param name [::String]
312
+ # Required. The name of the product to fetch issues for.
313
+ # Format: `accounts/{account}/products/{product}`
314
+ # @param language_code [::String]
315
+ # Optional. The [IETF BCP-47](https://tools.ietf.org/html/bcp47) language
316
+ # code used to localize an issue resolution content. If not set, the result
317
+ # will be in default language `en-US`.
318
+ # @param time_zone [::String]
319
+ # Optional. The [IANA](https://www.iana.org/time-zones) timezone used to
320
+ # localize times in an issue resolution content. For example
321
+ # 'America/Los_Angeles'. If not set, results will use as a default UTC.
322
+ # @param payload [::Google::Shopping::Merchant::IssueResolution::V1beta::RenderIssuesRequestPayload, ::Hash]
323
+ # Optional. The payload for configuring how the content should be rendered.
324
+ #
325
+ # @yield [response, operation] Access the result along with the RPC operation
326
+ # @yieldparam response [::Google::Shopping::Merchant::IssueResolution::V1beta::RenderProductIssuesResponse]
327
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
328
+ #
329
+ # @return [::Google::Shopping::Merchant::IssueResolution::V1beta::RenderProductIssuesResponse]
330
+ #
331
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
332
+ #
333
+ # @example Basic example
334
+ # require "google/shopping/merchant/issue_resolution/v1beta"
335
+ #
336
+ # # Create a client object. The client can be reused for multiple calls.
337
+ # client = Google::Shopping::Merchant::IssueResolution::V1beta::IssueResolutionService::Client.new
338
+ #
339
+ # # Create a request. To set request fields, pass in keyword arguments.
340
+ # request = Google::Shopping::Merchant::IssueResolution::V1beta::RenderProductIssuesRequest.new
341
+ #
342
+ # # Call the render_product_issues method.
343
+ # result = client.render_product_issues request
344
+ #
345
+ # # The returned object is of type Google::Shopping::Merchant::IssueResolution::V1beta::RenderProductIssuesResponse.
346
+ # p result
347
+ #
348
+ def render_product_issues request, options = nil
349
+ raise ::ArgumentError, "request must be provided" if request.nil?
350
+
351
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::IssueResolution::V1beta::RenderProductIssuesRequest
352
+
353
+ # Converts hash and nil to an options object
354
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
355
+
356
+ # Customize the options with defaults
357
+ metadata = @config.rpcs.render_product_issues.metadata.to_h
358
+
359
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
360
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
361
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
362
+ gapic_version: ::Google::Shopping::Merchant::IssueResolution::V1beta::VERSION
363
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
364
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
365
+
366
+ header_params = {}
367
+ if request.name
368
+ header_params["name"] = request.name
369
+ end
370
+
371
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
372
+ metadata[:"x-goog-request-params"] ||= request_params_header
373
+
374
+ options.apply_defaults timeout: @config.rpcs.render_product_issues.timeout,
375
+ metadata: metadata,
376
+ retry_policy: @config.rpcs.render_product_issues.retry_policy
377
+
378
+ options.apply_defaults timeout: @config.timeout,
379
+ metadata: @config.metadata,
380
+ retry_policy: @config.retry_policy
381
+
382
+ @issue_resolution_service_stub.call_rpc :render_product_issues, request, options: options do |response, operation|
383
+ yield response, operation if block_given?
384
+ end
385
+ rescue ::GRPC::BadStatus => e
386
+ raise ::Google::Cloud::Error.from_error(e)
387
+ end
388
+
389
+ ##
390
+ # Start an action. The action can be requested by a business in
391
+ # third-party application. Before the business can request the action, the
392
+ # third-party application needs to show them action specific content and
393
+ # display a user input form.
394
+ #
395
+ # The action can be successfully started only once all `required` inputs are
396
+ # provided. If any `required` input is missing, or invalid value was
397
+ # provided, the service will return 400 error. Validation errors will contain
398
+ # {::Google::Shopping::Merchant::IssueResolution::V1beta::InputField#id Ids} for
399
+ # all problematic field together with translated, human readable error
400
+ # messages that can be shown to the user.
401
+ #
402
+ # @overload trigger_action(request, options = nil)
403
+ # Pass arguments to `trigger_action` via a request object, either of type
404
+ # {::Google::Shopping::Merchant::IssueResolution::V1beta::TriggerActionRequest} or an equivalent Hash.
405
+ #
406
+ # @param request [::Google::Shopping::Merchant::IssueResolution::V1beta::TriggerActionRequest, ::Hash]
407
+ # A request object representing the call parameters. Required. To specify no
408
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
409
+ # @param options [::Gapic::CallOptions, ::Hash]
410
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
411
+ #
412
+ # @overload trigger_action(name: nil, payload: nil, language_code: nil)
413
+ # Pass arguments to `trigger_action` via keyword arguments. Note that at
414
+ # least one keyword argument is required. To specify no parameters, or to keep all
415
+ # the default parameter values, pass an empty Hash as a request object (see above).
416
+ #
417
+ # @param name [::String]
418
+ # Required. The business's account that is triggering the action.
419
+ # Format: `accounts/{account}`
420
+ # @param payload [::Google::Shopping::Merchant::IssueResolution::V1beta::TriggerActionPayload, ::Hash]
421
+ # Required. The payload for the triggered action.
422
+ # @param language_code [::String]
423
+ # Optional. Language code [IETF BCP 47
424
+ # syntax](https://tools.ietf.org/html/bcp47) used to localize the response.
425
+ # If not set, the result will be in default language `en-US`.
426
+ #
427
+ # @yield [response, operation] Access the result along with the RPC operation
428
+ # @yieldparam response [::Google::Shopping::Merchant::IssueResolution::V1beta::TriggerActionResponse]
429
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
430
+ #
431
+ # @return [::Google::Shopping::Merchant::IssueResolution::V1beta::TriggerActionResponse]
432
+ #
433
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
434
+ #
435
+ # @example Basic example
436
+ # require "google/shopping/merchant/issue_resolution/v1beta"
437
+ #
438
+ # # Create a client object. The client can be reused for multiple calls.
439
+ # client = Google::Shopping::Merchant::IssueResolution::V1beta::IssueResolutionService::Client.new
440
+ #
441
+ # # Create a request. To set request fields, pass in keyword arguments.
442
+ # request = Google::Shopping::Merchant::IssueResolution::V1beta::TriggerActionRequest.new
443
+ #
444
+ # # Call the trigger_action method.
445
+ # result = client.trigger_action request
446
+ #
447
+ # # The returned object is of type Google::Shopping::Merchant::IssueResolution::V1beta::TriggerActionResponse.
448
+ # p result
449
+ #
450
+ def trigger_action request, options = nil
451
+ raise ::ArgumentError, "request must be provided" if request.nil?
452
+
453
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::IssueResolution::V1beta::TriggerActionRequest
454
+
455
+ # Converts hash and nil to an options object
456
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
457
+
458
+ # Customize the options with defaults
459
+ metadata = @config.rpcs.trigger_action.metadata.to_h
460
+
461
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
462
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
463
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
464
+ gapic_version: ::Google::Shopping::Merchant::IssueResolution::V1beta::VERSION
465
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
466
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
467
+
468
+ header_params = {}
469
+ if request.name
470
+ header_params["name"] = request.name
471
+ end
472
+
473
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
474
+ metadata[:"x-goog-request-params"] ||= request_params_header
475
+
476
+ options.apply_defaults timeout: @config.rpcs.trigger_action.timeout,
477
+ metadata: metadata,
478
+ retry_policy: @config.rpcs.trigger_action.retry_policy
479
+
480
+ options.apply_defaults timeout: @config.timeout,
481
+ metadata: @config.metadata,
482
+ retry_policy: @config.retry_policy
483
+
484
+ @issue_resolution_service_stub.call_rpc :trigger_action, request, options: options do |response, operation|
485
+ yield response, operation if block_given?
486
+ end
487
+ rescue ::GRPC::BadStatus => e
488
+ raise ::Google::Cloud::Error.from_error(e)
489
+ end
490
+
491
+ ##
492
+ # Configuration class for the IssueResolutionService API.
493
+ #
494
+ # This class represents the configuration for IssueResolutionService,
495
+ # providing control over timeouts, retry behavior, logging, transport
496
+ # parameters, and other low-level controls. Certain parameters can also be
497
+ # applied individually to specific RPCs. See
498
+ # {::Google::Shopping::Merchant::IssueResolution::V1beta::IssueResolutionService::Client::Configuration::Rpcs}
499
+ # for a list of RPCs that can be configured independently.
500
+ #
501
+ # Configuration can be applied globally to all clients, or to a single client
502
+ # on construction.
503
+ #
504
+ # @example
505
+ #
506
+ # # Modify the global config, setting the timeout for
507
+ # # render_account_issues to 20 seconds,
508
+ # # and all remaining timeouts to 10 seconds.
509
+ # ::Google::Shopping::Merchant::IssueResolution::V1beta::IssueResolutionService::Client.configure do |config|
510
+ # config.timeout = 10.0
511
+ # config.rpcs.render_account_issues.timeout = 20.0
512
+ # end
513
+ #
514
+ # # Apply the above configuration only to a new client.
515
+ # client = ::Google::Shopping::Merchant::IssueResolution::V1beta::IssueResolutionService::Client.new do |config|
516
+ # config.timeout = 10.0
517
+ # config.rpcs.render_account_issues.timeout = 20.0
518
+ # end
519
+ #
520
+ # @!attribute [rw] endpoint
521
+ # A custom service endpoint, as a hostname or hostname:port. The default is
522
+ # nil, indicating to use the default endpoint in the current universe domain.
523
+ # @return [::String,nil]
524
+ # @!attribute [rw] credentials
525
+ # Credentials to send with calls. You may provide any of the following types:
526
+ # * (`String`) The path to a service account key file in JSON format
527
+ # * (`Hash`) A service account key as a Hash
528
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
529
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
530
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
531
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
532
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
533
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
534
+ # * (`nil`) indicating no credentials
535
+ #
536
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
537
+ # external source for authentication to Google Cloud, you must validate it before
538
+ # providing it to a Google API client library. Providing an unvalidated credential
539
+ # configuration to Google APIs can compromise the security of your systems and data.
540
+ # For more information, refer to [Validate credential configurations from external
541
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
542
+ # @return [::Object]
543
+ # @!attribute [rw] scope
544
+ # The OAuth scopes
545
+ # @return [::Array<::String>]
546
+ # @!attribute [rw] lib_name
547
+ # The library name as recorded in instrumentation and logging
548
+ # @return [::String]
549
+ # @!attribute [rw] lib_version
550
+ # The library version as recorded in instrumentation and logging
551
+ # @return [::String]
552
+ # @!attribute [rw] channel_args
553
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
554
+ # `GRPC::Core::Channel` object is provided as the credential.
555
+ # @return [::Hash]
556
+ # @!attribute [rw] interceptors
557
+ # An array of interceptors that are run before calls are executed.
558
+ # @return [::Array<::GRPC::ClientInterceptor>]
559
+ # @!attribute [rw] timeout
560
+ # The call timeout in seconds.
561
+ # @return [::Numeric]
562
+ # @!attribute [rw] metadata
563
+ # Additional gRPC headers to be sent with the call.
564
+ # @return [::Hash{::Symbol=>::String}]
565
+ # @!attribute [rw] retry_policy
566
+ # The retry policy. The value is a hash with the following keys:
567
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
568
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
569
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
570
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
571
+ # trigger a retry.
572
+ # @return [::Hash]
573
+ # @!attribute [rw] quota_project
574
+ # A separate project against which to charge quota.
575
+ # @return [::String]
576
+ # @!attribute [rw] universe_domain
577
+ # The universe domain within which to make requests. This determines the
578
+ # default endpoint URL. The default value of nil uses the environment
579
+ # universe (usually the default "googleapis.com" universe).
580
+ # @return [::String,nil]
581
+ # @!attribute [rw] logger
582
+ # A custom logger to use for request/response debug logging, or the value
583
+ # `:default` (the default) to construct a default logger, or `nil` to
584
+ # explicitly disable logging.
585
+ # @return [::Logger,:default,nil]
586
+ #
587
+ class Configuration
588
+ extend ::Gapic::Config
589
+
590
+ # @private
591
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
592
+ DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
593
+
594
+ config_attr :endpoint, nil, ::String, nil
595
+ config_attr :credentials, nil do |value|
596
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
597
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
598
+ allowed.any? { |klass| klass === value }
599
+ end
600
+ config_attr :scope, nil, ::String, ::Array, nil
601
+ config_attr :lib_name, nil, ::String, nil
602
+ config_attr :lib_version, nil, ::String, nil
603
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
604
+ config_attr :interceptors, nil, ::Array, nil
605
+ config_attr :timeout, nil, ::Numeric, nil
606
+ config_attr :metadata, nil, ::Hash, nil
607
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
608
+ config_attr :quota_project, nil, ::String, nil
609
+ config_attr :universe_domain, nil, ::String, nil
610
+ config_attr :logger, :default, ::Logger, nil, :default
611
+
612
+ # @private
613
+ def initialize parent_config = nil
614
+ @parent_config = parent_config unless parent_config.nil?
615
+
616
+ yield self if block_given?
617
+ end
618
+
619
+ ##
620
+ # Configurations for individual RPCs
621
+ # @return [Rpcs]
622
+ #
623
+ def rpcs
624
+ @rpcs ||= begin
625
+ parent_rpcs = nil
626
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
627
+ Rpcs.new parent_rpcs
628
+ end
629
+ end
630
+
631
+ ##
632
+ # Configuration for the channel pool
633
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
634
+ #
635
+ def channel_pool
636
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
637
+ end
638
+
639
+ ##
640
+ # Configuration RPC class for the IssueResolutionService API.
641
+ #
642
+ # Includes fields providing the configuration for each RPC in this service.
643
+ # Each configuration object is of type `Gapic::Config::Method` and includes
644
+ # the following configuration fields:
645
+ #
646
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
647
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
648
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
649
+ # include the following keys:
650
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
651
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
652
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
653
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
654
+ # trigger a retry.
655
+ #
656
+ class Rpcs
657
+ ##
658
+ # RPC-specific configuration for `render_account_issues`
659
+ # @return [::Gapic::Config::Method]
660
+ #
661
+ attr_reader :render_account_issues
662
+ ##
663
+ # RPC-specific configuration for `render_product_issues`
664
+ # @return [::Gapic::Config::Method]
665
+ #
666
+ attr_reader :render_product_issues
667
+ ##
668
+ # RPC-specific configuration for `trigger_action`
669
+ # @return [::Gapic::Config::Method]
670
+ #
671
+ attr_reader :trigger_action
672
+
673
+ # @private
674
+ def initialize parent_rpcs = nil
675
+ render_account_issues_config = parent_rpcs.render_account_issues if parent_rpcs.respond_to? :render_account_issues
676
+ @render_account_issues = ::Gapic::Config::Method.new render_account_issues_config
677
+ render_product_issues_config = parent_rpcs.render_product_issues if parent_rpcs.respond_to? :render_product_issues
678
+ @render_product_issues = ::Gapic::Config::Method.new render_product_issues_config
679
+ trigger_action_config = parent_rpcs.trigger_action if parent_rpcs.respond_to? :trigger_action
680
+ @trigger_action = ::Gapic::Config::Method.new trigger_action_config
681
+
682
+ yield self if block_given?
683
+ end
684
+ end
685
+ end
686
+ end
687
+ end
688
+ end
689
+ end
690
+ end
691
+ end
692
+ end