google-shopping-merchant-lfp-v1beta 0.a → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/shopping/merchant/lfp/v1beta/lfp_inventory_service/client.rb +435 -0
  6. data/lib/google/shopping/merchant/lfp/v1beta/lfp_inventory_service/credentials.rb +49 -0
  7. data/lib/google/shopping/merchant/lfp/v1beta/lfp_inventory_service/paths.rb +70 -0
  8. data/lib/google/shopping/merchant/lfp/v1beta/lfp_inventory_service/rest/client.rb +402 -0
  9. data/lib/google/shopping/merchant/lfp/v1beta/lfp_inventory_service/rest/service_stub.rb +131 -0
  10. data/lib/google/shopping/merchant/lfp/v1beta/lfp_inventory_service/rest.rb +56 -0
  11. data/lib/google/shopping/merchant/lfp/v1beta/lfp_inventory_service.rb +59 -0
  12. data/lib/google/shopping/merchant/lfp/v1beta/lfp_sale_service/client.rb +433 -0
  13. data/lib/google/shopping/merchant/lfp/v1beta/lfp_sale_service/credentials.rb +49 -0
  14. data/lib/google/shopping/merchant/lfp/v1beta/lfp_sale_service/paths.rb +52 -0
  15. data/lib/google/shopping/merchant/lfp/v1beta/lfp_sale_service/rest/client.rb +400 -0
  16. data/lib/google/shopping/merchant/lfp/v1beta/lfp_sale_service/rest/service_stub.rb +131 -0
  17. data/lib/google/shopping/merchant/lfp/v1beta/lfp_sale_service/rest.rb +56 -0
  18. data/lib/google/shopping/merchant/lfp/v1beta/lfp_sale_service.rb +59 -0
  19. data/lib/google/shopping/merchant/lfp/v1beta/lfp_store_service/client.rb +734 -0
  20. data/lib/google/shopping/merchant/lfp/v1beta/lfp_store_service/credentials.rb +49 -0
  21. data/lib/google/shopping/merchant/lfp/v1beta/lfp_store_service/paths.rb +68 -0
  22. data/lib/google/shopping/merchant/lfp/v1beta/lfp_store_service/rest/client.rb +680 -0
  23. data/lib/google/shopping/merchant/lfp/v1beta/lfp_store_service/rest/service_stub.rb +308 -0
  24. data/lib/google/shopping/merchant/lfp/v1beta/lfp_store_service/rest.rb +56 -0
  25. data/lib/google/shopping/merchant/lfp/v1beta/lfp_store_service.rb +59 -0
  26. data/lib/google/shopping/merchant/lfp/v1beta/lfpinventory_pb.rb +54 -0
  27. data/lib/google/shopping/merchant/lfp/v1beta/lfpinventory_services_pb.rb +51 -0
  28. data/lib/google/shopping/merchant/lfp/v1beta/lfpsale_pb.rb +55 -0
  29. data/lib/google/shopping/merchant/lfp/v1beta/lfpsale_services_pb.rb +49 -0
  30. data/lib/google/shopping/merchant/lfp/v1beta/lfpstore_pb.rb +56 -0
  31. data/lib/google/shopping/merchant/lfp/v1beta/lfpstore_services_pb.rb +57 -0
  32. data/lib/google/shopping/merchant/lfp/v1beta/rest.rb +41 -0
  33. data/lib/google/shopping/merchant/lfp/v1beta/version.rb +7 -2
  34. data/lib/google/shopping/merchant/lfp/v1beta.rb +49 -0
  35. data/lib/google-shopping-merchant-lfp-v1beta.rb +21 -0
  36. data/proto_docs/README.md +4 -0
  37. data/proto_docs/google/api/client.rb +399 -0
  38. data/proto_docs/google/api/field_behavior.rb +85 -0
  39. data/proto_docs/google/api/field_info.rb +65 -0
  40. data/proto_docs/google/api/launch_stage.rb +71 -0
  41. data/proto_docs/google/api/resource.rb +222 -0
  42. data/proto_docs/google/protobuf/duration.rb +98 -0
  43. data/proto_docs/google/protobuf/empty.rb +34 -0
  44. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  45. data/proto_docs/google/shopping/merchant/lfp/v1beta/lfpinventory.rb +113 -0
  46. data/proto_docs/google/shopping/merchant/lfp/v1beta/lfpsale.rb +96 -0
  47. data/proto_docs/google/shopping/merchant/lfp/v1beta/lfpstore.rb +185 -0
  48. data/proto_docs/google/shopping/type/types.rb +183 -0
  49. metadata +108 -10
@@ -0,0 +1,680 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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/lfp/v1beta/lfpstore_pb"
21
+ require "google/shopping/merchant/lfp/v1beta/lfp_store_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Shopping
25
+ module Merchant
26
+ module Lfp
27
+ module V1beta
28
+ module LfpStoreService
29
+ module Rest
30
+ ##
31
+ # REST client for the LfpStoreService service.
32
+ #
33
+ # Service for a [LFP
34
+ # partner](https://support.google.com/merchants/answer/7676652) to submit local
35
+ # stores for a merchant.
36
+ #
37
+ class Client
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "merchantapi.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :lfp_store_service_stub
45
+
46
+ ##
47
+ # Configure the LfpStoreService Client class.
48
+ #
49
+ # See {::Google::Shopping::Merchant::Lfp::V1beta::LfpStoreService::Rest::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all LfpStoreService clients
55
+ # ::Google::Shopping::Merchant::Lfp::V1beta::LfpStoreService::Rest::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Shopping", "Merchant", "Lfp", "V1beta"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config.timeout = 60.0
76
+ default_config.retry_policy = {
77
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
78
+ }
79
+
80
+ default_config
81
+ end
82
+ yield @configure if block_given?
83
+ @configure
84
+ end
85
+
86
+ ##
87
+ # Configure the LfpStoreService Client instance.
88
+ #
89
+ # The configuration is set to the derived mode, meaning that values can be changed,
90
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
91
+ # should be made on {Client.configure}.
92
+ #
93
+ # See {::Google::Shopping::Merchant::Lfp::V1beta::LfpStoreService::Rest::Client::Configuration}
94
+ # for a description of the configuration fields.
95
+ #
96
+ # @yield [config] Configure the Client client.
97
+ # @yieldparam config [Client::Configuration]
98
+ #
99
+ # @return [Client::Configuration]
100
+ #
101
+ def configure
102
+ yield @config if block_given?
103
+ @config
104
+ end
105
+
106
+ ##
107
+ # The effective universe domain
108
+ #
109
+ # @return [String]
110
+ #
111
+ def universe_domain
112
+ @lfp_store_service_stub.universe_domain
113
+ end
114
+
115
+ ##
116
+ # Create a new LfpStoreService REST client object.
117
+ #
118
+ # @example
119
+ #
120
+ # # Create a client using the default configuration
121
+ # client = ::Google::Shopping::Merchant::Lfp::V1beta::LfpStoreService::Rest::Client.new
122
+ #
123
+ # # Create a client using a custom configuration
124
+ # client = ::Google::Shopping::Merchant::Lfp::V1beta::LfpStoreService::Rest::Client.new do |config|
125
+ # config.timeout = 10.0
126
+ # end
127
+ #
128
+ # @yield [config] Configure the LfpStoreService client.
129
+ # @yieldparam config [Client::Configuration]
130
+ #
131
+ def initialize
132
+ # Create the configuration object
133
+ @config = Configuration.new Client.configure
134
+
135
+ # Yield the configuration if needed
136
+ yield @config if block_given?
137
+
138
+ # Create credentials
139
+ credentials = @config.credentials
140
+ # Use self-signed JWT if the endpoint is unchanged from default,
141
+ # but only if the default endpoint does not have a region prefix.
142
+ enable_self_signed_jwt = @config.endpoint.nil? ||
143
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
144
+ !@config.endpoint.split(".").first.include?("-"))
145
+ credentials ||= Credentials.default scope: @config.scope,
146
+ enable_self_signed_jwt: enable_self_signed_jwt
147
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
148
+ credentials = Credentials.new credentials, scope: @config.scope
149
+ end
150
+
151
+ @quota_project_id = @config.quota_project
152
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
153
+
154
+ @lfp_store_service_stub = ::Google::Shopping::Merchant::Lfp::V1beta::LfpStoreService::Rest::ServiceStub.new(
155
+ endpoint: @config.endpoint,
156
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
157
+ universe_domain: @config.universe_domain,
158
+ credentials: credentials
159
+ )
160
+ end
161
+
162
+ # Service calls
163
+
164
+ ##
165
+ # Retrieves information about a store.
166
+ #
167
+ # @overload get_lfp_store(request, options = nil)
168
+ # Pass arguments to `get_lfp_store` via a request object, either of type
169
+ # {::Google::Shopping::Merchant::Lfp::V1beta::GetLfpStoreRequest} or an equivalent Hash.
170
+ #
171
+ # @param request [::Google::Shopping::Merchant::Lfp::V1beta::GetLfpStoreRequest, ::Hash]
172
+ # A request object representing the call parameters. Required. To specify no
173
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
174
+ # @param options [::Gapic::CallOptions, ::Hash]
175
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
176
+ #
177
+ # @overload get_lfp_store(name: nil)
178
+ # Pass arguments to `get_lfp_store` via keyword arguments. Note that at
179
+ # least one keyword argument is required. To specify no parameters, or to keep all
180
+ # the default parameter values, pass an empty Hash as a request object (see above).
181
+ #
182
+ # @param name [::String]
183
+ # Required. The name of the store to retrieve.
184
+ # Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}`
185
+ # @yield [result, operation] Access the result along with the TransportOperation object
186
+ # @yieldparam result [::Google::Shopping::Merchant::Lfp::V1beta::LfpStore]
187
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
188
+ #
189
+ # @return [::Google::Shopping::Merchant::Lfp::V1beta::LfpStore]
190
+ #
191
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
192
+ #
193
+ # @example Basic example
194
+ # require "google/shopping/merchant/lfp/v1beta"
195
+ #
196
+ # # Create a client object. The client can be reused for multiple calls.
197
+ # client = Google::Shopping::Merchant::Lfp::V1beta::LfpStoreService::Rest::Client.new
198
+ #
199
+ # # Create a request. To set request fields, pass in keyword arguments.
200
+ # request = Google::Shopping::Merchant::Lfp::V1beta::GetLfpStoreRequest.new
201
+ #
202
+ # # Call the get_lfp_store method.
203
+ # result = client.get_lfp_store request
204
+ #
205
+ # # The returned object is of type Google::Shopping::Merchant::Lfp::V1beta::LfpStore.
206
+ # p result
207
+ #
208
+ def get_lfp_store request, options = nil
209
+ raise ::ArgumentError, "request must be provided" if request.nil?
210
+
211
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Lfp::V1beta::GetLfpStoreRequest
212
+
213
+ # Converts hash and nil to an options object
214
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
215
+
216
+ # Customize the options with defaults
217
+ call_metadata = @config.rpcs.get_lfp_store.metadata.to_h
218
+
219
+ # Set x-goog-api-client and x-goog-user-project headers
220
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
221
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
222
+ gapic_version: ::Google::Shopping::Merchant::Lfp::V1beta::VERSION,
223
+ transports_version_send: [:rest]
224
+
225
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
226
+
227
+ options.apply_defaults timeout: @config.rpcs.get_lfp_store.timeout,
228
+ metadata: call_metadata,
229
+ retry_policy: @config.rpcs.get_lfp_store.retry_policy
230
+
231
+ options.apply_defaults timeout: @config.timeout,
232
+ metadata: @config.metadata,
233
+ retry_policy: @config.retry_policy
234
+
235
+ @lfp_store_service_stub.get_lfp_store request, options do |result, operation|
236
+ yield result, operation if block_given?
237
+ return result
238
+ end
239
+ rescue ::Gapic::Rest::Error => e
240
+ raise ::Google::Cloud::Error.from_error(e)
241
+ end
242
+
243
+ ##
244
+ # Inserts a store for the target merchant. If the store with the same store
245
+ # code already exists, it will be replaced.
246
+ #
247
+ # @overload insert_lfp_store(request, options = nil)
248
+ # Pass arguments to `insert_lfp_store` via a request object, either of type
249
+ # {::Google::Shopping::Merchant::Lfp::V1beta::InsertLfpStoreRequest} or an equivalent Hash.
250
+ #
251
+ # @param request [::Google::Shopping::Merchant::Lfp::V1beta::InsertLfpStoreRequest, ::Hash]
252
+ # A request object representing the call parameters. Required. To specify no
253
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
254
+ # @param options [::Gapic::CallOptions, ::Hash]
255
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
256
+ #
257
+ # @overload insert_lfp_store(parent: nil, lfp_store: nil)
258
+ # Pass arguments to `insert_lfp_store` via keyword arguments. Note that at
259
+ # least one keyword argument is required. To specify no parameters, or to keep all
260
+ # the default parameter values, pass an empty Hash as a request object (see above).
261
+ #
262
+ # @param parent [::String]
263
+ # Required. The LFP provider account
264
+ # Format: `accounts/{account}`
265
+ # @param lfp_store [::Google::Shopping::Merchant::Lfp::V1beta::LfpStore, ::Hash]
266
+ # Required. The store to insert.
267
+ # @yield [result, operation] Access the result along with the TransportOperation object
268
+ # @yieldparam result [::Google::Shopping::Merchant::Lfp::V1beta::LfpStore]
269
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
270
+ #
271
+ # @return [::Google::Shopping::Merchant::Lfp::V1beta::LfpStore]
272
+ #
273
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
274
+ #
275
+ # @example Basic example
276
+ # require "google/shopping/merchant/lfp/v1beta"
277
+ #
278
+ # # Create a client object. The client can be reused for multiple calls.
279
+ # client = Google::Shopping::Merchant::Lfp::V1beta::LfpStoreService::Rest::Client.new
280
+ #
281
+ # # Create a request. To set request fields, pass in keyword arguments.
282
+ # request = Google::Shopping::Merchant::Lfp::V1beta::InsertLfpStoreRequest.new
283
+ #
284
+ # # Call the insert_lfp_store method.
285
+ # result = client.insert_lfp_store request
286
+ #
287
+ # # The returned object is of type Google::Shopping::Merchant::Lfp::V1beta::LfpStore.
288
+ # p result
289
+ #
290
+ def insert_lfp_store request, options = nil
291
+ raise ::ArgumentError, "request must be provided" if request.nil?
292
+
293
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Lfp::V1beta::InsertLfpStoreRequest
294
+
295
+ # Converts hash and nil to an options object
296
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
297
+
298
+ # Customize the options with defaults
299
+ call_metadata = @config.rpcs.insert_lfp_store.metadata.to_h
300
+
301
+ # Set x-goog-api-client and x-goog-user-project headers
302
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
303
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
304
+ gapic_version: ::Google::Shopping::Merchant::Lfp::V1beta::VERSION,
305
+ transports_version_send: [:rest]
306
+
307
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
308
+
309
+ options.apply_defaults timeout: @config.rpcs.insert_lfp_store.timeout,
310
+ metadata: call_metadata,
311
+ retry_policy: @config.rpcs.insert_lfp_store.retry_policy
312
+
313
+ options.apply_defaults timeout: @config.timeout,
314
+ metadata: @config.metadata,
315
+ retry_policy: @config.retry_policy
316
+
317
+ @lfp_store_service_stub.insert_lfp_store request, options do |result, operation|
318
+ yield result, operation if block_given?
319
+ return result
320
+ end
321
+ rescue ::Gapic::Rest::Error => e
322
+ raise ::Google::Cloud::Error.from_error(e)
323
+ end
324
+
325
+ ##
326
+ # Deletes a store for a target merchant.
327
+ #
328
+ # @overload delete_lfp_store(request, options = nil)
329
+ # Pass arguments to `delete_lfp_store` via a request object, either of type
330
+ # {::Google::Shopping::Merchant::Lfp::V1beta::DeleteLfpStoreRequest} or an equivalent Hash.
331
+ #
332
+ # @param request [::Google::Shopping::Merchant::Lfp::V1beta::DeleteLfpStoreRequest, ::Hash]
333
+ # A request object representing the call parameters. Required. To specify no
334
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
335
+ # @param options [::Gapic::CallOptions, ::Hash]
336
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
337
+ #
338
+ # @overload delete_lfp_store(name: nil)
339
+ # Pass arguments to `delete_lfp_store` via keyword arguments. Note that at
340
+ # least one keyword argument is required. To specify no parameters, or to keep all
341
+ # the default parameter values, pass an empty Hash as a request object (see above).
342
+ #
343
+ # @param name [::String]
344
+ # Required. The name of the store to delete for the target merchant account.
345
+ # Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}`
346
+ # @yield [result, operation] Access the result along with the TransportOperation object
347
+ # @yieldparam result [::Google::Protobuf::Empty]
348
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
349
+ #
350
+ # @return [::Google::Protobuf::Empty]
351
+ #
352
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
353
+ #
354
+ # @example Basic example
355
+ # require "google/shopping/merchant/lfp/v1beta"
356
+ #
357
+ # # Create a client object. The client can be reused for multiple calls.
358
+ # client = Google::Shopping::Merchant::Lfp::V1beta::LfpStoreService::Rest::Client.new
359
+ #
360
+ # # Create a request. To set request fields, pass in keyword arguments.
361
+ # request = Google::Shopping::Merchant::Lfp::V1beta::DeleteLfpStoreRequest.new
362
+ #
363
+ # # Call the delete_lfp_store method.
364
+ # result = client.delete_lfp_store request
365
+ #
366
+ # # The returned object is of type Google::Protobuf::Empty.
367
+ # p result
368
+ #
369
+ def delete_lfp_store request, options = nil
370
+ raise ::ArgumentError, "request must be provided" if request.nil?
371
+
372
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Lfp::V1beta::DeleteLfpStoreRequest
373
+
374
+ # Converts hash and nil to an options object
375
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
376
+
377
+ # Customize the options with defaults
378
+ call_metadata = @config.rpcs.delete_lfp_store.metadata.to_h
379
+
380
+ # Set x-goog-api-client and x-goog-user-project headers
381
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
382
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
383
+ gapic_version: ::Google::Shopping::Merchant::Lfp::V1beta::VERSION,
384
+ transports_version_send: [:rest]
385
+
386
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
387
+
388
+ options.apply_defaults timeout: @config.rpcs.delete_lfp_store.timeout,
389
+ metadata: call_metadata,
390
+ retry_policy: @config.rpcs.delete_lfp_store.retry_policy
391
+
392
+ options.apply_defaults timeout: @config.timeout,
393
+ metadata: @config.metadata,
394
+ retry_policy: @config.retry_policy
395
+
396
+ @lfp_store_service_stub.delete_lfp_store request, options do |result, operation|
397
+ yield result, operation if block_given?
398
+ return result
399
+ end
400
+ rescue ::Gapic::Rest::Error => e
401
+ raise ::Google::Cloud::Error.from_error(e)
402
+ end
403
+
404
+ ##
405
+ # Lists the stores of the target merchant, specified by the filter in
406
+ # `ListLfpStoresRequest`.
407
+ #
408
+ # @overload list_lfp_stores(request, options = nil)
409
+ # Pass arguments to `list_lfp_stores` via a request object, either of type
410
+ # {::Google::Shopping::Merchant::Lfp::V1beta::ListLfpStoresRequest} or an equivalent Hash.
411
+ #
412
+ # @param request [::Google::Shopping::Merchant::Lfp::V1beta::ListLfpStoresRequest, ::Hash]
413
+ # A request object representing the call parameters. Required. To specify no
414
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
415
+ # @param options [::Gapic::CallOptions, ::Hash]
416
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
417
+ #
418
+ # @overload list_lfp_stores(parent: nil, target_account: nil, page_size: nil, page_token: nil)
419
+ # Pass arguments to `list_lfp_stores` via keyword arguments. Note that at
420
+ # least one keyword argument is required. To specify no parameters, or to keep all
421
+ # the default parameter values, pass an empty Hash as a request object (see above).
422
+ #
423
+ # @param parent [::String]
424
+ # Required. The LFP partner.
425
+ # Format: `accounts/{account}`
426
+ # @param target_account [::Integer]
427
+ # Required. The Merchant Center id of the merchant to list stores for.
428
+ # @param page_size [::Integer]
429
+ # Optional. The maximum number of `LfpStore` resources for the given account
430
+ # to return. The service returns fewer than this value if the number of
431
+ # stores for the given account is less than the `pageSize`. The default value
432
+ # is 250. The maximum value is 1000; If a value higher than the maximum is
433
+ # specified, then the `pageSize` will default to the maximum.
434
+ # @param page_token [::String]
435
+ # Optional. A page token, received from a previous `ListLfpStoresRequest`
436
+ # call. Provide the page token to retrieve the subsequent page. When
437
+ # paginating, all other parameters provided to `ListLfpStoresRequest` must
438
+ # match the call that provided the page token. The token returned as
439
+ # {::Google::Shopping::Merchant::Lfp::V1beta::ListLfpStoresResponse#next_page_token nextPageToken}
440
+ # in the response to the previous request.
441
+ # @yield [result, operation] Access the result along with the TransportOperation object
442
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Shopping::Merchant::Lfp::V1beta::LfpStore>]
443
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
444
+ #
445
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Shopping::Merchant::Lfp::V1beta::LfpStore>]
446
+ #
447
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
448
+ #
449
+ # @example Basic example
450
+ # require "google/shopping/merchant/lfp/v1beta"
451
+ #
452
+ # # Create a client object. The client can be reused for multiple calls.
453
+ # client = Google::Shopping::Merchant::Lfp::V1beta::LfpStoreService::Rest::Client.new
454
+ #
455
+ # # Create a request. To set request fields, pass in keyword arguments.
456
+ # request = Google::Shopping::Merchant::Lfp::V1beta::ListLfpStoresRequest.new
457
+ #
458
+ # # Call the list_lfp_stores method.
459
+ # result = client.list_lfp_stores request
460
+ #
461
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
462
+ # # over elements, and API calls will be issued to fetch pages as needed.
463
+ # result.each do |item|
464
+ # # Each element is of type ::Google::Shopping::Merchant::Lfp::V1beta::LfpStore.
465
+ # p item
466
+ # end
467
+ #
468
+ def list_lfp_stores request, options = nil
469
+ raise ::ArgumentError, "request must be provided" if request.nil?
470
+
471
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Lfp::V1beta::ListLfpStoresRequest
472
+
473
+ # Converts hash and nil to an options object
474
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
475
+
476
+ # Customize the options with defaults
477
+ call_metadata = @config.rpcs.list_lfp_stores.metadata.to_h
478
+
479
+ # Set x-goog-api-client and x-goog-user-project headers
480
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
481
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
482
+ gapic_version: ::Google::Shopping::Merchant::Lfp::V1beta::VERSION,
483
+ transports_version_send: [:rest]
484
+
485
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
486
+
487
+ options.apply_defaults timeout: @config.rpcs.list_lfp_stores.timeout,
488
+ metadata: call_metadata,
489
+ retry_policy: @config.rpcs.list_lfp_stores.retry_policy
490
+
491
+ options.apply_defaults timeout: @config.timeout,
492
+ metadata: @config.metadata,
493
+ retry_policy: @config.retry_policy
494
+
495
+ @lfp_store_service_stub.list_lfp_stores request, options do |result, operation|
496
+ result = ::Gapic::Rest::PagedEnumerable.new @lfp_store_service_stub, :list_lfp_stores, "lfp_stores", request, result, options
497
+ yield result, operation if block_given?
498
+ return result
499
+ end
500
+ rescue ::Gapic::Rest::Error => e
501
+ raise ::Google::Cloud::Error.from_error(e)
502
+ end
503
+
504
+ ##
505
+ # Configuration class for the LfpStoreService REST API.
506
+ #
507
+ # This class represents the configuration for LfpStoreService REST,
508
+ # providing control over timeouts, retry behavior, logging, transport
509
+ # parameters, and other low-level controls. Certain parameters can also be
510
+ # applied individually to specific RPCs. See
511
+ # {::Google::Shopping::Merchant::Lfp::V1beta::LfpStoreService::Rest::Client::Configuration::Rpcs}
512
+ # for a list of RPCs that can be configured independently.
513
+ #
514
+ # Configuration can be applied globally to all clients, or to a single client
515
+ # on construction.
516
+ #
517
+ # @example
518
+ #
519
+ # # Modify the global config, setting the timeout for
520
+ # # get_lfp_store to 20 seconds,
521
+ # # and all remaining timeouts to 10 seconds.
522
+ # ::Google::Shopping::Merchant::Lfp::V1beta::LfpStoreService::Rest::Client.configure do |config|
523
+ # config.timeout = 10.0
524
+ # config.rpcs.get_lfp_store.timeout = 20.0
525
+ # end
526
+ #
527
+ # # Apply the above configuration only to a new client.
528
+ # client = ::Google::Shopping::Merchant::Lfp::V1beta::LfpStoreService::Rest::Client.new do |config|
529
+ # config.timeout = 10.0
530
+ # config.rpcs.get_lfp_store.timeout = 20.0
531
+ # end
532
+ #
533
+ # @!attribute [rw] endpoint
534
+ # A custom service endpoint, as a hostname or hostname:port. The default is
535
+ # nil, indicating to use the default endpoint in the current universe domain.
536
+ # @return [::String,nil]
537
+ # @!attribute [rw] credentials
538
+ # Credentials to send with calls. You may provide any of the following types:
539
+ # * (`String`) The path to a service account key file in JSON format
540
+ # * (`Hash`) A service account key as a Hash
541
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
542
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
543
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
544
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
545
+ # * (`nil`) indicating no credentials
546
+ # @return [::Object]
547
+ # @!attribute [rw] scope
548
+ # The OAuth scopes
549
+ # @return [::Array<::String>]
550
+ # @!attribute [rw] lib_name
551
+ # The library name as recorded in instrumentation and logging
552
+ # @return [::String]
553
+ # @!attribute [rw] lib_version
554
+ # The library version as recorded in instrumentation and logging
555
+ # @return [::String]
556
+ # @!attribute [rw] timeout
557
+ # The call timeout in seconds.
558
+ # @return [::Numeric]
559
+ # @!attribute [rw] metadata
560
+ # Additional headers to be sent with the call.
561
+ # @return [::Hash{::Symbol=>::String}]
562
+ # @!attribute [rw] retry_policy
563
+ # The retry policy. The value is a hash with the following keys:
564
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
565
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
566
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
567
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
568
+ # trigger a retry.
569
+ # @return [::Hash]
570
+ # @!attribute [rw] quota_project
571
+ # A separate project against which to charge quota.
572
+ # @return [::String]
573
+ # @!attribute [rw] universe_domain
574
+ # The universe domain within which to make requests. This determines the
575
+ # default endpoint URL. The default value of nil uses the environment
576
+ # universe (usually the default "googleapis.com" universe).
577
+ # @return [::String,nil]
578
+ #
579
+ class Configuration
580
+ extend ::Gapic::Config
581
+
582
+ # @private
583
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
584
+ DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
585
+
586
+ config_attr :endpoint, nil, ::String, nil
587
+ config_attr :credentials, nil do |value|
588
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
589
+ allowed.any? { |klass| klass === value }
590
+ end
591
+ config_attr :scope, nil, ::String, ::Array, nil
592
+ config_attr :lib_name, nil, ::String, nil
593
+ config_attr :lib_version, nil, ::String, nil
594
+ config_attr :timeout, nil, ::Numeric, nil
595
+ config_attr :metadata, nil, ::Hash, nil
596
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
597
+ config_attr :quota_project, nil, ::String, nil
598
+ config_attr :universe_domain, nil, ::String, nil
599
+
600
+ # @private
601
+ def initialize parent_config = nil
602
+ @parent_config = parent_config unless parent_config.nil?
603
+
604
+ yield self if block_given?
605
+ end
606
+
607
+ ##
608
+ # Configurations for individual RPCs
609
+ # @return [Rpcs]
610
+ #
611
+ def rpcs
612
+ @rpcs ||= begin
613
+ parent_rpcs = nil
614
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
615
+ Rpcs.new parent_rpcs
616
+ end
617
+ end
618
+
619
+ ##
620
+ # Configuration RPC class for the LfpStoreService API.
621
+ #
622
+ # Includes fields providing the configuration for each RPC in this service.
623
+ # Each configuration object is of type `Gapic::Config::Method` and includes
624
+ # the following configuration fields:
625
+ #
626
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
627
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
628
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
629
+ # include the following keys:
630
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
631
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
632
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
633
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
634
+ # trigger a retry.
635
+ #
636
+ class Rpcs
637
+ ##
638
+ # RPC-specific configuration for `get_lfp_store`
639
+ # @return [::Gapic::Config::Method]
640
+ #
641
+ attr_reader :get_lfp_store
642
+ ##
643
+ # RPC-specific configuration for `insert_lfp_store`
644
+ # @return [::Gapic::Config::Method]
645
+ #
646
+ attr_reader :insert_lfp_store
647
+ ##
648
+ # RPC-specific configuration for `delete_lfp_store`
649
+ # @return [::Gapic::Config::Method]
650
+ #
651
+ attr_reader :delete_lfp_store
652
+ ##
653
+ # RPC-specific configuration for `list_lfp_stores`
654
+ # @return [::Gapic::Config::Method]
655
+ #
656
+ attr_reader :list_lfp_stores
657
+
658
+ # @private
659
+ def initialize parent_rpcs = nil
660
+ get_lfp_store_config = parent_rpcs.get_lfp_store if parent_rpcs.respond_to? :get_lfp_store
661
+ @get_lfp_store = ::Gapic::Config::Method.new get_lfp_store_config
662
+ insert_lfp_store_config = parent_rpcs.insert_lfp_store if parent_rpcs.respond_to? :insert_lfp_store
663
+ @insert_lfp_store = ::Gapic::Config::Method.new insert_lfp_store_config
664
+ delete_lfp_store_config = parent_rpcs.delete_lfp_store if parent_rpcs.respond_to? :delete_lfp_store
665
+ @delete_lfp_store = ::Gapic::Config::Method.new delete_lfp_store_config
666
+ list_lfp_stores_config = parent_rpcs.list_lfp_stores if parent_rpcs.respond_to? :list_lfp_stores
667
+ @list_lfp_stores = ::Gapic::Config::Method.new list_lfp_stores_config
668
+
669
+ yield self if block_given?
670
+ end
671
+ end
672
+ end
673
+ end
674
+ end
675
+ end
676
+ end
677
+ end
678
+ end
679
+ end
680
+ end