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