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,71 @@
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
+
20
+ module Google
21
+ module Shopping
22
+ module Merchant
23
+ module Accounts
24
+ module V1beta
25
+ module LfpProvidersService
26
+ # Path helper methods for the LfpProvidersService API.
27
+ module Paths
28
+ ##
29
+ # Create a fully-qualified LfpProvider resource string.
30
+ #
31
+ # The resource will be in the following format:
32
+ #
33
+ # `accounts/{account}/omnichannelSettings/{omnichannel_setting}/lfpProviders/{lfp_provider}`
34
+ #
35
+ # @param account [String]
36
+ # @param omnichannel_setting [String]
37
+ # @param lfp_provider [String]
38
+ #
39
+ # @return [::String]
40
+ def lfp_provider_path account:, omnichannel_setting:, lfp_provider:
41
+ raise ::ArgumentError, "account cannot contain /" if account.to_s.include? "/"
42
+ raise ::ArgumentError, "omnichannel_setting cannot contain /" if omnichannel_setting.to_s.include? "/"
43
+
44
+ "accounts/#{account}/omnichannelSettings/#{omnichannel_setting}/lfpProviders/#{lfp_provider}"
45
+ end
46
+
47
+ ##
48
+ # Create a fully-qualified OmnichannelSetting resource string.
49
+ #
50
+ # The resource will be in the following format:
51
+ #
52
+ # `accounts/{account}/omnichannelSettings/{omnichannel_setting}`
53
+ #
54
+ # @param account [String]
55
+ # @param omnichannel_setting [String]
56
+ #
57
+ # @return [::String]
58
+ def omnichannel_setting_path account:, omnichannel_setting:
59
+ raise ::ArgumentError, "account cannot contain /" if account.to_s.include? "/"
60
+
61
+ "accounts/#{account}/omnichannelSettings/#{omnichannel_setting}"
62
+ end
63
+
64
+ extend self
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,544 @@
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/lfpproviders_pb"
21
+ require "google/shopping/merchant/accounts/v1beta/lfp_providers_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Shopping
25
+ module Merchant
26
+ module Accounts
27
+ module V1beta
28
+ module LfpProvidersService
29
+ module Rest
30
+ ##
31
+ # REST client for the LfpProvidersService service.
32
+ #
33
+ # The service facilitates the management of a merchant's LFP provider settings.
34
+ # This API defines the following resource model:
35
+ # - [LfpProvider][google.shopping.merchant.accounts.v1.LfpProvider]
36
+ #
37
+ class Client
38
+ # @private
39
+ API_VERSION = ""
40
+
41
+ # @private
42
+ DEFAULT_ENDPOINT_TEMPLATE = "merchantapi.$UNIVERSE_DOMAIN$"
43
+
44
+ include Paths
45
+
46
+ # @private
47
+ attr_reader :lfp_providers_service_stub
48
+
49
+ ##
50
+ # Configure the LfpProvidersService Client class.
51
+ #
52
+ # See {::Google::Shopping::Merchant::Accounts::V1beta::LfpProvidersService::Rest::Client::Configuration}
53
+ # for a description of the configuration fields.
54
+ #
55
+ # @example
56
+ #
57
+ # # Modify the configuration for all LfpProvidersService clients
58
+ # ::Google::Shopping::Merchant::Accounts::V1beta::LfpProvidersService::Rest::Client.configure do |config|
59
+ # config.timeout = 10.0
60
+ # end
61
+ #
62
+ # @yield [config] Configure the Client client.
63
+ # @yieldparam config [Client::Configuration]
64
+ #
65
+ # @return [Client::Configuration]
66
+ #
67
+ def self.configure
68
+ @configure ||= begin
69
+ namespace = ["Google", "Shopping", "Merchant", "Accounts", "V1beta"]
70
+ parent_config = while namespace.any?
71
+ parent_name = namespace.join "::"
72
+ parent_const = const_get parent_name
73
+ break parent_const.configure if parent_const.respond_to? :configure
74
+ namespace.pop
75
+ end
76
+ default_config = Client::Configuration.new parent_config
77
+
78
+ default_config.timeout = 60.0
79
+ default_config.retry_policy = {
80
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
81
+ }
82
+
83
+ default_config
84
+ end
85
+ yield @configure if block_given?
86
+ @configure
87
+ end
88
+
89
+ ##
90
+ # Configure the LfpProvidersService Client instance.
91
+ #
92
+ # The configuration is set to the derived mode, meaning that values can be changed,
93
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
94
+ # should be made on {Client.configure}.
95
+ #
96
+ # See {::Google::Shopping::Merchant::Accounts::V1beta::LfpProvidersService::Rest::Client::Configuration}
97
+ # for a description of the configuration fields.
98
+ #
99
+ # @yield [config] Configure the Client client.
100
+ # @yieldparam config [Client::Configuration]
101
+ #
102
+ # @return [Client::Configuration]
103
+ #
104
+ def configure
105
+ yield @config if block_given?
106
+ @config
107
+ end
108
+
109
+ ##
110
+ # The effective universe domain
111
+ #
112
+ # @return [String]
113
+ #
114
+ def universe_domain
115
+ @lfp_providers_service_stub.universe_domain
116
+ end
117
+
118
+ ##
119
+ # Create a new LfpProvidersService REST client object.
120
+ #
121
+ # @example
122
+ #
123
+ # # Create a client using the default configuration
124
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::LfpProvidersService::Rest::Client.new
125
+ #
126
+ # # Create a client using a custom configuration
127
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::LfpProvidersService::Rest::Client.new do |config|
128
+ # config.timeout = 10.0
129
+ # end
130
+ #
131
+ # @yield [config] Configure the LfpProvidersService client.
132
+ # @yieldparam config [Client::Configuration]
133
+ #
134
+ def initialize
135
+ # Create the configuration object
136
+ @config = Configuration.new Client.configure
137
+
138
+ # Yield the configuration if needed
139
+ yield @config if block_given?
140
+
141
+ # Create credentials
142
+ credentials = @config.credentials
143
+ # Use self-signed JWT if the endpoint is unchanged from default,
144
+ # but only if the default endpoint does not have a region prefix.
145
+ enable_self_signed_jwt = @config.endpoint.nil? ||
146
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
147
+ !@config.endpoint.split(".").first.include?("-"))
148
+ credentials ||= Credentials.default scope: @config.scope,
149
+ enable_self_signed_jwt: enable_self_signed_jwt
150
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
151
+ credentials = Credentials.new credentials, scope: @config.scope
152
+ end
153
+
154
+ @quota_project_id = @config.quota_project
155
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
156
+
157
+ @lfp_providers_service_stub = ::Google::Shopping::Merchant::Accounts::V1beta::LfpProvidersService::Rest::ServiceStub.new(
158
+ endpoint: @config.endpoint,
159
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
160
+ universe_domain: @config.universe_domain,
161
+ credentials: credentials,
162
+ logger: @config.logger
163
+ )
164
+
165
+ @lfp_providers_service_stub.logger(stub: true)&.info do |entry|
166
+ entry.set_system_name
167
+ entry.set_service
168
+ entry.message = "Created client for #{entry.service}"
169
+ entry.set_credentials_fields credentials
170
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
171
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
172
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
173
+ end
174
+ end
175
+
176
+ ##
177
+ # The logger used for request/response debug logging.
178
+ #
179
+ # @return [Logger]
180
+ #
181
+ def logger
182
+ @lfp_providers_service_stub.logger
183
+ end
184
+
185
+ # Service calls
186
+
187
+ ##
188
+ # Find the LFP provider candidates in a given country.
189
+ #
190
+ # @overload find_lfp_providers(request, options = nil)
191
+ # Pass arguments to `find_lfp_providers` via a request object, either of type
192
+ # {::Google::Shopping::Merchant::Accounts::V1beta::FindLfpProvidersRequest} or an equivalent Hash.
193
+ #
194
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::FindLfpProvidersRequest, ::Hash]
195
+ # A request object representing the call parameters. Required. To specify no
196
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
197
+ # @param options [::Gapic::CallOptions, ::Hash]
198
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
199
+ #
200
+ # @overload find_lfp_providers(parent: nil, page_size: nil, page_token: nil)
201
+ # Pass arguments to `find_lfp_providers` via keyword arguments. Note that at
202
+ # least one keyword argument is required. To specify no parameters, or to keep all
203
+ # the default parameter values, pass an empty Hash as a request object (see above).
204
+ #
205
+ # @param parent [::String]
206
+ # Required. The name of the parent resource under which the LFP providers are
207
+ # found. Format:
208
+ # `accounts/{account}/omnichannelSettings/{omnichannel_setting}`.
209
+ # @param page_size [::Integer]
210
+ # Optional. The maximum number of `LfpProvider` resources to return. The
211
+ # service returns fewer than this value if the number of lfp providers is
212
+ # less that than the `pageSize`. The default value is 50. The maximum value
213
+ # is 1000; If a value higher than the maximum is specified, then the
214
+ # `pageSize` will default to the maximum.
215
+ # @param page_token [::String]
216
+ # Optional. A page token, received from a previous `FindLfpProviders` call.
217
+ # Provide the page token to retrieve the subsequent page.
218
+ #
219
+ # When paginating, all other parameters provided to `FindLfpProviders` must
220
+ # match the call that provided the page token.
221
+ # @yield [result, operation] Access the result along with the TransportOperation object
222
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Shopping::Merchant::Accounts::V1beta::LfpProvider>]
223
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
224
+ #
225
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Shopping::Merchant::Accounts::V1beta::LfpProvider>]
226
+ #
227
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
228
+ #
229
+ # @example Basic example
230
+ # require "google/shopping/merchant/accounts/v1beta"
231
+ #
232
+ # # Create a client object. The client can be reused for multiple calls.
233
+ # client = Google::Shopping::Merchant::Accounts::V1beta::LfpProvidersService::Rest::Client.new
234
+ #
235
+ # # Create a request. To set request fields, pass in keyword arguments.
236
+ # request = Google::Shopping::Merchant::Accounts::V1beta::FindLfpProvidersRequest.new
237
+ #
238
+ # # Call the find_lfp_providers method.
239
+ # result = client.find_lfp_providers request
240
+ #
241
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
242
+ # # over elements, and API calls will be issued to fetch pages as needed.
243
+ # result.each do |item|
244
+ # # Each element is of type ::Google::Shopping::Merchant::Accounts::V1beta::LfpProvider.
245
+ # p item
246
+ # end
247
+ #
248
+ def find_lfp_providers request, options = nil
249
+ raise ::ArgumentError, "request must be provided" if request.nil?
250
+
251
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::FindLfpProvidersRequest
252
+
253
+ # Converts hash and nil to an options object
254
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
255
+
256
+ # Customize the options with defaults
257
+ call_metadata = @config.rpcs.find_lfp_providers.metadata.to_h
258
+
259
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
260
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
261
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
262
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION,
263
+ transports_version_send: [:rest]
264
+
265
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
266
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
267
+
268
+ options.apply_defaults timeout: @config.rpcs.find_lfp_providers.timeout,
269
+ metadata: call_metadata,
270
+ retry_policy: @config.rpcs.find_lfp_providers.retry_policy
271
+
272
+ options.apply_defaults timeout: @config.timeout,
273
+ metadata: @config.metadata,
274
+ retry_policy: @config.retry_policy
275
+
276
+ @lfp_providers_service_stub.find_lfp_providers request, options do |result, operation|
277
+ result = ::Gapic::Rest::PagedEnumerable.new @lfp_providers_service_stub, :find_lfp_providers, "lfp_providers", request, result, options
278
+ yield result, operation if block_given?
279
+ throw :response, result
280
+ end
281
+ rescue ::Gapic::Rest::Error => e
282
+ raise ::Google::Cloud::Error.from_error(e)
283
+ end
284
+
285
+ ##
286
+ # Link the specified merchant to a LFP provider for the specified country.
287
+ #
288
+ # @overload link_lfp_provider(request, options = nil)
289
+ # Pass arguments to `link_lfp_provider` via a request object, either of type
290
+ # {::Google::Shopping::Merchant::Accounts::V1beta::LinkLfpProviderRequest} or an equivalent Hash.
291
+ #
292
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::LinkLfpProviderRequest, ::Hash]
293
+ # A request object representing the call parameters. Required. To specify no
294
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
295
+ # @param options [::Gapic::CallOptions, ::Hash]
296
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
297
+ #
298
+ # @overload link_lfp_provider(name: nil, external_account_id: nil)
299
+ # Pass arguments to `link_lfp_provider` via keyword arguments. Note that at
300
+ # least one keyword argument is required. To specify no parameters, or to keep all
301
+ # the default parameter values, pass an empty Hash as a request object (see above).
302
+ #
303
+ # @param name [::String]
304
+ # Required. The name of the LFP provider resource to link.
305
+ # Format:
306
+ # `accounts/{account}/omnichannelSettings/{omnichannel_setting}/lfpProviders/{lfp_provider}`.
307
+ # The `lfp_provider` is the LFP provider ID.
308
+ # @param external_account_id [::String]
309
+ # Required. The external account ID by which this merchant is known to the
310
+ # LFP provider.
311
+ # @yield [result, operation] Access the result along with the TransportOperation object
312
+ # @yieldparam result [::Google::Shopping::Merchant::Accounts::V1beta::LinkLfpProviderResponse]
313
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
314
+ #
315
+ # @return [::Google::Shopping::Merchant::Accounts::V1beta::LinkLfpProviderResponse]
316
+ #
317
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
318
+ #
319
+ # @example Basic example
320
+ # require "google/shopping/merchant/accounts/v1beta"
321
+ #
322
+ # # Create a client object. The client can be reused for multiple calls.
323
+ # client = Google::Shopping::Merchant::Accounts::V1beta::LfpProvidersService::Rest::Client.new
324
+ #
325
+ # # Create a request. To set request fields, pass in keyword arguments.
326
+ # request = Google::Shopping::Merchant::Accounts::V1beta::LinkLfpProviderRequest.new
327
+ #
328
+ # # Call the link_lfp_provider method.
329
+ # result = client.link_lfp_provider request
330
+ #
331
+ # # The returned object is of type Google::Shopping::Merchant::Accounts::V1beta::LinkLfpProviderResponse.
332
+ # p result
333
+ #
334
+ def link_lfp_provider request, options = nil
335
+ raise ::ArgumentError, "request must be provided" if request.nil?
336
+
337
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::LinkLfpProviderRequest
338
+
339
+ # Converts hash and nil to an options object
340
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
341
+
342
+ # Customize the options with defaults
343
+ call_metadata = @config.rpcs.link_lfp_provider.metadata.to_h
344
+
345
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
346
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
347
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
348
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION,
349
+ transports_version_send: [:rest]
350
+
351
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
352
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
353
+
354
+ options.apply_defaults timeout: @config.rpcs.link_lfp_provider.timeout,
355
+ metadata: call_metadata,
356
+ retry_policy: @config.rpcs.link_lfp_provider.retry_policy
357
+
358
+ options.apply_defaults timeout: @config.timeout,
359
+ metadata: @config.metadata,
360
+ retry_policy: @config.retry_policy
361
+
362
+ @lfp_providers_service_stub.link_lfp_provider request, options do |result, operation|
363
+ yield result, operation if block_given?
364
+ end
365
+ rescue ::Gapic::Rest::Error => e
366
+ raise ::Google::Cloud::Error.from_error(e)
367
+ end
368
+
369
+ ##
370
+ # Configuration class for the LfpProvidersService REST API.
371
+ #
372
+ # This class represents the configuration for LfpProvidersService REST,
373
+ # providing control over timeouts, retry behavior, logging, transport
374
+ # parameters, and other low-level controls. Certain parameters can also be
375
+ # applied individually to specific RPCs. See
376
+ # {::Google::Shopping::Merchant::Accounts::V1beta::LfpProvidersService::Rest::Client::Configuration::Rpcs}
377
+ # for a list of RPCs that can be configured independently.
378
+ #
379
+ # Configuration can be applied globally to all clients, or to a single client
380
+ # on construction.
381
+ #
382
+ # @example
383
+ #
384
+ # # Modify the global config, setting the timeout for
385
+ # # find_lfp_providers to 20 seconds,
386
+ # # and all remaining timeouts to 10 seconds.
387
+ # ::Google::Shopping::Merchant::Accounts::V1beta::LfpProvidersService::Rest::Client.configure do |config|
388
+ # config.timeout = 10.0
389
+ # config.rpcs.find_lfp_providers.timeout = 20.0
390
+ # end
391
+ #
392
+ # # Apply the above configuration only to a new client.
393
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::LfpProvidersService::Rest::Client.new do |config|
394
+ # config.timeout = 10.0
395
+ # config.rpcs.find_lfp_providers.timeout = 20.0
396
+ # end
397
+ #
398
+ # @!attribute [rw] endpoint
399
+ # A custom service endpoint, as a hostname or hostname:port. The default is
400
+ # nil, indicating to use the default endpoint in the current universe domain.
401
+ # @return [::String,nil]
402
+ # @!attribute [rw] credentials
403
+ # Credentials to send with calls. You may provide any of the following types:
404
+ # * (`String`) The path to a service account key file in JSON format
405
+ # * (`Hash`) A service account key as a Hash
406
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
407
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
408
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
409
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
410
+ # * (`nil`) indicating no credentials
411
+ #
412
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
413
+ # external source for authentication to Google Cloud, you must validate it before
414
+ # providing it to a Google API client library. Providing an unvalidated credential
415
+ # configuration to Google APIs can compromise the security of your systems and data.
416
+ # For more information, refer to [Validate credential configurations from external
417
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
418
+ # @return [::Object]
419
+ # @!attribute [rw] scope
420
+ # The OAuth scopes
421
+ # @return [::Array<::String>]
422
+ # @!attribute [rw] lib_name
423
+ # The library name as recorded in instrumentation and logging
424
+ # @return [::String]
425
+ # @!attribute [rw] lib_version
426
+ # The library version as recorded in instrumentation and logging
427
+ # @return [::String]
428
+ # @!attribute [rw] timeout
429
+ # The call timeout in seconds.
430
+ # @return [::Numeric]
431
+ # @!attribute [rw] metadata
432
+ # Additional headers to be sent with the call.
433
+ # @return [::Hash{::Symbol=>::String}]
434
+ # @!attribute [rw] retry_policy
435
+ # The retry policy. The value is a hash with the following keys:
436
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
437
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
438
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
439
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
440
+ # trigger a retry.
441
+ # @return [::Hash]
442
+ # @!attribute [rw] quota_project
443
+ # A separate project against which to charge quota.
444
+ # @return [::String]
445
+ # @!attribute [rw] universe_domain
446
+ # The universe domain within which to make requests. This determines the
447
+ # default endpoint URL. The default value of nil uses the environment
448
+ # universe (usually the default "googleapis.com" universe).
449
+ # @return [::String,nil]
450
+ # @!attribute [rw] logger
451
+ # A custom logger to use for request/response debug logging, or the value
452
+ # `:default` (the default) to construct a default logger, or `nil` to
453
+ # explicitly disable logging.
454
+ # @return [::Logger,:default,nil]
455
+ #
456
+ class Configuration
457
+ extend ::Gapic::Config
458
+
459
+ # @private
460
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
461
+ DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
462
+
463
+ config_attr :endpoint, nil, ::String, nil
464
+ config_attr :credentials, nil do |value|
465
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
466
+ allowed.any? { |klass| klass === value }
467
+ end
468
+ config_attr :scope, nil, ::String, ::Array, nil
469
+ config_attr :lib_name, nil, ::String, nil
470
+ config_attr :lib_version, nil, ::String, nil
471
+ config_attr :timeout, nil, ::Numeric, nil
472
+ config_attr :metadata, nil, ::Hash, nil
473
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
474
+ config_attr :quota_project, nil, ::String, nil
475
+ config_attr :universe_domain, nil, ::String, nil
476
+ config_attr :logger, :default, ::Logger, nil, :default
477
+
478
+ # @private
479
+ def initialize parent_config = nil
480
+ @parent_config = parent_config unless parent_config.nil?
481
+
482
+ yield self if block_given?
483
+ end
484
+
485
+ ##
486
+ # Configurations for individual RPCs
487
+ # @return [Rpcs]
488
+ #
489
+ def rpcs
490
+ @rpcs ||= begin
491
+ parent_rpcs = nil
492
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
493
+ Rpcs.new parent_rpcs
494
+ end
495
+ end
496
+
497
+ ##
498
+ # Configuration RPC class for the LfpProvidersService API.
499
+ #
500
+ # Includes fields providing the configuration for each RPC in this service.
501
+ # Each configuration object is of type `Gapic::Config::Method` and includes
502
+ # the following configuration fields:
503
+ #
504
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
505
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
506
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
507
+ # include the following keys:
508
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
509
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
510
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
511
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
512
+ # trigger a retry.
513
+ #
514
+ class Rpcs
515
+ ##
516
+ # RPC-specific configuration for `find_lfp_providers`
517
+ # @return [::Gapic::Config::Method]
518
+ #
519
+ attr_reader :find_lfp_providers
520
+ ##
521
+ # RPC-specific configuration for `link_lfp_provider`
522
+ # @return [::Gapic::Config::Method]
523
+ #
524
+ attr_reader :link_lfp_provider
525
+
526
+ # @private
527
+ def initialize parent_rpcs = nil
528
+ find_lfp_providers_config = parent_rpcs.find_lfp_providers if parent_rpcs.respond_to? :find_lfp_providers
529
+ @find_lfp_providers = ::Gapic::Config::Method.new find_lfp_providers_config
530
+ link_lfp_provider_config = parent_rpcs.link_lfp_provider if parent_rpcs.respond_to? :link_lfp_provider
531
+ @link_lfp_provider = ::Gapic::Config::Method.new link_lfp_provider_config
532
+
533
+ yield self if block_given?
534
+ end
535
+ end
536
+ end
537
+ end
538
+ end
539
+ end
540
+ end
541
+ end
542
+ end
543
+ end
544
+ end