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