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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +154 -8
  5. data/lib/google/shopping/merchant/lfp/v1/lfp_inventory_service/client.rb +471 -0
  6. data/lib/google/shopping/merchant/lfp/v1/lfp_inventory_service/credentials.rb +49 -0
  7. data/lib/google/shopping/merchant/lfp/v1/lfp_inventory_service/paths.rb +70 -0
  8. data/lib/google/shopping/merchant/lfp/v1/lfp_inventory_service/rest/client.rb +438 -0
  9. data/lib/google/shopping/merchant/lfp/v1/lfp_inventory_service/rest/service_stub.rb +145 -0
  10. data/lib/google/shopping/merchant/lfp/v1/lfp_inventory_service/rest.rb +56 -0
  11. data/lib/google/shopping/merchant/lfp/v1/lfp_inventory_service.rb +59 -0
  12. data/lib/google/shopping/merchant/lfp/v1/lfp_merchant_state_service/client.rb +471 -0
  13. data/lib/google/shopping/merchant/lfp/v1/lfp_merchant_state_service/credentials.rb +49 -0
  14. data/lib/google/shopping/merchant/lfp/v1/lfp_merchant_state_service/paths.rb +52 -0
  15. data/lib/google/shopping/merchant/lfp/v1/lfp_merchant_state_service/rest/client.rb +438 -0
  16. data/lib/google/shopping/merchant/lfp/v1/lfp_merchant_state_service/rest/service_stub.rb +144 -0
  17. data/lib/google/shopping/merchant/lfp/v1/lfp_merchant_state_service/rest.rb +59 -0
  18. data/lib/google/shopping/merchant/lfp/v1/lfp_merchant_state_service.rb +62 -0
  19. data/lib/google/shopping/merchant/lfp/v1/lfp_sale_service/client.rb +469 -0
  20. data/lib/google/shopping/merchant/lfp/v1/lfp_sale_service/credentials.rb +49 -0
  21. data/lib/google/shopping/merchant/lfp/v1/lfp_sale_service/paths.rb +52 -0
  22. data/lib/google/shopping/merchant/lfp/v1/lfp_sale_service/rest/client.rb +436 -0
  23. data/lib/google/shopping/merchant/lfp/v1/lfp_sale_service/rest/service_stub.rb +145 -0
  24. data/lib/google/shopping/merchant/lfp/v1/lfp_sale_service/rest.rb +56 -0
  25. data/lib/google/shopping/merchant/lfp/v1/lfp_sale_service.rb +59 -0
  26. data/lib/google/shopping/merchant/lfp/v1/lfp_store_service/client.rb +771 -0
  27. data/lib/google/shopping/merchant/lfp/v1/lfp_store_service/credentials.rb +49 -0
  28. data/lib/google/shopping/merchant/lfp/v1/lfp_store_service/paths.rb +68 -0
  29. data/lib/google/shopping/merchant/lfp/v1/lfp_store_service/rest/client.rb +717 -0
  30. data/lib/google/shopping/merchant/lfp/v1/lfp_store_service/rest/service_stub.rb +328 -0
  31. data/lib/google/shopping/merchant/lfp/v1/lfp_store_service/rest.rb +56 -0
  32. data/lib/google/shopping/merchant/lfp/v1/lfp_store_service.rb +59 -0
  33. data/lib/google/shopping/merchant/lfp/v1/lfpinventory_pb.rb +54 -0
  34. data/lib/google/shopping/merchant/lfp/v1/lfpinventory_services_pb.rb +51 -0
  35. data/lib/google/shopping/merchant/lfp/v1/lfpmerchantstate_pb.rb +56 -0
  36. data/lib/google/shopping/merchant/lfp/v1/lfpmerchantstate_services_pb.rb +52 -0
  37. data/lib/google/shopping/merchant/lfp/v1/lfpsale_pb.rb +55 -0
  38. data/lib/google/shopping/merchant/lfp/v1/lfpsale_services_pb.rb +49 -0
  39. data/lib/google/shopping/merchant/lfp/v1/lfpstore_pb.rb +56 -0
  40. data/lib/google/shopping/merchant/lfp/v1/lfpstore_services_pb.rb +57 -0
  41. data/lib/google/shopping/merchant/lfp/v1/rest.rb +42 -0
  42. data/lib/google/shopping/merchant/lfp/v1/version.rb +7 -2
  43. data/lib/google/shopping/merchant/lfp/v1.rb +50 -0
  44. data/lib/google-shopping-merchant-lfp-v1.rb +21 -0
  45. data/proto_docs/README.md +4 -0
  46. data/proto_docs/google/api/client.rb +473 -0
  47. data/proto_docs/google/api/field_behavior.rb +85 -0
  48. data/proto_docs/google/api/field_info.rb +88 -0
  49. data/proto_docs/google/api/launch_stage.rb +71 -0
  50. data/proto_docs/google/api/resource.rb +227 -0
  51. data/proto_docs/google/protobuf/duration.rb +98 -0
  52. data/proto_docs/google/protobuf/empty.rb +34 -0
  53. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  54. data/proto_docs/google/shopping/merchant/lfp/v1/lfpinventory.rb +113 -0
  55. data/proto_docs/google/shopping/merchant/lfp/v1/lfpmerchantstate.rb +181 -0
  56. data/proto_docs/google/shopping/merchant/lfp/v1/lfpsale.rb +96 -0
  57. data/proto_docs/google/shopping/merchant/lfp/v1/lfpstore.rb +185 -0
  58. data/proto_docs/google/shopping/type/types.rb +210 -0
  59. metadata +117 -9
@@ -0,0 +1,717 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/shopping/merchant/lfp/v1/lfpstore_pb"
21
+ require "google/shopping/merchant/lfp/v1/lfp_store_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Shopping
25
+ module Merchant
26
+ module Lfp
27
+ module V1
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::V1::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::V1::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", "V1"]
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::V1::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::V1::LfpStoreService::Rest::Client.new
125
+ #
126
+ # # Create a client using a custom configuration
127
+ # client = ::Google::Shopping::Merchant::Lfp::V1::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::V1::LfpStoreService::Rest::ServiceStub.new(
158
+ endpoint: @config.endpoint,
159
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
160
+ universe_domain: @config.universe_domain,
161
+ credentials: credentials,
162
+ logger: @config.logger
163
+ )
164
+
165
+ @lfp_store_service_stub.logger(stub: true)&.info do |entry|
166
+ entry.set_system_name
167
+ entry.set_service
168
+ entry.message = "Created client for #{entry.service}"
169
+ entry.set_credentials_fields credentials
170
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
171
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
172
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
173
+ end
174
+ end
175
+
176
+ ##
177
+ # The logger used for request/response debug logging.
178
+ #
179
+ # @return [Logger]
180
+ #
181
+ def logger
182
+ @lfp_store_service_stub.logger
183
+ end
184
+
185
+ # Service calls
186
+
187
+ ##
188
+ # Retrieves information about a store.
189
+ #
190
+ # @overload get_lfp_store(request, options = nil)
191
+ # Pass arguments to `get_lfp_store` via a request object, either of type
192
+ # {::Google::Shopping::Merchant::Lfp::V1::GetLfpStoreRequest} or an equivalent Hash.
193
+ #
194
+ # @param request [::Google::Shopping::Merchant::Lfp::V1::GetLfpStoreRequest, ::Hash]
195
+ # A request object representing the call parameters. Required. To specify no
196
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
197
+ # @param options [::Gapic::CallOptions, ::Hash]
198
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
199
+ #
200
+ # @overload get_lfp_store(name: nil)
201
+ # Pass arguments to `get_lfp_store` via keyword arguments. Note that at
202
+ # least one keyword argument is required. To specify no parameters, or to keep all
203
+ # the default parameter values, pass an empty Hash as a request object (see above).
204
+ #
205
+ # @param name [::String]
206
+ # Required. The name of the store to retrieve.
207
+ # Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}`
208
+ # @yield [result, operation] Access the result along with the TransportOperation object
209
+ # @yieldparam result [::Google::Shopping::Merchant::Lfp::V1::LfpStore]
210
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
211
+ #
212
+ # @return [::Google::Shopping::Merchant::Lfp::V1::LfpStore]
213
+ #
214
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
215
+ #
216
+ # @example Basic example
217
+ # require "google/shopping/merchant/lfp/v1"
218
+ #
219
+ # # Create a client object. The client can be reused for multiple calls.
220
+ # client = Google::Shopping::Merchant::Lfp::V1::LfpStoreService::Rest::Client.new
221
+ #
222
+ # # Create a request. To set request fields, pass in keyword arguments.
223
+ # request = Google::Shopping::Merchant::Lfp::V1::GetLfpStoreRequest.new
224
+ #
225
+ # # Call the get_lfp_store method.
226
+ # result = client.get_lfp_store request
227
+ #
228
+ # # The returned object is of type Google::Shopping::Merchant::Lfp::V1::LfpStore.
229
+ # p result
230
+ #
231
+ def get_lfp_store request, options = nil
232
+ raise ::ArgumentError, "request must be provided" if request.nil?
233
+
234
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Lfp::V1::GetLfpStoreRequest
235
+
236
+ # Converts hash and nil to an options object
237
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
238
+
239
+ # Customize the options with defaults
240
+ call_metadata = @config.rpcs.get_lfp_store.metadata.to_h
241
+
242
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
243
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
244
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
245
+ gapic_version: ::Google::Shopping::Merchant::Lfp::V1::VERSION,
246
+ transports_version_send: [:rest]
247
+
248
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
249
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
250
+
251
+ options.apply_defaults timeout: @config.rpcs.get_lfp_store.timeout,
252
+ metadata: call_metadata,
253
+ retry_policy: @config.rpcs.get_lfp_store.retry_policy
254
+
255
+ options.apply_defaults timeout: @config.timeout,
256
+ metadata: @config.metadata,
257
+ retry_policy: @config.retry_policy
258
+
259
+ @lfp_store_service_stub.get_lfp_store request, options do |result, operation|
260
+ yield result, operation if block_given?
261
+ end
262
+ rescue ::Gapic::Rest::Error => e
263
+ raise ::Google::Cloud::Error.from_error(e)
264
+ end
265
+
266
+ ##
267
+ # Inserts a store for the target merchant. If the store with the same store
268
+ # code already exists, it will be replaced.
269
+ #
270
+ # @overload insert_lfp_store(request, options = nil)
271
+ # Pass arguments to `insert_lfp_store` via a request object, either of type
272
+ # {::Google::Shopping::Merchant::Lfp::V1::InsertLfpStoreRequest} or an equivalent Hash.
273
+ #
274
+ # @param request [::Google::Shopping::Merchant::Lfp::V1::InsertLfpStoreRequest, ::Hash]
275
+ # A request object representing the call parameters. Required. To specify no
276
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
277
+ # @param options [::Gapic::CallOptions, ::Hash]
278
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
279
+ #
280
+ # @overload insert_lfp_store(parent: nil, lfp_store: nil)
281
+ # Pass arguments to `insert_lfp_store` via keyword arguments. Note that at
282
+ # least one keyword argument is required. To specify no parameters, or to keep all
283
+ # the default parameter values, pass an empty Hash as a request object (see above).
284
+ #
285
+ # @param parent [::String]
286
+ # Required. The LFP provider account
287
+ # Format: `accounts/{account}`
288
+ # @param lfp_store [::Google::Shopping::Merchant::Lfp::V1::LfpStore, ::Hash]
289
+ # Required. The store to insert.
290
+ # @yield [result, operation] Access the result along with the TransportOperation object
291
+ # @yieldparam result [::Google::Shopping::Merchant::Lfp::V1::LfpStore]
292
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
293
+ #
294
+ # @return [::Google::Shopping::Merchant::Lfp::V1::LfpStore]
295
+ #
296
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
297
+ #
298
+ # @example Basic example
299
+ # require "google/shopping/merchant/lfp/v1"
300
+ #
301
+ # # Create a client object. The client can be reused for multiple calls.
302
+ # client = Google::Shopping::Merchant::Lfp::V1::LfpStoreService::Rest::Client.new
303
+ #
304
+ # # Create a request. To set request fields, pass in keyword arguments.
305
+ # request = Google::Shopping::Merchant::Lfp::V1::InsertLfpStoreRequest.new
306
+ #
307
+ # # Call the insert_lfp_store method.
308
+ # result = client.insert_lfp_store request
309
+ #
310
+ # # The returned object is of type Google::Shopping::Merchant::Lfp::V1::LfpStore.
311
+ # p result
312
+ #
313
+ def insert_lfp_store request, options = nil
314
+ raise ::ArgumentError, "request must be provided" if request.nil?
315
+
316
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Lfp::V1::InsertLfpStoreRequest
317
+
318
+ # Converts hash and nil to an options object
319
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
320
+
321
+ # Customize the options with defaults
322
+ call_metadata = @config.rpcs.insert_lfp_store.metadata.to_h
323
+
324
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
325
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
326
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
327
+ gapic_version: ::Google::Shopping::Merchant::Lfp::V1::VERSION,
328
+ transports_version_send: [:rest]
329
+
330
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
331
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
332
+
333
+ options.apply_defaults timeout: @config.rpcs.insert_lfp_store.timeout,
334
+ metadata: call_metadata,
335
+ retry_policy: @config.rpcs.insert_lfp_store.retry_policy
336
+
337
+ options.apply_defaults timeout: @config.timeout,
338
+ metadata: @config.metadata,
339
+ retry_policy: @config.retry_policy
340
+
341
+ @lfp_store_service_stub.insert_lfp_store request, options do |result, operation|
342
+ yield result, operation if block_given?
343
+ end
344
+ rescue ::Gapic::Rest::Error => e
345
+ raise ::Google::Cloud::Error.from_error(e)
346
+ end
347
+
348
+ ##
349
+ # Deletes a store for a target merchant.
350
+ #
351
+ # @overload delete_lfp_store(request, options = nil)
352
+ # Pass arguments to `delete_lfp_store` via a request object, either of type
353
+ # {::Google::Shopping::Merchant::Lfp::V1::DeleteLfpStoreRequest} or an equivalent Hash.
354
+ #
355
+ # @param request [::Google::Shopping::Merchant::Lfp::V1::DeleteLfpStoreRequest, ::Hash]
356
+ # A request object representing the call parameters. Required. To specify no
357
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
358
+ # @param options [::Gapic::CallOptions, ::Hash]
359
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
360
+ #
361
+ # @overload delete_lfp_store(name: nil)
362
+ # Pass arguments to `delete_lfp_store` via keyword arguments. Note that at
363
+ # least one keyword argument is required. To specify no parameters, or to keep all
364
+ # the default parameter values, pass an empty Hash as a request object (see above).
365
+ #
366
+ # @param name [::String]
367
+ # Required. The name of the store to delete for the target merchant account.
368
+ # Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}`
369
+ # @yield [result, operation] Access the result along with the TransportOperation object
370
+ # @yieldparam result [::Google::Protobuf::Empty]
371
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
372
+ #
373
+ # @return [::Google::Protobuf::Empty]
374
+ #
375
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
376
+ #
377
+ # @example Basic example
378
+ # require "google/shopping/merchant/lfp/v1"
379
+ #
380
+ # # Create a client object. The client can be reused for multiple calls.
381
+ # client = Google::Shopping::Merchant::Lfp::V1::LfpStoreService::Rest::Client.new
382
+ #
383
+ # # Create a request. To set request fields, pass in keyword arguments.
384
+ # request = Google::Shopping::Merchant::Lfp::V1::DeleteLfpStoreRequest.new
385
+ #
386
+ # # Call the delete_lfp_store method.
387
+ # result = client.delete_lfp_store request
388
+ #
389
+ # # The returned object is of type Google::Protobuf::Empty.
390
+ # p result
391
+ #
392
+ def delete_lfp_store request, options = nil
393
+ raise ::ArgumentError, "request must be provided" if request.nil?
394
+
395
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Lfp::V1::DeleteLfpStoreRequest
396
+
397
+ # Converts hash and nil to an options object
398
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
399
+
400
+ # Customize the options with defaults
401
+ call_metadata = @config.rpcs.delete_lfp_store.metadata.to_h
402
+
403
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
404
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
405
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
406
+ gapic_version: ::Google::Shopping::Merchant::Lfp::V1::VERSION,
407
+ transports_version_send: [:rest]
408
+
409
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
410
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
411
+
412
+ options.apply_defaults timeout: @config.rpcs.delete_lfp_store.timeout,
413
+ metadata: call_metadata,
414
+ retry_policy: @config.rpcs.delete_lfp_store.retry_policy
415
+
416
+ options.apply_defaults timeout: @config.timeout,
417
+ metadata: @config.metadata,
418
+ retry_policy: @config.retry_policy
419
+
420
+ @lfp_store_service_stub.delete_lfp_store request, options do |result, operation|
421
+ yield result, operation if block_given?
422
+ end
423
+ rescue ::Gapic::Rest::Error => e
424
+ raise ::Google::Cloud::Error.from_error(e)
425
+ end
426
+
427
+ ##
428
+ # Lists the stores of the target merchant, specified by the filter in
429
+ # `ListLfpStoresRequest`.
430
+ #
431
+ # @overload list_lfp_stores(request, options = nil)
432
+ # Pass arguments to `list_lfp_stores` via a request object, either of type
433
+ # {::Google::Shopping::Merchant::Lfp::V1::ListLfpStoresRequest} or an equivalent Hash.
434
+ #
435
+ # @param request [::Google::Shopping::Merchant::Lfp::V1::ListLfpStoresRequest, ::Hash]
436
+ # A request object representing the call parameters. Required. To specify no
437
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
438
+ # @param options [::Gapic::CallOptions, ::Hash]
439
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
440
+ #
441
+ # @overload list_lfp_stores(parent: nil, target_account: nil, page_size: nil, page_token: nil)
442
+ # Pass arguments to `list_lfp_stores` via keyword arguments. Note that at
443
+ # least one keyword argument is required. To specify no parameters, or to keep all
444
+ # the default parameter values, pass an empty Hash as a request object (see above).
445
+ #
446
+ # @param parent [::String]
447
+ # Required. The LFP partner.
448
+ # Format: `accounts/{account}`
449
+ # @param target_account [::Integer]
450
+ # Required. The Merchant Center id of the merchant to list stores for.
451
+ # @param page_size [::Integer]
452
+ # Optional. The maximum number of `LfpStore` resources for the given account
453
+ # to return. The service returns fewer than this value if the number of
454
+ # stores for the given account is less than the `pageSize`. The default value
455
+ # is 250. The maximum value is 1000; If a value higher than the maximum is
456
+ # specified, then the `pageSize` will default to the maximum.
457
+ # @param page_token [::String]
458
+ # Optional. A page token, received from a previous `ListLfpStoresRequest`
459
+ # call. Provide the page token to retrieve the subsequent page. When
460
+ # paginating, all other parameters provided to `ListLfpStoresRequest` must
461
+ # match the call that provided the page token. The token returned as
462
+ # {::Google::Shopping::Merchant::Lfp::V1::ListLfpStoresResponse#next_page_token nextPageToken}
463
+ # in the response to the previous request.
464
+ # @yield [result, operation] Access the result along with the TransportOperation object
465
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Shopping::Merchant::Lfp::V1::LfpStore>]
466
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
467
+ #
468
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Shopping::Merchant::Lfp::V1::LfpStore>]
469
+ #
470
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
471
+ #
472
+ # @example Basic example
473
+ # require "google/shopping/merchant/lfp/v1"
474
+ #
475
+ # # Create a client object. The client can be reused for multiple calls.
476
+ # client = Google::Shopping::Merchant::Lfp::V1::LfpStoreService::Rest::Client.new
477
+ #
478
+ # # Create a request. To set request fields, pass in keyword arguments.
479
+ # request = Google::Shopping::Merchant::Lfp::V1::ListLfpStoresRequest.new
480
+ #
481
+ # # Call the list_lfp_stores method.
482
+ # result = client.list_lfp_stores request
483
+ #
484
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
485
+ # # over elements, and API calls will be issued to fetch pages as needed.
486
+ # result.each do |item|
487
+ # # Each element is of type ::Google::Shopping::Merchant::Lfp::V1::LfpStore.
488
+ # p item
489
+ # end
490
+ #
491
+ def list_lfp_stores request, options = nil
492
+ raise ::ArgumentError, "request must be provided" if request.nil?
493
+
494
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Lfp::V1::ListLfpStoresRequest
495
+
496
+ # Converts hash and nil to an options object
497
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
498
+
499
+ # Customize the options with defaults
500
+ call_metadata = @config.rpcs.list_lfp_stores.metadata.to_h
501
+
502
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
503
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
504
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
505
+ gapic_version: ::Google::Shopping::Merchant::Lfp::V1::VERSION,
506
+ transports_version_send: [:rest]
507
+
508
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
509
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
510
+
511
+ options.apply_defaults timeout: @config.rpcs.list_lfp_stores.timeout,
512
+ metadata: call_metadata,
513
+ retry_policy: @config.rpcs.list_lfp_stores.retry_policy
514
+
515
+ options.apply_defaults timeout: @config.timeout,
516
+ metadata: @config.metadata,
517
+ retry_policy: @config.retry_policy
518
+
519
+ @lfp_store_service_stub.list_lfp_stores request, options do |result, operation|
520
+ result = ::Gapic::Rest::PagedEnumerable.new @lfp_store_service_stub, :list_lfp_stores, "lfp_stores", request, result, options
521
+ yield result, operation if block_given?
522
+ throw :response, result
523
+ end
524
+ rescue ::Gapic::Rest::Error => e
525
+ raise ::Google::Cloud::Error.from_error(e)
526
+ end
527
+
528
+ ##
529
+ # Configuration class for the LfpStoreService REST API.
530
+ #
531
+ # This class represents the configuration for LfpStoreService REST,
532
+ # providing control over timeouts, retry behavior, logging, transport
533
+ # parameters, and other low-level controls. Certain parameters can also be
534
+ # applied individually to specific RPCs. See
535
+ # {::Google::Shopping::Merchant::Lfp::V1::LfpStoreService::Rest::Client::Configuration::Rpcs}
536
+ # for a list of RPCs that can be configured independently.
537
+ #
538
+ # Configuration can be applied globally to all clients, or to a single client
539
+ # on construction.
540
+ #
541
+ # @example
542
+ #
543
+ # # Modify the global config, setting the timeout for
544
+ # # get_lfp_store to 20 seconds,
545
+ # # and all remaining timeouts to 10 seconds.
546
+ # ::Google::Shopping::Merchant::Lfp::V1::LfpStoreService::Rest::Client.configure do |config|
547
+ # config.timeout = 10.0
548
+ # config.rpcs.get_lfp_store.timeout = 20.0
549
+ # end
550
+ #
551
+ # # Apply the above configuration only to a new client.
552
+ # client = ::Google::Shopping::Merchant::Lfp::V1::LfpStoreService::Rest::Client.new do |config|
553
+ # config.timeout = 10.0
554
+ # config.rpcs.get_lfp_store.timeout = 20.0
555
+ # end
556
+ #
557
+ # @!attribute [rw] endpoint
558
+ # A custom service endpoint, as a hostname or hostname:port. The default is
559
+ # nil, indicating to use the default endpoint in the current universe domain.
560
+ # @return [::String,nil]
561
+ # @!attribute [rw] credentials
562
+ # Credentials to send with calls. You may provide any of the following types:
563
+ # * (`String`) The path to a service account key file in JSON format
564
+ # * (`Hash`) A service account key as a Hash
565
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
566
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
567
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
568
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
569
+ # * (`nil`) indicating no credentials
570
+ #
571
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
572
+ # external source for authentication to Google Cloud, you must validate it before
573
+ # providing it to a Google API client library. Providing an unvalidated credential
574
+ # configuration to Google APIs can compromise the security of your systems and data.
575
+ # For more information, refer to [Validate credential configurations from external
576
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
577
+ # @return [::Object]
578
+ # @!attribute [rw] scope
579
+ # The OAuth scopes
580
+ # @return [::Array<::String>]
581
+ # @!attribute [rw] lib_name
582
+ # The library name as recorded in instrumentation and logging
583
+ # @return [::String]
584
+ # @!attribute [rw] lib_version
585
+ # The library version as recorded in instrumentation and logging
586
+ # @return [::String]
587
+ # @!attribute [rw] timeout
588
+ # The call timeout in seconds.
589
+ # @return [::Numeric]
590
+ # @!attribute [rw] metadata
591
+ # Additional headers to be sent with the call.
592
+ # @return [::Hash{::Symbol=>::String}]
593
+ # @!attribute [rw] retry_policy
594
+ # The retry policy. The value is a hash with the following keys:
595
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
596
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
597
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
598
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
599
+ # trigger a retry.
600
+ # @return [::Hash]
601
+ # @!attribute [rw] quota_project
602
+ # A separate project against which to charge quota.
603
+ # @return [::String]
604
+ # @!attribute [rw] universe_domain
605
+ # The universe domain within which to make requests. This determines the
606
+ # default endpoint URL. The default value of nil uses the environment
607
+ # universe (usually the default "googleapis.com" universe).
608
+ # @return [::String,nil]
609
+ # @!attribute [rw] logger
610
+ # A custom logger to use for request/response debug logging, or the value
611
+ # `:default` (the default) to construct a default logger, or `nil` to
612
+ # explicitly disable logging.
613
+ # @return [::Logger,:default,nil]
614
+ #
615
+ class Configuration
616
+ extend ::Gapic::Config
617
+
618
+ # @private
619
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
620
+ DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
621
+
622
+ config_attr :endpoint, nil, ::String, nil
623
+ config_attr :credentials, nil do |value|
624
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
625
+ allowed.any? { |klass| klass === value }
626
+ end
627
+ config_attr :scope, nil, ::String, ::Array, nil
628
+ config_attr :lib_name, nil, ::String, nil
629
+ config_attr :lib_version, nil, ::String, nil
630
+ config_attr :timeout, nil, ::Numeric, nil
631
+ config_attr :metadata, nil, ::Hash, nil
632
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
633
+ config_attr :quota_project, nil, ::String, nil
634
+ config_attr :universe_domain, nil, ::String, nil
635
+ config_attr :logger, :default, ::Logger, nil, :default
636
+
637
+ # @private
638
+ def initialize parent_config = nil
639
+ @parent_config = parent_config unless parent_config.nil?
640
+
641
+ yield self if block_given?
642
+ end
643
+
644
+ ##
645
+ # Configurations for individual RPCs
646
+ # @return [Rpcs]
647
+ #
648
+ def rpcs
649
+ @rpcs ||= begin
650
+ parent_rpcs = nil
651
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
652
+ Rpcs.new parent_rpcs
653
+ end
654
+ end
655
+
656
+ ##
657
+ # Configuration RPC class for the LfpStoreService API.
658
+ #
659
+ # Includes fields providing the configuration for each RPC in this service.
660
+ # Each configuration object is of type `Gapic::Config::Method` and includes
661
+ # the following configuration fields:
662
+ #
663
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
664
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
665
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
666
+ # include the following keys:
667
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
668
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
669
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
670
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
671
+ # trigger a retry.
672
+ #
673
+ class Rpcs
674
+ ##
675
+ # RPC-specific configuration for `get_lfp_store`
676
+ # @return [::Gapic::Config::Method]
677
+ #
678
+ attr_reader :get_lfp_store
679
+ ##
680
+ # RPC-specific configuration for `insert_lfp_store`
681
+ # @return [::Gapic::Config::Method]
682
+ #
683
+ attr_reader :insert_lfp_store
684
+ ##
685
+ # RPC-specific configuration for `delete_lfp_store`
686
+ # @return [::Gapic::Config::Method]
687
+ #
688
+ attr_reader :delete_lfp_store
689
+ ##
690
+ # RPC-specific configuration for `list_lfp_stores`
691
+ # @return [::Gapic::Config::Method]
692
+ #
693
+ attr_reader :list_lfp_stores
694
+
695
+ # @private
696
+ def initialize parent_rpcs = nil
697
+ get_lfp_store_config = parent_rpcs.get_lfp_store if parent_rpcs.respond_to? :get_lfp_store
698
+ @get_lfp_store = ::Gapic::Config::Method.new get_lfp_store_config
699
+ insert_lfp_store_config = parent_rpcs.insert_lfp_store if parent_rpcs.respond_to? :insert_lfp_store
700
+ @insert_lfp_store = ::Gapic::Config::Method.new insert_lfp_store_config
701
+ delete_lfp_store_config = parent_rpcs.delete_lfp_store if parent_rpcs.respond_to? :delete_lfp_store
702
+ @delete_lfp_store = ::Gapic::Config::Method.new delete_lfp_store_config
703
+ list_lfp_stores_config = parent_rpcs.list_lfp_stores if parent_rpcs.respond_to? :list_lfp_stores
704
+ @list_lfp_stores = ::Gapic::Config::Method.new list_lfp_stores_config
705
+
706
+ yield self if block_given?
707
+ end
708
+ end
709
+ end
710
+ end
711
+ end
712
+ end
713
+ end
714
+ end
715
+ end
716
+ end
717
+ end