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,435 @@
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/lfpinventory_pb"
21
+
22
+ module Google
23
+ module Shopping
24
+ module Merchant
25
+ module Lfp
26
+ module V1beta
27
+ module LfpInventoryService
28
+ ##
29
+ # Client for the LfpInventoryService service.
30
+ #
31
+ # Service for a [LFP
32
+ # partner](https://support.google.com/merchants/answer/7676652) to submit local
33
+ # inventories for a merchant.
34
+ #
35
+ class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "merchantapi.$UNIVERSE_DOMAIN$"
38
+
39
+ include Paths
40
+
41
+ # @private
42
+ attr_reader :lfp_inventory_service_stub
43
+
44
+ ##
45
+ # Configure the LfpInventoryService Client class.
46
+ #
47
+ # See {::Google::Shopping::Merchant::Lfp::V1beta::LfpInventoryService::Client::Configuration}
48
+ # for a description of the configuration fields.
49
+ #
50
+ # @example
51
+ #
52
+ # # Modify the configuration for all LfpInventoryService clients
53
+ # ::Google::Shopping::Merchant::Lfp::V1beta::LfpInventoryService::Client.configure do |config|
54
+ # config.timeout = 10.0
55
+ # end
56
+ #
57
+ # @yield [config] Configure the Client client.
58
+ # @yieldparam config [Client::Configuration]
59
+ #
60
+ # @return [Client::Configuration]
61
+ #
62
+ def self.configure
63
+ @configure ||= begin
64
+ namespace = ["Google", "Shopping", "Merchant", "Lfp", "V1beta"]
65
+ parent_config = while namespace.any?
66
+ parent_name = namespace.join "::"
67
+ parent_const = const_get parent_name
68
+ break parent_const.configure if parent_const.respond_to? :configure
69
+ namespace.pop
70
+ end
71
+ default_config = Client::Configuration.new parent_config
72
+
73
+ default_config.timeout = 60.0
74
+ default_config.retry_policy = {
75
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
76
+ }
77
+
78
+ default_config
79
+ end
80
+ yield @configure if block_given?
81
+ @configure
82
+ end
83
+
84
+ ##
85
+ # Configure the LfpInventoryService Client instance.
86
+ #
87
+ # The configuration is set to the derived mode, meaning that values can be changed,
88
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
89
+ # should be made on {Client.configure}.
90
+ #
91
+ # See {::Google::Shopping::Merchant::Lfp::V1beta::LfpInventoryService::Client::Configuration}
92
+ # for a description of the configuration fields.
93
+ #
94
+ # @yield [config] Configure the Client client.
95
+ # @yieldparam config [Client::Configuration]
96
+ #
97
+ # @return [Client::Configuration]
98
+ #
99
+ def configure
100
+ yield @config if block_given?
101
+ @config
102
+ end
103
+
104
+ ##
105
+ # The effective universe domain
106
+ #
107
+ # @return [String]
108
+ #
109
+ def universe_domain
110
+ @lfp_inventory_service_stub.universe_domain
111
+ end
112
+
113
+ ##
114
+ # Create a new LfpInventoryService client object.
115
+ #
116
+ # @example
117
+ #
118
+ # # Create a client using the default configuration
119
+ # client = ::Google::Shopping::Merchant::Lfp::V1beta::LfpInventoryService::Client.new
120
+ #
121
+ # # Create a client using a custom configuration
122
+ # client = ::Google::Shopping::Merchant::Lfp::V1beta::LfpInventoryService::Client.new do |config|
123
+ # config.timeout = 10.0
124
+ # end
125
+ #
126
+ # @yield [config] Configure the LfpInventoryService client.
127
+ # @yieldparam config [Client::Configuration]
128
+ #
129
+ def initialize
130
+ # These require statements are intentionally placed here to initialize
131
+ # the gRPC module only when it's required.
132
+ # See https://github.com/googleapis/toolkit/issues/446
133
+ require "gapic/grpc"
134
+ require "google/shopping/merchant/lfp/v1beta/lfpinventory_services_pb"
135
+
136
+ # Create the configuration object
137
+ @config = Configuration.new Client.configure
138
+
139
+ # Yield the configuration if needed
140
+ yield @config if block_given?
141
+
142
+ # Create credentials
143
+ credentials = @config.credentials
144
+ # Use self-signed JWT if the endpoint is unchanged from default,
145
+ # but only if the default endpoint does not have a region prefix.
146
+ enable_self_signed_jwt = @config.endpoint.nil? ||
147
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
148
+ !@config.endpoint.split(".").first.include?("-"))
149
+ credentials ||= Credentials.default scope: @config.scope,
150
+ enable_self_signed_jwt: enable_self_signed_jwt
151
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
152
+ credentials = Credentials.new credentials, scope: @config.scope
153
+ end
154
+ @quota_project_id = @config.quota_project
155
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
156
+
157
+ @lfp_inventory_service_stub = ::Gapic::ServiceStub.new(
158
+ ::Google::Shopping::Merchant::Lfp::V1beta::LfpInventoryService::Stub,
159
+ credentials: credentials,
160
+ endpoint: @config.endpoint,
161
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
162
+ universe_domain: @config.universe_domain,
163
+ channel_args: @config.channel_args,
164
+ interceptors: @config.interceptors,
165
+ channel_pool_config: @config.channel_pool
166
+ )
167
+ end
168
+
169
+ # Service calls
170
+
171
+ ##
172
+ # Inserts a `LfpInventory` resource for the given target merchant account. If
173
+ # the resource already exists, it will be replaced. The inventory
174
+ # automatically expires after 30 days.
175
+ #
176
+ # @overload insert_lfp_inventory(request, options = nil)
177
+ # Pass arguments to `insert_lfp_inventory` via a request object, either of type
178
+ # {::Google::Shopping::Merchant::Lfp::V1beta::InsertLfpInventoryRequest} or an equivalent Hash.
179
+ #
180
+ # @param request [::Google::Shopping::Merchant::Lfp::V1beta::InsertLfpInventoryRequest, ::Hash]
181
+ # A request object representing the call parameters. Required. To specify no
182
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
183
+ # @param options [::Gapic::CallOptions, ::Hash]
184
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
185
+ #
186
+ # @overload insert_lfp_inventory(parent: nil, lfp_inventory: nil)
187
+ # Pass arguments to `insert_lfp_inventory` via keyword arguments. Note that at
188
+ # least one keyword argument is required. To specify no parameters, or to keep all
189
+ # the default parameter values, pass an empty Hash as a request object (see above).
190
+ #
191
+ # @param parent [::String]
192
+ # Required. The LFP provider account.
193
+ # Format: `accounts/{account}`
194
+ # @param lfp_inventory [::Google::Shopping::Merchant::Lfp::V1beta::LfpInventory, ::Hash]
195
+ # Required. The inventory to insert.
196
+ #
197
+ # @yield [response, operation] Access the result along with the RPC operation
198
+ # @yieldparam response [::Google::Shopping::Merchant::Lfp::V1beta::LfpInventory]
199
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
200
+ #
201
+ # @return [::Google::Shopping::Merchant::Lfp::V1beta::LfpInventory]
202
+ #
203
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
204
+ #
205
+ # @example Basic example
206
+ # require "google/shopping/merchant/lfp/v1beta"
207
+ #
208
+ # # Create a client object. The client can be reused for multiple calls.
209
+ # client = Google::Shopping::Merchant::Lfp::V1beta::LfpInventoryService::Client.new
210
+ #
211
+ # # Create a request. To set request fields, pass in keyword arguments.
212
+ # request = Google::Shopping::Merchant::Lfp::V1beta::InsertLfpInventoryRequest.new
213
+ #
214
+ # # Call the insert_lfp_inventory method.
215
+ # result = client.insert_lfp_inventory request
216
+ #
217
+ # # The returned object is of type Google::Shopping::Merchant::Lfp::V1beta::LfpInventory.
218
+ # p result
219
+ #
220
+ def insert_lfp_inventory request, options = nil
221
+ raise ::ArgumentError, "request must be provided" if request.nil?
222
+
223
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Lfp::V1beta::InsertLfpInventoryRequest
224
+
225
+ # Converts hash and nil to an options object
226
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
227
+
228
+ # Customize the options with defaults
229
+ metadata = @config.rpcs.insert_lfp_inventory.metadata.to_h
230
+
231
+ # Set x-goog-api-client and x-goog-user-project headers
232
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
233
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
234
+ gapic_version: ::Google::Shopping::Merchant::Lfp::V1beta::VERSION
235
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
236
+
237
+ header_params = {}
238
+ if request.parent
239
+ header_params["parent"] = request.parent
240
+ end
241
+
242
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
243
+ metadata[:"x-goog-request-params"] ||= request_params_header
244
+
245
+ options.apply_defaults timeout: @config.rpcs.insert_lfp_inventory.timeout,
246
+ metadata: metadata,
247
+ retry_policy: @config.rpcs.insert_lfp_inventory.retry_policy
248
+
249
+ options.apply_defaults timeout: @config.timeout,
250
+ metadata: @config.metadata,
251
+ retry_policy: @config.retry_policy
252
+
253
+ @lfp_inventory_service_stub.call_rpc :insert_lfp_inventory, request, options: options do |response, operation|
254
+ yield response, operation if block_given?
255
+ return response
256
+ end
257
+ rescue ::GRPC::BadStatus => e
258
+ raise ::Google::Cloud::Error.from_error(e)
259
+ end
260
+
261
+ ##
262
+ # Configuration class for the LfpInventoryService API.
263
+ #
264
+ # This class represents the configuration for LfpInventoryService,
265
+ # providing control over timeouts, retry behavior, logging, transport
266
+ # parameters, and other low-level controls. Certain parameters can also be
267
+ # applied individually to specific RPCs. See
268
+ # {::Google::Shopping::Merchant::Lfp::V1beta::LfpInventoryService::Client::Configuration::Rpcs}
269
+ # for a list of RPCs that can be configured independently.
270
+ #
271
+ # Configuration can be applied globally to all clients, or to a single client
272
+ # on construction.
273
+ #
274
+ # @example
275
+ #
276
+ # # Modify the global config, setting the timeout for
277
+ # # insert_lfp_inventory to 20 seconds,
278
+ # # and all remaining timeouts to 10 seconds.
279
+ # ::Google::Shopping::Merchant::Lfp::V1beta::LfpInventoryService::Client.configure do |config|
280
+ # config.timeout = 10.0
281
+ # config.rpcs.insert_lfp_inventory.timeout = 20.0
282
+ # end
283
+ #
284
+ # # Apply the above configuration only to a new client.
285
+ # client = ::Google::Shopping::Merchant::Lfp::V1beta::LfpInventoryService::Client.new do |config|
286
+ # config.timeout = 10.0
287
+ # config.rpcs.insert_lfp_inventory.timeout = 20.0
288
+ # end
289
+ #
290
+ # @!attribute [rw] endpoint
291
+ # A custom service endpoint, as a hostname or hostname:port. The default is
292
+ # nil, indicating to use the default endpoint in the current universe domain.
293
+ # @return [::String,nil]
294
+ # @!attribute [rw] credentials
295
+ # Credentials to send with calls. You may provide any of the following types:
296
+ # * (`String`) The path to a service account key file in JSON format
297
+ # * (`Hash`) A service account key as a Hash
298
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
299
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
300
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
301
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
302
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
303
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
304
+ # * (`nil`) indicating no credentials
305
+ # @return [::Object]
306
+ # @!attribute [rw] scope
307
+ # The OAuth scopes
308
+ # @return [::Array<::String>]
309
+ # @!attribute [rw] lib_name
310
+ # The library name as recorded in instrumentation and logging
311
+ # @return [::String]
312
+ # @!attribute [rw] lib_version
313
+ # The library version as recorded in instrumentation and logging
314
+ # @return [::String]
315
+ # @!attribute [rw] channel_args
316
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
317
+ # `GRPC::Core::Channel` object is provided as the credential.
318
+ # @return [::Hash]
319
+ # @!attribute [rw] interceptors
320
+ # An array of interceptors that are run before calls are executed.
321
+ # @return [::Array<::GRPC::ClientInterceptor>]
322
+ # @!attribute [rw] timeout
323
+ # The call timeout in seconds.
324
+ # @return [::Numeric]
325
+ # @!attribute [rw] metadata
326
+ # Additional gRPC headers to be sent with the call.
327
+ # @return [::Hash{::Symbol=>::String}]
328
+ # @!attribute [rw] retry_policy
329
+ # The retry policy. The value is a hash with the following keys:
330
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
331
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
332
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
333
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
334
+ # trigger a retry.
335
+ # @return [::Hash]
336
+ # @!attribute [rw] quota_project
337
+ # A separate project against which to charge quota.
338
+ # @return [::String]
339
+ # @!attribute [rw] universe_domain
340
+ # The universe domain within which to make requests. This determines the
341
+ # default endpoint URL. The default value of nil uses the environment
342
+ # universe (usually the default "googleapis.com" universe).
343
+ # @return [::String,nil]
344
+ #
345
+ class Configuration
346
+ extend ::Gapic::Config
347
+
348
+ # @private
349
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
350
+ DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
351
+
352
+ config_attr :endpoint, nil, ::String, nil
353
+ config_attr :credentials, nil do |value|
354
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
355
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
356
+ allowed.any? { |klass| klass === value }
357
+ end
358
+ config_attr :scope, nil, ::String, ::Array, nil
359
+ config_attr :lib_name, nil, ::String, nil
360
+ config_attr :lib_version, nil, ::String, nil
361
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
362
+ config_attr :interceptors, nil, ::Array, nil
363
+ config_attr :timeout, nil, ::Numeric, nil
364
+ config_attr :metadata, nil, ::Hash, nil
365
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
366
+ config_attr :quota_project, nil, ::String, nil
367
+ config_attr :universe_domain, nil, ::String, nil
368
+
369
+ # @private
370
+ def initialize parent_config = nil
371
+ @parent_config = parent_config unless parent_config.nil?
372
+
373
+ yield self if block_given?
374
+ end
375
+
376
+ ##
377
+ # Configurations for individual RPCs
378
+ # @return [Rpcs]
379
+ #
380
+ def rpcs
381
+ @rpcs ||= begin
382
+ parent_rpcs = nil
383
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
384
+ Rpcs.new parent_rpcs
385
+ end
386
+ end
387
+
388
+ ##
389
+ # Configuration for the channel pool
390
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
391
+ #
392
+ def channel_pool
393
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
394
+ end
395
+
396
+ ##
397
+ # Configuration RPC class for the LfpInventoryService API.
398
+ #
399
+ # Includes fields providing the configuration for each RPC in this service.
400
+ # Each configuration object is of type `Gapic::Config::Method` and includes
401
+ # the following configuration fields:
402
+ #
403
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
404
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
405
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
406
+ # include the following keys:
407
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
408
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
409
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
410
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
411
+ # trigger a retry.
412
+ #
413
+ class Rpcs
414
+ ##
415
+ # RPC-specific configuration for `insert_lfp_inventory`
416
+ # @return [::Gapic::Config::Method]
417
+ #
418
+ attr_reader :insert_lfp_inventory
419
+
420
+ # @private
421
+ def initialize parent_rpcs = nil
422
+ insert_lfp_inventory_config = parent_rpcs.insert_lfp_inventory if parent_rpcs.respond_to? :insert_lfp_inventory
423
+ @insert_lfp_inventory = ::Gapic::Config::Method.new insert_lfp_inventory_config
424
+
425
+ yield self if block_given?
426
+ end
427
+ end
428
+ end
429
+ end
430
+ end
431
+ end
432
+ end
433
+ end
434
+ end
435
+ end
@@ -0,0 +1,49 @@
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 "googleauth"
20
+
21
+ module Google
22
+ module Shopping
23
+ module Merchant
24
+ module Lfp
25
+ module V1beta
26
+ module LfpInventoryService
27
+ # Credentials for the LfpInventoryService API.
28
+ class Credentials < ::Google::Auth::Credentials
29
+ self.scope = [
30
+ "https://www.googleapis.com/auth/content"
31
+ ]
32
+ self.env_vars = [
33
+ "GOOGLE_CLOUD_CREDENTIALS",
34
+ "GOOGLE_CLOUD_KEYFILE",
35
+ "GCLOUD_KEYFILE",
36
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
37
+ "GOOGLE_CLOUD_KEYFILE_JSON",
38
+ "GCLOUD_KEYFILE_JSON"
39
+ ]
40
+ self.paths = [
41
+ "~/.config/google_cloud/application_default_credentials.json"
42
+ ]
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,70 @@
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
+
20
+ module Google
21
+ module Shopping
22
+ module Merchant
23
+ module Lfp
24
+ module V1beta
25
+ module LfpInventoryService
26
+ # Path helper methods for the LfpInventoryService API.
27
+ module Paths
28
+ ##
29
+ # Create a fully-qualified Account resource string.
30
+ #
31
+ # The resource will be in the following format:
32
+ #
33
+ # `accounts/{account}`
34
+ #
35
+ # @param account [String]
36
+ #
37
+ # @return [::String]
38
+ def account_path account:
39
+ "accounts/#{account}"
40
+ end
41
+
42
+ ##
43
+ # Create a fully-qualified LfpInventory resource string.
44
+ #
45
+ # The resource will be in the following format:
46
+ #
47
+ # `accounts/{account}/lfpInventories/{target_merchant}~{store_code}~{offer}`
48
+ #
49
+ # @param account [String]
50
+ # @param target_merchant [String]
51
+ # @param store_code [String]
52
+ # @param offer [String]
53
+ #
54
+ # @return [::String]
55
+ def lfp_inventory_path account:, target_merchant:, store_code:, offer:
56
+ raise ::ArgumentError, "account cannot contain /" if account.to_s.include? "/"
57
+ raise ::ArgumentError, "target_merchant cannot contain /" if target_merchant.to_s.include? "/"
58
+ raise ::ArgumentError, "store_code cannot contain /" if store_code.to_s.include? "/"
59
+
60
+ "accounts/#{account}/lfpInventories/#{target_merchant}~#{store_code}~#{offer}"
61
+ end
62
+
63
+ extend self
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end