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