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,438 @@
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/lfpmerchantstate_pb"
21
+ require "google/shopping/merchant/lfp/v1/lfp_merchant_state_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Shopping
25
+ module Merchant
26
+ module Lfp
27
+ module V1
28
+ module LfpMerchantStateService
29
+ module Rest
30
+ ##
31
+ # REST client for the LfpMerchantStateService service.
32
+ #
33
+ # Service for a [LFP
34
+ # partner](https://support.google.com/merchants/answer/7676652) to get the
35
+ # state of a merchant.
36
+ #
37
+ # For information about onboarding a retailer, see [How to onboard a
38
+ # retailer](https://support.google.com/merchants/answer/15243706).
39
+ #
40
+ class Client
41
+ # @private
42
+ API_VERSION = ""
43
+
44
+ # @private
45
+ DEFAULT_ENDPOINT_TEMPLATE = "merchantapi.$UNIVERSE_DOMAIN$"
46
+
47
+ include Paths
48
+
49
+ # @private
50
+ attr_reader :lfp_merchant_state_service_stub
51
+
52
+ ##
53
+ # Configure the LfpMerchantStateService Client class.
54
+ #
55
+ # See {::Google::Shopping::Merchant::Lfp::V1::LfpMerchantStateService::Rest::Client::Configuration}
56
+ # for a description of the configuration fields.
57
+ #
58
+ # @example
59
+ #
60
+ # # Modify the configuration for all LfpMerchantStateService clients
61
+ # ::Google::Shopping::Merchant::Lfp::V1::LfpMerchantStateService::Rest::Client.configure do |config|
62
+ # config.timeout = 10.0
63
+ # end
64
+ #
65
+ # @yield [config] Configure the Client client.
66
+ # @yieldparam config [Client::Configuration]
67
+ #
68
+ # @return [Client::Configuration]
69
+ #
70
+ def self.configure
71
+ @configure ||= begin
72
+ namespace = ["Google", "Shopping", "Merchant", "Lfp", "V1"]
73
+ parent_config = while namespace.any?
74
+ parent_name = namespace.join "::"
75
+ parent_const = const_get parent_name
76
+ break parent_const.configure if parent_const.respond_to? :configure
77
+ namespace.pop
78
+ end
79
+ default_config = Client::Configuration.new parent_config
80
+
81
+ default_config.timeout = 60.0
82
+ default_config.retry_policy = {
83
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
84
+ }
85
+
86
+ default_config
87
+ end
88
+ yield @configure if block_given?
89
+ @configure
90
+ end
91
+
92
+ ##
93
+ # Configure the LfpMerchantStateService Client instance.
94
+ #
95
+ # The configuration is set to the derived mode, meaning that values can be changed,
96
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
97
+ # should be made on {Client.configure}.
98
+ #
99
+ # See {::Google::Shopping::Merchant::Lfp::V1::LfpMerchantStateService::Rest::Client::Configuration}
100
+ # for a description of the configuration fields.
101
+ #
102
+ # @yield [config] Configure the Client client.
103
+ # @yieldparam config [Client::Configuration]
104
+ #
105
+ # @return [Client::Configuration]
106
+ #
107
+ def configure
108
+ yield @config if block_given?
109
+ @config
110
+ end
111
+
112
+ ##
113
+ # The effective universe domain
114
+ #
115
+ # @return [String]
116
+ #
117
+ def universe_domain
118
+ @lfp_merchant_state_service_stub.universe_domain
119
+ end
120
+
121
+ ##
122
+ # Create a new LfpMerchantStateService REST client object.
123
+ #
124
+ # @example
125
+ #
126
+ # # Create a client using the default configuration
127
+ # client = ::Google::Shopping::Merchant::Lfp::V1::LfpMerchantStateService::Rest::Client.new
128
+ #
129
+ # # Create a client using a custom configuration
130
+ # client = ::Google::Shopping::Merchant::Lfp::V1::LfpMerchantStateService::Rest::Client.new do |config|
131
+ # config.timeout = 10.0
132
+ # end
133
+ #
134
+ # @yield [config] Configure the LfpMerchantStateService client.
135
+ # @yieldparam config [Client::Configuration]
136
+ #
137
+ def initialize
138
+ # Create the configuration object
139
+ @config = Configuration.new Client.configure
140
+
141
+ # Yield the configuration if needed
142
+ yield @config if block_given?
143
+
144
+ # Create credentials
145
+ credentials = @config.credentials
146
+ # Use self-signed JWT if the endpoint is unchanged from default,
147
+ # but only if the default endpoint does not have a region prefix.
148
+ enable_self_signed_jwt = @config.endpoint.nil? ||
149
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
150
+ !@config.endpoint.split(".").first.include?("-"))
151
+ credentials ||= Credentials.default scope: @config.scope,
152
+ enable_self_signed_jwt: enable_self_signed_jwt
153
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
154
+ credentials = Credentials.new credentials, scope: @config.scope
155
+ end
156
+
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_merchant_state_service_stub = ::Google::Shopping::Merchant::Lfp::V1::LfpMerchantStateService::Rest::ServiceStub.new(
161
+ endpoint: @config.endpoint,
162
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
163
+ universe_domain: @config.universe_domain,
164
+ credentials: credentials,
165
+ logger: @config.logger
166
+ )
167
+
168
+ @lfp_merchant_state_service_stub.logger(stub: true)&.info do |entry|
169
+ entry.set_system_name
170
+ entry.set_service
171
+ entry.message = "Created client for #{entry.service}"
172
+ entry.set_credentials_fields credentials
173
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
174
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
175
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
176
+ end
177
+ end
178
+
179
+ ##
180
+ # The logger used for request/response debug logging.
181
+ #
182
+ # @return [Logger]
183
+ #
184
+ def logger
185
+ @lfp_merchant_state_service_stub.logger
186
+ end
187
+
188
+ # Service calls
189
+
190
+ ##
191
+ # Gets the LFP state of a merchant
192
+ #
193
+ # @overload get_lfp_merchant_state(request, options = nil)
194
+ # Pass arguments to `get_lfp_merchant_state` via a request object, either of type
195
+ # {::Google::Shopping::Merchant::Lfp::V1::GetLfpMerchantStateRequest} or an equivalent Hash.
196
+ #
197
+ # @param request [::Google::Shopping::Merchant::Lfp::V1::GetLfpMerchantStateRequest, ::Hash]
198
+ # A request object representing the call parameters. Required. To specify no
199
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
200
+ # @param options [::Gapic::CallOptions, ::Hash]
201
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
202
+ #
203
+ # @overload get_lfp_merchant_state(name: nil)
204
+ # Pass arguments to `get_lfp_merchant_state` via keyword arguments. Note that at
205
+ # least one keyword argument is required. To specify no parameters, or to keep all
206
+ # the default parameter values, pass an empty Hash as a request object (see above).
207
+ #
208
+ # @param name [::String]
209
+ # Required. The name of the state to retrieve.
210
+ # Format: `accounts/{account}/lfpMerchantStates/{target_merchant}`. For
211
+ # example, `accounts/123456/lfpMerchantStates/567890`.
212
+ # @yield [result, operation] Access the result along with the TransportOperation object
213
+ # @yieldparam result [::Google::Shopping::Merchant::Lfp::V1::LfpMerchantState]
214
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
215
+ #
216
+ # @return [::Google::Shopping::Merchant::Lfp::V1::LfpMerchantState]
217
+ #
218
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
219
+ #
220
+ # @example Basic example
221
+ # require "google/shopping/merchant/lfp/v1"
222
+ #
223
+ # # Create a client object. The client can be reused for multiple calls.
224
+ # client = Google::Shopping::Merchant::Lfp::V1::LfpMerchantStateService::Rest::Client.new
225
+ #
226
+ # # Create a request. To set request fields, pass in keyword arguments.
227
+ # request = Google::Shopping::Merchant::Lfp::V1::GetLfpMerchantStateRequest.new
228
+ #
229
+ # # Call the get_lfp_merchant_state method.
230
+ # result = client.get_lfp_merchant_state request
231
+ #
232
+ # # The returned object is of type Google::Shopping::Merchant::Lfp::V1::LfpMerchantState.
233
+ # p result
234
+ #
235
+ def get_lfp_merchant_state request, options = nil
236
+ raise ::ArgumentError, "request must be provided" if request.nil?
237
+
238
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Lfp::V1::GetLfpMerchantStateRequest
239
+
240
+ # Converts hash and nil to an options object
241
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
242
+
243
+ # Customize the options with defaults
244
+ call_metadata = @config.rpcs.get_lfp_merchant_state.metadata.to_h
245
+
246
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
247
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
248
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
249
+ gapic_version: ::Google::Shopping::Merchant::Lfp::V1::VERSION,
250
+ transports_version_send: [:rest]
251
+
252
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
253
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
254
+
255
+ options.apply_defaults timeout: @config.rpcs.get_lfp_merchant_state.timeout,
256
+ metadata: call_metadata,
257
+ retry_policy: @config.rpcs.get_lfp_merchant_state.retry_policy
258
+
259
+ options.apply_defaults timeout: @config.timeout,
260
+ metadata: @config.metadata,
261
+ retry_policy: @config.retry_policy
262
+
263
+ @lfp_merchant_state_service_stub.get_lfp_merchant_state request, options do |result, operation|
264
+ yield result, operation if block_given?
265
+ end
266
+ rescue ::Gapic::Rest::Error => e
267
+ raise ::Google::Cloud::Error.from_error(e)
268
+ end
269
+
270
+ ##
271
+ # Configuration class for the LfpMerchantStateService REST API.
272
+ #
273
+ # This class represents the configuration for LfpMerchantStateService REST,
274
+ # providing control over timeouts, retry behavior, logging, transport
275
+ # parameters, and other low-level controls. Certain parameters can also be
276
+ # applied individually to specific RPCs. See
277
+ # {::Google::Shopping::Merchant::Lfp::V1::LfpMerchantStateService::Rest::Client::Configuration::Rpcs}
278
+ # for a list of RPCs that can be configured independently.
279
+ #
280
+ # Configuration can be applied globally to all clients, or to a single client
281
+ # on construction.
282
+ #
283
+ # @example
284
+ #
285
+ # # Modify the global config, setting the timeout for
286
+ # # get_lfp_merchant_state to 20 seconds,
287
+ # # and all remaining timeouts to 10 seconds.
288
+ # ::Google::Shopping::Merchant::Lfp::V1::LfpMerchantStateService::Rest::Client.configure do |config|
289
+ # config.timeout = 10.0
290
+ # config.rpcs.get_lfp_merchant_state.timeout = 20.0
291
+ # end
292
+ #
293
+ # # Apply the above configuration only to a new client.
294
+ # client = ::Google::Shopping::Merchant::Lfp::V1::LfpMerchantStateService::Rest::Client.new do |config|
295
+ # config.timeout = 10.0
296
+ # config.rpcs.get_lfp_merchant_state.timeout = 20.0
297
+ # end
298
+ #
299
+ # @!attribute [rw] endpoint
300
+ # A custom service endpoint, as a hostname or hostname:port. The default is
301
+ # nil, indicating to use the default endpoint in the current universe domain.
302
+ # @return [::String,nil]
303
+ # @!attribute [rw] credentials
304
+ # Credentials to send with calls. You may provide any of the following types:
305
+ # * (`String`) The path to a service account key file in JSON format
306
+ # * (`Hash`) A service account key as a Hash
307
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
308
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
309
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
310
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
311
+ # * (`nil`) indicating no credentials
312
+ #
313
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
314
+ # external source for authentication to Google Cloud, you must validate it before
315
+ # providing it to a Google API client library. Providing an unvalidated credential
316
+ # configuration to Google APIs can compromise the security of your systems and data.
317
+ # For more information, refer to [Validate credential configurations from external
318
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
319
+ # @return [::Object]
320
+ # @!attribute [rw] scope
321
+ # The OAuth scopes
322
+ # @return [::Array<::String>]
323
+ # @!attribute [rw] lib_name
324
+ # The library name as recorded in instrumentation and logging
325
+ # @return [::String]
326
+ # @!attribute [rw] lib_version
327
+ # The library version as recorded in instrumentation and logging
328
+ # @return [::String]
329
+ # @!attribute [rw] timeout
330
+ # The call timeout in seconds.
331
+ # @return [::Numeric]
332
+ # @!attribute [rw] metadata
333
+ # Additional headers to be sent with the call.
334
+ # @return [::Hash{::Symbol=>::String}]
335
+ # @!attribute [rw] retry_policy
336
+ # The retry policy. The value is a hash with the following keys:
337
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
338
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
339
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
340
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
341
+ # trigger a retry.
342
+ # @return [::Hash]
343
+ # @!attribute [rw] quota_project
344
+ # A separate project against which to charge quota.
345
+ # @return [::String]
346
+ # @!attribute [rw] universe_domain
347
+ # The universe domain within which to make requests. This determines the
348
+ # default endpoint URL. The default value of nil uses the environment
349
+ # universe (usually the default "googleapis.com" universe).
350
+ # @return [::String,nil]
351
+ # @!attribute [rw] logger
352
+ # A custom logger to use for request/response debug logging, or the value
353
+ # `:default` (the default) to construct a default logger, or `nil` to
354
+ # explicitly disable logging.
355
+ # @return [::Logger,:default,nil]
356
+ #
357
+ class Configuration
358
+ extend ::Gapic::Config
359
+
360
+ # @private
361
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
362
+ DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
363
+
364
+ config_attr :endpoint, nil, ::String, nil
365
+ config_attr :credentials, nil do |value|
366
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
367
+ allowed.any? { |klass| klass === value }
368
+ end
369
+ config_attr :scope, nil, ::String, ::Array, nil
370
+ config_attr :lib_name, nil, ::String, nil
371
+ config_attr :lib_version, nil, ::String, nil
372
+ config_attr :timeout, nil, ::Numeric, nil
373
+ config_attr :metadata, nil, ::Hash, nil
374
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
375
+ config_attr :quota_project, nil, ::String, nil
376
+ config_attr :universe_domain, nil, ::String, nil
377
+ config_attr :logger, :default, ::Logger, nil, :default
378
+
379
+ # @private
380
+ def initialize parent_config = nil
381
+ @parent_config = parent_config unless parent_config.nil?
382
+
383
+ yield self if block_given?
384
+ end
385
+
386
+ ##
387
+ # Configurations for individual RPCs
388
+ # @return [Rpcs]
389
+ #
390
+ def rpcs
391
+ @rpcs ||= begin
392
+ parent_rpcs = nil
393
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
394
+ Rpcs.new parent_rpcs
395
+ end
396
+ end
397
+
398
+ ##
399
+ # Configuration RPC class for the LfpMerchantStateService API.
400
+ #
401
+ # Includes fields providing the configuration for each RPC in this service.
402
+ # Each configuration object is of type `Gapic::Config::Method` and includes
403
+ # the following configuration fields:
404
+ #
405
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
406
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
407
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
408
+ # include the following keys:
409
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
410
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
411
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
412
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
413
+ # trigger a retry.
414
+ #
415
+ class Rpcs
416
+ ##
417
+ # RPC-specific configuration for `get_lfp_merchant_state`
418
+ # @return [::Gapic::Config::Method]
419
+ #
420
+ attr_reader :get_lfp_merchant_state
421
+
422
+ # @private
423
+ def initialize parent_rpcs = nil
424
+ get_lfp_merchant_state_config = parent_rpcs.get_lfp_merchant_state if parent_rpcs.respond_to? :get_lfp_merchant_state
425
+ @get_lfp_merchant_state = ::Gapic::Config::Method.new get_lfp_merchant_state_config
426
+
427
+ yield self if block_given?
428
+ end
429
+ end
430
+ end
431
+ end
432
+ end
433
+ end
434
+ end
435
+ end
436
+ end
437
+ end
438
+ end
@@ -0,0 +1,144 @@
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/shopping/merchant/lfp/v1/lfpmerchantstate_pb"
20
+
21
+ module Google
22
+ module Shopping
23
+ module Merchant
24
+ module Lfp
25
+ module V1
26
+ module LfpMerchantStateService
27
+ module Rest
28
+ ##
29
+ # REST service stub for the LfpMerchantStateService service.
30
+ # Service stub contains baseline method implementations
31
+ # including transcoding, making the REST call, and deserialing the response.
32
+ #
33
+ class ServiceStub
34
+ # @private
35
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
36
+ # These require statements are intentionally placed here to initialize
37
+ # the REST modules only when it's required.
38
+ require "gapic/rest"
39
+
40
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
41
+ endpoint_template: endpoint_template,
42
+ universe_domain: universe_domain,
43
+ credentials: credentials,
44
+ numeric_enums: true,
45
+ service_name: self.class,
46
+ raise_faraday_errors: false,
47
+ logger: logger
48
+ end
49
+
50
+ ##
51
+ # The effective universe domain
52
+ #
53
+ # @return [String]
54
+ #
55
+ def universe_domain
56
+ @client_stub.universe_domain
57
+ end
58
+
59
+ ##
60
+ # The effective endpoint
61
+ #
62
+ # @return [String]
63
+ #
64
+ def endpoint
65
+ @client_stub.endpoint
66
+ end
67
+
68
+ ##
69
+ # The logger used for request/response debug logging.
70
+ #
71
+ # @return [Logger]
72
+ #
73
+ def logger stub: false
74
+ stub ? @client_stub.stub_logger : @client_stub.logger
75
+ end
76
+
77
+ ##
78
+ # Baseline implementation for the get_lfp_merchant_state REST call
79
+ #
80
+ # @param request_pb [::Google::Shopping::Merchant::Lfp::V1::GetLfpMerchantStateRequest]
81
+ # A request object representing the call parameters. Required.
82
+ # @param options [::Gapic::CallOptions]
83
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
84
+ #
85
+ # @yield [result, operation] Access the result along with the TransportOperation object
86
+ # @yieldparam result [::Google::Shopping::Merchant::Lfp::V1::LfpMerchantState]
87
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
88
+ #
89
+ # @return [::Google::Shopping::Merchant::Lfp::V1::LfpMerchantState]
90
+ # A result object deserialized from the server's reply
91
+ def get_lfp_merchant_state request_pb, options = nil
92
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
93
+
94
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_lfp_merchant_state_request request_pb
95
+ query_string_params = if query_string_params.any?
96
+ query_string_params.to_h { |p| p.split "=", 2 }
97
+ else
98
+ {}
99
+ end
100
+
101
+ response = @client_stub.make_http_request(
102
+ verb,
103
+ uri: uri,
104
+ body: body || "",
105
+ params: query_string_params,
106
+ method_name: "get_lfp_merchant_state",
107
+ options: options
108
+ )
109
+ operation = ::Gapic::Rest::TransportOperation.new response
110
+ result = ::Google::Shopping::Merchant::Lfp::V1::LfpMerchantState.decode_json response.body, ignore_unknown_fields: true
111
+ catch :response do
112
+ yield result, operation if block_given?
113
+ result
114
+ end
115
+ end
116
+
117
+ ##
118
+ # @private
119
+ #
120
+ # GRPC transcoding helper method for the get_lfp_merchant_state REST call
121
+ #
122
+ # @param request_pb [::Google::Shopping::Merchant::Lfp::V1::GetLfpMerchantStateRequest]
123
+ # A request object representing the call parameters. Required.
124
+ # @return [Array(String, [String, nil], Hash{String => String})]
125
+ # Uri, Body, Query string parameters
126
+ def self.transcode_get_lfp_merchant_state_request request_pb
127
+ transcoder = Gapic::Rest::GrpcTranscoder.new
128
+ .with_bindings(
129
+ uri_method: :get,
130
+ uri_template: "/lfp/v1/{name}",
131
+ matches: [
132
+ ["name", %r{^accounts/[^/]+/lfpMerchantStates/[^/]+/?$}, false]
133
+ ]
134
+ )
135
+ transcoder.transcode request_pb
136
+ end
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
142
+ end
143
+ end
144
+ end
@@ -0,0 +1,59 @@
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 "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/shopping/merchant/lfp/v1/version"
24
+
25
+ require "google/shopping/merchant/lfp/v1/lfp_merchant_state_service/credentials"
26
+ require "google/shopping/merchant/lfp/v1/lfp_merchant_state_service/paths"
27
+ require "google/shopping/merchant/lfp/v1/lfp_merchant_state_service/rest/client"
28
+
29
+ module Google
30
+ module Shopping
31
+ module Merchant
32
+ module Lfp
33
+ module V1
34
+ ##
35
+ # Service for a [LFP
36
+ # partner](https://support.google.com/merchants/answer/7676652) to get the
37
+ # state of a merchant.
38
+ #
39
+ # For information about onboarding a retailer, see [How to onboard a
40
+ # retailer](https://support.google.com/merchants/answer/15243706).
41
+ #
42
+ # To load this service and instantiate a REST client:
43
+ #
44
+ # require "google/shopping/merchant/lfp/v1/lfp_merchant_state_service/rest"
45
+ # client = ::Google::Shopping::Merchant::Lfp::V1::LfpMerchantStateService::Rest::Client.new
46
+ #
47
+ module LfpMerchantStateService
48
+ # Client for the REST transport
49
+ module Rest
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
57
+
58
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
59
+ require "google/shopping/merchant/lfp/v1/lfp_merchant_state_service/rest/helpers" if ::File.file? helper_path