google-cloud-discovery_engine-v1beta 0.16.0 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -21
  3. data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +49 -7
  4. data/lib/google/cloud/discovery_engine/v1beta/completion_service/operations.rb +19 -15
  5. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +49 -7
  6. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/operations.rb +50 -38
  7. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb +62 -38
  8. data/lib/google/cloud/discovery_engine/v1beta/control_service/client.rb +36 -6
  9. data/lib/google/cloud/discovery_engine/v1beta/control_service/rest/client.rb +36 -6
  10. data/lib/google/cloud/discovery_engine/v1beta/control_service/rest/service_stub.rb +54 -32
  11. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +37 -14
  12. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +37 -14
  13. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/service_stub.rb +118 -80
  14. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/client.rb +38 -6
  15. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/operations.rb +19 -15
  16. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/client.rb +38 -6
  17. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/operations.rb +50 -38
  18. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/service_stub.rb +54 -32
  19. data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +60 -9
  20. data/lib/google/cloud/discovery_engine/v1beta/document_service/operations.rb +19 -15
  21. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +60 -9
  22. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +50 -38
  23. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/service_stub.rb +78 -50
  24. data/lib/google/cloud/discovery_engine/v1beta/engine_service/client.rb +39 -9
  25. data/lib/google/cloud/discovery_engine/v1beta/engine_service/operations.rb +19 -15
  26. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/client.rb +39 -9
  27. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/operations.rb +50 -38
  28. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/service_stub.rb +78 -50
  29. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/client.rb +38 -5
  30. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/operations.rb +19 -15
  31. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/client.rb +38 -5
  32. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/operations.rb +50 -38
  33. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/service_stub.rb +46 -26
  34. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/client.rb +35 -4
  35. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/client.rb +35 -3
  36. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/service_stub.rb +30 -14
  37. data/lib/google/cloud/discovery_engine/v1beta/project_service/client.rb +36 -2
  38. data/lib/google/cloud/discovery_engine/v1beta/project_service/operations.rb +19 -15
  39. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/client.rb +36 -2
  40. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/operations.rb +50 -38
  41. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/service_stub.rb +22 -8
  42. data/lib/google/cloud/discovery_engine/v1beta/rank_service/client.rb +35 -2
  43. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/client.rb +35 -2
  44. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/service_stub.rb +22 -8
  45. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb +35 -2
  46. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb +35 -2
  47. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/service_stub.rb +22 -8
  48. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/client.rb +43 -7
  49. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/operations.rb +19 -15
  50. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/client.rb +43 -7
  51. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/operations.rb +50 -38
  52. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/service_stub.rb +62 -38
  53. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/client.rb +36 -6
  54. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest/client.rb +36 -6
  55. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest/service_stub.rb +54 -32
  56. data/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb +39 -6
  57. data/lib/google/cloud/discovery_engine/v1beta/schema_service/operations.rb +19 -15
  58. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb +39 -6
  59. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +50 -38
  60. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/service_stub.rb +54 -32
  61. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +37 -3
  62. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +35 -3
  63. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/service_stub.rb +30 -14
  64. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/client.rb +36 -3
  65. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/operations.rb +19 -15
  66. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/client.rb +36 -3
  67. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/operations.rb +50 -38
  68. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/service_stub.rb +30 -14
  69. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/client.rb +36 -4
  70. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest/client.rb +36 -4
  71. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest/service_stub.rb +38 -20
  72. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/client.rb +47 -16
  73. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/operations.rb +19 -15
  74. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/client.rb +47 -16
  75. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/operations.rb +50 -38
  76. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/service_stub.rb +134 -92
  77. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +43 -5
  78. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/operations.rb +19 -15
  79. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +43 -5
  80. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +50 -38
  81. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb +46 -26
  82. data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
  83. data/proto_docs/google/api/client.rb +19 -0
  84. data/proto_docs/google/cloud/discoveryengine/v1beta/answer.rb +6 -0
  85. data/proto_docs/google/cloud/discoveryengine/v1beta/common.rb +8 -0
  86. data/proto_docs/google/cloud/discoveryengine/v1beta/completion.rb +4 -0
  87. data/proto_docs/google/cloud/discoveryengine/v1beta/control.rb +8 -0
  88. data/proto_docs/google/cloud/discoveryengine/v1beta/conversation.rb +4 -0
  89. data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +8 -0
  90. data/proto_docs/google/cloud/discoveryengine/v1beta/document.rb +8 -0
  91. data/proto_docs/google/cloud/discoveryengine/v1beta/document_processing_config.rb +6 -0
  92. data/proto_docs/google/cloud/discoveryengine/v1beta/document_service.rb +8 -0
  93. data/proto_docs/google/cloud/discoveryengine/v1beta/engine.rb +4 -0
  94. data/proto_docs/google/cloud/discoveryengine/v1beta/grounded_generation_service.rb +6 -0
  95. data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +40 -0
  96. data/proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb +4 -0
  97. data/proto_docs/google/cloud/discoveryengine/v1beta/schema.rb +4 -0
  98. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +14 -0
  99. data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config.rb +8 -0
  100. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +6 -0
  101. data/proto_docs/google/longrunning/operations.rb +23 -14
  102. data/proto_docs/google/protobuf/struct.rb +12 -0
  103. metadata +6 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03ccf808ee4fe5e65560966192cbc367522c8aaedfd4a21bfadb17a34afe5395
4
- data.tar.gz: c048a44de610ddce2da04abd17d2e97a53b2b303d820cc3cb9a9906eee562d33
3
+ metadata.gz: f6ecff28eba445244be03d01f1d369b308382ec42ffd3d71af656624930a32ce
4
+ data.tar.gz: a2d391b256cf03a8569832f79ec1cfed3c79d40c662d56723df8f0219ce35d95
5
5
  SHA512:
6
- metadata.gz: 5479fd924bf38180abed0eef647521985fcb9bbc9af2c8870d5d5ea131ede9d5c3b7dd326c480ad0a1b491a352ea0d769ea5b46ade241cba7d320252fad341c1
7
- data.tar.gz: 6a945dbda3267553c018174928bd1b346474933d8239e064265d07e46061642f376061fd806ac7aef047ca2d5cffe39f27b64dbf25e2125a52ec2fe90263d791
6
+ metadata.gz: d05bd2647b8de3e8cd1f404d1b28eadc4a0ffade2a809f6502f554c3f2533d54192a29713139efecdf2c825bc144417dc4dd60081646f211860d164d918bc5ac
7
+ data.tar.gz: 9d59b93beb89a019c2e36514000dc5f7c4bdb5a2a4e1297fb94aefc474b3e80f0e6093d353b8c50fa6554fc662cff6d2b98634957695ad8b12d7ac4309c7e129
data/README.md CHANGED
@@ -42,40 +42,50 @@ for class and method documentation.
42
42
  See also the [Product Documentation](https://cloud.google.com/generative-ai-app-builder/docs)
43
43
  for general usage information.
44
44
 
45
- ## Enabling Logging
46
-
47
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
48
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
49
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
50
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
51
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
52
-
53
- Configuring a Ruby stdlib logger:
45
+ ## Debug Logging
46
+
47
+ This library comes with opt-in Debug Logging that can help you troubleshoot
48
+ your application's integration with the API. When logging is activated, key
49
+ events such as requests and responses, along with data payloads and metadata
50
+ such as headers and client configuration, are logged to the standard error
51
+ stream.
52
+
53
+ **WARNING:** Client Library Debug Logging includes your data payloads in
54
+ plaintext, which could include sensitive data such as PII for yourself or your
55
+ customers, private keys, or other security data that could be compromising if
56
+ leaked. Always practice good data hygiene with your application logs, and follow
57
+ the principle of least access. Google also recommends that Client Library Debug
58
+ Logging be enabled only temporarily during active debugging, and not used
59
+ permanently in production.
60
+
61
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
62
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
63
+ list of client library gem names. This will select the default logging behavior,
64
+ which writes logs to the standard error stream. On a local workstation, this may
65
+ result in logs appearing on the console. When running on a Google Cloud hosting
66
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
67
+ results in logs appearing alongside your application logs in the
68
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
69
+
70
+ You can customize logging by modifying the `logger` configuration when
71
+ constructing a client object. For example:
54
72
 
55
73
  ```ruby
74
+ require "google/cloud/discovery_engine/v1beta"
56
75
  require "logger"
57
76
 
58
- module MyLogger
59
- LOGGER = Logger.new $stderr, level: Logger::WARN
60
- def logger
61
- LOGGER
62
- end
63
- end
64
-
65
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
66
- module GRPC
67
- extend MyLogger
77
+ client = ::Google::Cloud::DiscoveryEngine::V1beta::CompletionService::Client.new do |config|
78
+ config.logger = Logger.new "my-app.log"
68
79
  end
69
80
  ```
70
81
 
71
-
72
82
  ## Google Cloud Samples
73
83
 
74
84
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
75
85
 
76
86
  ## Supported Ruby Versions
77
87
 
78
- This library is supported on Ruby 2.7+.
88
+ This library is supported on Ruby 3.0+.
79
89
 
80
90
  Google provides official support for Ruby versions that are actively supported
81
91
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -170,14 +170,26 @@ module Google
170
170
  universe_domain: @config.universe_domain,
171
171
  channel_args: @config.channel_args,
172
172
  interceptors: @config.interceptors,
173
- channel_pool_config: @config.channel_pool
173
+ channel_pool_config: @config.channel_pool,
174
+ logger: @config.logger
174
175
  )
175
176
 
177
+ @completion_service_stub.stub_logger&.info do |entry|
178
+ entry.set_system_name
179
+ entry.set_service
180
+ entry.message = "Created client for #{entry.service}"
181
+ entry.set_credentials_fields credentials
182
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
183
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
184
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
185
+ end
186
+
176
187
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
177
188
  config.credentials = credentials
178
189
  config.quota_project = @quota_project_id
179
190
  config.endpoint = @completion_service_stub.endpoint
180
191
  config.universe_domain = @completion_service_stub.universe_domain
192
+ config.logger = @completion_service_stub.logger if config.respond_to? :logger=
181
193
  end
182
194
  end
183
195
 
@@ -195,6 +207,15 @@ module Google
195
207
  #
196
208
  attr_reader :location_client
197
209
 
210
+ ##
211
+ # The logger used for request/response debug logging.
212
+ #
213
+ # @return [Logger]
214
+ #
215
+ def logger
216
+ @completion_service_stub.logger
217
+ end
218
+
198
219
  # Service calls
199
220
 
200
221
  ##
@@ -320,7 +341,6 @@ module Google
320
341
 
321
342
  @completion_service_stub.call_rpc :complete_query, request, options: options do |response, operation|
322
343
  yield response, operation if block_given?
323
- return response
324
344
  end
325
345
  rescue ::GRPC::BadStatus => e
326
346
  raise ::Google::Cloud::Error.from_error(e)
@@ -468,7 +488,6 @@ module Google
468
488
 
469
489
  @completion_service_stub.call_rpc :advanced_complete_query, request, options: options do |response, operation|
470
490
  yield response, operation if block_given?
471
- return response
472
491
  end
473
492
  rescue ::GRPC::BadStatus => e
474
493
  raise ::Google::Cloud::Error.from_error(e)
@@ -496,6 +515,8 @@ module Google
496
515
  #
497
516
  # @param inline_source [::Google::Cloud::DiscoveryEngine::V1beta::ImportSuggestionDenyListEntriesRequest::InlineSource, ::Hash]
498
517
  # The Inline source for the input content for suggestion deny list entries.
518
+ #
519
+ # Note: The following fields are mutually exclusive: `inline_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
499
520
  # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1beta::GcsSource, ::Hash]
500
521
  # Cloud Storage location for the input content.
501
522
  #
@@ -505,6 +526,8 @@ module Google
505
526
  #
506
527
  # * `suggestion_deny_list` (default): One JSON [SuggestionDenyListEntry]
507
528
  # per line.
529
+ #
530
+ # Note: The following fields are mutually exclusive: `gcs_source`, `inline_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
508
531
  # @param parent [::String]
509
532
  # Required. The parent data store resource name for which to import denylist
510
533
  # entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*.
@@ -576,7 +599,7 @@ module Google
576
599
  @completion_service_stub.call_rpc :import_suggestion_deny_list_entries, request, options: options do |response, operation|
577
600
  response = ::Gapic::Operation.new response, @operations_client, options: options
578
601
  yield response, operation if block_given?
579
- return response
602
+ throw :response, response
580
603
  end
581
604
  rescue ::GRPC::BadStatus => e
582
605
  raise ::Google::Cloud::Error.from_error(e)
@@ -673,7 +696,7 @@ module Google
673
696
  @completion_service_stub.call_rpc :purge_suggestion_deny_list_entries, request, options: options do |response, operation|
674
697
  response = ::Gapic::Operation.new response, @operations_client, options: options
675
698
  yield response, operation if block_given?
676
- return response
699
+ throw :response, response
677
700
  end
678
701
  rescue ::GRPC::BadStatus => e
679
702
  raise ::Google::Cloud::Error.from_error(e)
@@ -701,10 +724,16 @@ module Google
701
724
  #
702
725
  # @param inline_source [::Google::Cloud::DiscoveryEngine::V1beta::ImportCompletionSuggestionsRequest::InlineSource, ::Hash]
703
726
  # The Inline source for suggestion entries.
727
+ #
728
+ # Note: The following fields are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
704
729
  # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1beta::GcsSource, ::Hash]
705
730
  # Cloud Storage location for the input content.
731
+ #
732
+ # Note: The following fields are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
706
733
  # @param bigquery_source [::Google::Cloud::DiscoveryEngine::V1beta::BigQuerySource, ::Hash]
707
734
  # BigQuery input source.
735
+ #
736
+ # Note: The following fields are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
708
737
  # @param parent [::String]
709
738
  # Required. The parent data store resource name for which to import customer
710
739
  # autocomplete suggestions.
@@ -780,7 +809,7 @@ module Google
780
809
  @completion_service_stub.call_rpc :import_completion_suggestions, request, options: options do |response, operation|
781
810
  response = ::Gapic::Operation.new response, @operations_client, options: options
782
811
  yield response, operation if block_given?
783
- return response
812
+ throw :response, response
784
813
  end
785
814
  rescue ::GRPC::BadStatus => e
786
815
  raise ::Google::Cloud::Error.from_error(e)
@@ -878,7 +907,7 @@ module Google
878
907
  @completion_service_stub.call_rpc :purge_completion_suggestions, request, options: options do |response, operation|
879
908
  response = ::Gapic::Operation.new response, @operations_client, options: options
880
909
  yield response, operation if block_given?
881
- return response
910
+ throw :response, response
882
911
  end
883
912
  rescue ::GRPC::BadStatus => e
884
913
  raise ::Google::Cloud::Error.from_error(e)
@@ -928,6 +957,13 @@ module Google
928
957
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
929
958
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
930
959
  # * (`nil`) indicating no credentials
960
+ #
961
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
962
+ # external source for authentication to Google Cloud, you must validate it before
963
+ # providing it to a Google API client library. Providing an unvalidated credential
964
+ # configuration to Google APIs can compromise the security of your systems and data.
965
+ # For more information, refer to [Validate credential configurations from external
966
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
931
967
  # @return [::Object]
932
968
  # @!attribute [rw] scope
933
969
  # The OAuth scopes
@@ -967,6 +1003,11 @@ module Google
967
1003
  # default endpoint URL. The default value of nil uses the environment
968
1004
  # universe (usually the default "googleapis.com" universe).
969
1005
  # @return [::String,nil]
1006
+ # @!attribute [rw] logger
1007
+ # A custom logger to use for request/response debug logging, or the value
1008
+ # `:default` (the default) to construct a default logger, or `nil` to
1009
+ # explicitly disable logging.
1010
+ # @return [::Logger,:default,nil]
970
1011
  #
971
1012
  class Configuration
972
1013
  extend ::Gapic::Config
@@ -991,6 +1032,7 @@ module Google
991
1032
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
992
1033
  config_attr :quota_project, nil, ::String, nil
993
1034
  config_attr :universe_domain, nil, ::String, nil
1035
+ config_attr :logger, :default, ::Logger, nil, :default
994
1036
 
995
1037
  # @private
996
1038
  def initialize parent_config = nil
@@ -124,14 +124,6 @@ module Google
124
124
  # Lists operations that match the specified filter in the request. If the
125
125
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
126
126
  #
127
- # NOTE: the `name` binding allows API services to override the binding
128
- # to use different resource name schemes, such as `users/*/operations`. To
129
- # override the binding, API services can add a binding such as
130
- # `"/v1/{name=users/*}/operations"` to their service configuration.
131
- # For backwards compatibility, the default name includes the operations
132
- # collection id, however overriding users must ensure the name binding
133
- # is the parent resource, without the operations collection id.
134
- #
135
127
  # @overload list_operations(request, options = nil)
136
128
  # Pass arguments to `list_operations` via a request object, either of type
137
129
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -221,7 +213,7 @@ module Google
221
213
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
222
214
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
223
215
  yield response, operation if block_given?
224
- return response
216
+ throw :response, response
225
217
  end
226
218
  rescue ::GRPC::BadStatus => e
227
219
  raise ::Google::Cloud::Error.from_error(e)
@@ -317,7 +309,7 @@ module Google
317
309
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
318
310
  response = ::Gapic::Operation.new response, @operations_client, options: options
319
311
  yield response, operation if block_given?
320
- return response
312
+ throw :response, response
321
313
  end
322
314
  rescue ::GRPC::BadStatus => e
323
315
  raise ::Google::Cloud::Error.from_error(e)
@@ -406,7 +398,6 @@ module Google
406
398
 
407
399
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
408
400
  yield response, operation if block_given?
409
- return response
410
401
  end
411
402
  rescue ::GRPC::BadStatus => e
412
403
  raise ::Google::Cloud::Error.from_error(e)
@@ -421,8 +412,9 @@ module Google
421
412
  # other methods to check whether the cancellation succeeded or whether the
422
413
  # operation completed despite cancellation. On successful cancellation,
423
414
  # the operation is not deleted; instead, it becomes an operation with
424
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
425
- # corresponding to `Code.CANCELLED`.
415
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
416
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
417
+ # `Code.CANCELLED`.
426
418
  #
427
419
  # @overload cancel_operation(request, options = nil)
428
420
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -501,7 +493,6 @@ module Google
501
493
 
502
494
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
503
495
  yield response, operation if block_given?
504
- return response
505
496
  end
506
497
  rescue ::GRPC::BadStatus => e
507
498
  raise ::Google::Cloud::Error.from_error(e)
@@ -599,7 +590,7 @@ module Google
599
590
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
600
591
  response = ::Gapic::Operation.new response, @operations_client, options: options
601
592
  yield response, operation if block_given?
602
- return response
593
+ throw :response, response
603
594
  end
604
595
  rescue ::GRPC::BadStatus => e
605
596
  raise ::Google::Cloud::Error.from_error(e)
@@ -649,6 +640,13 @@ module Google
649
640
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
650
641
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
651
642
  # * (`nil`) indicating no credentials
643
+ #
644
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
645
+ # external source for authentication to Google Cloud, you must validate it before
646
+ # providing it to a Google API client library. Providing an unvalidated credential
647
+ # configuration to Google APIs can compromise the security of your systems and data.
648
+ # For more information, refer to [Validate credential configurations from external
649
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
652
650
  # @return [::Object]
653
651
  # @!attribute [rw] scope
654
652
  # The OAuth scopes
@@ -688,6 +686,11 @@ module Google
688
686
  # default endpoint URL. The default value of nil uses the environment
689
687
  # universe (usually the default "googleapis.com" universe).
690
688
  # @return [::String,nil]
689
+ # @!attribute [rw] logger
690
+ # A custom logger to use for request/response debug logging, or the value
691
+ # `:default` (the default) to construct a default logger, or `nil` to
692
+ # explicitly disable logging.
693
+ # @return [::Logger,:default,nil]
691
694
  #
692
695
  class Configuration
693
696
  extend ::Gapic::Config
@@ -712,6 +715,7 @@ module Google
712
715
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
713
716
  config_attr :quota_project, nil, ::String, nil
714
717
  config_attr :universe_domain, nil, ::String, nil
718
+ config_attr :logger, :default, ::Logger, nil, :default
715
719
 
716
720
  # @private
717
721
  def initialize parent_config = nil
@@ -163,14 +163,26 @@ module Google
163
163
  endpoint: @config.endpoint,
164
164
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
165
165
  universe_domain: @config.universe_domain,
166
- credentials: credentials
166
+ credentials: credentials,
167
+ logger: @config.logger
167
168
  )
168
169
 
170
+ @completion_service_stub.logger(stub: true)&.info do |entry|
171
+ entry.set_system_name
172
+ entry.set_service
173
+ entry.message = "Created client for #{entry.service}"
174
+ entry.set_credentials_fields credentials
175
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
176
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
177
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
178
+ end
179
+
169
180
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
170
181
  config.credentials = credentials
171
182
  config.quota_project = @quota_project_id
172
183
  config.endpoint = @completion_service_stub.endpoint
173
184
  config.universe_domain = @completion_service_stub.universe_domain
185
+ config.logger = @completion_service_stub.logger if config.respond_to? :logger=
174
186
  end
175
187
  end
176
188
 
@@ -188,6 +200,15 @@ module Google
188
200
  #
189
201
  attr_reader :location_client
190
202
 
203
+ ##
204
+ # The logger used for request/response debug logging.
205
+ #
206
+ # @return [Logger]
207
+ #
208
+ def logger
209
+ @completion_service_stub.logger
210
+ end
211
+
191
212
  # Service calls
192
213
 
193
214
  ##
@@ -306,7 +327,6 @@ module Google
306
327
 
307
328
  @completion_service_stub.complete_query request, options do |result, operation|
308
329
  yield result, operation if block_given?
309
- return result
310
330
  end
311
331
  rescue ::Gapic::Rest::Error => e
312
332
  raise ::Google::Cloud::Error.from_error(e)
@@ -447,7 +467,6 @@ module Google
447
467
 
448
468
  @completion_service_stub.advanced_complete_query request, options do |result, operation|
449
469
  yield result, operation if block_given?
450
- return result
451
470
  end
452
471
  rescue ::Gapic::Rest::Error => e
453
472
  raise ::Google::Cloud::Error.from_error(e)
@@ -475,6 +494,8 @@ module Google
475
494
  #
476
495
  # @param inline_source [::Google::Cloud::DiscoveryEngine::V1beta::ImportSuggestionDenyListEntriesRequest::InlineSource, ::Hash]
477
496
  # The Inline source for the input content for suggestion deny list entries.
497
+ #
498
+ # Note: The following fields are mutually exclusive: `inline_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
478
499
  # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1beta::GcsSource, ::Hash]
479
500
  # Cloud Storage location for the input content.
480
501
  #
@@ -484,6 +505,8 @@ module Google
484
505
  #
485
506
  # * `suggestion_deny_list` (default): One JSON [SuggestionDenyListEntry]
486
507
  # per line.
508
+ #
509
+ # Note: The following fields are mutually exclusive: `gcs_source`, `inline_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
487
510
  # @param parent [::String]
488
511
  # Required. The parent data store resource name for which to import denylist
489
512
  # entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*.
@@ -548,7 +571,7 @@ module Google
548
571
  @completion_service_stub.import_suggestion_deny_list_entries request, options do |result, operation|
549
572
  result = ::Gapic::Operation.new result, @operations_client, options: options
550
573
  yield result, operation if block_given?
551
- return result
574
+ throw :response, result
552
575
  end
553
576
  rescue ::Gapic::Rest::Error => e
554
577
  raise ::Google::Cloud::Error.from_error(e)
@@ -638,7 +661,7 @@ module Google
638
661
  @completion_service_stub.purge_suggestion_deny_list_entries request, options do |result, operation|
639
662
  result = ::Gapic::Operation.new result, @operations_client, options: options
640
663
  yield result, operation if block_given?
641
- return result
664
+ throw :response, result
642
665
  end
643
666
  rescue ::Gapic::Rest::Error => e
644
667
  raise ::Google::Cloud::Error.from_error(e)
@@ -666,10 +689,16 @@ module Google
666
689
  #
667
690
  # @param inline_source [::Google::Cloud::DiscoveryEngine::V1beta::ImportCompletionSuggestionsRequest::InlineSource, ::Hash]
668
691
  # The Inline source for suggestion entries.
692
+ #
693
+ # Note: The following fields are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
669
694
  # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1beta::GcsSource, ::Hash]
670
695
  # Cloud Storage location for the input content.
696
+ #
697
+ # Note: The following fields are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
671
698
  # @param bigquery_source [::Google::Cloud::DiscoveryEngine::V1beta::BigQuerySource, ::Hash]
672
699
  # BigQuery input source.
700
+ #
701
+ # Note: The following fields are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
673
702
  # @param parent [::String]
674
703
  # Required. The parent data store resource name for which to import customer
675
704
  # autocomplete suggestions.
@@ -738,7 +767,7 @@ module Google
738
767
  @completion_service_stub.import_completion_suggestions request, options do |result, operation|
739
768
  result = ::Gapic::Operation.new result, @operations_client, options: options
740
769
  yield result, operation if block_given?
741
- return result
770
+ throw :response, result
742
771
  end
743
772
  rescue ::Gapic::Rest::Error => e
744
773
  raise ::Google::Cloud::Error.from_error(e)
@@ -829,7 +858,7 @@ module Google
829
858
  @completion_service_stub.purge_completion_suggestions request, options do |result, operation|
830
859
  result = ::Gapic::Operation.new result, @operations_client, options: options
831
860
  yield result, operation if block_given?
832
- return result
861
+ throw :response, result
833
862
  end
834
863
  rescue ::Gapic::Rest::Error => e
835
864
  raise ::Google::Cloud::Error.from_error(e)
@@ -877,6 +906,13 @@ module Google
877
906
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
878
907
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
879
908
  # * (`nil`) indicating no credentials
909
+ #
910
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
911
+ # external source for authentication to Google Cloud, you must validate it before
912
+ # providing it to a Google API client library. Providing an unvalidated credential
913
+ # configuration to Google APIs can compromise the security of your systems and data.
914
+ # For more information, refer to [Validate credential configurations from external
915
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
880
916
  # @return [::Object]
881
917
  # @!attribute [rw] scope
882
918
  # The OAuth scopes
@@ -909,6 +945,11 @@ module Google
909
945
  # default endpoint URL. The default value of nil uses the environment
910
946
  # universe (usually the default "googleapis.com" universe).
911
947
  # @return [::String,nil]
948
+ # @!attribute [rw] logger
949
+ # A custom logger to use for request/response debug logging, or the value
950
+ # `:default` (the default) to construct a default logger, or `nil` to
951
+ # explicitly disable logging.
952
+ # @return [::Logger,:default,nil]
912
953
  #
913
954
  class Configuration
914
955
  extend ::Gapic::Config
@@ -930,6 +971,7 @@ module Google
930
971
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
931
972
  config_attr :quota_project, nil, ::String, nil
932
973
  config_attr :universe_domain, nil, ::String, nil
974
+ config_attr :logger, :default, ::Logger, nil, :default
933
975
 
934
976
  # @private
935
977
  def initialize parent_config = nil