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

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