google-cloud-discovery_engine-v1beta 0.15.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -20
  3. data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +186 -6
  4. data/lib/google/cloud/discovery_engine/v1beta/completion_service/operations.rb +12 -15
  5. data/lib/google/cloud/discovery_engine/v1beta/completion_service/paths.rb +62 -0
  6. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +179 -6
  7. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/operations.rb +43 -38
  8. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb +131 -31
  9. data/lib/google/cloud/discovery_engine/v1beta/control_service/client.rb +35 -12
  10. data/lib/google/cloud/discovery_engine/v1beta/control_service/rest/client.rb +35 -12
  11. data/lib/google/cloud/discovery_engine/v1beta/control_service/rest/service_stub.rb +54 -32
  12. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +48 -27
  13. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +48 -27
  14. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/service_stub.rb +118 -80
  15. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/client.rb +31 -6
  16. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/operations.rb +12 -15
  17. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/client.rb +31 -6
  18. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/operations.rb +43 -38
  19. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/service_stub.rb +54 -32
  20. data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +31 -9
  21. data/lib/google/cloud/discovery_engine/v1beta/document_service/operations.rb +12 -15
  22. data/lib/google/cloud/discovery_engine/v1beta/document_service/paths.rb +25 -0
  23. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +31 -9
  24. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +43 -38
  25. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/service_stub.rb +78 -50
  26. data/lib/google/cloud/discovery_engine/v1beta/engine_service/client.rb +35 -12
  27. data/lib/google/cloud/discovery_engine/v1beta/engine_service/operations.rb +12 -15
  28. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/client.rb +35 -12
  29. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/operations.rb +43 -38
  30. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/service_stub.rb +78 -50
  31. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/client.rb +31 -5
  32. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/operations.rb +12 -15
  33. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/client.rb +31 -5
  34. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/operations.rb +43 -38
  35. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/service_stub.rb +46 -26
  36. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/client.rb +244 -6
  37. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/paths.rb +85 -0
  38. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/client.rb +152 -6
  39. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/service_stub.rb +83 -7
  40. data/lib/google/cloud/discovery_engine/v1beta/project_service/client.rb +29 -2
  41. data/lib/google/cloud/discovery_engine/v1beta/project_service/operations.rb +12 -15
  42. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/client.rb +29 -2
  43. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/operations.rb +43 -38
  44. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/service_stub.rb +22 -8
  45. data/lib/google/cloud/discovery_engine/v1beta/rank_service/client.rb +29 -3
  46. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/client.rb +29 -3
  47. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/service_stub.rb +22 -8
  48. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb +28 -2
  49. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb +28 -2
  50. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/service_stub.rb +22 -8
  51. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/client.rb +30 -7
  52. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/operations.rb +12 -15
  53. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/client.rb +30 -7
  54. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/operations.rb +43 -38
  55. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/service_stub.rb +62 -38
  56. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/client.rb +29 -6
  57. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest/client.rb +29 -6
  58. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest/service_stub.rb +54 -32
  59. data/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb +32 -6
  60. data/lib/google/cloud/discovery_engine/v1beta/schema_service/operations.rb +12 -15
  61. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb +32 -6
  62. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +43 -38
  63. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/service_stub.rb +54 -32
  64. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +427 -3
  65. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +417 -3
  66. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/service_stub.rb +99 -7
  67. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/client.rb +29 -3
  68. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/operations.rb +12 -15
  69. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/client.rb +29 -3
  70. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/operations.rb +43 -38
  71. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/service_stub.rb +30 -14
  72. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/client.rb +31 -6
  73. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest/client.rb +31 -6
  74. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest/service_stub.rb +38 -20
  75. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/client.rb +361 -14
  76. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/operations.rb +12 -15
  77. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/paths.rb +49 -0
  78. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/client.rb +340 -14
  79. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/operations.rb +43 -38
  80. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/service_stub.rb +308 -73
  81. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +31 -6
  82. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/operations.rb +12 -15
  83. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +31 -6
  84. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +43 -38
  85. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb +46 -26
  86. data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
  87. data/lib/google/cloud/discoveryengine/v1beta/answer_pb.rb +1 -1
  88. data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +1 -1
  89. data/lib/google/cloud/discoveryengine/v1beta/completion_service_pb.rb +18 -1
  90. data/lib/google/cloud/discoveryengine/v1beta/completion_service_services_pb.rb +2 -0
  91. data/lib/google/cloud/discoveryengine/v1beta/control_pb.rb +1 -1
  92. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +4 -1
  93. data/lib/google/cloud/discoveryengine/v1beta/custom_tuning_model_pb.rb +1 -1
  94. data/lib/google/cloud/discoveryengine/v1beta/data_store_pb.rb +7 -1
  95. data/lib/google/cloud/discoveryengine/v1beta/document_service_pb.rb +2 -1
  96. data/lib/google/cloud/discoveryengine/v1beta/engine_pb.rb +1 -1
  97. data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_pb.rb +24 -1
  98. data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_services_pb.rb +4 -0
  99. data/lib/google/cloud/discoveryengine/v1beta/grounding_pb.rb +2 -1
  100. data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +3 -1
  101. data/lib/google/cloud/discoveryengine/v1beta/search_service_services_pb.rb +14 -0
  102. data/lib/google/cloud/discoveryengine/v1beta/serving_config_pb.rb +2 -2
  103. data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_pb.rb +2 -1
  104. data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_service_pb.rb +10 -1
  105. data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_service_services_pb.rb +7 -0
  106. data/lib/google/cloud/discoveryengine/v1beta/user_event_pb.rb +1 -1
  107. data/proto_docs/google/api/client.rb +39 -0
  108. data/proto_docs/google/cloud/discoveryengine/v1beta/answer.rb +20 -6
  109. data/proto_docs/google/cloud/discoveryengine/v1beta/completion_service.rb +268 -0
  110. data/proto_docs/google/cloud/discoveryengine/v1beta/control.rb +9 -0
  111. data/proto_docs/google/cloud/discoveryengine/v1beta/control_service.rb +6 -6
  112. data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +95 -15
  113. data/proto_docs/google/cloud/discoveryengine/v1beta/custom_tuning_model.rb +8 -3
  114. data/proto_docs/google/cloud/discoveryengine/v1beta/data_store.rb +131 -0
  115. data/proto_docs/google/cloud/discoveryengine/v1beta/document_processing_config.rb +7 -5
  116. data/proto_docs/google/cloud/discoveryengine/v1beta/document_service.rb +19 -0
  117. data/proto_docs/google/cloud/discoveryengine/v1beta/engine.rb +5 -1
  118. data/proto_docs/google/cloud/discoveryengine/v1beta/engine_service.rb +4 -4
  119. data/proto_docs/google/cloud/discoveryengine/v1beta/grounded_generation_service.rb +396 -1
  120. data/proto_docs/google/cloud/discoveryengine/v1beta/grounding.rb +10 -0
  121. data/proto_docs/google/cloud/discoveryengine/v1beta/project.rb +1 -1
  122. data/proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb +1 -1
  123. data/proto_docs/google/cloud/discoveryengine/v1beta/rank_service.rb +1 -1
  124. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +71 -0
  125. data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config.rb +16 -0
  126. data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config_service.rb +2 -2
  127. data/proto_docs/google/cloud/discoveryengine/v1beta/site_search_engine.rb +17 -0
  128. data/proto_docs/google/cloud/discoveryengine/v1beta/site_search_engine_service.rb +147 -1
  129. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +9 -1
  130. data/proto_docs/google/longrunning/operations.rb +19 -14
  131. metadata +5 -5
@@ -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,146 @@ 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
330
+ end
331
+ rescue ::Gapic::Rest::Error => e
332
+ raise ::Google::Cloud::Error.from_error(e)
333
+ end
334
+
335
+ ##
336
+ # Completes the user input with advanced keyword suggestions.
337
+ #
338
+ # @overload advanced_complete_query(request, options = nil)
339
+ # Pass arguments to `advanced_complete_query` via a request object, either of type
340
+ # {::Google::Cloud::DiscoveryEngine::V1beta::AdvancedCompleteQueryRequest} or an equivalent Hash.
341
+ #
342
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::AdvancedCompleteQueryRequest, ::Hash]
343
+ # A request object representing the call parameters. Required. To specify no
344
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
345
+ # @param options [::Gapic::CallOptions, ::Hash]
346
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
347
+ #
348
+ # @overload advanced_complete_query(completion_config: nil, query: nil, query_model: nil, user_pseudo_id: nil, user_info: nil, include_tail_suggestions: nil, boost_spec: nil, suggestion_types: nil)
349
+ # Pass arguments to `advanced_complete_query` via keyword arguments. Note that at
350
+ # least one keyword argument is required. To specify no parameters, or to keep all
351
+ # the default parameter values, pass an empty Hash as a request object (see above).
352
+ #
353
+ # @param completion_config [::String]
354
+ # Required. The completion_config of the parent dataStore or engine resource
355
+ # name for which the completion is performed, such as
356
+ # `projects/*/locations/global/collections/default_collection/dataStores/*/completionConfig`
357
+ # `projects/*/locations/global/collections/default_collection/engines/*/completionConfig`.
358
+ # @param query [::String]
359
+ # Required. The typeahead input used to fetch suggestions. Maximum length is
360
+ # 128 characters.
361
+ #
362
+ # The query can not be empty for most of the suggestion types. If it is
363
+ # empty, an `INVALID_ARGUMENT` error is returned. The exception is when the
364
+ # suggestion_types contains only the type `RECENT_SEARCH`, the query can
365
+ # be an empty string. The is called "zero prefix" feature, which returns
366
+ # user's recently searched queries given the empty query.
367
+ # @param query_model [::String]
368
+ # Specifies the autocomplete data model. This overrides any model specified
369
+ # in the Configuration > Autocomplete section of the Cloud console. Currently
370
+ # supported values:
371
+ #
372
+ # * `document` - Using suggestions generated from user-imported documents.
373
+ # * `search-history` - Using suggestions generated from the past history of
374
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchService::Rest::Client#search SearchService.Search}
375
+ # API calls. Do not use it when there is no traffic for Search API.
376
+ # * `user-event` - Using suggestions generated from user-imported search
377
+ # events.
378
+ # * `document-completable` - Using suggestions taken directly from
379
+ # user-imported document fields marked as completable.
380
+ #
381
+ # Default values:
382
+ #
383
+ # * `document` is the default model for regular dataStores.
384
+ # * `search-history` is the default model for site search dataStores.
385
+ # @param user_pseudo_id [::String]
386
+ # A unique identifier for tracking visitors. For example, this could be
387
+ # implemented with an HTTP cookie, which should be able to uniquely identify
388
+ # a visitor on a single device. This unique identifier should not change if
389
+ # the visitor logs in or out of the website.
390
+ #
391
+ # This field should NOT have a fixed value such as `unknown_visitor`.
392
+ #
393
+ # This should be the same identifier as
394
+ # {::Google::Cloud::DiscoveryEngine::V1beta::UserEvent#user_pseudo_id UserEvent.user_pseudo_id}
395
+ # and
396
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#user_pseudo_id SearchRequest.user_pseudo_id}.
397
+ #
398
+ # The field must be a UTF-8 encoded string with a length limit of 128
399
+ # @param user_info [::Google::Cloud::DiscoveryEngine::V1beta::UserInfo, ::Hash]
400
+ # Optional. Information about the end user.
401
+ #
402
+ # This should be the same identifier information as
403
+ # {::Google::Cloud::DiscoveryEngine::V1beta::UserEvent#user_info UserEvent.user_info}
404
+ # and
405
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#user_info SearchRequest.user_info}.
406
+ # @param include_tail_suggestions [::Boolean]
407
+ # Indicates if tail suggestions should be returned if there are no
408
+ # suggestions that match the full query. Even if set to true, if there are
409
+ # suggestions that match the full query, those are returned and no
410
+ # tail suggestions are returned.
411
+ # @param boost_spec [::Google::Cloud::DiscoveryEngine::V1beta::AdvancedCompleteQueryRequest::BoostSpec, ::Hash]
412
+ # Optional. Specification to boost suggestions matching the condition.
413
+ # @param suggestion_types [::Array<::Google::Cloud::DiscoveryEngine::V1beta::AdvancedCompleteQueryRequest::SuggestionType>]
414
+ # Optional. Suggestion types to return. If empty or unspecified, query
415
+ # suggestions are returned. Only one suggestion type is supported at the
416
+ # moment.
417
+ # @yield [result, operation] Access the result along with the TransportOperation object
418
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::AdvancedCompleteQueryResponse]
419
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
420
+ #
421
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::AdvancedCompleteQueryResponse]
422
+ #
423
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
424
+ #
425
+ # @example Basic example
426
+ # require "google/cloud/discovery_engine/v1beta"
427
+ #
428
+ # # Create a client object. The client can be reused for multiple calls.
429
+ # client = Google::Cloud::DiscoveryEngine::V1beta::CompletionService::Rest::Client.new
430
+ #
431
+ # # Create a request. To set request fields, pass in keyword arguments.
432
+ # request = Google::Cloud::DiscoveryEngine::V1beta::AdvancedCompleteQueryRequest.new
433
+ #
434
+ # # Call the advanced_complete_query method.
435
+ # result = client.advanced_complete_query request
436
+ #
437
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::AdvancedCompleteQueryResponse.
438
+ # p result
439
+ #
440
+ def advanced_complete_query request, options = nil
441
+ raise ::ArgumentError, "request must be provided" if request.nil?
442
+
443
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::AdvancedCompleteQueryRequest
444
+
445
+ # Converts hash and nil to an options object
446
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
447
+
448
+ # Customize the options with defaults
449
+ call_metadata = @config.rpcs.advanced_complete_query.metadata.to_h
450
+
451
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
452
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
453
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
454
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
455
+ transports_version_send: [:rest]
456
+
457
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
458
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
459
+
460
+ options.apply_defaults timeout: @config.rpcs.advanced_complete_query.timeout,
461
+ metadata: call_metadata,
462
+ retry_policy: @config.rpcs.advanced_complete_query.retry_policy
463
+
464
+ options.apply_defaults timeout: @config.timeout,
465
+ metadata: @config.metadata,
466
+ retry_policy: @config.retry_policy
467
+
468
+ @completion_service_stub.advanced_complete_query request, options do |result, operation|
469
+ yield result, operation if block_given?
310
470
  end
311
471
  rescue ::Gapic::Rest::Error => e
312
472
  raise ::Google::Cloud::Error.from_error(e)
@@ -407,7 +567,7 @@ module Google
407
567
  @completion_service_stub.import_suggestion_deny_list_entries request, options do |result, operation|
408
568
  result = ::Gapic::Operation.new result, @operations_client, options: options
409
569
  yield result, operation if block_given?
410
- return result
570
+ throw :response, result
411
571
  end
412
572
  rescue ::Gapic::Rest::Error => e
413
573
  raise ::Google::Cloud::Error.from_error(e)
@@ -497,7 +657,7 @@ module Google
497
657
  @completion_service_stub.purge_suggestion_deny_list_entries request, options do |result, operation|
498
658
  result = ::Gapic::Operation.new result, @operations_client, options: options
499
659
  yield result, operation if block_given?
500
- return result
660
+ throw :response, result
501
661
  end
502
662
  rescue ::Gapic::Rest::Error => e
503
663
  raise ::Google::Cloud::Error.from_error(e)
@@ -597,7 +757,7 @@ module Google
597
757
  @completion_service_stub.import_completion_suggestions request, options do |result, operation|
598
758
  result = ::Gapic::Operation.new result, @operations_client, options: options
599
759
  yield result, operation if block_given?
600
- return result
760
+ throw :response, result
601
761
  end
602
762
  rescue ::Gapic::Rest::Error => e
603
763
  raise ::Google::Cloud::Error.from_error(e)
@@ -688,7 +848,7 @@ module Google
688
848
  @completion_service_stub.purge_completion_suggestions request, options do |result, operation|
689
849
  result = ::Gapic::Operation.new result, @operations_client, options: options
690
850
  yield result, operation if block_given?
691
- return result
851
+ throw :response, result
692
852
  end
693
853
  rescue ::Gapic::Rest::Error => e
694
854
  raise ::Google::Cloud::Error.from_error(e)
@@ -768,6 +928,11 @@ module Google
768
928
  # default endpoint URL. The default value of nil uses the environment
769
929
  # universe (usually the default "googleapis.com" universe).
770
930
  # @return [::String,nil]
931
+ # @!attribute [rw] logger
932
+ # A custom logger to use for request/response debug logging, or the value
933
+ # `:default` (the default) to construct a default logger, or `nil` to
934
+ # explicitly disable logging.
935
+ # @return [::Logger,:default,nil]
771
936
  #
772
937
  class Configuration
773
938
  extend ::Gapic::Config
@@ -789,6 +954,7 @@ module Google
789
954
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
790
955
  config_attr :quota_project, nil, ::String, nil
791
956
  config_attr :universe_domain, nil, ::String, nil
957
+ config_attr :logger, :default, ::Logger, nil, :default
792
958
 
793
959
  # @private
794
960
  def initialize parent_config = nil
@@ -833,6 +999,11 @@ module Google
833
999
  #
834
1000
  attr_reader :complete_query
835
1001
  ##
1002
+ # RPC-specific configuration for `advanced_complete_query`
1003
+ # @return [::Gapic::Config::Method]
1004
+ #
1005
+ attr_reader :advanced_complete_query
1006
+ ##
836
1007
  # RPC-specific configuration for `import_suggestion_deny_list_entries`
837
1008
  # @return [::Gapic::Config::Method]
838
1009
  #
@@ -857,6 +1028,8 @@ module Google
857
1028
  def initialize parent_rpcs = nil
858
1029
  complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query
859
1030
  @complete_query = ::Gapic::Config::Method.new complete_query_config
1031
+ advanced_complete_query_config = parent_rpcs.advanced_complete_query if parent_rpcs.respond_to? :advanced_complete_query
1032
+ @advanced_complete_query = ::Gapic::Config::Method.new advanced_complete_query_config
860
1033
  import_suggestion_deny_list_entries_config = parent_rpcs.import_suggestion_deny_list_entries if parent_rpcs.respond_to? :import_suggestion_deny_list_entries
861
1034
  @import_suggestion_deny_list_entries = ::Gapic::Config::Method.new import_suggestion_deny_list_entries_config
862
1035
  purge_suggestion_deny_list_entries_config = parent_rpcs.purge_suggestion_deny_list_entries if parent_rpcs.respond_to? :purge_suggestion_deny_list_entries
@@ -115,14 +115,6 @@ module Google
115
115
  # Lists operations that match the specified filter in the request. If the
116
116
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
117
117
  #
118
- # NOTE: the `name` binding allows API services to override the binding
119
- # to use different resource name schemes, such as `users/*/operations`. To
120
- # override the binding, API services can add a binding such as
121
- # `"/v1/{name=users/*}/operations"` to their service configuration.
122
- # For backwards compatibility, the default name includes the operations
123
- # collection id, however overriding users must ensure the name binding
124
- # is the parent resource, without the operations collection id.
125
- #
126
118
  # @overload list_operations(request, options = nil)
127
119
  # Pass arguments to `list_operations` via a request object, either of type
128
120
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -204,7 +196,7 @@ module Google
204
196
  @operations_stub.list_operations request, options do |result, operation|
205
197
  result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
206
198
  yield result, operation if block_given?
207
- return result
199
+ throw :response, result
208
200
  end
209
201
  rescue ::Gapic::Rest::Error => e
210
202
  raise ::Google::Cloud::Error.from_error(e)
@@ -293,7 +285,7 @@ module Google
293
285
  @operations_stub.get_operation request, options do |result, operation|
294
286
  result = ::Gapic::Operation.new result, @operations_client, options: options
295
287
  yield result, operation if block_given?
296
- return result
288
+ throw :response, result
297
289
  end
298
290
  rescue ::Gapic::Rest::Error => e
299
291
  raise ::Google::Cloud::Error.from_error(e)
@@ -375,7 +367,6 @@ module Google
375
367
 
376
368
  @operations_stub.delete_operation request, options do |result, operation|
377
369
  yield result, operation if block_given?
378
- return result
379
370
  end
380
371
  rescue ::Gapic::Rest::Error => e
381
372
  raise ::Google::Cloud::Error.from_error(e)
@@ -390,8 +381,9 @@ module Google
390
381
  # other methods to check whether the cancellation succeeded or whether the
391
382
  # operation completed despite cancellation. On successful cancellation,
392
383
  # the operation is not deleted; instead, it becomes an operation with
393
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
394
- # corresponding to `Code.CANCELLED`.
384
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
385
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
386
+ # `Code.CANCELLED`.
395
387
  #
396
388
  # @overload cancel_operation(request, options = nil)
397
389
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -463,7 +455,6 @@ module Google
463
455
 
464
456
  @operations_stub.cancel_operation request, options do |result, operation|
465
457
  yield result, operation if block_given?
466
- return result
467
458
  end
468
459
  rescue ::Gapic::Rest::Error => e
469
460
  raise ::Google::Cloud::Error.from_error(e)
@@ -543,6 +534,11 @@ module Google
543
534
  # default endpoint URL. The default value of nil uses the environment
544
535
  # universe (usually the default "googleapis.com" universe).
545
536
  # @return [::String,nil]
537
+ # @!attribute [rw] logger
538
+ # A custom logger to use for request/response debug logging, or the value
539
+ # `:default` (the default) to construct a default logger, or `nil` to
540
+ # explicitly disable logging.
541
+ # @return [::Logger,:default,nil]
546
542
  #
547
543
  class Configuration
548
544
  extend ::Gapic::Config
@@ -564,6 +560,7 @@ module Google
564
560
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
565
561
  config_attr :quota_project, nil, ::String, nil
566
562
  config_attr :universe_domain, nil, ::String, nil
563
+ config_attr :logger, :default, ::Logger, nil, :default
567
564
 
568
565
  # @private
569
566
  def initialize parent_config = nil
@@ -683,16 +680,18 @@ module Google
683
680
 
684
681
  response = @client_stub.make_http_request(
685
682
  verb,
686
- uri: uri,
687
- body: body || "",
688
- params: query_string_params,
683
+ uri: uri,
684
+ body: body || "",
685
+ params: query_string_params,
686
+ method_name: "list_operations",
689
687
  options: options
690
688
  )
691
689
  operation = ::Gapic::Rest::TransportOperation.new response
692
690
  result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
693
-
694
- yield result, operation if block_given?
695
- result
691
+ catch :response do
692
+ yield result, operation if block_given?
693
+ result
694
+ end
696
695
  end
697
696
 
698
697
  ##
@@ -721,16 +720,18 @@ module Google
721
720
 
722
721
  response = @client_stub.make_http_request(
723
722
  verb,
724
- uri: uri,
725
- body: body || "",
726
- params: query_string_params,
723
+ uri: uri,
724
+ body: body || "",
725
+ params: query_string_params,
726
+ method_name: "get_operation",
727
727
  options: options
728
728
  )
729
729
  operation = ::Gapic::Rest::TransportOperation.new response
730
730
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
731
-
732
- yield result, operation if block_given?
733
- result
731
+ catch :response do
732
+ yield result, operation if block_given?
733
+ result
734
+ end
734
735
  end
735
736
 
736
737
  ##
@@ -759,16 +760,18 @@ module Google
759
760
 
760
761
  response = @client_stub.make_http_request(
761
762
  verb,
762
- uri: uri,
763
- body: body || "",
764
- params: query_string_params,
763
+ uri: uri,
764
+ body: body || "",
765
+ params: query_string_params,
766
+ method_name: "delete_operation",
765
767
  options: options
766
768
  )
767
769
  operation = ::Gapic::Rest::TransportOperation.new response
768
770
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
769
-
770
- yield result, operation if block_given?
771
- result
771
+ catch :response do
772
+ yield result, operation if block_given?
773
+ result
774
+ end
772
775
  end
773
776
 
774
777
  ##
@@ -797,16 +800,18 @@ module Google
797
800
 
798
801
  response = @client_stub.make_http_request(
799
802
  verb,
800
- uri: uri,
801
- body: body || "",
802
- params: query_string_params,
803
+ uri: uri,
804
+ body: body || "",
805
+ params: query_string_params,
806
+ method_name: "cancel_operation",
803
807
  options: options
804
808
  )
805
809
  operation = ::Gapic::Rest::TransportOperation.new response
806
810
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
807
-
808
- yield result, operation if block_given?
809
- result
811
+ catch :response do
812
+ yield result, operation if block_given?
813
+ result
814
+ end
810
815
  end
811
816
 
812
817
  ##