google-cloud-dataqna-v1alpha 0.2.1 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd9e8ced460afd0f6580e075b6cbe8efd51c2e854199cddc3f32f649984f7f34
4
- data.tar.gz: cdb96a2428844e51a63e1a15d34961e0f801701cbc66d99b40d8ae8f0377ebf3
3
+ metadata.gz: 97026080cad20da35c49e74f411fe42db96ac73ab863826fa7d9736c3dbeed42
4
+ data.tar.gz: 4b7330e493789b85e56d740092e50bb2013e37d11718cd7aa0e106cec07c140c
5
5
  SHA512:
6
- metadata.gz: 56a7eef5020a159971706a4d3df85051e0bd8c0de61acb9e7fd316ca154fb2743182eac6903e3e7285dfc5f2a68bdcccf3296b2a9ab22d2d05ca5667ca7bf4cd
7
- data.tar.gz: 05ca33efffb7f7a17482986abae6e2943fb946bf67d467c45a54f86ca193d2a9f2f5071052115ee9c2c61396e4237444c3fc10df7a191739c0a7830a7e290f1e
6
+ metadata.gz: dd6086e1cdb72256f5d31f2e6eeb2d83b030e1851233549bc06a5cbebabaafe0ce4b8d81fb2c327343803effdb777e4847a5d300f75989f56a496fa2abb44bf3
7
+ data.tar.gz: a3784c5e79a89b29d4d4c53e2a82d3027be93d04568e5e4138e9a02eb7d596a1c71a74798605c6f8fa386d74393b6745b7763c26d69360840bde9ab6d3db149a
data/AUTHENTICATION.md CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-dataqna-v1alpha
66
66
  checks for credentials are configured on the service Credentials class (such as
67
67
  {::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Credentials}):
68
68
 
69
- 1. `BIGQUERY_DATAQNA_CREDENTIALS` - Path to JSON file, or JSON contents
70
- 2. `BIGQUERY_DATAQNA_KEYFILE` - Path to JSON file, or JSON contents
71
- 3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
- 4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
- 5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
69
+ * `BIGQUERY_DATAQNA_CREDENTIALS` - Path to JSON file, or JSON contents
70
+ * `BIGQUERY_DATAQNA_KEYFILE` - Path to JSON file, or JSON contents
71
+ * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
+ * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
+ * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
74
74
 
75
75
  ```ruby
76
76
  require "google/cloud/dataqna/v1alpha"
@@ -82,8 +82,8 @@ client = ::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client.new
82
82
 
83
83
  ### Configuration
84
84
 
85
- The **Credentials JSON** can be configured instead of placing them in
86
- environment variables. Either on an individual client initialization:
85
+ The path to the **Credentials JSON** file can be configured instead of storing
86
+ it in an environment variable. Either on an individual client initialization:
87
87
 
88
88
  ```ruby
89
89
  require "google/cloud/dataqna/v1alpha"
@@ -93,7 +93,7 @@ client = ::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client.new do
93
93
  end
94
94
  ```
95
95
 
96
- Or configured globally for all clients:
96
+ Or globally for all clients:
97
97
 
98
98
  ```ruby
99
99
  require "google/cloud/dataqna/v1alpha"
data/README.md CHANGED
@@ -33,16 +33,13 @@ In order to use this library, you first need to go through the following steps:
33
33
  require "google/cloud/dataqna/v1alpha"
34
34
 
35
35
  client = ::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client.new
36
- request = my_create_request
36
+ request = ::Google::Cloud::DataQnA::V1alpha::SuggestQueriesRequest.new # (request fields as keyword arguments...)
37
37
  response = client.suggest_queries request
38
38
  ```
39
39
 
40
40
  View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-dataqna-v1alpha/latest)
41
41
  for class and method documentation.
42
42
 
43
- See also the [Product Documentation](https://cloud.google.com/bigquery/docs/dataqna/)
44
- for general usage information.
45
-
46
43
  ## Enabling Logging
47
44
 
48
45
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
@@ -106,13 +106,12 @@ module Google
106
106
  # See {::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client::Configuration}
107
107
  # for a description of the configuration fields.
108
108
  #
109
- # ## Example
109
+ # @example
110
110
  #
111
- # To modify the configuration for all AutoSuggestionService clients:
112
- #
113
- # ::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client.configure do |config|
114
- # config.timeout = 10.0
115
- # end
111
+ # # Modify the configuration for all AutoSuggestionService clients
112
+ # ::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client.configure do |config|
113
+ # config.timeout = 10.0
114
+ # end
116
115
  #
117
116
  # @yield [config] Configure the Client client.
118
117
  # @yieldparam config [Client::Configuration]
@@ -161,19 +160,15 @@ module Google
161
160
  ##
162
161
  # Create a new AutoSuggestionService client object.
163
162
  #
164
- # ## Examples
165
- #
166
- # To create a new AutoSuggestionService client with the default
167
- # configuration:
163
+ # @example
168
164
  #
169
- # client = ::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client.new
165
+ # # Create a client using the default configuration
166
+ # client = ::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client.new
170
167
  #
171
- # To create a new AutoSuggestionService client with a custom
172
- # configuration:
173
- #
174
- # client = ::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client.new do |config|
175
- # config.timeout = 10.0
176
- # end
168
+ # # Create a client using a custom configuration
169
+ # client = ::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client.new do |config|
170
+ # config.timeout = 10.0
171
+ # end
177
172
  #
178
173
  # @yield [config] Configure the AutoSuggestionService client.
179
174
  # @yieldparam config [Client::Configuration]
@@ -193,14 +188,13 @@ module Google
193
188
 
194
189
  # Create credentials
195
190
  credentials = @config.credentials
196
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
191
+ # Use self-signed JWT if the endpoint is unchanged from default,
197
192
  # but only if the default endpoint does not have a region prefix.
198
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
199
- @config.endpoint == Client.configure.endpoint &&
193
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
200
194
  !@config.endpoint.split(".").first.include?("-")
201
195
  credentials ||= Credentials.default scope: @config.scope,
202
196
  enable_self_signed_jwt: enable_self_signed_jwt
203
- if credentials.is_a?(String) || credentials.is_a?(Hash)
197
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
204
198
  credentials = Credentials.new credentials, scope: @config.scope
205
199
  end
206
200
  @quota_project_id = @config.quota_project
@@ -263,6 +257,21 @@ module Google
263
257
  #
264
258
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
265
259
  #
260
+ # @example Basic example
261
+ # require "google/cloud/dataqna/v1alpha"
262
+ #
263
+ # # Create a client object. The client can be reused for multiple calls.
264
+ # client = Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client.new
265
+ #
266
+ # # Create a request. To set request fields, pass in keyword arguments.
267
+ # request = Google::Cloud::DataQnA::V1alpha::SuggestQueriesRequest.new
268
+ #
269
+ # # Call the suggest_queries method.
270
+ # result = client.suggest_queries request
271
+ #
272
+ # # The returned object is of type Google::Cloud::DataQnA::V1alpha::SuggestQueriesResponse.
273
+ # p result
274
+ #
266
275
  def suggest_queries request, options = nil
267
276
  raise ::ArgumentError, "request must be provided" if request.nil?
268
277
 
@@ -280,16 +289,20 @@ module Google
280
289
  gapic_version: ::Google::Cloud::DataQnA::V1alpha::VERSION
281
290
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
282
291
 
283
- header_params = {
284
- "parent" => request.parent
285
- }
292
+ header_params = {}
293
+ if request.parent
294
+ header_params["parent"] = request.parent
295
+ end
296
+
286
297
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
287
298
  metadata[:"x-goog-request-params"] ||= request_params_header
288
299
 
289
300
  options.apply_defaults timeout: @config.rpcs.suggest_queries.timeout,
290
301
  metadata: metadata,
291
302
  retry_policy: @config.rpcs.suggest_queries.retry_policy
292
- options.apply_defaults metadata: @config.metadata,
303
+
304
+ options.apply_defaults timeout: @config.timeout,
305
+ metadata: @config.metadata,
293
306
  retry_policy: @config.retry_policy
294
307
 
295
308
  @auto_suggestion_service_stub.call_rpc :suggest_queries, request, options: options do |response, operation|
@@ -313,22 +326,21 @@ module Google
313
326
  # Configuration can be applied globally to all clients, or to a single client
314
327
  # on construction.
315
328
  #
316
- # # Examples
317
- #
318
- # To modify the global config, setting the timeout for suggest_queries
319
- # to 20 seconds, and all remaining timeouts to 10 seconds:
320
- #
321
- # ::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client.configure do |config|
322
- # config.timeout = 10.0
323
- # config.rpcs.suggest_queries.timeout = 20.0
324
- # end
325
- #
326
- # To apply the above configuration only to a new client:
327
- #
328
- # client = ::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client.new do |config|
329
- # config.timeout = 10.0
330
- # config.rpcs.suggest_queries.timeout = 20.0
331
- # end
329
+ # @example
330
+ #
331
+ # # Modify the global config, setting the timeout for
332
+ # # suggest_queries to 20 seconds,
333
+ # # and all remaining timeouts to 10 seconds.
334
+ # ::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client.configure do |config|
335
+ # config.timeout = 10.0
336
+ # config.rpcs.suggest_queries.timeout = 20.0
337
+ # end
338
+ #
339
+ # # Apply the above configuration only to a new client.
340
+ # client = ::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client.new do |config|
341
+ # config.timeout = 10.0
342
+ # config.rpcs.suggest_queries.timeout = 20.0
343
+ # end
332
344
  #
333
345
  # @!attribute [rw] endpoint
334
346
  # The hostname or hostname:port of the service endpoint.
@@ -1,13 +1,13 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/dataqna/v1alpha/auto_suggestion_service.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/field_behavior_pb'
8
6
  require 'google/api/resource_pb'
9
7
  require 'google/cloud/dataqna/v1alpha/annotated_string_pb'
10
8
  require 'google/api/client_pb'
9
+ require 'google/protobuf'
10
+
11
11
  Google::Protobuf::DescriptorPool.generated_pool.build do
12
12
  add_file("google/cloud/dataqna/v1alpha/auto_suggestion_service.proto", :syntax => :proto3) do
13
13
  add_message "google.cloud.dataqna.v1alpha.SuggestQueriesRequest" do
@@ -1,14 +1,14 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/dataqna/v1alpha/question.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/field_behavior_pb'
7
5
  require 'google/api/resource_pb'
8
6
  require 'google/cloud/dataqna/v1alpha/annotated_string_pb'
9
7
  require 'google/protobuf/any_pb'
10
8
  require 'google/protobuf/timestamp_pb'
11
9
  require 'google/rpc/status_pb'
10
+ require 'google/protobuf'
11
+
12
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
13
13
  add_file("google/cloud/dataqna/v1alpha/question.proto", :syntax => :proto3) do
14
14
  add_message "google.cloud.dataqna.v1alpha.Question" do
@@ -55,13 +55,12 @@ module Google
55
55
  # See {::Google::Cloud::DataQnA::V1alpha::QuestionService::Client::Configuration}
56
56
  # for a description of the configuration fields.
57
57
  #
58
- # ## Example
58
+ # @example
59
59
  #
60
- # To modify the configuration for all QuestionService clients:
61
- #
62
- # ::Google::Cloud::DataQnA::V1alpha::QuestionService::Client.configure do |config|
63
- # config.timeout = 10.0
64
- # end
60
+ # # Modify the configuration for all QuestionService clients
61
+ # ::Google::Cloud::DataQnA::V1alpha::QuestionService::Client.configure do |config|
62
+ # config.timeout = 10.0
63
+ # end
65
64
  #
66
65
  # @yield [config] Configure the Client client.
67
66
  # @yieldparam config [Client::Configuration]
@@ -81,10 +80,7 @@ module Google
81
80
 
82
81
  default_config.timeout = 60.0
83
82
  default_config.retry_policy = {
84
- initial_delay: 1.0,
85
- max_delay: 10.0,
86
- multiplier: 1.3,
87
- retry_codes: [14]
83
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
88
84
  }
89
85
 
90
86
  default_config.rpcs.create_question.timeout = 60.0
@@ -122,19 +118,15 @@ module Google
122
118
  ##
123
119
  # Create a new QuestionService client object.
124
120
  #
125
- # ## Examples
126
- #
127
- # To create a new QuestionService client with the default
128
- # configuration:
129
- #
130
- # client = ::Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new
121
+ # @example
131
122
  #
132
- # To create a new QuestionService client with a custom
133
- # configuration:
123
+ # # Create a client using the default configuration
124
+ # client = ::Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new
134
125
  #
135
- # client = ::Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new do |config|
136
- # config.timeout = 10.0
137
- # end
126
+ # # Create a client using a custom configuration
127
+ # client = ::Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new do |config|
128
+ # config.timeout = 10.0
129
+ # end
138
130
  #
139
131
  # @yield [config] Configure the QuestionService client.
140
132
  # @yieldparam config [Client::Configuration]
@@ -154,14 +146,13 @@ module Google
154
146
 
155
147
  # Create credentials
156
148
  credentials = @config.credentials
157
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
149
+ # Use self-signed JWT if the endpoint is unchanged from default,
158
150
  # but only if the default endpoint does not have a region prefix.
159
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
160
- @config.endpoint == Client.configure.endpoint &&
151
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
161
152
  !@config.endpoint.split(".").first.include?("-")
162
153
  credentials ||= Credentials.default scope: @config.scope,
163
154
  enable_self_signed_jwt: enable_self_signed_jwt
164
- if credentials.is_a?(String) || credentials.is_a?(Hash)
155
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
165
156
  credentials = Credentials.new credentials, scope: @config.scope
166
157
  end
167
158
  @quota_project_id = @config.quota_project
@@ -210,6 +201,21 @@ module Google
210
201
  #
211
202
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
212
203
  #
204
+ # @example Basic example
205
+ # require "google/cloud/dataqna/v1alpha"
206
+ #
207
+ # # Create a client object. The client can be reused for multiple calls.
208
+ # client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new
209
+ #
210
+ # # Create a request. To set request fields, pass in keyword arguments.
211
+ # request = Google::Cloud::DataQnA::V1alpha::GetQuestionRequest.new
212
+ #
213
+ # # Call the get_question method.
214
+ # result = client.get_question request
215
+ #
216
+ # # The returned object is of type Google::Cloud::DataQnA::V1alpha::Question.
217
+ # p result
218
+ #
213
219
  def get_question request, options = nil
214
220
  raise ::ArgumentError, "request must be provided" if request.nil?
215
221
 
@@ -227,16 +233,20 @@ module Google
227
233
  gapic_version: ::Google::Cloud::DataQnA::V1alpha::VERSION
228
234
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
229
235
 
230
- header_params = {
231
- "name" => request.name
232
- }
236
+ header_params = {}
237
+ if request.name
238
+ header_params["name"] = request.name
239
+ end
240
+
233
241
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
234
242
  metadata[:"x-goog-request-params"] ||= request_params_header
235
243
 
236
244
  options.apply_defaults timeout: @config.rpcs.get_question.timeout,
237
245
  metadata: metadata,
238
246
  retry_policy: @config.rpcs.get_question.retry_policy
239
- options.apply_defaults metadata: @config.metadata,
247
+
248
+ options.apply_defaults timeout: @config.timeout,
249
+ metadata: @config.metadata,
240
250
  retry_policy: @config.retry_policy
241
251
 
242
252
  @question_service_stub.call_rpc :get_question, request, options: options do |response, operation|
@@ -279,6 +289,21 @@ module Google
279
289
  #
280
290
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
281
291
  #
292
+ # @example Basic example
293
+ # require "google/cloud/dataqna/v1alpha"
294
+ #
295
+ # # Create a client object. The client can be reused for multiple calls.
296
+ # client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new
297
+ #
298
+ # # Create a request. To set request fields, pass in keyword arguments.
299
+ # request = Google::Cloud::DataQnA::V1alpha::CreateQuestionRequest.new
300
+ #
301
+ # # Call the create_question method.
302
+ # result = client.create_question request
303
+ #
304
+ # # The returned object is of type Google::Cloud::DataQnA::V1alpha::Question.
305
+ # p result
306
+ #
282
307
  def create_question request, options = nil
283
308
  raise ::ArgumentError, "request must be provided" if request.nil?
284
309
 
@@ -296,16 +321,20 @@ module Google
296
321
  gapic_version: ::Google::Cloud::DataQnA::V1alpha::VERSION
297
322
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
298
323
 
299
- header_params = {
300
- "parent" => request.parent
301
- }
324
+ header_params = {}
325
+ if request.parent
326
+ header_params["parent"] = request.parent
327
+ end
328
+
302
329
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
303
330
  metadata[:"x-goog-request-params"] ||= request_params_header
304
331
 
305
332
  options.apply_defaults timeout: @config.rpcs.create_question.timeout,
306
333
  metadata: metadata,
307
334
  retry_policy: @config.rpcs.create_question.retry_policy
308
- options.apply_defaults metadata: @config.metadata,
335
+
336
+ options.apply_defaults timeout: @config.timeout,
337
+ metadata: @config.metadata,
309
338
  retry_policy: @config.retry_policy
310
339
 
311
340
  @question_service_stub.call_rpc :create_question, request, options: options do |response, operation|
@@ -348,6 +377,21 @@ module Google
348
377
  #
349
378
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
350
379
  #
380
+ # @example Basic example
381
+ # require "google/cloud/dataqna/v1alpha"
382
+ #
383
+ # # Create a client object. The client can be reused for multiple calls.
384
+ # client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new
385
+ #
386
+ # # Create a request. To set request fields, pass in keyword arguments.
387
+ # request = Google::Cloud::DataQnA::V1alpha::ExecuteQuestionRequest.new
388
+ #
389
+ # # Call the execute_question method.
390
+ # result = client.execute_question request
391
+ #
392
+ # # The returned object is of type Google::Cloud::DataQnA::V1alpha::Question.
393
+ # p result
394
+ #
351
395
  def execute_question request, options = nil
352
396
  raise ::ArgumentError, "request must be provided" if request.nil?
353
397
 
@@ -365,16 +409,20 @@ module Google
365
409
  gapic_version: ::Google::Cloud::DataQnA::V1alpha::VERSION
366
410
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
367
411
 
368
- header_params = {
369
- "name" => request.name
370
- }
412
+ header_params = {}
413
+ if request.name
414
+ header_params["name"] = request.name
415
+ end
416
+
371
417
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
372
418
  metadata[:"x-goog-request-params"] ||= request_params_header
373
419
 
374
420
  options.apply_defaults timeout: @config.rpcs.execute_question.timeout,
375
421
  metadata: metadata,
376
422
  retry_policy: @config.rpcs.execute_question.retry_policy
377
- options.apply_defaults metadata: @config.metadata,
423
+
424
+ options.apply_defaults timeout: @config.timeout,
425
+ metadata: @config.metadata,
378
426
  retry_policy: @config.retry_policy
379
427
 
380
428
  @question_service_stub.call_rpc :execute_question, request, options: options do |response, operation|
@@ -416,6 +464,21 @@ module Google
416
464
  #
417
465
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
418
466
  #
467
+ # @example Basic example
468
+ # require "google/cloud/dataqna/v1alpha"
469
+ #
470
+ # # Create a client object. The client can be reused for multiple calls.
471
+ # client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new
472
+ #
473
+ # # Create a request. To set request fields, pass in keyword arguments.
474
+ # request = Google::Cloud::DataQnA::V1alpha::GetUserFeedbackRequest.new
475
+ #
476
+ # # Call the get_user_feedback method.
477
+ # result = client.get_user_feedback request
478
+ #
479
+ # # The returned object is of type Google::Cloud::DataQnA::V1alpha::UserFeedback.
480
+ # p result
481
+ #
419
482
  def get_user_feedback request, options = nil
420
483
  raise ::ArgumentError, "request must be provided" if request.nil?
421
484
 
@@ -433,16 +496,20 @@ module Google
433
496
  gapic_version: ::Google::Cloud::DataQnA::V1alpha::VERSION
434
497
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
435
498
 
436
- header_params = {
437
- "name" => request.name
438
- }
499
+ header_params = {}
500
+ if request.name
501
+ header_params["name"] = request.name
502
+ end
503
+
439
504
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
440
505
  metadata[:"x-goog-request-params"] ||= request_params_header
441
506
 
442
507
  options.apply_defaults timeout: @config.rpcs.get_user_feedback.timeout,
443
508
  metadata: metadata,
444
509
  retry_policy: @config.rpcs.get_user_feedback.retry_policy
445
- options.apply_defaults metadata: @config.metadata,
510
+
511
+ options.apply_defaults timeout: @config.timeout,
512
+ metadata: @config.metadata,
446
513
  retry_policy: @config.retry_policy
447
514
 
448
515
  @question_service_stub.call_rpc :get_user_feedback, request, options: options do |response, operation|
@@ -488,6 +555,21 @@ module Google
488
555
  #
489
556
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
490
557
  #
558
+ # @example Basic example
559
+ # require "google/cloud/dataqna/v1alpha"
560
+ #
561
+ # # Create a client object. The client can be reused for multiple calls.
562
+ # client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new
563
+ #
564
+ # # Create a request. To set request fields, pass in keyword arguments.
565
+ # request = Google::Cloud::DataQnA::V1alpha::UpdateUserFeedbackRequest.new
566
+ #
567
+ # # Call the update_user_feedback method.
568
+ # result = client.update_user_feedback request
569
+ #
570
+ # # The returned object is of type Google::Cloud::DataQnA::V1alpha::UserFeedback.
571
+ # p result
572
+ #
491
573
  def update_user_feedback request, options = nil
492
574
  raise ::ArgumentError, "request must be provided" if request.nil?
493
575
 
@@ -505,16 +587,20 @@ module Google
505
587
  gapic_version: ::Google::Cloud::DataQnA::V1alpha::VERSION
506
588
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
507
589
 
508
- header_params = {
509
- "user_feedback.name" => request.user_feedback.name
510
- }
590
+ header_params = {}
591
+ if request.user_feedback&.name
592
+ header_params["user_feedback.name"] = request.user_feedback.name
593
+ end
594
+
511
595
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
512
596
  metadata[:"x-goog-request-params"] ||= request_params_header
513
597
 
514
598
  options.apply_defaults timeout: @config.rpcs.update_user_feedback.timeout,
515
599
  metadata: metadata,
516
600
  retry_policy: @config.rpcs.update_user_feedback.retry_policy
517
- options.apply_defaults metadata: @config.metadata,
601
+
602
+ options.apply_defaults timeout: @config.timeout,
603
+ metadata: @config.metadata,
518
604
  retry_policy: @config.retry_policy
519
605
 
520
606
  @question_service_stub.call_rpc :update_user_feedback, request, options: options do |response, operation|
@@ -538,22 +624,21 @@ module Google
538
624
  # Configuration can be applied globally to all clients, or to a single client
539
625
  # on construction.
540
626
  #
541
- # # Examples
542
- #
543
- # To modify the global config, setting the timeout for get_question
544
- # to 20 seconds, and all remaining timeouts to 10 seconds:
545
- #
546
- # ::Google::Cloud::DataQnA::V1alpha::QuestionService::Client.configure do |config|
547
- # config.timeout = 10.0
548
- # config.rpcs.get_question.timeout = 20.0
549
- # end
550
- #
551
- # To apply the above configuration only to a new client:
552
- #
553
- # client = ::Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new do |config|
554
- # config.timeout = 10.0
555
- # config.rpcs.get_question.timeout = 20.0
556
- # end
627
+ # @example
628
+ #
629
+ # # Modify the global config, setting the timeout for
630
+ # # get_question to 20 seconds,
631
+ # # and all remaining timeouts to 10 seconds.
632
+ # ::Google::Cloud::DataQnA::V1alpha::QuestionService::Client.configure do |config|
633
+ # config.timeout = 10.0
634
+ # config.rpcs.get_question.timeout = 20.0
635
+ # end
636
+ #
637
+ # # Apply the above configuration only to a new client.
638
+ # client = ::Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new do |config|
639
+ # config.timeout = 10.0
640
+ # config.rpcs.get_question.timeout = 20.0
641
+ # end
557
642
  #
558
643
  # @!attribute [rw] endpoint
559
644
  # The hostname or hostname:port of the service endpoint.
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/dataqna/v1alpha/question_service.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/client_pb'
8
6
  require 'google/api/field_behavior_pb'
@@ -10,6 +8,8 @@ require 'google/api/resource_pb'
10
8
  require 'google/cloud/dataqna/v1alpha/question_pb'
11
9
  require 'google/cloud/dataqna/v1alpha/user_feedback_pb'
12
10
  require 'google/protobuf/field_mask_pb'
11
+ require 'google/protobuf'
12
+
13
13
  Google::Protobuf::DescriptorPool.generated_pool.build do
14
14
  add_file("google/cloud/dataqna/v1alpha/question_service.proto", :syntax => :proto3) do
15
15
  add_message "google.cloud.dataqna.v1alpha.GetQuestionRequest" do
@@ -1,10 +1,10 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/dataqna/v1alpha/user_feedback.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/field_behavior_pb'
7
5
  require 'google/api/resource_pb'
6
+ require 'google/protobuf'
7
+
8
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
9
  add_file("google/cloud/dataqna/v1alpha/user_feedback.proto", :syntax => :proto3) do
10
10
  add_message "google.cloud.dataqna.v1alpha.UserFeedback" do
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module DataQnA
23
23
  module V1alpha
24
- VERSION = "0.2.1"
24
+ VERSION = "0.2.5"
25
25
  end
26
26
  end
27
27
  end
@@ -57,9 +57,15 @@ module Google
57
57
 
58
58
  # Denotes that a (repeated) field is an unordered list.
59
59
  # This indicates that the service may provide the elements of the list
60
- # in any arbitrary order, rather than the order the user originally
60
+ # in any arbitrary order, rather than the order the user originally
61
61
  # provided. Additionally, the list's order may or may not be stable.
62
62
  UNORDERED_LIST = 6
63
+
64
+ # Denotes that this field returns a non-empty default value if not set.
65
+ # This indicates that if the user provides the empty value in a request,
66
+ # a non-empty value will be returned. The user will not be aware of what
67
+ # non-empty value to expect.
68
+ NON_EMPTY_DEFAULT = 7
63
69
  end
64
70
  end
65
71
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-dataqna-v1alpha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-17 00:00:00.000000000 Z
11
+ date: 2021-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.5'
19
+ version: '0.7'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '0.5'
29
+ version: '0.7'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a