google-shopping-merchant-inventories-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 (39) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +149 -0
  4. data/README.md +144 -8
  5. data/lib/google/shopping/merchant/inventories/v1beta/local_inventory_service/client.rb +634 -0
  6. data/lib/google/shopping/merchant/inventories/v1beta/local_inventory_service/credentials.rb +49 -0
  7. data/lib/google/shopping/merchant/inventories/v1beta/local_inventory_service/paths.rb +54 -0
  8. data/lib/google/shopping/merchant/inventories/v1beta/local_inventory_service/rest/client.rb +584 -0
  9. data/lib/google/shopping/merchant/inventories/v1beta/local_inventory_service/rest/service_stub.rb +228 -0
  10. data/lib/google/shopping/merchant/inventories/v1beta/local_inventory_service/rest.rb +54 -0
  11. data/lib/google/shopping/merchant/inventories/v1beta/local_inventory_service.rb +57 -0
  12. data/lib/google/shopping/merchant/inventories/v1beta/localinventory_pb.rb +58 -0
  13. data/lib/google/shopping/merchant/inventories/v1beta/localinventory_services_pb.rb +68 -0
  14. data/lib/google/shopping/merchant/inventories/v1beta/regional_inventory_service/client.rb +634 -0
  15. data/lib/google/shopping/merchant/inventories/v1beta/regional_inventory_service/credentials.rb +49 -0
  16. data/lib/google/shopping/merchant/inventories/v1beta/regional_inventory_service/paths.rb +54 -0
  17. data/lib/google/shopping/merchant/inventories/v1beta/regional_inventory_service/rest/client.rb +584 -0
  18. data/lib/google/shopping/merchant/inventories/v1beta/regional_inventory_service/rest/service_stub.rb +228 -0
  19. data/lib/google/shopping/merchant/inventories/v1beta/regional_inventory_service/rest.rb +55 -0
  20. data/lib/google/shopping/merchant/inventories/v1beta/regional_inventory_service.rb +58 -0
  21. data/lib/google/shopping/merchant/inventories/v1beta/regionalinventory_pb.rb +58 -0
  22. data/lib/google/shopping/merchant/inventories/v1beta/regionalinventory_services_pb.rb +69 -0
  23. data/lib/google/shopping/merchant/inventories/v1beta/rest.rb +40 -0
  24. data/lib/google/shopping/merchant/inventories/v1beta/version.rb +7 -2
  25. data/lib/google/shopping/merchant/inventories/v1beta.rb +48 -0
  26. data/lib/google-shopping-merchant-inventories-v1beta.rb +21 -0
  27. data/proto_docs/README.md +4 -0
  28. data/proto_docs/google/api/client.rb +381 -0
  29. data/proto_docs/google/api/field_behavior.rb +85 -0
  30. data/proto_docs/google/api/launch_stage.rb +71 -0
  31. data/proto_docs/google/api/resource.rb +222 -0
  32. data/proto_docs/google/protobuf/duration.rb +98 -0
  33. data/proto_docs/google/protobuf/empty.rb +34 -0
  34. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  35. data/proto_docs/google/shopping/merchant/inventories/v1beta/localinventory.rb +163 -0
  36. data/proto_docs/google/shopping/merchant/inventories/v1beta/regionalinventory.rb +142 -0
  37. data/proto_docs/google/shopping/type/types.rb +175 -0
  38. data/proto_docs/google/type/interval.rb +45 -0
  39. metadata +212 -12
@@ -0,0 +1,584 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/inventories/v1beta/localinventory_pb"
21
+ require "google/shopping/merchant/inventories/v1beta/local_inventory_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Shopping
25
+ module Merchant
26
+ module Inventories
27
+ module V1beta
28
+ module LocalInventoryService
29
+ module Rest
30
+ ##
31
+ # REST client for the LocalInventoryService service.
32
+ #
33
+ # Service to manage local inventory for products
34
+ #
35
+ class Client
36
+ include Paths
37
+
38
+ # @private
39
+ attr_reader :local_inventory_service_stub
40
+
41
+ ##
42
+ # Configure the LocalInventoryService Client class.
43
+ #
44
+ # See {::Google::Shopping::Merchant::Inventories::V1beta::LocalInventoryService::Rest::Client::Configuration}
45
+ # for a description of the configuration fields.
46
+ #
47
+ # @example
48
+ #
49
+ # # Modify the configuration for all LocalInventoryService clients
50
+ # ::Google::Shopping::Merchant::Inventories::V1beta::LocalInventoryService::Rest::Client.configure do |config|
51
+ # config.timeout = 10.0
52
+ # end
53
+ #
54
+ # @yield [config] Configure the Client client.
55
+ # @yieldparam config [Client::Configuration]
56
+ #
57
+ # @return [Client::Configuration]
58
+ #
59
+ def self.configure
60
+ @configure ||= begin
61
+ namespace = ["Google", "Shopping", "Merchant", "Inventories", "V1beta"]
62
+ parent_config = while namespace.any?
63
+ parent_name = namespace.join "::"
64
+ parent_const = const_get parent_name
65
+ break parent_const.configure if parent_const.respond_to? :configure
66
+ namespace.pop
67
+ end
68
+ default_config = Client::Configuration.new parent_config
69
+
70
+ default_config.timeout = 60.0
71
+ default_config.retry_policy = {
72
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
73
+ }
74
+
75
+ default_config
76
+ end
77
+ yield @configure if block_given?
78
+ @configure
79
+ end
80
+
81
+ ##
82
+ # Configure the LocalInventoryService Client instance.
83
+ #
84
+ # The configuration is set to the derived mode, meaning that values can be changed,
85
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
86
+ # should be made on {Client.configure}.
87
+ #
88
+ # See {::Google::Shopping::Merchant::Inventories::V1beta::LocalInventoryService::Rest::Client::Configuration}
89
+ # for a description of the configuration fields.
90
+ #
91
+ # @yield [config] Configure the Client client.
92
+ # @yieldparam config [Client::Configuration]
93
+ #
94
+ # @return [Client::Configuration]
95
+ #
96
+ def configure
97
+ yield @config if block_given?
98
+ @config
99
+ end
100
+
101
+ ##
102
+ # Create a new LocalInventoryService REST client object.
103
+ #
104
+ # @example
105
+ #
106
+ # # Create a client using the default configuration
107
+ # client = ::Google::Shopping::Merchant::Inventories::V1beta::LocalInventoryService::Rest::Client.new
108
+ #
109
+ # # Create a client using a custom configuration
110
+ # client = ::Google::Shopping::Merchant::Inventories::V1beta::LocalInventoryService::Rest::Client.new do |config|
111
+ # config.timeout = 10.0
112
+ # end
113
+ #
114
+ # @yield [config] Configure the LocalInventoryService client.
115
+ # @yieldparam config [Client::Configuration]
116
+ #
117
+ def initialize
118
+ # Create the configuration object
119
+ @config = Configuration.new Client.configure
120
+
121
+ # Yield the configuration if needed
122
+ yield @config if block_given?
123
+
124
+ # Create credentials
125
+ credentials = @config.credentials
126
+ # Use self-signed JWT if the endpoint is unchanged from default,
127
+ # but only if the default endpoint does not have a region prefix.
128
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
129
+ !@config.endpoint.split(".").first.include?("-")
130
+ credentials ||= Credentials.default scope: @config.scope,
131
+ enable_self_signed_jwt: enable_self_signed_jwt
132
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
133
+ credentials = Credentials.new credentials, scope: @config.scope
134
+ end
135
+
136
+ @quota_project_id = @config.quota_project
137
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
138
+
139
+ @local_inventory_service_stub = ::Google::Shopping::Merchant::Inventories::V1beta::LocalInventoryService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
140
+ end
141
+
142
+ # Service calls
143
+
144
+ ##
145
+ # Lists the `LocalInventory` resources for the given product in your merchant
146
+ # account. The response might contain fewer items than specified by
147
+ # `pageSize`. If `pageToken` was returned in previous request, it can be used
148
+ # to obtain additional results.
149
+ #
150
+ # `LocalInventory` resources are listed per product for a given account.
151
+ #
152
+ # @overload list_local_inventories(request, options = nil)
153
+ # Pass arguments to `list_local_inventories` via a request object, either of type
154
+ # {::Google::Shopping::Merchant::Inventories::V1beta::ListLocalInventoriesRequest} or an equivalent Hash.
155
+ #
156
+ # @param request [::Google::Shopping::Merchant::Inventories::V1beta::ListLocalInventoriesRequest, ::Hash]
157
+ # A request object representing the call parameters. Required. To specify no
158
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
159
+ # @param options [::Gapic::CallOptions, ::Hash]
160
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
161
+ #
162
+ # @overload list_local_inventories(parent: nil, page_size: nil, page_token: nil)
163
+ # Pass arguments to `list_local_inventories` via keyword arguments. Note that at
164
+ # least one keyword argument is required. To specify no parameters, or to keep all
165
+ # the default parameter values, pass an empty Hash as a request object (see above).
166
+ #
167
+ # @param parent [::String]
168
+ # Required. The `name` of the parent product to list local inventories for.
169
+ # Format:
170
+ # `accounts/{account}/products/{product}`
171
+ # @param page_size [::Integer]
172
+ # The maximum number of `LocalInventory` resources for the given
173
+ # product to return. The service returns fewer than this value if the number
174
+ # of inventories for the given product is less that than the `pageSize`. The
175
+ # default value is 25000. The maximum value is 25000; If a value higher than
176
+ # the maximum is specified, then the `pageSize` will default to the maximum
177
+ # @param page_token [::String]
178
+ # A page token, received from a previous `ListLocalInventories` call.
179
+ # Provide the page token to retrieve the subsequent page.
180
+ #
181
+ # When paginating, all other parameters provided to `ListLocalInventories`
182
+ # must match the call that provided the page token. The token returned as
183
+ # {::Google::Shopping::Merchant::Inventories::V1beta::ListLocalInventoriesResponse#next_page_token nextPageToken}
184
+ # in the response to the previous request.
185
+ # @yield [result, operation] Access the result along with the TransportOperation object
186
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Shopping::Merchant::Inventories::V1beta::LocalInventory>]
187
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
188
+ #
189
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Shopping::Merchant::Inventories::V1beta::LocalInventory>]
190
+ #
191
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
192
+ #
193
+ # @example Basic example
194
+ # require "google/shopping/merchant/inventories/v1beta"
195
+ #
196
+ # # Create a client object. The client can be reused for multiple calls.
197
+ # client = Google::Shopping::Merchant::Inventories::V1beta::LocalInventoryService::Rest::Client.new
198
+ #
199
+ # # Create a request. To set request fields, pass in keyword arguments.
200
+ # request = Google::Shopping::Merchant::Inventories::V1beta::ListLocalInventoriesRequest.new
201
+ #
202
+ # # Call the list_local_inventories method.
203
+ # result = client.list_local_inventories request
204
+ #
205
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
206
+ # # over elements, and API calls will be issued to fetch pages as needed.
207
+ # result.each do |item|
208
+ # # Each element is of type ::Google::Shopping::Merchant::Inventories::V1beta::LocalInventory.
209
+ # p item
210
+ # end
211
+ #
212
+ def list_local_inventories request, options = nil
213
+ raise ::ArgumentError, "request must be provided" if request.nil?
214
+
215
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Inventories::V1beta::ListLocalInventoriesRequest
216
+
217
+ # Converts hash and nil to an options object
218
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
219
+
220
+ # Customize the options with defaults
221
+ call_metadata = @config.rpcs.list_local_inventories.metadata.to_h
222
+
223
+ # Set x-goog-api-client and x-goog-user-project headers
224
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
225
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
226
+ gapic_version: ::Google::Shopping::Merchant::Inventories::V1beta::VERSION,
227
+ transports_version_send: [:rest]
228
+
229
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
230
+
231
+ options.apply_defaults timeout: @config.rpcs.list_local_inventories.timeout,
232
+ metadata: call_metadata,
233
+ retry_policy: @config.rpcs.list_local_inventories.retry_policy
234
+
235
+ options.apply_defaults timeout: @config.timeout,
236
+ metadata: @config.metadata,
237
+ retry_policy: @config.retry_policy
238
+
239
+ @local_inventory_service_stub.list_local_inventories request, options do |result, operation|
240
+ result = ::Gapic::Rest::PagedEnumerable.new @local_inventory_service_stub, :list_local_inventories, "local_inventories", request, result, options
241
+ yield result, operation if block_given?
242
+ return result
243
+ end
244
+ rescue ::Gapic::Rest::Error => e
245
+ raise ::Google::Cloud::Error.from_error(e)
246
+ end
247
+
248
+ ##
249
+ # Inserts a `LocalInventory` resource to a product in your merchant
250
+ # account.
251
+ #
252
+ # Replaces the full `LocalInventory` resource if an entry with the same
253
+ # {::Google::Shopping::Merchant::Inventories::V1beta::LocalInventory#store_code `storeCode`}
254
+ # already exists for the product.
255
+ #
256
+ # It might take up to 30 minutes for the new or updated `LocalInventory`
257
+ # resource to appear in products.
258
+ #
259
+ # @overload insert_local_inventory(request, options = nil)
260
+ # Pass arguments to `insert_local_inventory` via a request object, either of type
261
+ # {::Google::Shopping::Merchant::Inventories::V1beta::InsertLocalInventoryRequest} or an equivalent Hash.
262
+ #
263
+ # @param request [::Google::Shopping::Merchant::Inventories::V1beta::InsertLocalInventoryRequest, ::Hash]
264
+ # A request object representing the call parameters. Required. To specify no
265
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
266
+ # @param options [::Gapic::CallOptions, ::Hash]
267
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
268
+ #
269
+ # @overload insert_local_inventory(parent: nil, local_inventory: nil)
270
+ # Pass arguments to `insert_local_inventory` via keyword arguments. Note that at
271
+ # least one keyword argument is required. To specify no parameters, or to keep all
272
+ # the default parameter values, pass an empty Hash as a request object (see above).
273
+ #
274
+ # @param parent [::String]
275
+ # Required. The account and product where this inventory will be inserted.
276
+ # Format: `accounts/{account}/products/{product}`
277
+ # @param local_inventory [::Google::Shopping::Merchant::Inventories::V1beta::LocalInventory, ::Hash]
278
+ # Required. Local inventory information of the product. If the product
279
+ # already has a `LocalInventory` resource for the same `storeCode`, full
280
+ # replacement of the `LocalInventory` resource is performed.
281
+ # @yield [result, operation] Access the result along with the TransportOperation object
282
+ # @yieldparam result [::Google::Shopping::Merchant::Inventories::V1beta::LocalInventory]
283
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
284
+ #
285
+ # @return [::Google::Shopping::Merchant::Inventories::V1beta::LocalInventory]
286
+ #
287
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
288
+ #
289
+ # @example Basic example
290
+ # require "google/shopping/merchant/inventories/v1beta"
291
+ #
292
+ # # Create a client object. The client can be reused for multiple calls.
293
+ # client = Google::Shopping::Merchant::Inventories::V1beta::LocalInventoryService::Rest::Client.new
294
+ #
295
+ # # Create a request. To set request fields, pass in keyword arguments.
296
+ # request = Google::Shopping::Merchant::Inventories::V1beta::InsertLocalInventoryRequest.new
297
+ #
298
+ # # Call the insert_local_inventory method.
299
+ # result = client.insert_local_inventory request
300
+ #
301
+ # # The returned object is of type Google::Shopping::Merchant::Inventories::V1beta::LocalInventory.
302
+ # p result
303
+ #
304
+ def insert_local_inventory request, options = nil
305
+ raise ::ArgumentError, "request must be provided" if request.nil?
306
+
307
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Inventories::V1beta::InsertLocalInventoryRequest
308
+
309
+ # Converts hash and nil to an options object
310
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
311
+
312
+ # Customize the options with defaults
313
+ call_metadata = @config.rpcs.insert_local_inventory.metadata.to_h
314
+
315
+ # Set x-goog-api-client and x-goog-user-project headers
316
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
317
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
318
+ gapic_version: ::Google::Shopping::Merchant::Inventories::V1beta::VERSION,
319
+ transports_version_send: [:rest]
320
+
321
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
322
+
323
+ options.apply_defaults timeout: @config.rpcs.insert_local_inventory.timeout,
324
+ metadata: call_metadata,
325
+ retry_policy: @config.rpcs.insert_local_inventory.retry_policy
326
+
327
+ options.apply_defaults timeout: @config.timeout,
328
+ metadata: @config.metadata,
329
+ retry_policy: @config.retry_policy
330
+
331
+ @local_inventory_service_stub.insert_local_inventory request, options do |result, operation|
332
+ yield result, operation if block_given?
333
+ return result
334
+ end
335
+ rescue ::Gapic::Rest::Error => e
336
+ raise ::Google::Cloud::Error.from_error(e)
337
+ end
338
+
339
+ ##
340
+ # Deletes the specified `LocalInventory` from the given product in your
341
+ # merchant account. It might take a up to an hour for the
342
+ # `LocalInventory` to be deleted from the specific product.
343
+ # Once you have received a successful delete response, wait for that
344
+ # period before attempting a delete again.
345
+ #
346
+ # @overload delete_local_inventory(request, options = nil)
347
+ # Pass arguments to `delete_local_inventory` via a request object, either of type
348
+ # {::Google::Shopping::Merchant::Inventories::V1beta::DeleteLocalInventoryRequest} or an equivalent Hash.
349
+ #
350
+ # @param request [::Google::Shopping::Merchant::Inventories::V1beta::DeleteLocalInventoryRequest, ::Hash]
351
+ # A request object representing the call parameters. Required. To specify no
352
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
353
+ # @param options [::Gapic::CallOptions, ::Hash]
354
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
355
+ #
356
+ # @overload delete_local_inventory(name: nil)
357
+ # Pass arguments to `delete_local_inventory` via keyword arguments. Note that at
358
+ # least one keyword argument is required. To specify no parameters, or to keep all
359
+ # the default parameter values, pass an empty Hash as a request object (see above).
360
+ #
361
+ # @param name [::String]
362
+ # Required. The name of the local inventory for the given product to delete.
363
+ # Format:
364
+ # `accounts/{account}/products/{product}/localInventories/{store_code}`
365
+ # @yield [result, operation] Access the result along with the TransportOperation object
366
+ # @yieldparam result [::Google::Protobuf::Empty]
367
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
368
+ #
369
+ # @return [::Google::Protobuf::Empty]
370
+ #
371
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
372
+ #
373
+ # @example Basic example
374
+ # require "google/shopping/merchant/inventories/v1beta"
375
+ #
376
+ # # Create a client object. The client can be reused for multiple calls.
377
+ # client = Google::Shopping::Merchant::Inventories::V1beta::LocalInventoryService::Rest::Client.new
378
+ #
379
+ # # Create a request. To set request fields, pass in keyword arguments.
380
+ # request = Google::Shopping::Merchant::Inventories::V1beta::DeleteLocalInventoryRequest.new
381
+ #
382
+ # # Call the delete_local_inventory method.
383
+ # result = client.delete_local_inventory request
384
+ #
385
+ # # The returned object is of type Google::Protobuf::Empty.
386
+ # p result
387
+ #
388
+ def delete_local_inventory request, options = nil
389
+ raise ::ArgumentError, "request must be provided" if request.nil?
390
+
391
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Inventories::V1beta::DeleteLocalInventoryRequest
392
+
393
+ # Converts hash and nil to an options object
394
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
395
+
396
+ # Customize the options with defaults
397
+ call_metadata = @config.rpcs.delete_local_inventory.metadata.to_h
398
+
399
+ # Set x-goog-api-client and x-goog-user-project headers
400
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
401
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
402
+ gapic_version: ::Google::Shopping::Merchant::Inventories::V1beta::VERSION,
403
+ transports_version_send: [:rest]
404
+
405
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
406
+
407
+ options.apply_defaults timeout: @config.rpcs.delete_local_inventory.timeout,
408
+ metadata: call_metadata,
409
+ retry_policy: @config.rpcs.delete_local_inventory.retry_policy
410
+
411
+ options.apply_defaults timeout: @config.timeout,
412
+ metadata: @config.metadata,
413
+ retry_policy: @config.retry_policy
414
+
415
+ @local_inventory_service_stub.delete_local_inventory request, options do |result, operation|
416
+ yield result, operation if block_given?
417
+ return result
418
+ end
419
+ rescue ::Gapic::Rest::Error => e
420
+ raise ::Google::Cloud::Error.from_error(e)
421
+ end
422
+
423
+ ##
424
+ # Configuration class for the LocalInventoryService REST API.
425
+ #
426
+ # This class represents the configuration for LocalInventoryService REST,
427
+ # providing control over timeouts, retry behavior, logging, transport
428
+ # parameters, and other low-level controls. Certain parameters can also be
429
+ # applied individually to specific RPCs. See
430
+ # {::Google::Shopping::Merchant::Inventories::V1beta::LocalInventoryService::Rest::Client::Configuration::Rpcs}
431
+ # for a list of RPCs that can be configured independently.
432
+ #
433
+ # Configuration can be applied globally to all clients, or to a single client
434
+ # on construction.
435
+ #
436
+ # @example
437
+ #
438
+ # # Modify the global config, setting the timeout for
439
+ # # list_local_inventories to 20 seconds,
440
+ # # and all remaining timeouts to 10 seconds.
441
+ # ::Google::Shopping::Merchant::Inventories::V1beta::LocalInventoryService::Rest::Client.configure do |config|
442
+ # config.timeout = 10.0
443
+ # config.rpcs.list_local_inventories.timeout = 20.0
444
+ # end
445
+ #
446
+ # # Apply the above configuration only to a new client.
447
+ # client = ::Google::Shopping::Merchant::Inventories::V1beta::LocalInventoryService::Rest::Client.new do |config|
448
+ # config.timeout = 10.0
449
+ # config.rpcs.list_local_inventories.timeout = 20.0
450
+ # end
451
+ #
452
+ # @!attribute [rw] endpoint
453
+ # The hostname or hostname:port of the service endpoint.
454
+ # Defaults to `"merchantapi.googleapis.com"`.
455
+ # @return [::String]
456
+ # @!attribute [rw] credentials
457
+ # Credentials to send with calls. You may provide any of the following types:
458
+ # * (`String`) The path to a service account key file in JSON format
459
+ # * (`Hash`) A service account key as a Hash
460
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
461
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
462
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
463
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
464
+ # * (`nil`) indicating no credentials
465
+ # @return [::Object]
466
+ # @!attribute [rw] scope
467
+ # The OAuth scopes
468
+ # @return [::Array<::String>]
469
+ # @!attribute [rw] lib_name
470
+ # The library name as recorded in instrumentation and logging
471
+ # @return [::String]
472
+ # @!attribute [rw] lib_version
473
+ # The library version as recorded in instrumentation and logging
474
+ # @return [::String]
475
+ # @!attribute [rw] timeout
476
+ # The call timeout in seconds.
477
+ # @return [::Numeric]
478
+ # @!attribute [rw] metadata
479
+ # Additional headers to be sent with the call.
480
+ # @return [::Hash{::Symbol=>::String}]
481
+ # @!attribute [rw] retry_policy
482
+ # The retry policy. The value is a hash with the following keys:
483
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
484
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
485
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
486
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
487
+ # trigger a retry.
488
+ # @return [::Hash]
489
+ # @!attribute [rw] quota_project
490
+ # A separate project against which to charge quota.
491
+ # @return [::String]
492
+ #
493
+ class Configuration
494
+ extend ::Gapic::Config
495
+
496
+ DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
497
+
498
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
499
+ config_attr :credentials, nil do |value|
500
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
501
+ allowed.any? { |klass| klass === value }
502
+ end
503
+ config_attr :scope, nil, ::String, ::Array, nil
504
+ config_attr :lib_name, nil, ::String, nil
505
+ config_attr :lib_version, nil, ::String, nil
506
+ config_attr :timeout, nil, ::Numeric, nil
507
+ config_attr :metadata, nil, ::Hash, nil
508
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
509
+ config_attr :quota_project, nil, ::String, nil
510
+
511
+ # @private
512
+ def initialize parent_config = nil
513
+ @parent_config = parent_config unless parent_config.nil?
514
+
515
+ yield self if block_given?
516
+ end
517
+
518
+ ##
519
+ # Configurations for individual RPCs
520
+ # @return [Rpcs]
521
+ #
522
+ def rpcs
523
+ @rpcs ||= begin
524
+ parent_rpcs = nil
525
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
526
+ Rpcs.new parent_rpcs
527
+ end
528
+ end
529
+
530
+ ##
531
+ # Configuration RPC class for the LocalInventoryService API.
532
+ #
533
+ # Includes fields providing the configuration for each RPC in this service.
534
+ # Each configuration object is of type `Gapic::Config::Method` and includes
535
+ # the following configuration fields:
536
+ #
537
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
538
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
539
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
540
+ # include the following keys:
541
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
542
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
543
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
544
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
545
+ # trigger a retry.
546
+ #
547
+ class Rpcs
548
+ ##
549
+ # RPC-specific configuration for `list_local_inventories`
550
+ # @return [::Gapic::Config::Method]
551
+ #
552
+ attr_reader :list_local_inventories
553
+ ##
554
+ # RPC-specific configuration for `insert_local_inventory`
555
+ # @return [::Gapic::Config::Method]
556
+ #
557
+ attr_reader :insert_local_inventory
558
+ ##
559
+ # RPC-specific configuration for `delete_local_inventory`
560
+ # @return [::Gapic::Config::Method]
561
+ #
562
+ attr_reader :delete_local_inventory
563
+
564
+ # @private
565
+ def initialize parent_rpcs = nil
566
+ list_local_inventories_config = parent_rpcs.list_local_inventories if parent_rpcs.respond_to? :list_local_inventories
567
+ @list_local_inventories = ::Gapic::Config::Method.new list_local_inventories_config
568
+ insert_local_inventory_config = parent_rpcs.insert_local_inventory if parent_rpcs.respond_to? :insert_local_inventory
569
+ @insert_local_inventory = ::Gapic::Config::Method.new insert_local_inventory_config
570
+ delete_local_inventory_config = parent_rpcs.delete_local_inventory if parent_rpcs.respond_to? :delete_local_inventory
571
+ @delete_local_inventory = ::Gapic::Config::Method.new delete_local_inventory_config
572
+
573
+ yield self if block_given?
574
+ end
575
+ end
576
+ end
577
+ end
578
+ end
579
+ end
580
+ end
581
+ end
582
+ end
583
+ end
584
+ end