google-cloud-dialogflow-v2 0.7.0 → 0.10.1

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