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

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