google-cloud-retail-v2 0.2.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +8 -8
- data/LICENSE.md +188 -190
- data/README.md +3 -3
- data/lib/google/cloud/retail/v2.rb +2 -0
- data/lib/google/cloud/retail/v2/catalog_pb.rb +2 -0
- data/lib/google/cloud/retail/v2/catalog_service/client.rb +211 -15
- data/lib/google/cloud/retail/v2/catalog_service/paths.rb +21 -0
- data/lib/google/cloud/retail/v2/catalog_service_pb.rb +16 -0
- data/lib/google/cloud/retail/v2/catalog_service_services_pb.rb +46 -0
- data/lib/google/cloud/retail/v2/common_pb.rb +46 -0
- data/lib/google/cloud/retail/v2/completion_service.rb +54 -0
- data/lib/google/cloud/retail/v2/completion_service/client.rb +546 -0
- data/lib/google/cloud/retail/v2/completion_service/credentials.rb +51 -0
- data/lib/google/cloud/retail/v2/completion_service/operations.rb +655 -0
- data/lib/google/cloud/retail/v2/completion_service/paths.rb +52 -0
- data/lib/google/cloud/retail/v2/completion_service_pb.rb +50 -0
- data/lib/google/cloud/retail/v2/completion_service_services_pb.rb +61 -0
- data/lib/google/cloud/retail/v2/import_config_pb.rb +32 -0
- data/lib/google/cloud/retail/v2/prediction_service/client.rb +41 -43
- data/lib/google/cloud/retail/v2/product_pb.rb +21 -0
- data/lib/google/cloud/retail/v2/product_service/client.rb +643 -18
- data/lib/google/cloud/retail/v2/product_service/operations.rb +11 -11
- data/lib/google/cloud/retail/v2/product_service_pb.rb +56 -0
- data/lib/google/cloud/retail/v2/product_service_services_pb.rb +75 -0
- data/lib/google/cloud/retail/v2/search_service.rb +53 -0
- data/lib/google/cloud/retail/v2/search_service/client.rb +541 -0
- data/lib/google/cloud/retail/v2/search_service/credentials.rb +51 -0
- data/lib/google/cloud/retail/v2/search_service/paths.rb +54 -0
- data/lib/google/cloud/retail/v2/search_service_pb.rb +131 -0
- data/lib/google/cloud/retail/v2/search_service_services_pb.rb +53 -0
- data/lib/google/cloud/retail/v2/user_event_pb.rb +11 -0
- data/lib/google/cloud/retail/v2/user_event_service/client.rb +12 -15
- data/lib/google/cloud/retail/v2/user_event_service/operations.rb +11 -11
- data/lib/google/cloud/retail/v2/user_event_service/paths.rb +19 -0
- data/lib/google/cloud/retail/v2/version.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +7 -1
- data/proto_docs/google/api/httpbody.rb +4 -3
- data/proto_docs/google/cloud/retail/v2/catalog.rb +6 -6
- data/proto_docs/google/cloud/retail/v2/catalog_service.rb +53 -4
- data/proto_docs/google/cloud/retail/v2/common.rb +272 -4
- data/proto_docs/google/cloud/retail/v2/completion_service.rb +162 -0
- data/proto_docs/google/cloud/retail/v2/import_config.rb +122 -6
- data/proto_docs/google/cloud/retail/v2/prediction_service.rb +32 -31
- data/proto_docs/google/cloud/retail/v2/product.rb +266 -10
- data/proto_docs/google/cloud/retail/v2/product_service.rb +362 -2
- data/proto_docs/google/cloud/retail/v2/purge_config.rb +1 -1
- data/proto_docs/google/cloud/retail/v2/search_service.rb +820 -0
- data/proto_docs/google/cloud/retail/v2/user_event.rb +95 -3
- data/proto_docs/google/type/date.rb +53 -0
- metadata +32 -10
@@ -61,17 +61,14 @@ module Google
|
|
61
61
|
parent_config = while namespace.any?
|
62
62
|
parent_name = namespace.join "::"
|
63
63
|
parent_const = const_get parent_name
|
64
|
-
break parent_const.configure if parent_const
|
64
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
65
65
|
namespace.pop
|
66
66
|
end
|
67
67
|
default_config = Client::Configuration.new parent_config
|
68
68
|
|
69
69
|
default_config.timeout = 60.0
|
70
70
|
default_config.retry_policy = {
|
71
|
-
initial_delay: 0.1,
|
72
|
-
max_delay: 60.0,
|
73
|
-
multiplier: 1.3,
|
74
|
-
retry_codes: [14, 4]
|
71
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
75
72
|
}
|
76
73
|
|
77
74
|
default_config
|
@@ -140,9 +137,9 @@ module Google
|
|
140
137
|
enable_self_signed_jwt = @config.scope == Client.configure.scope &&
|
141
138
|
@config.endpoint == Client.configure.endpoint &&
|
142
139
|
!@config.endpoint.split(".").first.include?("-")
|
143
|
-
credentials ||= Credentials.default scope:
|
140
|
+
credentials ||= Credentials.default scope: @config.scope,
|
144
141
|
enable_self_signed_jwt: enable_self_signed_jwt
|
145
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
142
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
146
143
|
credentials = Credentials.new credentials, scope: @config.scope
|
147
144
|
end
|
148
145
|
@quota_project_id = @config.quota_project
|
@@ -331,6 +328,144 @@ module Google
|
|
331
328
|
raise ::Google::Cloud::Error.from_error(e)
|
332
329
|
end
|
333
330
|
|
331
|
+
##
|
332
|
+
# Gets a list of {::Google::Cloud::Retail::V2::Product Product}s.
|
333
|
+
#
|
334
|
+
# @overload list_products(request, options = nil)
|
335
|
+
# Pass arguments to `list_products` via a request object, either of type
|
336
|
+
# {::Google::Cloud::Retail::V2::ListProductsRequest} or an equivalent Hash.
|
337
|
+
#
|
338
|
+
# @param request [::Google::Cloud::Retail::V2::ListProductsRequest, ::Hash]
|
339
|
+
# A request object representing the call parameters. Required. To specify no
|
340
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
341
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
342
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
343
|
+
#
|
344
|
+
# @overload list_products(parent: nil, page_size: nil, page_token: nil, filter: nil, read_mask: nil)
|
345
|
+
# Pass arguments to `list_products` via keyword arguments. Note that at
|
346
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
347
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
348
|
+
#
|
349
|
+
# @param parent [::String]
|
350
|
+
# Required. The parent branch resource name, such as
|
351
|
+
# `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
|
352
|
+
# `default_branch` as the branch ID, to list products under the default
|
353
|
+
# branch.
|
354
|
+
#
|
355
|
+
# If the caller does not have permission to list
|
356
|
+
# {::Google::Cloud::Retail::V2::Product Product}s under this branch, regardless of
|
357
|
+
# whether or not this branch exists, a PERMISSION_DENIED error is returned.
|
358
|
+
# @param page_size [::Integer]
|
359
|
+
# Maximum number of {::Google::Cloud::Retail::V2::Product Product}s to return. If
|
360
|
+
# unspecified, defaults to 100. The maximum allowed value is 1000. Values
|
361
|
+
# above 1000 will be coerced to 1000.
|
362
|
+
#
|
363
|
+
# If this field is negative, an INVALID_ARGUMENT error is returned.
|
364
|
+
# @param page_token [::String]
|
365
|
+
# A page token
|
366
|
+
# {::Google::Cloud::Retail::V2::ListProductsResponse#next_page_token ListProductsResponse.next_page_token},
|
367
|
+
# received from a previous
|
368
|
+
# {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}
|
369
|
+
# call. Provide this to retrieve the subsequent page.
|
370
|
+
#
|
371
|
+
# When paginating, all other parameters provided to
|
372
|
+
# {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}
|
373
|
+
# must match the call that provided the page token. Otherwise, an
|
374
|
+
# INVALID_ARGUMENT error is returned.
|
375
|
+
# @param filter [::String]
|
376
|
+
# A filter to apply on the list results. Supported features:
|
377
|
+
#
|
378
|
+
# * List all the products under the parent branch if
|
379
|
+
# {::Google::Cloud::Retail::V2::ListProductsRequest#filter filter} is unset.
|
380
|
+
# * List {::Google::Cloud::Retail::V2::Product::Type::VARIANT Product.Type.VARIANT}
|
381
|
+
# {::Google::Cloud::Retail::V2::Product Product}s sharing the same
|
382
|
+
# {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY}
|
383
|
+
# {::Google::Cloud::Retail::V2::Product Product}. For example:
|
384
|
+
# `primary_product_id = "some_product_id"`
|
385
|
+
# * List {::Google::Cloud::Retail::V2::Product Product}s bundled in a
|
386
|
+
# {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION}
|
387
|
+
# {::Google::Cloud::Retail::V2::Product Product}.
|
388
|
+
# For example:
|
389
|
+
# `collection_product_id = "some_product_id"`
|
390
|
+
# * List {::Google::Cloud::Retail::V2::Product Product}s with a partibular type.
|
391
|
+
# For example:
|
392
|
+
# `type = "PRIMARY"`
|
393
|
+
# `type = "VARIANT"`
|
394
|
+
# `type = "COLLECTION"`
|
395
|
+
#
|
396
|
+
# If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
|
397
|
+
#
|
398
|
+
# If the specified
|
399
|
+
# {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY}
|
400
|
+
# {::Google::Cloud::Retail::V2::Product Product} or
|
401
|
+
# {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION}
|
402
|
+
# {::Google::Cloud::Retail::V2::Product Product} does not exist, a NOT_FOUND error
|
403
|
+
# is returned.
|
404
|
+
# @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
|
405
|
+
# The fields of {::Google::Cloud::Retail::V2::Product Product} to return in the
|
406
|
+
# responses. If not set or empty, the following fields are returned:
|
407
|
+
#
|
408
|
+
# * {::Google::Cloud::Retail::V2::Product#name Product.name}
|
409
|
+
# * {::Google::Cloud::Retail::V2::Product#id Product.id}
|
410
|
+
# * {::Google::Cloud::Retail::V2::Product#title Product.title}
|
411
|
+
# * {::Google::Cloud::Retail::V2::Product#uri Product.uri}
|
412
|
+
# * {::Google::Cloud::Retail::V2::Product#images Product.images}
|
413
|
+
# * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info}
|
414
|
+
# * {::Google::Cloud::Retail::V2::Product#brands Product.brands}
|
415
|
+
#
|
416
|
+
# If "*" is provided, all fields are returned.
|
417
|
+
# {::Google::Cloud::Retail::V2::Product#name Product.name} is always returned no
|
418
|
+
# matter what mask is set.
|
419
|
+
#
|
420
|
+
# If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
|
421
|
+
# is returned.
|
422
|
+
#
|
423
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
424
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Product>]
|
425
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
426
|
+
#
|
427
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Product>]
|
428
|
+
#
|
429
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
430
|
+
#
|
431
|
+
def list_products request, options = nil
|
432
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
433
|
+
|
434
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListProductsRequest
|
435
|
+
|
436
|
+
# Converts hash and nil to an options object
|
437
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
438
|
+
|
439
|
+
# Customize the options with defaults
|
440
|
+
metadata = @config.rpcs.list_products.metadata.to_h
|
441
|
+
|
442
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
443
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
444
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
445
|
+
gapic_version: ::Google::Cloud::Retail::V2::VERSION
|
446
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
447
|
+
|
448
|
+
header_params = {
|
449
|
+
"parent" => request.parent
|
450
|
+
}
|
451
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
452
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
453
|
+
|
454
|
+
options.apply_defaults timeout: @config.rpcs.list_products.timeout,
|
455
|
+
metadata: metadata,
|
456
|
+
retry_policy: @config.rpcs.list_products.retry_policy
|
457
|
+
options.apply_defaults metadata: @config.metadata,
|
458
|
+
retry_policy: @config.retry_policy
|
459
|
+
|
460
|
+
@product_service_stub.call_rpc :list_products, request, options: options do |response, operation|
|
461
|
+
response = ::Gapic::PagedEnumerable.new @product_service_stub, :list_products, request, response, operation, options
|
462
|
+
yield response, operation if block_given?
|
463
|
+
return response
|
464
|
+
end
|
465
|
+
rescue ::GRPC::BadStatus => e
|
466
|
+
raise ::Google::Cloud::Error.from_error(e)
|
467
|
+
end
|
468
|
+
|
334
469
|
##
|
335
470
|
# Updates a {::Google::Cloud::Retail::V2::Product Product}.
|
336
471
|
#
|
@@ -344,7 +479,7 @@ module Google
|
|
344
479
|
# @param options [::Gapic::CallOptions, ::Hash]
|
345
480
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
346
481
|
#
|
347
|
-
# @overload update_product(product: nil, update_mask: nil)
|
482
|
+
# @overload update_product(product: nil, update_mask: nil, allow_missing: nil)
|
348
483
|
# Pass arguments to `update_product` via keyword arguments. Note that at
|
349
484
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
350
485
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -356,8 +491,10 @@ module Google
|
|
356
491
|
# {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it
|
357
492
|
# exists, a PERMISSION_DENIED error is returned.
|
358
493
|
#
|
359
|
-
# If the {::Google::Cloud::Retail::V2::Product Product} to update does not exist
|
360
|
-
#
|
494
|
+
# If the {::Google::Cloud::Retail::V2::Product Product} to update does not exist
|
495
|
+
# and
|
496
|
+
# {::Google::Cloud::Retail::V2::UpdateProductRequest#allow_missing allow_missing}
|
497
|
+
# is not set, a NOT_FOUND error is returned.
|
361
498
|
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
362
499
|
# Indicates which fields in the provided
|
363
500
|
# {::Google::Cloud::Retail::V2::Product Product} to update. The immutable and
|
@@ -366,6 +503,10 @@ module Google
|
|
366
503
|
#
|
367
504
|
# If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
|
368
505
|
# is returned.
|
506
|
+
# @param allow_missing [::Boolean]
|
507
|
+
# If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not
|
508
|
+
# found, a new {::Google::Cloud::Retail::V2::Product Product} will be created. In
|
509
|
+
# this situation, `update_mask` is ignored.
|
369
510
|
#
|
370
511
|
# @yield [response, operation] Access the result along with the RPC operation
|
371
512
|
# @yieldparam response [::Google::Cloud::Retail::V2::Product]
|
@@ -442,6 +583,17 @@ module Google
|
|
442
583
|
# If the {::Google::Cloud::Retail::V2::Product Product} to delete does not exist,
|
443
584
|
# a NOT_FOUND error is returned.
|
444
585
|
#
|
586
|
+
# The {::Google::Cloud::Retail::V2::Product Product} to delete can neither be a
|
587
|
+
# {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION}
|
588
|
+
# {::Google::Cloud::Retail::V2::Product Product} member nor a
|
589
|
+
# {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY}
|
590
|
+
# {::Google::Cloud::Retail::V2::Product Product} with more than one
|
591
|
+
# {::Google::Cloud::Retail::V2::Product::Type::VARIANT variants}. Otherwise, an
|
592
|
+
# INVALID_ARGUMENT error is returned.
|
593
|
+
#
|
594
|
+
# All inventory information for the named
|
595
|
+
# {::Google::Cloud::Retail::V2::Product Product} will be deleted.
|
596
|
+
#
|
445
597
|
# @yield [response, operation] Access the result along with the RPC operation
|
446
598
|
# @yieldparam response [::Google::Protobuf::Empty]
|
447
599
|
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
@@ -506,7 +658,7 @@ module Google
|
|
506
658
|
# @param options [::Gapic::CallOptions, ::Hash]
|
507
659
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
508
660
|
#
|
509
|
-
# @overload import_products(parent: nil, input_config: nil, errors_config: nil, update_mask: nil)
|
661
|
+
# @overload import_products(parent: nil, request_id: nil, input_config: nil, errors_config: nil, update_mask: nil, reconciliation_mode: nil, notification_pubsub_topic: nil)
|
510
662
|
# Pass arguments to `import_products` via keyword arguments. Note that at
|
511
663
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
512
664
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -517,6 +669,16 @@ module Google
|
|
517
669
|
#
|
518
670
|
# If no updateMask is specified, requires products.create permission.
|
519
671
|
# If updateMask is specified, requires products.update permission.
|
672
|
+
# @param request_id [::String]
|
673
|
+
# Unique identifier provided by client, within the ancestor
|
674
|
+
# dataset scope. Ensures idempotency and used for request deduplication.
|
675
|
+
# Server-generated if unspecified. Up to 128 characters long and must match
|
676
|
+
# the pattern: "[a-zA-Z0-9_]+". This is returned as [Operation.name][] in
|
677
|
+
# {::Google::Cloud::Retail::V2::ImportMetadata ImportMetadata}.
|
678
|
+
#
|
679
|
+
# Only supported when
|
680
|
+
# {::Google::Cloud::Retail::V2::ImportProductsRequest#reconciliation_mode ImportProductsRequest.reconciliation_mode}
|
681
|
+
# is set to `FULL`.
|
520
682
|
# @param input_config [::Google::Cloud::Retail::V2::ProductInputConfig, ::Hash]
|
521
683
|
# Required. The desired input location of the data.
|
522
684
|
# @param errors_config [::Google::Cloud::Retail::V2::ImportErrorsConfig, ::Hash]
|
@@ -524,6 +686,20 @@ module Google
|
|
524
686
|
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
525
687
|
# Indicates which fields in the provided imported 'products' to update. If
|
526
688
|
# not set, will by default update all fields.
|
689
|
+
# @param reconciliation_mode [::Google::Cloud::Retail::V2::ImportProductsRequest::ReconciliationMode]
|
690
|
+
# The mode of reconciliation between existing products and the products to be
|
691
|
+
# imported. Defaults to
|
692
|
+
# {::Google::Cloud::Retail::V2::ImportProductsRequest::ReconciliationMode::INCREMENTAL ReconciliationMode.INCREMENTAL}.
|
693
|
+
# @param notification_pubsub_topic [::String]
|
694
|
+
# Pub/Sub topic for receiving notification. If this field is set,
|
695
|
+
# when the import is finished, a notification will be sent to
|
696
|
+
# specified Pub/Sub topic. The message data will be JSON string of a
|
697
|
+
# {::Google::Longrunning::Operation Operation}.
|
698
|
+
# Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
|
699
|
+
#
|
700
|
+
# Only supported when
|
701
|
+
# {::Google::Cloud::Retail::V2::ImportProductsRequest#reconciliation_mode ImportProductsRequest.reconciliation_mode}
|
702
|
+
# is set to `FULL`.
|
527
703
|
#
|
528
704
|
# @yield [response, operation] Access the result along with the RPC operation
|
529
705
|
# @yieldparam response [::Gapic::Operation]
|
@@ -571,6 +747,427 @@ module Google
|
|
571
747
|
raise ::Google::Cloud::Error.from_error(e)
|
572
748
|
end
|
573
749
|
|
750
|
+
##
|
751
|
+
# Updates inventory information for a
|
752
|
+
# {::Google::Cloud::Retail::V2::Product Product} while respecting the last update
|
753
|
+
# timestamps of each inventory field.
|
754
|
+
#
|
755
|
+
# This process is asynchronous and does not require the
|
756
|
+
# {::Google::Cloud::Retail::V2::Product Product} to exist before updating
|
757
|
+
# fulfillment information. If the request is valid, the update will be
|
758
|
+
# enqueued and processed downstream. As a consequence, when a response is
|
759
|
+
# returned, updates are not immediately manifested in the
|
760
|
+
# {::Google::Cloud::Retail::V2::Product Product} queried by
|
761
|
+
# {::Google::Cloud::Retail::V2::ProductService::Client#get_product GetProduct} or
|
762
|
+
# {::Google::Cloud::Retail::V2::ProductService::Client#list_products ListProducts}.
|
763
|
+
#
|
764
|
+
# When inventory is updated with
|
765
|
+
# {::Google::Cloud::Retail::V2::ProductService::Client#create_product CreateProduct} and
|
766
|
+
# {::Google::Cloud::Retail::V2::ProductService::Client#update_product UpdateProduct}, the
|
767
|
+
# specified inventory field value(s) will overwrite any existing value(s)
|
768
|
+
# while ignoring the last update time for this field. Furthermore, the last
|
769
|
+
# update time for the specified inventory fields will be overwritten to the
|
770
|
+
# time of the
|
771
|
+
# {::Google::Cloud::Retail::V2::ProductService::Client#create_product CreateProduct} or
|
772
|
+
# {::Google::Cloud::Retail::V2::ProductService::Client#update_product UpdateProduct}
|
773
|
+
# request.
|
774
|
+
#
|
775
|
+
# If no inventory fields are set in
|
776
|
+
# {::Google::Cloud::Retail::V2::CreateProductRequest#product CreateProductRequest.product},
|
777
|
+
# then any pre-existing inventory information for this product will be used.
|
778
|
+
#
|
779
|
+
# If no inventory fields are set in [UpdateProductRequest.set_mask][],
|
780
|
+
# then any existing inventory information will be preserved.
|
781
|
+
#
|
782
|
+
# Pre-existing inventory information can only be updated with
|
783
|
+
# {::Google::Cloud::Retail::V2::ProductService::Client#set_inventory SetInventory},
|
784
|
+
# {::Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places AddFulfillmentPlaces},
|
785
|
+
# and
|
786
|
+
# {::Google::Cloud::Retail::V2::ProductService::Client#remove_fulfillment_places RemoveFulfillmentPlaces}.
|
787
|
+
#
|
788
|
+
# This feature is only available for users who have Retail Search enabled.
|
789
|
+
# Contact Retail Support (retail-search-support@google.com) if you are
|
790
|
+
# interested in using Retail Search.
|
791
|
+
#
|
792
|
+
# @overload set_inventory(request, options = nil)
|
793
|
+
# Pass arguments to `set_inventory` via a request object, either of type
|
794
|
+
# {::Google::Cloud::Retail::V2::SetInventoryRequest} or an equivalent Hash.
|
795
|
+
#
|
796
|
+
# @param request [::Google::Cloud::Retail::V2::SetInventoryRequest, ::Hash]
|
797
|
+
# A request object representing the call parameters. Required. To specify no
|
798
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
799
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
800
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
801
|
+
#
|
802
|
+
# @overload set_inventory(inventory: nil, set_mask: nil, set_time: nil, allow_missing: nil)
|
803
|
+
# Pass arguments to `set_inventory` via keyword arguments. Note that at
|
804
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
805
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
806
|
+
#
|
807
|
+
# @param inventory [::Google::Cloud::Retail::V2::Product, ::Hash]
|
808
|
+
# Required. The inventory information to update. The allowable fields to
|
809
|
+
# update are:
|
810
|
+
# * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info}
|
811
|
+
# * {::Google::Cloud::Retail::V2::Product#availability Product.availability}
|
812
|
+
# * {::Google::Cloud::Retail::V2::Product#available_quantity Product.available_quantity}
|
813
|
+
# * {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info}
|
814
|
+
# The updated inventory fields must be specified in
|
815
|
+
# {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask}.
|
816
|
+
#
|
817
|
+
# If [SetInventoryRequest.inventory.name][] is empty or invalid, an
|
818
|
+
# INVALID_ARGUMENT error is returned.
|
819
|
+
#
|
820
|
+
# If the caller does not have permission to update the
|
821
|
+
# {::Google::Cloud::Retail::V2::Product Product} named in
|
822
|
+
# {::Google::Cloud::Retail::V2::Product#name Product.name}, regardless of whether
|
823
|
+
# or not it exists, a PERMISSION_DENIED error is returned.
|
824
|
+
#
|
825
|
+
# If the {::Google::Cloud::Retail::V2::Product Product} to update does not have
|
826
|
+
# existing inventory information, the provided inventory information will be
|
827
|
+
# inserted.
|
828
|
+
#
|
829
|
+
# If the {::Google::Cloud::Retail::V2::Product Product} to update has existing
|
830
|
+
# inventory information, the provided inventory information will be merged
|
831
|
+
# while respecting the last update time for each inventory field, using the
|
832
|
+
# provided or default value for
|
833
|
+
# {::Google::Cloud::Retail::V2::SetInventoryRequest#set_time SetInventoryRequest.set_time}.
|
834
|
+
#
|
835
|
+
# The last update time is recorded for the following inventory fields:
|
836
|
+
# * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info}
|
837
|
+
# * {::Google::Cloud::Retail::V2::Product#availability Product.availability}
|
838
|
+
# * {::Google::Cloud::Retail::V2::Product#available_quantity Product.available_quantity}
|
839
|
+
# * {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info}
|
840
|
+
#
|
841
|
+
# If a full overwrite of inventory information while ignoring timestamps is
|
842
|
+
# needed, [UpdateProduct][] should be invoked instead.
|
843
|
+
# @param set_mask [::Google::Protobuf::FieldMask, ::Hash]
|
844
|
+
# Indicates which inventory fields in the provided
|
845
|
+
# {::Google::Cloud::Retail::V2::Product Product} to update. If not set or set with
|
846
|
+
# empty paths, all inventory fields will be updated.
|
847
|
+
#
|
848
|
+
# If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
|
849
|
+
# is returned and the entire update will be ignored.
|
850
|
+
# @param set_time [::Google::Protobuf::Timestamp, ::Hash]
|
851
|
+
# The time when the request is issued, used to prevent
|
852
|
+
# out-of-order updates on inventory fields with the last update time
|
853
|
+
# recorded. If not provided, the internal system time will be used.
|
854
|
+
# @param allow_missing [::Boolean]
|
855
|
+
# If set to true, and the {::Google::Cloud::Retail::V2::Product Product} with name
|
856
|
+
# {::Google::Cloud::Retail::V2::Product#name Product.name} is not found, the
|
857
|
+
# inventory update will still be processed and retained for at most 1 day
|
858
|
+
# until the {::Google::Cloud::Retail::V2::Product Product} is created. If set to
|
859
|
+
# false, an INVALID_ARGUMENT error is returned if the
|
860
|
+
# {::Google::Cloud::Retail::V2::Product Product} is not found.
|
861
|
+
#
|
862
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
863
|
+
# @yieldparam response [::Gapic::Operation]
|
864
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
865
|
+
#
|
866
|
+
# @return [::Gapic::Operation]
|
867
|
+
#
|
868
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
869
|
+
#
|
870
|
+
def set_inventory request, options = nil
|
871
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
872
|
+
|
873
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::SetInventoryRequest
|
874
|
+
|
875
|
+
# Converts hash and nil to an options object
|
876
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
877
|
+
|
878
|
+
# Customize the options with defaults
|
879
|
+
metadata = @config.rpcs.set_inventory.metadata.to_h
|
880
|
+
|
881
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
882
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
883
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
884
|
+
gapic_version: ::Google::Cloud::Retail::V2::VERSION
|
885
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
886
|
+
|
887
|
+
header_params = {
|
888
|
+
"inventory.name" => request.inventory.name
|
889
|
+
}
|
890
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
891
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
892
|
+
|
893
|
+
options.apply_defaults timeout: @config.rpcs.set_inventory.timeout,
|
894
|
+
metadata: metadata,
|
895
|
+
retry_policy: @config.rpcs.set_inventory.retry_policy
|
896
|
+
options.apply_defaults metadata: @config.metadata,
|
897
|
+
retry_policy: @config.retry_policy
|
898
|
+
|
899
|
+
@product_service_stub.call_rpc :set_inventory, request, options: options do |response, operation|
|
900
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
901
|
+
yield response, operation if block_given?
|
902
|
+
return response
|
903
|
+
end
|
904
|
+
rescue ::GRPC::BadStatus => e
|
905
|
+
raise ::Google::Cloud::Error.from_error(e)
|
906
|
+
end
|
907
|
+
|
908
|
+
##
|
909
|
+
# Incrementally adds place IDs to
|
910
|
+
# {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids Product.fulfillment_info.place_ids}.
|
911
|
+
#
|
912
|
+
# This process is asynchronous and does not require the
|
913
|
+
# {::Google::Cloud::Retail::V2::Product Product} to exist before updating
|
914
|
+
# fulfillment information. If the request is valid, the update will be
|
915
|
+
# enqueued and processed downstream. As a consequence, when a response is
|
916
|
+
# returned, the added place IDs are not immediately manifested in the
|
917
|
+
# {::Google::Cloud::Retail::V2::Product Product} queried by
|
918
|
+
# {::Google::Cloud::Retail::V2::ProductService::Client#get_product GetProduct} or
|
919
|
+
# {::Google::Cloud::Retail::V2::ProductService::Client#list_products ListProducts}.
|
920
|
+
#
|
921
|
+
# This feature is only available for users who have Retail Search enabled.
|
922
|
+
# Contact Retail Support (retail-search-support@google.com) if you are
|
923
|
+
# interested in using Retail Search.
|
924
|
+
#
|
925
|
+
# @overload add_fulfillment_places(request, options = nil)
|
926
|
+
# Pass arguments to `add_fulfillment_places` via a request object, either of type
|
927
|
+
# {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest} or an equivalent Hash.
|
928
|
+
#
|
929
|
+
# @param request [::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest, ::Hash]
|
930
|
+
# A request object representing the call parameters. Required. To specify no
|
931
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
932
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
933
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
934
|
+
#
|
935
|
+
# @overload add_fulfillment_places(product: nil, type: nil, place_ids: nil, add_time: nil, allow_missing: nil)
|
936
|
+
# Pass arguments to `add_fulfillment_places` via keyword arguments. Note that at
|
937
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
938
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
939
|
+
#
|
940
|
+
# @param product [::String]
|
941
|
+
# Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product},
|
942
|
+
# such as
|
943
|
+
# `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
|
944
|
+
#
|
945
|
+
# If the caller does not have permission to access the
|
946
|
+
# {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it
|
947
|
+
# exists, a PERMISSION_DENIED error is returned.
|
948
|
+
# @param type [::String]
|
949
|
+
# Required. The fulfillment type, including commonly used types (such as
|
950
|
+
# pickup in store and same day delivery), and custom types.
|
951
|
+
#
|
952
|
+
# Supported values:
|
953
|
+
#
|
954
|
+
# * "pickup-in-store"
|
955
|
+
# * "ship-to-store"
|
956
|
+
# * "same-day-delivery"
|
957
|
+
# * "next-day-delivery"
|
958
|
+
# * "custom-type-1"
|
959
|
+
# * "custom-type-2"
|
960
|
+
# * "custom-type-3"
|
961
|
+
# * "custom-type-4"
|
962
|
+
# * "custom-type-5"
|
963
|
+
#
|
964
|
+
# If this field is set to an invalid value other than these, an
|
965
|
+
# INVALID_ARGUMENT error is returned.
|
966
|
+
#
|
967
|
+
# This field directly corresponds to [Product.fulfillment_info.type][].
|
968
|
+
# @param place_ids [::Array<::String>]
|
969
|
+
# Required. The IDs for this
|
970
|
+
# {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type}, such as
|
971
|
+
# the store IDs for "pickup-in-store" or the region IDs for
|
972
|
+
# "same-day-delivery" to be added for this
|
973
|
+
# {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type}. Duplicate
|
974
|
+
# IDs will be automatically ignored.
|
975
|
+
#
|
976
|
+
# At least 1 value is required, and a maximum of 2000 values are allowed.
|
977
|
+
# Each value must be a string with a length limit of 10 characters, matching
|
978
|
+
# the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
|
979
|
+
# INVALID_ARGUMENT error is returned.
|
980
|
+
#
|
981
|
+
# If the total number of place IDs exceeds 2000 for this
|
982
|
+
# {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type} after
|
983
|
+
# adding, then the update will be rejected.
|
984
|
+
# @param add_time [::Google::Protobuf::Timestamp, ::Hash]
|
985
|
+
# The time when the fulfillment updates are issued, used to prevent
|
986
|
+
# out-of-order updates on fulfillment information. If not provided, the
|
987
|
+
# internal system time will be used.
|
988
|
+
# @param allow_missing [::Boolean]
|
989
|
+
# If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not
|
990
|
+
# found, the fulfillment information will still be processed and retained for
|
991
|
+
# at most 1 day and processed once the
|
992
|
+
# {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, an
|
993
|
+
# INVALID_ARGUMENT error is returned if the
|
994
|
+
# {::Google::Cloud::Retail::V2::Product Product} is not found.
|
995
|
+
#
|
996
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
997
|
+
# @yieldparam response [::Gapic::Operation]
|
998
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
999
|
+
#
|
1000
|
+
# @return [::Gapic::Operation]
|
1001
|
+
#
|
1002
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1003
|
+
#
|
1004
|
+
def add_fulfillment_places request, options = nil
|
1005
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1006
|
+
|
1007
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest
|
1008
|
+
|
1009
|
+
# Converts hash and nil to an options object
|
1010
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1011
|
+
|
1012
|
+
# Customize the options with defaults
|
1013
|
+
metadata = @config.rpcs.add_fulfillment_places.metadata.to_h
|
1014
|
+
|
1015
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1016
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1017
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1018
|
+
gapic_version: ::Google::Cloud::Retail::V2::VERSION
|
1019
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1020
|
+
|
1021
|
+
header_params = {
|
1022
|
+
"product" => request.product
|
1023
|
+
}
|
1024
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1025
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1026
|
+
|
1027
|
+
options.apply_defaults timeout: @config.rpcs.add_fulfillment_places.timeout,
|
1028
|
+
metadata: metadata,
|
1029
|
+
retry_policy: @config.rpcs.add_fulfillment_places.retry_policy
|
1030
|
+
options.apply_defaults metadata: @config.metadata,
|
1031
|
+
retry_policy: @config.retry_policy
|
1032
|
+
|
1033
|
+
@product_service_stub.call_rpc :add_fulfillment_places, request, options: options do |response, operation|
|
1034
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1035
|
+
yield response, operation if block_given?
|
1036
|
+
return response
|
1037
|
+
end
|
1038
|
+
rescue ::GRPC::BadStatus => e
|
1039
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1040
|
+
end
|
1041
|
+
|
1042
|
+
##
|
1043
|
+
# Incrementally removes place IDs from a
|
1044
|
+
# {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids Product.fulfillment_info.place_ids}.
|
1045
|
+
#
|
1046
|
+
# This process is asynchronous and does not require the
|
1047
|
+
# {::Google::Cloud::Retail::V2::Product Product} to exist before updating
|
1048
|
+
# fulfillment information. If the request is valid, the update will be
|
1049
|
+
# enqueued and processed downstream. As a consequence, when a response is
|
1050
|
+
# returned, the removed place IDs are not immediately manifested in the
|
1051
|
+
# {::Google::Cloud::Retail::V2::Product Product} queried by
|
1052
|
+
# {::Google::Cloud::Retail::V2::ProductService::Client#get_product GetProduct} or
|
1053
|
+
# {::Google::Cloud::Retail::V2::ProductService::Client#list_products ListProducts}.
|
1054
|
+
#
|
1055
|
+
# This feature is only available for users who have Retail Search enabled.
|
1056
|
+
# Contact Retail Support (retail-search-support@google.com) if you are
|
1057
|
+
# interested in using Retail Search.
|
1058
|
+
#
|
1059
|
+
# @overload remove_fulfillment_places(request, options = nil)
|
1060
|
+
# Pass arguments to `remove_fulfillment_places` via a request object, either of type
|
1061
|
+
# {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest} or an equivalent Hash.
|
1062
|
+
#
|
1063
|
+
# @param request [::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest, ::Hash]
|
1064
|
+
# A request object representing the call parameters. Required. To specify no
|
1065
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1066
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1067
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1068
|
+
#
|
1069
|
+
# @overload remove_fulfillment_places(product: nil, type: nil, place_ids: nil, remove_time: nil, allow_missing: nil)
|
1070
|
+
# Pass arguments to `remove_fulfillment_places` via keyword arguments. Note that at
|
1071
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1072
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1073
|
+
#
|
1074
|
+
# @param product [::String]
|
1075
|
+
# Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product},
|
1076
|
+
# such as
|
1077
|
+
# `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
|
1078
|
+
#
|
1079
|
+
# If the caller does not have permission to access the
|
1080
|
+
# {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it
|
1081
|
+
# exists, a PERMISSION_DENIED error is returned.
|
1082
|
+
# @param type [::String]
|
1083
|
+
# Required. The fulfillment type, including commonly used types (such as
|
1084
|
+
# pickup in store and same day delivery), and custom types.
|
1085
|
+
#
|
1086
|
+
# Supported values:
|
1087
|
+
#
|
1088
|
+
# * "pickup-in-store"
|
1089
|
+
# * "ship-to-store"
|
1090
|
+
# * "same-day-delivery"
|
1091
|
+
# * "next-day-delivery"
|
1092
|
+
# * "custom-type-1"
|
1093
|
+
# * "custom-type-2"
|
1094
|
+
# * "custom-type-3"
|
1095
|
+
# * "custom-type-4"
|
1096
|
+
# * "custom-type-5"
|
1097
|
+
#
|
1098
|
+
# If this field is set to an invalid value other than these, an
|
1099
|
+
# INVALID_ARGUMENT error is returned.
|
1100
|
+
#
|
1101
|
+
# This field directly corresponds to [Product.fulfillment_info.type][].
|
1102
|
+
# @param place_ids [::Array<::String>]
|
1103
|
+
# Required. The IDs for this
|
1104
|
+
# {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest#type type}, such as
|
1105
|
+
# the store IDs for "pickup-in-store" or the region IDs for
|
1106
|
+
# "same-day-delivery", to be removed for this
|
1107
|
+
# {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest#type type}.
|
1108
|
+
#
|
1109
|
+
# At least 1 value is required, and a maximum of 2000 values are allowed.
|
1110
|
+
# Each value must be a string with a length limit of 10 characters, matching
|
1111
|
+
# the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
|
1112
|
+
# INVALID_ARGUMENT error is returned.
|
1113
|
+
# @param remove_time [::Google::Protobuf::Timestamp, ::Hash]
|
1114
|
+
# The time when the fulfillment updates are issued, used to prevent
|
1115
|
+
# out-of-order updates on fulfillment information. If not provided, the
|
1116
|
+
# internal system time will be used.
|
1117
|
+
# @param allow_missing [::Boolean]
|
1118
|
+
# If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not
|
1119
|
+
# found, the fulfillment information will still be processed and retained for
|
1120
|
+
# at most 1 day and processed once the
|
1121
|
+
# {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, an
|
1122
|
+
# INVALID_ARGUMENT error is returned if the
|
1123
|
+
# {::Google::Cloud::Retail::V2::Product Product} is not found.
|
1124
|
+
#
|
1125
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1126
|
+
# @yieldparam response [::Gapic::Operation]
|
1127
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1128
|
+
#
|
1129
|
+
# @return [::Gapic::Operation]
|
1130
|
+
#
|
1131
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1132
|
+
#
|
1133
|
+
def remove_fulfillment_places request, options = nil
|
1134
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1135
|
+
|
1136
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest
|
1137
|
+
|
1138
|
+
# Converts hash and nil to an options object
|
1139
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1140
|
+
|
1141
|
+
# Customize the options with defaults
|
1142
|
+
metadata = @config.rpcs.remove_fulfillment_places.metadata.to_h
|
1143
|
+
|
1144
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1145
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1146
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1147
|
+
gapic_version: ::Google::Cloud::Retail::V2::VERSION
|
1148
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1149
|
+
|
1150
|
+
header_params = {
|
1151
|
+
"product" => request.product
|
1152
|
+
}
|
1153
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1154
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1155
|
+
|
1156
|
+
options.apply_defaults timeout: @config.rpcs.remove_fulfillment_places.timeout,
|
1157
|
+
metadata: metadata,
|
1158
|
+
retry_policy: @config.rpcs.remove_fulfillment_places.retry_policy
|
1159
|
+
options.apply_defaults metadata: @config.metadata,
|
1160
|
+
retry_policy: @config.retry_policy
|
1161
|
+
|
1162
|
+
@product_service_stub.call_rpc :remove_fulfillment_places, request, options: options do |response, operation|
|
1163
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1164
|
+
yield response, operation if block_given?
|
1165
|
+
return response
|
1166
|
+
end
|
1167
|
+
rescue ::GRPC::BadStatus => e
|
1168
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1169
|
+
end
|
1170
|
+
|
574
1171
|
##
|
575
1172
|
# Configuration class for the ProductService API.
|
576
1173
|
#
|
@@ -663,7 +1260,7 @@ module Google
|
|
663
1260
|
config_attr :scope, nil, ::String, ::Array, nil
|
664
1261
|
config_attr :lib_name, nil, ::String, nil
|
665
1262
|
config_attr :lib_version, nil, ::String, nil
|
666
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
1263
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
667
1264
|
config_attr :interceptors, nil, ::Array, nil
|
668
1265
|
config_attr :timeout, nil, ::Numeric, nil
|
669
1266
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -684,7 +1281,7 @@ module Google
|
|
684
1281
|
def rpcs
|
685
1282
|
@rpcs ||= begin
|
686
1283
|
parent_rpcs = nil
|
687
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
1284
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
688
1285
|
Rpcs.new parent_rpcs
|
689
1286
|
end
|
690
1287
|
end
|
@@ -718,6 +1315,11 @@ module Google
|
|
718
1315
|
#
|
719
1316
|
attr_reader :get_product
|
720
1317
|
##
|
1318
|
+
# RPC-specific configuration for `list_products`
|
1319
|
+
# @return [::Gapic::Config::Method]
|
1320
|
+
#
|
1321
|
+
attr_reader :list_products
|
1322
|
+
##
|
721
1323
|
# RPC-specific configuration for `update_product`
|
722
1324
|
# @return [::Gapic::Config::Method]
|
723
1325
|
#
|
@@ -732,19 +1334,42 @@ module Google
|
|
732
1334
|
# @return [::Gapic::Config::Method]
|
733
1335
|
#
|
734
1336
|
attr_reader :import_products
|
1337
|
+
##
|
1338
|
+
# RPC-specific configuration for `set_inventory`
|
1339
|
+
# @return [::Gapic::Config::Method]
|
1340
|
+
#
|
1341
|
+
attr_reader :set_inventory
|
1342
|
+
##
|
1343
|
+
# RPC-specific configuration for `add_fulfillment_places`
|
1344
|
+
# @return [::Gapic::Config::Method]
|
1345
|
+
#
|
1346
|
+
attr_reader :add_fulfillment_places
|
1347
|
+
##
|
1348
|
+
# RPC-specific configuration for `remove_fulfillment_places`
|
1349
|
+
# @return [::Gapic::Config::Method]
|
1350
|
+
#
|
1351
|
+
attr_reader :remove_fulfillment_places
|
735
1352
|
|
736
1353
|
# @private
|
737
1354
|
def initialize parent_rpcs = nil
|
738
|
-
create_product_config = parent_rpcs
|
1355
|
+
create_product_config = parent_rpcs.create_product if parent_rpcs.respond_to? :create_product
|
739
1356
|
@create_product = ::Gapic::Config::Method.new create_product_config
|
740
|
-
get_product_config = parent_rpcs
|
1357
|
+
get_product_config = parent_rpcs.get_product if parent_rpcs.respond_to? :get_product
|
741
1358
|
@get_product = ::Gapic::Config::Method.new get_product_config
|
742
|
-
|
1359
|
+
list_products_config = parent_rpcs.list_products if parent_rpcs.respond_to? :list_products
|
1360
|
+
@list_products = ::Gapic::Config::Method.new list_products_config
|
1361
|
+
update_product_config = parent_rpcs.update_product if parent_rpcs.respond_to? :update_product
|
743
1362
|
@update_product = ::Gapic::Config::Method.new update_product_config
|
744
|
-
delete_product_config = parent_rpcs
|
1363
|
+
delete_product_config = parent_rpcs.delete_product if parent_rpcs.respond_to? :delete_product
|
745
1364
|
@delete_product = ::Gapic::Config::Method.new delete_product_config
|
746
|
-
import_products_config = parent_rpcs
|
1365
|
+
import_products_config = parent_rpcs.import_products if parent_rpcs.respond_to? :import_products
|
747
1366
|
@import_products = ::Gapic::Config::Method.new import_products_config
|
1367
|
+
set_inventory_config = parent_rpcs.set_inventory if parent_rpcs.respond_to? :set_inventory
|
1368
|
+
@set_inventory = ::Gapic::Config::Method.new set_inventory_config
|
1369
|
+
add_fulfillment_places_config = parent_rpcs.add_fulfillment_places if parent_rpcs.respond_to? :add_fulfillment_places
|
1370
|
+
@add_fulfillment_places = ::Gapic::Config::Method.new add_fulfillment_places_config
|
1371
|
+
remove_fulfillment_places_config = parent_rpcs.remove_fulfillment_places if parent_rpcs.respond_to? :remove_fulfillment_places
|
1372
|
+
@remove_fulfillment_places = ::Gapic::Config::Method.new remove_fulfillment_places_config
|
748
1373
|
|
749
1374
|
yield self if block_given?
|
750
1375
|
end
|