google-shopping-merchant-accounts-v1beta 0.8.0 → 0.9.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 (43) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/shopping/merchant/accounts/v1beta/gbp_accounts_service/client.rb +581 -0
  3. data/lib/google/shopping/merchant/accounts/v1beta/gbp_accounts_service/credentials.rb +49 -0
  4. data/lib/google/shopping/merchant/accounts/v1beta/gbp_accounts_service/paths.rb +49 -0
  5. data/lib/google/shopping/merchant/accounts/v1beta/gbp_accounts_service/rest/client.rb +541 -0
  6. data/lib/google/shopping/merchant/accounts/v1beta/gbp_accounts_service/rest/service_stub.rb +206 -0
  7. data/lib/google/shopping/merchant/accounts/v1beta/gbp_accounts_service/rest.rb +57 -0
  8. data/lib/google/shopping/merchant/accounts/v1beta/gbp_accounts_service.rb +60 -0
  9. data/lib/google/shopping/merchant/accounts/v1beta/gbpaccounts_pb.rb +56 -0
  10. data/lib/google/shopping/merchant/accounts/v1beta/gbpaccounts_services_pb.rb +52 -0
  11. data/lib/google/shopping/merchant/accounts/v1beta/lfp_providers_service/client.rb +584 -0
  12. data/lib/google/shopping/merchant/accounts/v1beta/lfp_providers_service/credentials.rb +49 -0
  13. data/lib/google/shopping/merchant/accounts/v1beta/lfp_providers_service/paths.rb +71 -0
  14. data/lib/google/shopping/merchant/accounts/v1beta/lfp_providers_service/rest/client.rb +544 -0
  15. data/lib/google/shopping/merchant/accounts/v1beta/lfp_providers_service/rest/service_stub.rb +206 -0
  16. data/lib/google/shopping/merchant/accounts/v1beta/lfp_providers_service/rest.rb +56 -0
  17. data/lib/google/shopping/merchant/accounts/v1beta/lfp_providers_service.rb +59 -0
  18. data/lib/google/shopping/merchant/accounts/v1beta/lfpproviders_pb.rb +55 -0
  19. data/lib/google/shopping/merchant/accounts/v1beta/lfpproviders_services_pb.rb +51 -0
  20. data/lib/google/shopping/merchant/accounts/v1beta/omnichannel_settings_service/client.rb +875 -0
  21. data/lib/google/shopping/merchant/accounts/v1beta/omnichannel_settings_service/credentials.rb +49 -0
  22. data/lib/google/shopping/merchant/accounts/v1beta/omnichannel_settings_service/paths.rb +66 -0
  23. data/lib/google/shopping/merchant/accounts/v1beta/omnichannel_settings_service/rest/client.rb +814 -0
  24. data/lib/google/shopping/merchant/accounts/v1beta/omnichannel_settings_service/rest/service_stub.rb +391 -0
  25. data/lib/google/shopping/merchant/accounts/v1beta/omnichannel_settings_service/rest.rb +57 -0
  26. data/lib/google/shopping/merchant/accounts/v1beta/omnichannel_settings_service.rb +60 -0
  27. data/lib/google/shopping/merchant/accounts/v1beta/omnichannelsettings_pb.rb +68 -0
  28. data/lib/google/shopping/merchant/accounts/v1beta/omnichannelsettings_services_pb.rb +58 -0
  29. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_pb.rb +8 -1
  30. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/client.rb +285 -4
  31. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/rest/client.rb +264 -4
  32. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/rest/service_stub.rb +185 -0
  33. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/rest.rb +1 -1
  34. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service.rb +1 -1
  35. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_services_pb.rb +9 -3
  36. data/lib/google/shopping/merchant/accounts/v1beta/rest.rb +3 -0
  37. data/lib/google/shopping/merchant/accounts/v1beta/version.rb +1 -1
  38. data/lib/google/shopping/merchant/accounts/v1beta.rb +3 -0
  39. data/proto_docs/google/shopping/merchant/accounts/v1beta/gbpaccounts.rb +123 -0
  40. data/proto_docs/google/shopping/merchant/accounts/v1beta/lfpproviders.rb +108 -0
  41. data/proto_docs/google/shopping/merchant/accounts/v1beta/omnichannelsettings.rb +336 -0
  42. data/proto_docs/google/shopping/merchant/accounts/v1beta/online_return_policy.rb +64 -10
  43. metadata +31 -1
@@ -0,0 +1,875 @@
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/omnichannelsettings_pb"
21
+
22
+ module Google
23
+ module Shopping
24
+ module Merchant
25
+ module Accounts
26
+ module V1beta
27
+ module OmnichannelSettingsService
28
+ ##
29
+ # Client for the OmnichannelSettingsService service.
30
+ #
31
+ # The service facilitates the management of a merchant's omnichannel settings.
32
+ # ## This API defines the following resource model:
33
+ #
34
+ # [OmnichannelSetting][google.shopping.merchant.accounts.v1.OmnichannelSetting]
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 :omnichannel_settings_service_stub
47
+
48
+ ##
49
+ # Configure the OmnichannelSettingsService Client class.
50
+ #
51
+ # See {::Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSettingsService::Client::Configuration}
52
+ # for a description of the configuration fields.
53
+ #
54
+ # @example
55
+ #
56
+ # # Modify the configuration for all OmnichannelSettingsService clients
57
+ # ::Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSettingsService::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", "Accounts", "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 OmnichannelSettingsService 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::Accounts::V1beta::OmnichannelSettingsService::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
+ @omnichannel_settings_service_stub.universe_domain
115
+ end
116
+
117
+ ##
118
+ # Create a new OmnichannelSettingsService client object.
119
+ #
120
+ # @example
121
+ #
122
+ # # Create a client using the default configuration
123
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSettingsService::Client.new
124
+ #
125
+ # # Create a client using a custom configuration
126
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSettingsService::Client.new do |config|
127
+ # config.timeout = 10.0
128
+ # end
129
+ #
130
+ # @yield [config] Configure the OmnichannelSettingsService client.
131
+ # @yieldparam config [Client::Configuration]
132
+ #
133
+ def initialize
134
+ # These require statements are intentionally placed here to initialize
135
+ # the gRPC module only when it's required.
136
+ # See https://github.com/googleapis/toolkit/issues/446
137
+ require "gapic/grpc"
138
+ require "google/shopping/merchant/accounts/v1beta/omnichannelsettings_services_pb"
139
+
140
+ # Create the configuration object
141
+ @config = Configuration.new Client.configure
142
+
143
+ # Yield the configuration if needed
144
+ yield @config if block_given?
145
+
146
+ # Create credentials
147
+ credentials = @config.credentials
148
+ # Use self-signed JWT if the endpoint is unchanged from default,
149
+ # but only if the default endpoint does not have a region prefix.
150
+ enable_self_signed_jwt = @config.endpoint.nil? ||
151
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
152
+ !@config.endpoint.split(".").first.include?("-"))
153
+ credentials ||= Credentials.default scope: @config.scope,
154
+ enable_self_signed_jwt: enable_self_signed_jwt
155
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
156
+ credentials = Credentials.new credentials, scope: @config.scope
157
+ end
158
+ @quota_project_id = @config.quota_project
159
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
160
+
161
+ @omnichannel_settings_service_stub = ::Gapic::ServiceStub.new(
162
+ ::Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSettingsService::Stub,
163
+ credentials: credentials,
164
+ endpoint: @config.endpoint,
165
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
166
+ universe_domain: @config.universe_domain,
167
+ channel_args: @config.channel_args,
168
+ interceptors: @config.interceptors,
169
+ channel_pool_config: @config.channel_pool,
170
+ logger: @config.logger
171
+ )
172
+
173
+ @omnichannel_settings_service_stub.stub_logger&.info do |entry|
174
+ entry.set_system_name
175
+ entry.set_service
176
+ entry.message = "Created client for #{entry.service}"
177
+ entry.set_credentials_fields credentials
178
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
179
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
180
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
181
+ end
182
+ end
183
+
184
+ ##
185
+ # The logger used for request/response debug logging.
186
+ #
187
+ # @return [Logger]
188
+ #
189
+ def logger
190
+ @omnichannel_settings_service_stub.logger
191
+ end
192
+
193
+ # Service calls
194
+
195
+ ##
196
+ # Get the omnichannel settings for a given merchant.
197
+ #
198
+ # @overload get_omnichannel_setting(request, options = nil)
199
+ # Pass arguments to `get_omnichannel_setting` via a request object, either of type
200
+ # {::Google::Shopping::Merchant::Accounts::V1beta::GetOmnichannelSettingRequest} or an equivalent Hash.
201
+ #
202
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::GetOmnichannelSettingRequest, ::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 get_omnichannel_setting(name: nil)
209
+ # Pass arguments to `get_omnichannel_setting` 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 name of the omnichannel setting to retrieve.
215
+ # Format: `accounts/{account}/omnichannelSettings/{omnichannel_setting}`
216
+ #
217
+ # @yield [response, operation] Access the result along with the RPC operation
218
+ # @yieldparam response [::Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSetting]
219
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
220
+ #
221
+ # @return [::Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSetting]
222
+ #
223
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
224
+ #
225
+ # @example Basic example
226
+ # require "google/shopping/merchant/accounts/v1beta"
227
+ #
228
+ # # Create a client object. The client can be reused for multiple calls.
229
+ # client = Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSettingsService::Client.new
230
+ #
231
+ # # Create a request. To set request fields, pass in keyword arguments.
232
+ # request = Google::Shopping::Merchant::Accounts::V1beta::GetOmnichannelSettingRequest.new
233
+ #
234
+ # # Call the get_omnichannel_setting method.
235
+ # result = client.get_omnichannel_setting request
236
+ #
237
+ # # The returned object is of type Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSetting.
238
+ # p result
239
+ #
240
+ def get_omnichannel_setting request, options = nil
241
+ raise ::ArgumentError, "request must be provided" if request.nil?
242
+
243
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::GetOmnichannelSettingRequest
244
+
245
+ # Converts hash and nil to an options object
246
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
247
+
248
+ # Customize the options with defaults
249
+ metadata = @config.rpcs.get_omnichannel_setting.metadata.to_h
250
+
251
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
252
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
253
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
254
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
255
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
256
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
257
+
258
+ header_params = {}
259
+ if request.name
260
+ header_params["name"] = request.name
261
+ end
262
+
263
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
264
+ metadata[:"x-goog-request-params"] ||= request_params_header
265
+
266
+ options.apply_defaults timeout: @config.rpcs.get_omnichannel_setting.timeout,
267
+ metadata: metadata,
268
+ retry_policy: @config.rpcs.get_omnichannel_setting.retry_policy
269
+
270
+ options.apply_defaults timeout: @config.timeout,
271
+ metadata: @config.metadata,
272
+ retry_policy: @config.retry_policy
273
+
274
+ @omnichannel_settings_service_stub.call_rpc :get_omnichannel_setting, request, options: options do |response, operation|
275
+ yield response, operation if block_given?
276
+ end
277
+ rescue ::GRPC::BadStatus => e
278
+ raise ::Google::Cloud::Error.from_error(e)
279
+ end
280
+
281
+ ##
282
+ # List all the omnichannel settings for a given merchant.
283
+ #
284
+ # @overload list_omnichannel_settings(request, options = nil)
285
+ # Pass arguments to `list_omnichannel_settings` via a request object, either of type
286
+ # {::Google::Shopping::Merchant::Accounts::V1beta::ListOmnichannelSettingsRequest} or an equivalent Hash.
287
+ #
288
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::ListOmnichannelSettingsRequest, ::Hash]
289
+ # A request object representing the call parameters. Required. To specify no
290
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
291
+ # @param options [::Gapic::CallOptions, ::Hash]
292
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
293
+ #
294
+ # @overload list_omnichannel_settings(parent: nil, page_size: nil, page_token: nil)
295
+ # Pass arguments to `list_omnichannel_settings` via keyword arguments. Note that at
296
+ # least one keyword argument is required. To specify no parameters, or to keep all
297
+ # the default parameter values, pass an empty Hash as a request object (see above).
298
+ #
299
+ # @param parent [::String]
300
+ # Required. The parent, which owns this collection of omnichannel settings.
301
+ # Format: `accounts/{account}`
302
+ # @param page_size [::Integer]
303
+ # Optional. The maximum number of omnichannel settings to return. The service
304
+ # may return fewer than this value. If unspecified, at most 50 omnichannel
305
+ # settings will be returned. The maximum value is 1000; values above 1000
306
+ # will be coerced to 1000.
307
+ # @param page_token [::String]
308
+ # Optional. A page token, received from a previous `ListOmnichannelSettings`
309
+ # call. Provide this to retrieve the subsequent page.
310
+ #
311
+ # When paginating, all other parameters provided to `ListOmnichannelSettings`
312
+ # must match the call that provided the page token.
313
+ #
314
+ # @yield [response, operation] Access the result along with the RPC operation
315
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSetting>]
316
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
317
+ #
318
+ # @return [::Gapic::PagedEnumerable<::Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSetting>]
319
+ #
320
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
321
+ #
322
+ # @example Basic example
323
+ # require "google/shopping/merchant/accounts/v1beta"
324
+ #
325
+ # # Create a client object. The client can be reused for multiple calls.
326
+ # client = Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSettingsService::Client.new
327
+ #
328
+ # # Create a request. To set request fields, pass in keyword arguments.
329
+ # request = Google::Shopping::Merchant::Accounts::V1beta::ListOmnichannelSettingsRequest.new
330
+ #
331
+ # # Call the list_omnichannel_settings method.
332
+ # result = client.list_omnichannel_settings request
333
+ #
334
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
335
+ # # over elements, and API calls will be issued to fetch pages as needed.
336
+ # result.each do |item|
337
+ # # Each element is of type ::Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSetting.
338
+ # p item
339
+ # end
340
+ #
341
+ def list_omnichannel_settings request, options = nil
342
+ raise ::ArgumentError, "request must be provided" if request.nil?
343
+
344
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::ListOmnichannelSettingsRequest
345
+
346
+ # Converts hash and nil to an options object
347
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
348
+
349
+ # Customize the options with defaults
350
+ metadata = @config.rpcs.list_omnichannel_settings.metadata.to_h
351
+
352
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
353
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
354
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
355
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
356
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
357
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
358
+
359
+ header_params = {}
360
+ if request.parent
361
+ header_params["parent"] = request.parent
362
+ end
363
+
364
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
365
+ metadata[:"x-goog-request-params"] ||= request_params_header
366
+
367
+ options.apply_defaults timeout: @config.rpcs.list_omnichannel_settings.timeout,
368
+ metadata: metadata,
369
+ retry_policy: @config.rpcs.list_omnichannel_settings.retry_policy
370
+
371
+ options.apply_defaults timeout: @config.timeout,
372
+ metadata: @config.metadata,
373
+ retry_policy: @config.retry_policy
374
+
375
+ @omnichannel_settings_service_stub.call_rpc :list_omnichannel_settings, request, options: options do |response, operation|
376
+ response = ::Gapic::PagedEnumerable.new @omnichannel_settings_service_stub, :list_omnichannel_settings, request, response, operation, options
377
+ yield response, operation if block_given?
378
+ throw :response, response
379
+ end
380
+ rescue ::GRPC::BadStatus => e
381
+ raise ::Google::Cloud::Error.from_error(e)
382
+ end
383
+
384
+ ##
385
+ # Create the omnichannel settings for a given merchant.
386
+ #
387
+ # @overload create_omnichannel_setting(request, options = nil)
388
+ # Pass arguments to `create_omnichannel_setting` via a request object, either of type
389
+ # {::Google::Shopping::Merchant::Accounts::V1beta::CreateOmnichannelSettingRequest} or an equivalent Hash.
390
+ #
391
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::CreateOmnichannelSettingRequest, ::Hash]
392
+ # A request object representing the call parameters. Required. To specify no
393
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
394
+ # @param options [::Gapic::CallOptions, ::Hash]
395
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
396
+ #
397
+ # @overload create_omnichannel_setting(parent: nil, omnichannel_setting: nil)
398
+ # Pass arguments to `create_omnichannel_setting` via keyword arguments. Note that at
399
+ # least one keyword argument is required. To specify no parameters, or to keep all
400
+ # the default parameter values, pass an empty Hash as a request object (see above).
401
+ #
402
+ # @param parent [::String]
403
+ # Required. The parent resource where this omnichannel setting will be
404
+ # created. Format: `accounts/{account}`
405
+ # @param omnichannel_setting [::Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSetting, ::Hash]
406
+ # Required. The omnichannel setting to create.
407
+ #
408
+ # @yield [response, operation] Access the result along with the RPC operation
409
+ # @yieldparam response [::Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSetting]
410
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
411
+ #
412
+ # @return [::Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSetting]
413
+ #
414
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
415
+ #
416
+ # @example Basic example
417
+ # require "google/shopping/merchant/accounts/v1beta"
418
+ #
419
+ # # Create a client object. The client can be reused for multiple calls.
420
+ # client = Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSettingsService::Client.new
421
+ #
422
+ # # Create a request. To set request fields, pass in keyword arguments.
423
+ # request = Google::Shopping::Merchant::Accounts::V1beta::CreateOmnichannelSettingRequest.new
424
+ #
425
+ # # Call the create_omnichannel_setting method.
426
+ # result = client.create_omnichannel_setting request
427
+ #
428
+ # # The returned object is of type Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSetting.
429
+ # p result
430
+ #
431
+ def create_omnichannel_setting request, options = nil
432
+ raise ::ArgumentError, "request must be provided" if request.nil?
433
+
434
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::CreateOmnichannelSettingRequest
435
+
436
+ # Converts hash and nil to an options object
437
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
438
+
439
+ # Customize the options with defaults
440
+ metadata = @config.rpcs.create_omnichannel_setting.metadata.to_h
441
+
442
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
443
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
444
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
445
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
446
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
447
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
448
+
449
+ header_params = {}
450
+ if request.parent
451
+ header_params["parent"] = request.parent
452
+ end
453
+
454
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
455
+ metadata[:"x-goog-request-params"] ||= request_params_header
456
+
457
+ options.apply_defaults timeout: @config.rpcs.create_omnichannel_setting.timeout,
458
+ metadata: metadata,
459
+ retry_policy: @config.rpcs.create_omnichannel_setting.retry_policy
460
+
461
+ options.apply_defaults timeout: @config.timeout,
462
+ metadata: @config.metadata,
463
+ retry_policy: @config.retry_policy
464
+
465
+ @omnichannel_settings_service_stub.call_rpc :create_omnichannel_setting, request, options: options do |response, operation|
466
+ yield response, operation if block_given?
467
+ end
468
+ rescue ::GRPC::BadStatus => e
469
+ raise ::Google::Cloud::Error.from_error(e)
470
+ end
471
+
472
+ ##
473
+ # Update the omnichannel setting for a given merchant in a given country.
474
+ #
475
+ # @overload update_omnichannel_setting(request, options = nil)
476
+ # Pass arguments to `update_omnichannel_setting` via a request object, either of type
477
+ # {::Google::Shopping::Merchant::Accounts::V1beta::UpdateOmnichannelSettingRequest} or an equivalent Hash.
478
+ #
479
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::UpdateOmnichannelSettingRequest, ::Hash]
480
+ # A request object representing the call parameters. Required. To specify no
481
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
482
+ # @param options [::Gapic::CallOptions, ::Hash]
483
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
484
+ #
485
+ # @overload update_omnichannel_setting(omnichannel_setting: nil, update_mask: nil)
486
+ # Pass arguments to `update_omnichannel_setting` via keyword arguments. Note that at
487
+ # least one keyword argument is required. To specify no parameters, or to keep all
488
+ # the default parameter values, pass an empty Hash as a request object (see above).
489
+ #
490
+ # @param omnichannel_setting [::Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSetting, ::Hash]
491
+ # Required. The omnichannel setting to update.
492
+ #
493
+ # The omnichannel setting's `name` field is used to identify the
494
+ # omnichannel setting to be updated.
495
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
496
+ # Required. The list of fields to be updated.
497
+ #
498
+ # The following fields are supported in snake_case only:
499
+ # - `lsf_type`
500
+ # - `in_stock`
501
+ # - `pickup`
502
+ # - `odo`
503
+ # - `about`
504
+ # - `inventory_verification`
505
+ #
506
+ # Full replacement with wildcard `*`is supported, while empty/implied update
507
+ # mask is not.
508
+ #
509
+ # @yield [response, operation] Access the result along with the RPC operation
510
+ # @yieldparam response [::Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSetting]
511
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
512
+ #
513
+ # @return [::Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSetting]
514
+ #
515
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
516
+ #
517
+ # @example Basic example
518
+ # require "google/shopping/merchant/accounts/v1beta"
519
+ #
520
+ # # Create a client object. The client can be reused for multiple calls.
521
+ # client = Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSettingsService::Client.new
522
+ #
523
+ # # Create a request. To set request fields, pass in keyword arguments.
524
+ # request = Google::Shopping::Merchant::Accounts::V1beta::UpdateOmnichannelSettingRequest.new
525
+ #
526
+ # # Call the update_omnichannel_setting method.
527
+ # result = client.update_omnichannel_setting request
528
+ #
529
+ # # The returned object is of type Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSetting.
530
+ # p result
531
+ #
532
+ def update_omnichannel_setting request, options = nil
533
+ raise ::ArgumentError, "request must be provided" if request.nil?
534
+
535
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::UpdateOmnichannelSettingRequest
536
+
537
+ # Converts hash and nil to an options object
538
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
539
+
540
+ # Customize the options with defaults
541
+ metadata = @config.rpcs.update_omnichannel_setting.metadata.to_h
542
+
543
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
544
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
545
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
546
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
547
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
548
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
549
+
550
+ header_params = {}
551
+ if request.omnichannel_setting&.name
552
+ header_params["omnichannel_setting.name"] = request.omnichannel_setting.name
553
+ end
554
+
555
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
556
+ metadata[:"x-goog-request-params"] ||= request_params_header
557
+
558
+ options.apply_defaults timeout: @config.rpcs.update_omnichannel_setting.timeout,
559
+ metadata: metadata,
560
+ retry_policy: @config.rpcs.update_omnichannel_setting.retry_policy
561
+
562
+ options.apply_defaults timeout: @config.timeout,
563
+ metadata: @config.metadata,
564
+ retry_policy: @config.retry_policy
565
+
566
+ @omnichannel_settings_service_stub.call_rpc :update_omnichannel_setting, request, options: options do |response, operation|
567
+ yield response, operation if block_given?
568
+ end
569
+ rescue ::GRPC::BadStatus => e
570
+ raise ::Google::Cloud::Error.from_error(e)
571
+ end
572
+
573
+ ##
574
+ # Requests inventory verification for a given merchant in a given country.
575
+ #
576
+ # @overload request_inventory_verification(request, options = nil)
577
+ # Pass arguments to `request_inventory_verification` via a request object, either of type
578
+ # {::Google::Shopping::Merchant::Accounts::V1beta::RequestInventoryVerificationRequest} or an equivalent Hash.
579
+ #
580
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::RequestInventoryVerificationRequest, ::Hash]
581
+ # A request object representing the call parameters. Required. To specify no
582
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
583
+ # @param options [::Gapic::CallOptions, ::Hash]
584
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
585
+ #
586
+ # @overload request_inventory_verification(name: nil)
587
+ # Pass arguments to `request_inventory_verification` via keyword arguments. Note that at
588
+ # least one keyword argument is required. To specify no parameters, or to keep all
589
+ # the default parameter values, pass an empty Hash as a request object (see above).
590
+ #
591
+ # @param name [::String]
592
+ # Required. The name of the omnichannel setting to request inventory
593
+ # verification. Format:
594
+ # `accounts/{account}/omnichannelSettings/{omnichannel_setting}`
595
+ #
596
+ # @yield [response, operation] Access the result along with the RPC operation
597
+ # @yieldparam response [::Google::Shopping::Merchant::Accounts::V1beta::RequestInventoryVerificationResponse]
598
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
599
+ #
600
+ # @return [::Google::Shopping::Merchant::Accounts::V1beta::RequestInventoryVerificationResponse]
601
+ #
602
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
603
+ #
604
+ # @example Basic example
605
+ # require "google/shopping/merchant/accounts/v1beta"
606
+ #
607
+ # # Create a client object. The client can be reused for multiple calls.
608
+ # client = Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSettingsService::Client.new
609
+ #
610
+ # # Create a request. To set request fields, pass in keyword arguments.
611
+ # request = Google::Shopping::Merchant::Accounts::V1beta::RequestInventoryVerificationRequest.new
612
+ #
613
+ # # Call the request_inventory_verification method.
614
+ # result = client.request_inventory_verification request
615
+ #
616
+ # # The returned object is of type Google::Shopping::Merchant::Accounts::V1beta::RequestInventoryVerificationResponse.
617
+ # p result
618
+ #
619
+ def request_inventory_verification request, options = nil
620
+ raise ::ArgumentError, "request must be provided" if request.nil?
621
+
622
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::RequestInventoryVerificationRequest
623
+
624
+ # Converts hash and nil to an options object
625
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
626
+
627
+ # Customize the options with defaults
628
+ metadata = @config.rpcs.request_inventory_verification.metadata.to_h
629
+
630
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
631
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
632
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
633
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
634
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
635
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
636
+
637
+ header_params = {}
638
+ if request.name
639
+ header_params["name"] = request.name
640
+ end
641
+
642
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
643
+ metadata[:"x-goog-request-params"] ||= request_params_header
644
+
645
+ options.apply_defaults timeout: @config.rpcs.request_inventory_verification.timeout,
646
+ metadata: metadata,
647
+ retry_policy: @config.rpcs.request_inventory_verification.retry_policy
648
+
649
+ options.apply_defaults timeout: @config.timeout,
650
+ metadata: @config.metadata,
651
+ retry_policy: @config.retry_policy
652
+
653
+ @omnichannel_settings_service_stub.call_rpc :request_inventory_verification, request, options: options do |response, operation|
654
+ yield response, operation if block_given?
655
+ end
656
+ rescue ::GRPC::BadStatus => e
657
+ raise ::Google::Cloud::Error.from_error(e)
658
+ end
659
+
660
+ ##
661
+ # Configuration class for the OmnichannelSettingsService API.
662
+ #
663
+ # This class represents the configuration for OmnichannelSettingsService,
664
+ # providing control over timeouts, retry behavior, logging, transport
665
+ # parameters, and other low-level controls. Certain parameters can also be
666
+ # applied individually to specific RPCs. See
667
+ # {::Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSettingsService::Client::Configuration::Rpcs}
668
+ # for a list of RPCs that can be configured independently.
669
+ #
670
+ # Configuration can be applied globally to all clients, or to a single client
671
+ # on construction.
672
+ #
673
+ # @example
674
+ #
675
+ # # Modify the global config, setting the timeout for
676
+ # # get_omnichannel_setting to 20 seconds,
677
+ # # and all remaining timeouts to 10 seconds.
678
+ # ::Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSettingsService::Client.configure do |config|
679
+ # config.timeout = 10.0
680
+ # config.rpcs.get_omnichannel_setting.timeout = 20.0
681
+ # end
682
+ #
683
+ # # Apply the above configuration only to a new client.
684
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::OmnichannelSettingsService::Client.new do |config|
685
+ # config.timeout = 10.0
686
+ # config.rpcs.get_omnichannel_setting.timeout = 20.0
687
+ # end
688
+ #
689
+ # @!attribute [rw] endpoint
690
+ # A custom service endpoint, as a hostname or hostname:port. The default is
691
+ # nil, indicating to use the default endpoint in the current universe domain.
692
+ # @return [::String,nil]
693
+ # @!attribute [rw] credentials
694
+ # Credentials to send with calls. You may provide any of the following types:
695
+ # * (`String`) The path to a service account key file in JSON format
696
+ # * (`Hash`) A service account key as a Hash
697
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
698
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
699
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
700
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
701
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
702
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
703
+ # * (`nil`) indicating no credentials
704
+ #
705
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
706
+ # external source for authentication to Google Cloud, you must validate it before
707
+ # providing it to a Google API client library. Providing an unvalidated credential
708
+ # configuration to Google APIs can compromise the security of your systems and data.
709
+ # For more information, refer to [Validate credential configurations from external
710
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
711
+ # @return [::Object]
712
+ # @!attribute [rw] scope
713
+ # The OAuth scopes
714
+ # @return [::Array<::String>]
715
+ # @!attribute [rw] lib_name
716
+ # The library name as recorded in instrumentation and logging
717
+ # @return [::String]
718
+ # @!attribute [rw] lib_version
719
+ # The library version as recorded in instrumentation and logging
720
+ # @return [::String]
721
+ # @!attribute [rw] channel_args
722
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
723
+ # `GRPC::Core::Channel` object is provided as the credential.
724
+ # @return [::Hash]
725
+ # @!attribute [rw] interceptors
726
+ # An array of interceptors that are run before calls are executed.
727
+ # @return [::Array<::GRPC::ClientInterceptor>]
728
+ # @!attribute [rw] timeout
729
+ # The call timeout in seconds.
730
+ # @return [::Numeric]
731
+ # @!attribute [rw] metadata
732
+ # Additional gRPC headers to be sent with the call.
733
+ # @return [::Hash{::Symbol=>::String}]
734
+ # @!attribute [rw] retry_policy
735
+ # The retry policy. The value is a hash with the following keys:
736
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
737
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
738
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
739
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
740
+ # trigger a retry.
741
+ # @return [::Hash]
742
+ # @!attribute [rw] quota_project
743
+ # A separate project against which to charge quota.
744
+ # @return [::String]
745
+ # @!attribute [rw] universe_domain
746
+ # The universe domain within which to make requests. This determines the
747
+ # default endpoint URL. The default value of nil uses the environment
748
+ # universe (usually the default "googleapis.com" universe).
749
+ # @return [::String,nil]
750
+ # @!attribute [rw] logger
751
+ # A custom logger to use for request/response debug logging, or the value
752
+ # `:default` (the default) to construct a default logger, or `nil` to
753
+ # explicitly disable logging.
754
+ # @return [::Logger,:default,nil]
755
+ #
756
+ class Configuration
757
+ extend ::Gapic::Config
758
+
759
+ # @private
760
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
761
+ DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
762
+
763
+ config_attr :endpoint, nil, ::String, nil
764
+ config_attr :credentials, nil do |value|
765
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
766
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
767
+ allowed.any? { |klass| klass === value }
768
+ end
769
+ config_attr :scope, nil, ::String, ::Array, nil
770
+ config_attr :lib_name, nil, ::String, nil
771
+ config_attr :lib_version, nil, ::String, nil
772
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
773
+ config_attr :interceptors, nil, ::Array, nil
774
+ config_attr :timeout, nil, ::Numeric, nil
775
+ config_attr :metadata, nil, ::Hash, nil
776
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
777
+ config_attr :quota_project, nil, ::String, nil
778
+ config_attr :universe_domain, nil, ::String, nil
779
+ config_attr :logger, :default, ::Logger, nil, :default
780
+
781
+ # @private
782
+ def initialize parent_config = nil
783
+ @parent_config = parent_config unless parent_config.nil?
784
+
785
+ yield self if block_given?
786
+ end
787
+
788
+ ##
789
+ # Configurations for individual RPCs
790
+ # @return [Rpcs]
791
+ #
792
+ def rpcs
793
+ @rpcs ||= begin
794
+ parent_rpcs = nil
795
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
796
+ Rpcs.new parent_rpcs
797
+ end
798
+ end
799
+
800
+ ##
801
+ # Configuration for the channel pool
802
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
803
+ #
804
+ def channel_pool
805
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
806
+ end
807
+
808
+ ##
809
+ # Configuration RPC class for the OmnichannelSettingsService API.
810
+ #
811
+ # Includes fields providing the configuration for each RPC in this service.
812
+ # Each configuration object is of type `Gapic::Config::Method` and includes
813
+ # the following configuration fields:
814
+ #
815
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
816
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
817
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
818
+ # include the following keys:
819
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
820
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
821
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
822
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
823
+ # trigger a retry.
824
+ #
825
+ class Rpcs
826
+ ##
827
+ # RPC-specific configuration for `get_omnichannel_setting`
828
+ # @return [::Gapic::Config::Method]
829
+ #
830
+ attr_reader :get_omnichannel_setting
831
+ ##
832
+ # RPC-specific configuration for `list_omnichannel_settings`
833
+ # @return [::Gapic::Config::Method]
834
+ #
835
+ attr_reader :list_omnichannel_settings
836
+ ##
837
+ # RPC-specific configuration for `create_omnichannel_setting`
838
+ # @return [::Gapic::Config::Method]
839
+ #
840
+ attr_reader :create_omnichannel_setting
841
+ ##
842
+ # RPC-specific configuration for `update_omnichannel_setting`
843
+ # @return [::Gapic::Config::Method]
844
+ #
845
+ attr_reader :update_omnichannel_setting
846
+ ##
847
+ # RPC-specific configuration for `request_inventory_verification`
848
+ # @return [::Gapic::Config::Method]
849
+ #
850
+ attr_reader :request_inventory_verification
851
+
852
+ # @private
853
+ def initialize parent_rpcs = nil
854
+ get_omnichannel_setting_config = parent_rpcs.get_omnichannel_setting if parent_rpcs.respond_to? :get_omnichannel_setting
855
+ @get_omnichannel_setting = ::Gapic::Config::Method.new get_omnichannel_setting_config
856
+ list_omnichannel_settings_config = parent_rpcs.list_omnichannel_settings if parent_rpcs.respond_to? :list_omnichannel_settings
857
+ @list_omnichannel_settings = ::Gapic::Config::Method.new list_omnichannel_settings_config
858
+ create_omnichannel_setting_config = parent_rpcs.create_omnichannel_setting if parent_rpcs.respond_to? :create_omnichannel_setting
859
+ @create_omnichannel_setting = ::Gapic::Config::Method.new create_omnichannel_setting_config
860
+ update_omnichannel_setting_config = parent_rpcs.update_omnichannel_setting if parent_rpcs.respond_to? :update_omnichannel_setting
861
+ @update_omnichannel_setting = ::Gapic::Config::Method.new update_omnichannel_setting_config
862
+ request_inventory_verification_config = parent_rpcs.request_inventory_verification if parent_rpcs.respond_to? :request_inventory_verification
863
+ @request_inventory_verification = ::Gapic::Config::Method.new request_inventory_verification_config
864
+
865
+ yield self if block_given?
866
+ end
867
+ end
868
+ end
869
+ end
870
+ end
871
+ end
872
+ end
873
+ end
874
+ end
875
+ end