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
@@ -164,14 +164,26 @@ module Google
164
164
  universe_domain: @config.universe_domain,
165
165
  channel_args: @config.channel_args,
166
166
  interceptors: @config.interceptors,
167
- channel_pool_config: @config.channel_pool
167
+ channel_pool_config: @config.channel_pool,
168
+ logger: @config.logger
168
169
  )
169
170
 
171
+ @sample_query_set_service_stub.stub_logger&.info do |entry|
172
+ entry.set_system_name
173
+ entry.set_service
174
+ entry.message = "Created client for #{entry.service}"
175
+ entry.set_credentials_fields credentials
176
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
177
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
178
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
179
+ end
180
+
170
181
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
171
182
  config.credentials = credentials
172
183
  config.quota_project = @quota_project_id
173
184
  config.endpoint = @sample_query_set_service_stub.endpoint
174
185
  config.universe_domain = @sample_query_set_service_stub.universe_domain
186
+ config.logger = @sample_query_set_service_stub.logger if config.respond_to? :logger=
175
187
  end
176
188
  end
177
189
 
@@ -182,6 +194,15 @@ module Google
182
194
  #
183
195
  attr_reader :location_client
184
196
 
197
+ ##
198
+ # The logger used for request/response debug logging.
199
+ #
200
+ # @return [Logger]
201
+ #
202
+ def logger
203
+ @sample_query_set_service_stub.logger
204
+ end
205
+
185
206
  # Service calls
186
207
 
187
208
  ##
@@ -277,7 +298,6 @@ module Google
277
298
 
278
299
  @sample_query_set_service_stub.call_rpc :get_sample_query_set, request, options: options do |response, operation|
279
300
  yield response, operation if block_given?
280
- return response
281
301
  end
282
302
  rescue ::GRPC::BadStatus => e
283
303
  raise ::Google::Cloud::Error.from_error(e)
@@ -393,7 +413,7 @@ module Google
393
413
  @sample_query_set_service_stub.call_rpc :list_sample_query_sets, request, options: options do |response, operation|
394
414
  response = ::Gapic::PagedEnumerable.new @sample_query_set_service_stub, :list_sample_query_sets, request, response, operation, options
395
415
  yield response, operation if block_given?
396
- return response
416
+ throw :response, response
397
417
  end
398
418
  rescue ::GRPC::BadStatus => e
399
419
  raise ::Google::Cloud::Error.from_error(e)
@@ -505,7 +525,6 @@ module Google
505
525
 
506
526
  @sample_query_set_service_stub.call_rpc :create_sample_query_set, request, options: options do |response, operation|
507
527
  yield response, operation if block_given?
508
- return response
509
528
  end
510
529
  rescue ::GRPC::BadStatus => e
511
530
  raise ::Google::Cloud::Error.from_error(e)
@@ -603,7 +622,6 @@ module Google
603
622
 
604
623
  @sample_query_set_service_stub.call_rpc :update_sample_query_set, request, options: options do |response, operation|
605
624
  yield response, operation if block_given?
606
- return response
607
625
  end
608
626
  rescue ::GRPC::BadStatus => e
609
627
  raise ::Google::Cloud::Error.from_error(e)
@@ -701,7 +719,6 @@ module Google
701
719
 
702
720
  @sample_query_set_service_stub.call_rpc :delete_sample_query_set, request, options: options do |response, operation|
703
721
  yield response, operation if block_given?
704
- return response
705
722
  end
706
723
  rescue ::GRPC::BadStatus => e
707
724
  raise ::Google::Cloud::Error.from_error(e)
@@ -751,6 +768,13 @@ module Google
751
768
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
752
769
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
753
770
  # * (`nil`) indicating no credentials
771
+ #
772
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
773
+ # external source for authentication to Google Cloud, you must validate it before
774
+ # providing it to a Google API client library. Providing an unvalidated credential
775
+ # configuration to Google APIs can compromise the security of your systems and data.
776
+ # For more information, refer to [Validate credential configurations from external
777
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
754
778
  # @return [::Object]
755
779
  # @!attribute [rw] scope
756
780
  # The OAuth scopes
@@ -790,6 +814,11 @@ module Google
790
814
  # default endpoint URL. The default value of nil uses the environment
791
815
  # universe (usually the default "googleapis.com" universe).
792
816
  # @return [::String,nil]
817
+ # @!attribute [rw] logger
818
+ # A custom logger to use for request/response debug logging, or the value
819
+ # `:default` (the default) to construct a default logger, or `nil` to
820
+ # explicitly disable logging.
821
+ # @return [::Logger,:default,nil]
793
822
  #
794
823
  class Configuration
795
824
  extend ::Gapic::Config
@@ -814,6 +843,7 @@ module Google
814
843
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
815
844
  config_attr :quota_project, nil, ::String, nil
816
845
  config_attr :universe_domain, nil, ::String, nil
846
+ config_attr :logger, :default, ::Logger, nil, :default
817
847
 
818
848
  # @private
819
849
  def initialize parent_config = nil
@@ -157,14 +157,26 @@ module Google
157
157
  endpoint: @config.endpoint,
158
158
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
159
159
  universe_domain: @config.universe_domain,
160
- credentials: credentials
160
+ credentials: credentials,
161
+ logger: @config.logger
161
162
  )
162
163
 
164
+ @sample_query_set_service_stub.logger(stub: true)&.info do |entry|
165
+ entry.set_system_name
166
+ entry.set_service
167
+ entry.message = "Created client for #{entry.service}"
168
+ entry.set_credentials_fields credentials
169
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
170
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
171
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
172
+ end
173
+
163
174
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
164
175
  config.credentials = credentials
165
176
  config.quota_project = @quota_project_id
166
177
  config.endpoint = @sample_query_set_service_stub.endpoint
167
178
  config.universe_domain = @sample_query_set_service_stub.universe_domain
179
+ config.logger = @sample_query_set_service_stub.logger if config.respond_to? :logger=
168
180
  end
169
181
  end
170
182
 
@@ -175,6 +187,15 @@ module Google
175
187
  #
176
188
  attr_reader :location_client
177
189
 
190
+ ##
191
+ # The logger used for request/response debug logging.
192
+ #
193
+ # @return [Logger]
194
+ #
195
+ def logger
196
+ @sample_query_set_service_stub.logger
197
+ end
198
+
178
199
  # Service calls
179
200
 
180
201
  ##
@@ -263,7 +284,6 @@ module Google
263
284
 
264
285
  @sample_query_set_service_stub.get_sample_query_set request, options do |result, operation|
265
286
  yield result, operation if block_given?
266
- return result
267
287
  end
268
288
  rescue ::Gapic::Rest::Error => e
269
289
  raise ::Google::Cloud::Error.from_error(e)
@@ -372,7 +392,7 @@ module Google
372
392
  @sample_query_set_service_stub.list_sample_query_sets request, options do |result, operation|
373
393
  result = ::Gapic::Rest::PagedEnumerable.new @sample_query_set_service_stub, :list_sample_query_sets, "sample_query_sets", request, result, options
374
394
  yield result, operation if block_given?
375
- return result
395
+ throw :response, result
376
396
  end
377
397
  rescue ::Gapic::Rest::Error => e
378
398
  raise ::Google::Cloud::Error.from_error(e)
@@ -477,7 +497,6 @@ module Google
477
497
 
478
498
  @sample_query_set_service_stub.create_sample_query_set request, options do |result, operation|
479
499
  yield result, operation if block_given?
480
- return result
481
500
  end
482
501
  rescue ::Gapic::Rest::Error => e
483
502
  raise ::Google::Cloud::Error.from_error(e)
@@ -568,7 +587,6 @@ module Google
568
587
 
569
588
  @sample_query_set_service_stub.update_sample_query_set request, options do |result, operation|
570
589
  yield result, operation if block_given?
571
- return result
572
590
  end
573
591
  rescue ::Gapic::Rest::Error => e
574
592
  raise ::Google::Cloud::Error.from_error(e)
@@ -659,7 +677,6 @@ module Google
659
677
 
660
678
  @sample_query_set_service_stub.delete_sample_query_set request, options do |result, operation|
661
679
  yield result, operation if block_given?
662
- return result
663
680
  end
664
681
  rescue ::Gapic::Rest::Error => e
665
682
  raise ::Google::Cloud::Error.from_error(e)
@@ -707,6 +724,13 @@ module Google
707
724
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
708
725
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
709
726
  # * (`nil`) indicating no credentials
727
+ #
728
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
729
+ # external source for authentication to Google Cloud, you must validate it before
730
+ # providing it to a Google API client library. Providing an unvalidated credential
731
+ # configuration to Google APIs can compromise the security of your systems and data.
732
+ # For more information, refer to [Validate credential configurations from external
733
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
710
734
  # @return [::Object]
711
735
  # @!attribute [rw] scope
712
736
  # The OAuth scopes
@@ -739,6 +763,11 @@ module Google
739
763
  # default endpoint URL. The default value of nil uses the environment
740
764
  # universe (usually the default "googleapis.com" universe).
741
765
  # @return [::String,nil]
766
+ # @!attribute [rw] logger
767
+ # A custom logger to use for request/response debug logging, or the value
768
+ # `:default` (the default) to construct a default logger, or `nil` to
769
+ # explicitly disable logging.
770
+ # @return [::Logger,:default,nil]
742
771
  #
743
772
  class Configuration
744
773
  extend ::Gapic::Config
@@ -760,6 +789,7 @@ module Google
760
789
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
761
790
  config_attr :quota_project, nil, ::String, nil
762
791
  config_attr :universe_domain, nil, ::String, nil
792
+ config_attr :logger, :default, ::Logger, nil, :default
763
793
 
764
794
  # @private
765
795
  def initialize parent_config = nil
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the get_sample_query_set REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "get_sample_query_set",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::DiscoveryEngine::V1beta::SampleQuerySet.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "list_sample_query_sets",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::DiscoveryEngine::V1beta::ListSampleQuerySetsResponse.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -163,16 +179,18 @@ module Google
163
179
 
164
180
  response = @client_stub.make_http_request(
165
181
  verb,
166
- uri: uri,
167
- body: body || "",
168
- params: query_string_params,
182
+ uri: uri,
183
+ body: body || "",
184
+ params: query_string_params,
185
+ method_name: "create_sample_query_set",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Cloud::DiscoveryEngine::V1beta::SampleQuerySet.decode_json response.body, ignore_unknown_fields: true
173
-
174
- yield result, operation if block_given?
175
- result
190
+ catch :response do
191
+ yield result, operation if block_given?
192
+ result
193
+ end
176
194
  end
177
195
 
178
196
  ##
@@ -201,16 +219,18 @@ module Google
201
219
 
202
220
  response = @client_stub.make_http_request(
203
221
  verb,
204
- uri: uri,
205
- body: body || "",
206
- params: query_string_params,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ method_name: "update_sample_query_set",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Cloud::DiscoveryEngine::V1beta::SampleQuerySet.decode_json response.body, ignore_unknown_fields: true
211
-
212
- yield result, operation if block_given?
213
- result
230
+ catch :response do
231
+ yield result, operation if block_given?
232
+ result
233
+ end
214
234
  end
215
235
 
216
236
  ##
@@ -239,16 +259,18 @@ module Google
239
259
 
240
260
  response = @client_stub.make_http_request(
241
261
  verb,
242
- uri: uri,
243
- body: body || "",
244
- params: query_string_params,
262
+ uri: uri,
263
+ body: body || "",
264
+ params: query_string_params,
265
+ method_name: "delete_sample_query_set",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
249
-
250
- yield result, operation if block_given?
251
- result
270
+ catch :response do
271
+ yield result, operation if block_given?
272
+ result
273
+ end
252
274
  end
253
275
 
254
276
  ##
@@ -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
+ @schema_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 = @schema_service_stub.endpoint
180
191
  config.universe_domain = @schema_service_stub.universe_domain
192
+ config.logger = @schema_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
+ @schema_service_stub.logger
217
+ end
218
+
198
219
  # Service calls
199
220
 
200
221
  ##
@@ -278,7 +299,6 @@ module Google
278
299
 
279
300
  @schema_service_stub.call_rpc :get_schema, request, options: options do |response, operation|
280
301
  yield response, operation if block_given?
281
- return response
282
302
  end
283
303
  rescue ::GRPC::BadStatus => e
284
304
  raise ::Google::Cloud::Error.from_error(e)
@@ -386,7 +406,7 @@ module Google
386
406
  @schema_service_stub.call_rpc :list_schemas, request, options: options do |response, operation|
387
407
  response = ::Gapic::PagedEnumerable.new @schema_service_stub, :list_schemas, request, response, operation, options
388
408
  yield response, operation if block_given?
389
- return response
409
+ throw :response, response
390
410
  end
391
411
  rescue ::GRPC::BadStatus => e
392
412
  raise ::Google::Cloud::Error.from_error(e)
@@ -493,7 +513,7 @@ module Google
493
513
  @schema_service_stub.call_rpc :create_schema, request, options: options do |response, operation|
494
514
  response = ::Gapic::Operation.new response, @operations_client, options: options
495
515
  yield response, operation if block_given?
496
- return response
516
+ throw :response, response
497
517
  end
498
518
  rescue ::GRPC::BadStatus => e
499
519
  raise ::Google::Cloud::Error.from_error(e)
@@ -593,7 +613,7 @@ module Google
593
613
  @schema_service_stub.call_rpc :update_schema, request, options: options do |response, operation|
594
614
  response = ::Gapic::Operation.new response, @operations_client, options: options
595
615
  yield response, operation if block_given?
596
- return response
616
+ throw :response, response
597
617
  end
598
618
  rescue ::GRPC::BadStatus => e
599
619
  raise ::Google::Cloud::Error.from_error(e)
@@ -688,7 +708,7 @@ module Google
688
708
  @schema_service_stub.call_rpc :delete_schema, request, options: options do |response, operation|
689
709
  response = ::Gapic::Operation.new response, @operations_client, options: options
690
710
  yield response, operation if block_given?
691
- return response
711
+ throw :response, response
692
712
  end
693
713
  rescue ::GRPC::BadStatus => e
694
714
  raise ::Google::Cloud::Error.from_error(e)
@@ -738,6 +758,13 @@ module Google
738
758
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
739
759
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
740
760
  # * (`nil`) indicating no credentials
761
+ #
762
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
763
+ # external source for authentication to Google Cloud, you must validate it before
764
+ # providing it to a Google API client library. Providing an unvalidated credential
765
+ # configuration to Google APIs can compromise the security of your systems and data.
766
+ # For more information, refer to [Validate credential configurations from external
767
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
741
768
  # @return [::Object]
742
769
  # @!attribute [rw] scope
743
770
  # The OAuth scopes
@@ -777,6 +804,11 @@ module Google
777
804
  # default endpoint URL. The default value of nil uses the environment
778
805
  # universe (usually the default "googleapis.com" universe).
779
806
  # @return [::String,nil]
807
+ # @!attribute [rw] logger
808
+ # A custom logger to use for request/response debug logging, or the value
809
+ # `:default` (the default) to construct a default logger, or `nil` to
810
+ # explicitly disable logging.
811
+ # @return [::Logger,:default,nil]
780
812
  #
781
813
  class Configuration
782
814
  extend ::Gapic::Config
@@ -801,6 +833,7 @@ module Google
801
833
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
802
834
  config_attr :quota_project, nil, ::String, nil
803
835
  config_attr :universe_domain, nil, ::String, nil
836
+ config_attr :logger, :default, ::Logger, nil, :default
804
837
 
805
838
  # @private
806
839
  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