google-cloud-dialogflow-v2 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/dialogflow/v2.rb +2 -0
- data/lib/google/cloud/dialogflow/v2/agents/paths.rb +42 -3
- data/lib/google/cloud/dialogflow/v2/answer_record_services_pb.rb +1 -2
- data/lib/google/cloud/dialogflow/v2/answer_records.rb +1 -2
- data/lib/google/cloud/dialogflow/v2/answer_records/client.rb +1 -2
- data/lib/google/cloud/dialogflow/v2/contexts/paths.rb +72 -0
- data/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb +44 -3
- data/lib/google/cloud/dialogflow/v2/entity_types/paths.rb +58 -12
- data/lib/google/cloud/dialogflow/v2/environment_pb.rb +50 -1
- data/lib/google/cloud/dialogflow/v2/environment_services_pb.rb +21 -0
- data/lib/google/cloud/dialogflow/v2/environments/client.rb +411 -1
- data/lib/google/cloud/dialogflow/v2/environments/paths.rb +104 -5
- data/lib/google/cloud/dialogflow/v2/fulfillment_pb.rb +59 -0
- data/lib/google/cloud/dialogflow/v2/fulfillment_services_pb.rb +47 -0
- data/lib/google/cloud/dialogflow/v2/fulfillments.rb +49 -0
- data/lib/google/cloud/dialogflow/v2/fulfillments/client.rb +460 -0
- data/lib/google/cloud/dialogflow/v2/fulfillments/credentials.rb +52 -0
- data/lib/google/cloud/dialogflow/v2/fulfillments/paths.rb +69 -0
- data/lib/google/cloud/dialogflow/v2/intents/paths.rb +96 -12
- data/lib/google/cloud/dialogflow/v2/participants/paths.rb +76 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb +72 -0
- data/lib/google/cloud/dialogflow/v2/sessions/paths.rb +110 -0
- data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
- data/lib/google/cloud/dialogflow/v2/version_pb.rb +69 -0
- data/lib/google/cloud/dialogflow/v2/version_services_pb.rb +59 -0
- data/lib/google/cloud/dialogflow/v2/versions.rb +49 -0
- data/lib/google/cloud/dialogflow/v2/versions/client.rb +709 -0
- data/lib/google/cloud/dialogflow/v2/versions/credentials.rb +52 -0
- data/lib/google/cloud/dialogflow/v2/versions/paths.rb +110 -0
- data/proto_docs/google/cloud/dialogflow/v2/answer_record.rb +9 -16
- data/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb +14 -2
- data/proto_docs/google/cloud/dialogflow/v2/environment.rb +169 -4
- data/proto_docs/google/cloud/dialogflow/v2/fulfillment.rb +144 -0
- data/proto_docs/google/cloud/dialogflow/v2/version.rb +176 -0
- metadata +17 -3
@@ -35,6 +35,27 @@ module Google
|
|
35
35
|
|
36
36
|
# Returns the list of all non-draft environments of the specified agent.
|
37
37
|
rpc :ListEnvironments, ::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest, ::Google::Cloud::Dialogflow::V2::ListEnvironmentsResponse
|
38
|
+
# Retrieves the specified agent environment.
|
39
|
+
rpc :GetEnvironment, ::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest, ::Google::Cloud::Dialogflow::V2::Environment
|
40
|
+
# Creates an agent environment.
|
41
|
+
rpc :CreateEnvironment, ::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest, ::Google::Cloud::Dialogflow::V2::Environment
|
42
|
+
# Updates the specified agent environment.
|
43
|
+
#
|
44
|
+
# This method allows you to deploy new agent versions into the environment.
|
45
|
+
# When an environment is pointed to a new agent version by setting
|
46
|
+
# `environment.agent_version`, the environment is temporarily set to the
|
47
|
+
# `LOADING` state. During that time, the environment keeps on serving the
|
48
|
+
# previous version of the agent. After the new agent version is done loading,
|
49
|
+
# the environment is set back to the `RUNNING` state.
|
50
|
+
# You can use "-" as Environment ID in environment name to update version
|
51
|
+
# in "draft" environment. WARNING: this will negate all recent changes to
|
52
|
+
# draft and can't be undone. You may want to save the draft to a version
|
53
|
+
# before calling this function.
|
54
|
+
rpc :UpdateEnvironment, ::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest, ::Google::Cloud::Dialogflow::V2::Environment
|
55
|
+
# Deletes the specified agent environment.
|
56
|
+
rpc :DeleteEnvironment, ::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest, ::Google::Protobuf::Empty
|
57
|
+
# Gets the history of the specified environment.
|
58
|
+
rpc :GetEnvironmentHistory, ::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest, ::Google::Cloud::Dialogflow::V2::EnvironmentHistory
|
38
59
|
end
|
39
60
|
|
40
61
|
Stub = Service.rpc_stub_class
|
@@ -178,7 +178,9 @@ module Google
|
|
178
178
|
#
|
179
179
|
# @param parent [::String]
|
180
180
|
# Required. The agent to list all environments from.
|
181
|
-
# Format:
|
181
|
+
# Format:
|
182
|
+
# - `projects/<Project ID>/agent`
|
183
|
+
# - `projects/<Project ID>/locations/<Location ID>/agent`
|
182
184
|
# @param page_size [::Integer]
|
183
185
|
# Optional. The maximum number of items to return in a single page. By default 100 and
|
184
186
|
# at most 1000.
|
@@ -231,6 +233,379 @@ module Google
|
|
231
233
|
raise ::Google::Cloud::Error.from_error(e)
|
232
234
|
end
|
233
235
|
|
236
|
+
##
|
237
|
+
# Retrieves the specified agent environment.
|
238
|
+
#
|
239
|
+
# @overload get_environment(request, options = nil)
|
240
|
+
# Pass arguments to `get_environment` via a request object, either of type
|
241
|
+
# {::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest} or an equivalent Hash.
|
242
|
+
#
|
243
|
+
# @param request [::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest, ::Hash]
|
244
|
+
# A request object representing the call parameters. Required. To specify no
|
245
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
246
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
247
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
248
|
+
#
|
249
|
+
# @overload get_environment(name: nil)
|
250
|
+
# Pass arguments to `get_environment` via keyword arguments. Note that at
|
251
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
252
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
253
|
+
#
|
254
|
+
# @param name [::String]
|
255
|
+
# Required. The name of the environment.
|
256
|
+
# Supported formats:
|
257
|
+
# - `projects/<Project ID>/agent/environments/<Environment ID>`
|
258
|
+
# - `projects/<Project ID>/locations/<Location
|
259
|
+
# ID>/agent/environments/<Environment ID>`
|
260
|
+
#
|
261
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
262
|
+
# @yieldparam response [::Google::Cloud::Dialogflow::V2::Environment]
|
263
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
264
|
+
#
|
265
|
+
# @return [::Google::Cloud::Dialogflow::V2::Environment]
|
266
|
+
#
|
267
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
268
|
+
#
|
269
|
+
def get_environment request, options = nil
|
270
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
271
|
+
|
272
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest
|
273
|
+
|
274
|
+
# Converts hash and nil to an options object
|
275
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
276
|
+
|
277
|
+
# Customize the options with defaults
|
278
|
+
metadata = @config.rpcs.get_environment.metadata.to_h
|
279
|
+
|
280
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
281
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
282
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
283
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
284
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
285
|
+
|
286
|
+
header_params = {
|
287
|
+
"name" => request.name
|
288
|
+
}
|
289
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
290
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
291
|
+
|
292
|
+
options.apply_defaults timeout: @config.rpcs.get_environment.timeout,
|
293
|
+
metadata: metadata,
|
294
|
+
retry_policy: @config.rpcs.get_environment.retry_policy
|
295
|
+
options.apply_defaults metadata: @config.metadata,
|
296
|
+
retry_policy: @config.retry_policy
|
297
|
+
|
298
|
+
@environments_stub.call_rpc :get_environment, request, options: options do |response, operation|
|
299
|
+
yield response, operation if block_given?
|
300
|
+
return response
|
301
|
+
end
|
302
|
+
rescue ::GRPC::BadStatus => e
|
303
|
+
raise ::Google::Cloud::Error.from_error(e)
|
304
|
+
end
|
305
|
+
|
306
|
+
##
|
307
|
+
# Creates an agent environment.
|
308
|
+
#
|
309
|
+
# @overload create_environment(request, options = nil)
|
310
|
+
# Pass arguments to `create_environment` via a request object, either of type
|
311
|
+
# {::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest} or an equivalent Hash.
|
312
|
+
#
|
313
|
+
# @param request [::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest, ::Hash]
|
314
|
+
# A request object representing the call parameters. Required. To specify no
|
315
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
316
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
317
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
318
|
+
#
|
319
|
+
# @overload create_environment(parent: nil, environment: nil, environment_id: nil)
|
320
|
+
# Pass arguments to `create_environment` via keyword arguments. Note that at
|
321
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
322
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
323
|
+
#
|
324
|
+
# @param parent [::String]
|
325
|
+
# Required. The agent to create an environment for.
|
326
|
+
# Supported formats:
|
327
|
+
# - `projects/<Project ID>/agent`
|
328
|
+
# - `projects/<Project ID>/locations/<Location ID>/agent`
|
329
|
+
# @param environment [::Google::Cloud::Dialogflow::V2::Environment, ::Hash]
|
330
|
+
# Required. The environment to create.
|
331
|
+
# @param environment_id [::String]
|
332
|
+
# Required. The unique id of the new environment.
|
333
|
+
#
|
334
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
335
|
+
# @yieldparam response [::Google::Cloud::Dialogflow::V2::Environment]
|
336
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
337
|
+
#
|
338
|
+
# @return [::Google::Cloud::Dialogflow::V2::Environment]
|
339
|
+
#
|
340
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
341
|
+
#
|
342
|
+
def create_environment request, options = nil
|
343
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
344
|
+
|
345
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest
|
346
|
+
|
347
|
+
# Converts hash and nil to an options object
|
348
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
349
|
+
|
350
|
+
# Customize the options with defaults
|
351
|
+
metadata = @config.rpcs.create_environment.metadata.to_h
|
352
|
+
|
353
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
354
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
355
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
356
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
357
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
358
|
+
|
359
|
+
header_params = {
|
360
|
+
"parent" => request.parent
|
361
|
+
}
|
362
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
363
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
364
|
+
|
365
|
+
options.apply_defaults timeout: @config.rpcs.create_environment.timeout,
|
366
|
+
metadata: metadata,
|
367
|
+
retry_policy: @config.rpcs.create_environment.retry_policy
|
368
|
+
options.apply_defaults metadata: @config.metadata,
|
369
|
+
retry_policy: @config.retry_policy
|
370
|
+
|
371
|
+
@environments_stub.call_rpc :create_environment, request, options: options do |response, operation|
|
372
|
+
yield response, operation if block_given?
|
373
|
+
return response
|
374
|
+
end
|
375
|
+
rescue ::GRPC::BadStatus => e
|
376
|
+
raise ::Google::Cloud::Error.from_error(e)
|
377
|
+
end
|
378
|
+
|
379
|
+
##
|
380
|
+
# Updates the specified agent environment.
|
381
|
+
#
|
382
|
+
# This method allows you to deploy new agent versions into the environment.
|
383
|
+
# When an environment is pointed to a new agent version by setting
|
384
|
+
# `environment.agent_version`, the environment is temporarily set to the
|
385
|
+
# `LOADING` state. During that time, the environment keeps on serving the
|
386
|
+
# previous version of the agent. After the new agent version is done loading,
|
387
|
+
# the environment is set back to the `RUNNING` state.
|
388
|
+
# You can use "-" as Environment ID in environment name to update version
|
389
|
+
# in "draft" environment. WARNING: this will negate all recent changes to
|
390
|
+
# draft and can't be undone. You may want to save the draft to a version
|
391
|
+
# before calling this function.
|
392
|
+
#
|
393
|
+
# @overload update_environment(request, options = nil)
|
394
|
+
# Pass arguments to `update_environment` via a request object, either of type
|
395
|
+
# {::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest} or an equivalent Hash.
|
396
|
+
#
|
397
|
+
# @param request [::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest, ::Hash]
|
398
|
+
# A request object representing the call parameters. Required. To specify no
|
399
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
400
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
401
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
402
|
+
#
|
403
|
+
# @overload update_environment(environment: nil, update_mask: nil, allow_load_to_draft_and_discard_changes: nil)
|
404
|
+
# Pass arguments to `update_environment` via keyword arguments. Note that at
|
405
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
406
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
407
|
+
#
|
408
|
+
# @param environment [::Google::Cloud::Dialogflow::V2::Environment, ::Hash]
|
409
|
+
# Required. The environment to update.
|
410
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
411
|
+
# Required. The mask to control which fields get updated.
|
412
|
+
# @param allow_load_to_draft_and_discard_changes [::Boolean]
|
413
|
+
# Optional. This field is used to prevent accidental overwrite of the draft
|
414
|
+
# environment, which is an operation that cannot be undone. To confirm that
|
415
|
+
# the caller desires this overwrite, this field must be explicitly set to
|
416
|
+
# true when updating the draft environment (environment ID = `-`).
|
417
|
+
#
|
418
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
419
|
+
# @yieldparam response [::Google::Cloud::Dialogflow::V2::Environment]
|
420
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
421
|
+
#
|
422
|
+
# @return [::Google::Cloud::Dialogflow::V2::Environment]
|
423
|
+
#
|
424
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
425
|
+
#
|
426
|
+
def update_environment request, options = nil
|
427
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
428
|
+
|
429
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest
|
430
|
+
|
431
|
+
# Converts hash and nil to an options object
|
432
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
433
|
+
|
434
|
+
# Customize the options with defaults
|
435
|
+
metadata = @config.rpcs.update_environment.metadata.to_h
|
436
|
+
|
437
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
438
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
439
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
440
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
441
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
442
|
+
|
443
|
+
header_params = {
|
444
|
+
"environment.name" => request.environment.name
|
445
|
+
}
|
446
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
447
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
448
|
+
|
449
|
+
options.apply_defaults timeout: @config.rpcs.update_environment.timeout,
|
450
|
+
metadata: metadata,
|
451
|
+
retry_policy: @config.rpcs.update_environment.retry_policy
|
452
|
+
options.apply_defaults metadata: @config.metadata,
|
453
|
+
retry_policy: @config.retry_policy
|
454
|
+
|
455
|
+
@environments_stub.call_rpc :update_environment, request, options: options do |response, operation|
|
456
|
+
yield response, operation if block_given?
|
457
|
+
return response
|
458
|
+
end
|
459
|
+
rescue ::GRPC::BadStatus => e
|
460
|
+
raise ::Google::Cloud::Error.from_error(e)
|
461
|
+
end
|
462
|
+
|
463
|
+
##
|
464
|
+
# Deletes the specified agent environment.
|
465
|
+
#
|
466
|
+
# @overload delete_environment(request, options = nil)
|
467
|
+
# Pass arguments to `delete_environment` via a request object, either of type
|
468
|
+
# {::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest} or an equivalent Hash.
|
469
|
+
#
|
470
|
+
# @param request [::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest, ::Hash]
|
471
|
+
# A request object representing the call parameters. Required. To specify no
|
472
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
473
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
474
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
475
|
+
#
|
476
|
+
# @overload delete_environment(name: nil)
|
477
|
+
# Pass arguments to `delete_environment` via keyword arguments. Note that at
|
478
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
479
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
480
|
+
#
|
481
|
+
# @param name [::String]
|
482
|
+
# Required. The name of the environment to delete.
|
483
|
+
# / Format:
|
484
|
+
# - `projects/<Project ID>/agent/environments/<Environment ID>`
|
485
|
+
# - `projects/<Project ID>/locations/<Location
|
486
|
+
# ID>/agent/environments/<Environment ID>`
|
487
|
+
#
|
488
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
489
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
490
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
491
|
+
#
|
492
|
+
# @return [::Google::Protobuf::Empty]
|
493
|
+
#
|
494
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
495
|
+
#
|
496
|
+
def delete_environment request, options = nil
|
497
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
498
|
+
|
499
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest
|
500
|
+
|
501
|
+
# Converts hash and nil to an options object
|
502
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
503
|
+
|
504
|
+
# Customize the options with defaults
|
505
|
+
metadata = @config.rpcs.delete_environment.metadata.to_h
|
506
|
+
|
507
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
508
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
509
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
510
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
511
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
512
|
+
|
513
|
+
header_params = {
|
514
|
+
"name" => request.name
|
515
|
+
}
|
516
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
517
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
518
|
+
|
519
|
+
options.apply_defaults timeout: @config.rpcs.delete_environment.timeout,
|
520
|
+
metadata: metadata,
|
521
|
+
retry_policy: @config.rpcs.delete_environment.retry_policy
|
522
|
+
options.apply_defaults metadata: @config.metadata,
|
523
|
+
retry_policy: @config.retry_policy
|
524
|
+
|
525
|
+
@environments_stub.call_rpc :delete_environment, request, options: options do |response, operation|
|
526
|
+
yield response, operation if block_given?
|
527
|
+
return response
|
528
|
+
end
|
529
|
+
rescue ::GRPC::BadStatus => e
|
530
|
+
raise ::Google::Cloud::Error.from_error(e)
|
531
|
+
end
|
532
|
+
|
533
|
+
##
|
534
|
+
# Gets the history of the specified environment.
|
535
|
+
#
|
536
|
+
# @overload get_environment_history(request, options = nil)
|
537
|
+
# Pass arguments to `get_environment_history` via a request object, either of type
|
538
|
+
# {::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest} or an equivalent Hash.
|
539
|
+
#
|
540
|
+
# @param request [::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest, ::Hash]
|
541
|
+
# A request object representing the call parameters. Required. To specify no
|
542
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
543
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
544
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
545
|
+
#
|
546
|
+
# @overload get_environment_history(parent: nil, page_size: nil, page_token: nil)
|
547
|
+
# Pass arguments to `get_environment_history` via keyword arguments. Note that at
|
548
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
549
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
550
|
+
#
|
551
|
+
# @param parent [::String]
|
552
|
+
# Required. The name of the environment to retrieve history for.
|
553
|
+
# Supported formats:
|
554
|
+
# - `projects/<Project ID>/agent/environments/<Environment ID>`
|
555
|
+
# - `projects/<Project ID>/locations/<Location
|
556
|
+
# ID>/agent/environments/<Environment ID>`
|
557
|
+
# @param page_size [::Integer]
|
558
|
+
# Optional. The maximum number of items to return in a single page. By default 100 and
|
559
|
+
# at most 1000.
|
560
|
+
# @param page_token [::String]
|
561
|
+
# Optional. The next_page_token value returned from a previous list request.
|
562
|
+
#
|
563
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
564
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EnvironmentHistory::Entry>]
|
565
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
566
|
+
#
|
567
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EnvironmentHistory::Entry>]
|
568
|
+
#
|
569
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
570
|
+
#
|
571
|
+
def get_environment_history request, options = nil
|
572
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
573
|
+
|
574
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest
|
575
|
+
|
576
|
+
# Converts hash and nil to an options object
|
577
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
578
|
+
|
579
|
+
# Customize the options with defaults
|
580
|
+
metadata = @config.rpcs.get_environment_history.metadata.to_h
|
581
|
+
|
582
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
583
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
584
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
585
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
586
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
587
|
+
|
588
|
+
header_params = {
|
589
|
+
"parent" => request.parent
|
590
|
+
}
|
591
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
592
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
593
|
+
|
594
|
+
options.apply_defaults timeout: @config.rpcs.get_environment_history.timeout,
|
595
|
+
metadata: metadata,
|
596
|
+
retry_policy: @config.rpcs.get_environment_history.retry_policy
|
597
|
+
options.apply_defaults metadata: @config.metadata,
|
598
|
+
retry_policy: @config.retry_policy
|
599
|
+
|
600
|
+
@environments_stub.call_rpc :get_environment_history, request, options: options do |response, operation|
|
601
|
+
response = ::Gapic::PagedEnumerable.new @environments_stub, :get_environment_history, request, response, operation, options
|
602
|
+
yield response, operation if block_given?
|
603
|
+
return response
|
604
|
+
end
|
605
|
+
rescue ::GRPC::BadStatus => e
|
606
|
+
raise ::Google::Cloud::Error.from_error(e)
|
607
|
+
end
|
608
|
+
|
234
609
|
##
|
235
610
|
# Configuration class for the Environments API.
|
236
611
|
#
|
@@ -372,11 +747,46 @@ module Google
|
|
372
747
|
# @return [::Gapic::Config::Method]
|
373
748
|
#
|
374
749
|
attr_reader :list_environments
|
750
|
+
##
|
751
|
+
# RPC-specific configuration for `get_environment`
|
752
|
+
# @return [::Gapic::Config::Method]
|
753
|
+
#
|
754
|
+
attr_reader :get_environment
|
755
|
+
##
|
756
|
+
# RPC-specific configuration for `create_environment`
|
757
|
+
# @return [::Gapic::Config::Method]
|
758
|
+
#
|
759
|
+
attr_reader :create_environment
|
760
|
+
##
|
761
|
+
# RPC-specific configuration for `update_environment`
|
762
|
+
# @return [::Gapic::Config::Method]
|
763
|
+
#
|
764
|
+
attr_reader :update_environment
|
765
|
+
##
|
766
|
+
# RPC-specific configuration for `delete_environment`
|
767
|
+
# @return [::Gapic::Config::Method]
|
768
|
+
#
|
769
|
+
attr_reader :delete_environment
|
770
|
+
##
|
771
|
+
# RPC-specific configuration for `get_environment_history`
|
772
|
+
# @return [::Gapic::Config::Method]
|
773
|
+
#
|
774
|
+
attr_reader :get_environment_history
|
375
775
|
|
376
776
|
# @private
|
377
777
|
def initialize parent_rpcs = nil
|
378
778
|
list_environments_config = parent_rpcs.list_environments if parent_rpcs.respond_to? :list_environments
|
379
779
|
@list_environments = ::Gapic::Config::Method.new list_environments_config
|
780
|
+
get_environment_config = parent_rpcs.get_environment if parent_rpcs.respond_to? :get_environment
|
781
|
+
@get_environment = ::Gapic::Config::Method.new get_environment_config
|
782
|
+
create_environment_config = parent_rpcs.create_environment if parent_rpcs.respond_to? :create_environment
|
783
|
+
@create_environment = ::Gapic::Config::Method.new create_environment_config
|
784
|
+
update_environment_config = parent_rpcs.update_environment if parent_rpcs.respond_to? :update_environment
|
785
|
+
@update_environment = ::Gapic::Config::Method.new update_environment_config
|
786
|
+
delete_environment_config = parent_rpcs.delete_environment if parent_rpcs.respond_to? :delete_environment
|
787
|
+
@delete_environment = ::Gapic::Config::Method.new delete_environment_config
|
788
|
+
get_environment_history_config = parent_rpcs.get_environment_history if parent_rpcs.respond_to? :get_environment_history
|
789
|
+
@get_environment_history = ::Gapic::Config::Method.new get_environment_history_config
|
380
790
|
|
381
791
|
yield self if block_given?
|
382
792
|
end
|