google-cloud-dialogflow-cx-v3 0.20.0 → 0.22.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/cx/v3/advanced_settings_pb.rb +2 -1
- data/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb +6 -1
- data/lib/google/cloud/dialogflow/cx/v3/agent_services_pb.rb +4 -0
- data/lib/google/cloud/dialogflow/cx/v3/agents/client.rb +200 -1
- data/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb +10 -1
- data/lib/google/cloud/dialogflow/cx/v3/agents/paths.rb +19 -0
- data/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb +338 -0
- data/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb +75 -0
- data/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb +119 -0
- data/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb +10 -1
- data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb +36 -0
- data/lib/google/cloud/dialogflow/cx/v3/data_store_connection_pb.rb +45 -0
- data/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb +10 -1
- data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb +36 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb +10 -1
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb +84 -0
- data/lib/google/cloud/dialogflow/cx/v3/environments/client.rb +10 -1
- data/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb +10 -1
- data/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb +184 -0
- data/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb +75 -0
- data/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb +10 -1
- data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb +116 -0
- data/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb +3 -1
- data/lib/google/cloud/dialogflow/cx/v3/flows/client.rb +10 -1
- data/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb +10 -1
- data/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb +185 -0
- data/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb +75 -0
- data/lib/google/cloud/dialogflow/cx/v3/fulfillment_pb.rb +3 -1
- data/lib/google/cloud/dialogflow/cx/v3/generative_settings_pb.rb +51 -0
- data/lib/google/cloud/dialogflow/cx/v3/import_strategy_pb.rb +2 -2
- data/lib/google/cloud/dialogflow/cx/v3/inline_pb.rb +47 -0
- data/lib/google/cloud/dialogflow/cx/v3/intent_pb.rb +13 -1
- data/lib/google/cloud/dialogflow/cx/v3/intent_services_pb.rb +22 -0
- data/lib/google/cloud/dialogflow/cx/v3/intents/client.rb +278 -1
- data/lib/google/cloud/dialogflow/cx/v3/intents/operations.rb +781 -0
- data/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb +338 -0
- data/lib/google/cloud/dialogflow/cx/v3/intents/rest/operations.rb +892 -0
- data/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb +120 -0
- data/lib/google/cloud/dialogflow/cx/v3/intents/rest.rb +1 -0
- data/lib/google/cloud/dialogflow/cx/v3/intents.rb +1 -0
- data/lib/google/cloud/dialogflow/cx/v3/page_pb.rb +6 -1
- data/lib/google/cloud/dialogflow/cx/v3/pages/client.rb +10 -1
- data/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb +84 -0
- data/lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb +2 -1
- data/lib/google/cloud/dialogflow/cx/v3/safety_settings_pb.rb +47 -0
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_pb.rb +2 -1
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb +10 -1
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb +84 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb +10 -1
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb +84 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_pb.rb +3 -1
- data/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +10 -1
- data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb +48 -0
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb +10 -1
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb +10 -1
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb +228 -0
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb +75 -0
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb +10 -1
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb +84 -0
- data/lib/google/cloud/dialogflow/cx/v3/validation_message_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/version.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/versions/client.rb +10 -1
- data/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb +10 -1
- data/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb +130 -0
- data/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb +75 -0
- data/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb +10 -1
- data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb +84 -0
- data/proto_docs/google/api/field_behavior.rb +14 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/advanced_settings.rb +28 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb +44 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/data_store_connection.rb +61 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb +7 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/fulfillment.rb +11 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/generative_settings.rb +109 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/import_strategy.rb +1 -1
- data/proto_docs/google/cloud/dialogflow/cx/v3/inline.rb +49 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/intent.rb +175 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/page.rb +52 -2
- data/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb +14 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/safety_settings.rb +49 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb +17 -2
- data/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +11 -1
- data/proto_docs/google/cloud/dialogflow/cx/v3/validation_message.rb +3 -0
- metadata +15 -5
@@ -137,6 +137,12 @@ module Google
|
|
137
137
|
@quota_project_id = @config.quota_project
|
138
138
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
139
139
|
|
140
|
+
@operations_client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Operations.new do |config|
|
141
|
+
config.credentials = credentials
|
142
|
+
config.quota_project = @quota_project_id
|
143
|
+
config.endpoint = @config.endpoint
|
144
|
+
end
|
145
|
+
|
140
146
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
141
147
|
config.credentials = credentials
|
142
148
|
config.quota_project = @quota_project_id
|
@@ -147,6 +153,13 @@ module Google
|
|
147
153
|
@intents_stub = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
148
154
|
end
|
149
155
|
|
156
|
+
##
|
157
|
+
# Get the associated client for long-running operations.
|
158
|
+
#
|
159
|
+
# @return [::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Operations]
|
160
|
+
#
|
161
|
+
attr_reader :operations_client
|
162
|
+
|
150
163
|
##
|
151
164
|
# Get the associated client for mix-in of the Locations.
|
152
165
|
#
|
@@ -202,6 +215,26 @@ module Google
|
|
202
215
|
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Intent>]
|
203
216
|
#
|
204
217
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
218
|
+
#
|
219
|
+
# @example Basic example
|
220
|
+
# require "google/cloud/dialogflow/cx/v3"
|
221
|
+
#
|
222
|
+
# # Create a client object. The client can be reused for multiple calls.
|
223
|
+
# client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new
|
224
|
+
#
|
225
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
226
|
+
# request = Google::Cloud::Dialogflow::CX::V3::ListIntentsRequest.new
|
227
|
+
#
|
228
|
+
# # Call the list_intents method.
|
229
|
+
# result = client.list_intents request
|
230
|
+
#
|
231
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
232
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
233
|
+
# result.each do |item|
|
234
|
+
# # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Intent.
|
235
|
+
# p item
|
236
|
+
# end
|
237
|
+
#
|
205
238
|
def list_intents request, options = nil
|
206
239
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
207
240
|
|
@@ -278,6 +311,22 @@ module Google
|
|
278
311
|
# @return [::Google::Cloud::Dialogflow::CX::V3::Intent]
|
279
312
|
#
|
280
313
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
314
|
+
#
|
315
|
+
# @example Basic example
|
316
|
+
# require "google/cloud/dialogflow/cx/v3"
|
317
|
+
#
|
318
|
+
# # Create a client object. The client can be reused for multiple calls.
|
319
|
+
# client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new
|
320
|
+
#
|
321
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
322
|
+
# request = Google::Cloud::Dialogflow::CX::V3::GetIntentRequest.new
|
323
|
+
#
|
324
|
+
# # Call the get_intent method.
|
325
|
+
# result = client.get_intent request
|
326
|
+
#
|
327
|
+
# # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Intent.
|
328
|
+
# p result
|
329
|
+
#
|
281
330
|
def get_intent request, options = nil
|
282
331
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
283
332
|
|
@@ -357,6 +406,22 @@ module Google
|
|
357
406
|
# @return [::Google::Cloud::Dialogflow::CX::V3::Intent]
|
358
407
|
#
|
359
408
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
409
|
+
#
|
410
|
+
# @example Basic example
|
411
|
+
# require "google/cloud/dialogflow/cx/v3"
|
412
|
+
#
|
413
|
+
# # Create a client object. The client can be reused for multiple calls.
|
414
|
+
# client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new
|
415
|
+
#
|
416
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
417
|
+
# request = Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest.new
|
418
|
+
#
|
419
|
+
# # Call the create_intent method.
|
420
|
+
# result = client.create_intent request
|
421
|
+
#
|
422
|
+
# # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Intent.
|
423
|
+
# p result
|
424
|
+
#
|
360
425
|
def create_intent request, options = nil
|
361
426
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
362
427
|
|
@@ -436,6 +501,22 @@ module Google
|
|
436
501
|
# @return [::Google::Cloud::Dialogflow::CX::V3::Intent]
|
437
502
|
#
|
438
503
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
504
|
+
#
|
505
|
+
# @example Basic example
|
506
|
+
# require "google/cloud/dialogflow/cx/v3"
|
507
|
+
#
|
508
|
+
# # Create a client object. The client can be reused for multiple calls.
|
509
|
+
# client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new
|
510
|
+
#
|
511
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
512
|
+
# request = Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest.new
|
513
|
+
#
|
514
|
+
# # Call the update_intent method.
|
515
|
+
# result = client.update_intent request
|
516
|
+
#
|
517
|
+
# # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Intent.
|
518
|
+
# p result
|
519
|
+
#
|
439
520
|
def update_intent request, options = nil
|
440
521
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
441
522
|
|
@@ -504,6 +585,22 @@ module Google
|
|
504
585
|
# @return [::Google::Protobuf::Empty]
|
505
586
|
#
|
506
587
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
588
|
+
#
|
589
|
+
# @example Basic example
|
590
|
+
# require "google/cloud/dialogflow/cx/v3"
|
591
|
+
#
|
592
|
+
# # Create a client object. The client can be reused for multiple calls.
|
593
|
+
# client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new
|
594
|
+
#
|
595
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
596
|
+
# request = Google::Cloud::Dialogflow::CX::V3::DeleteIntentRequest.new
|
597
|
+
#
|
598
|
+
# # Call the delete_intent method.
|
599
|
+
# result = client.delete_intent request
|
600
|
+
#
|
601
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
602
|
+
# p result
|
603
|
+
#
|
507
604
|
def delete_intent request, options = nil
|
508
605
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
509
606
|
|
@@ -539,6 +636,233 @@ module Google
|
|
539
636
|
raise ::Google::Cloud::Error.from_error(e)
|
540
637
|
end
|
541
638
|
|
639
|
+
##
|
640
|
+
# Imports the specified intents into the agent.
|
641
|
+
#
|
642
|
+
# This method is a [long-running
|
643
|
+
# operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
|
644
|
+
# The returned `Operation` type has the following method-specific fields:
|
645
|
+
#
|
646
|
+
# - `metadata`:
|
647
|
+
# {::Google::Cloud::Dialogflow::CX::V3::ImportIntentsMetadata ImportIntentsMetadata}
|
648
|
+
# - `response`:
|
649
|
+
# {::Google::Cloud::Dialogflow::CX::V3::ImportIntentsResponse ImportIntentsResponse}
|
650
|
+
#
|
651
|
+
# @overload import_intents(request, options = nil)
|
652
|
+
# Pass arguments to `import_intents` via a request object, either of type
|
653
|
+
# {::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest} or an equivalent Hash.
|
654
|
+
#
|
655
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest, ::Hash]
|
656
|
+
# A request object representing the call parameters. Required. To specify no
|
657
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
658
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
659
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
660
|
+
#
|
661
|
+
# @overload import_intents(parent: nil, intents_uri: nil, intents_content: nil, merge_option: nil)
|
662
|
+
# Pass arguments to `import_intents` via keyword arguments. Note that at
|
663
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
664
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
665
|
+
#
|
666
|
+
# @param parent [::String]
|
667
|
+
# Required. The agent to import the intents into.
|
668
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
|
669
|
+
# @param intents_uri [::String]
|
670
|
+
# The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI
|
671
|
+
# to import intents from. The format of this URI must be
|
672
|
+
# `gs://<bucket-name>/<object-name>`.
|
673
|
+
#
|
674
|
+
# Dialogflow performs a read operation for the Cloud Storage object
|
675
|
+
# on the caller's behalf, so your request authentication must
|
676
|
+
# have read permissions for the object. For more information, see
|
677
|
+
# [Dialogflow access
|
678
|
+
# control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage).
|
679
|
+
# @param intents_content [::Google::Cloud::Dialogflow::CX::V3::InlineSource, ::Hash]
|
680
|
+
# Uncompressed byte content of intents.
|
681
|
+
# @param merge_option [::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest::MergeOption]
|
682
|
+
# Merge option for importing intents. If not specified, `REJECT` is assumed.
|
683
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
684
|
+
# @yieldparam result [::Gapic::Operation]
|
685
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
686
|
+
#
|
687
|
+
# @return [::Gapic::Operation]
|
688
|
+
#
|
689
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
690
|
+
#
|
691
|
+
# @example Basic example
|
692
|
+
# require "google/cloud/dialogflow/cx/v3"
|
693
|
+
#
|
694
|
+
# # Create a client object. The client can be reused for multiple calls.
|
695
|
+
# client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new
|
696
|
+
#
|
697
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
698
|
+
# request = Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest.new
|
699
|
+
#
|
700
|
+
# # Call the import_intents method.
|
701
|
+
# result = client.import_intents request
|
702
|
+
#
|
703
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
704
|
+
# # check the status of an operation, cancel it, or wait for results.
|
705
|
+
# # Here is how to wait for a response.
|
706
|
+
# result.wait_until_done! timeout: 60
|
707
|
+
# if result.response?
|
708
|
+
# p result.response
|
709
|
+
# else
|
710
|
+
# puts "No response received."
|
711
|
+
# end
|
712
|
+
#
|
713
|
+
def import_intents request, options = nil
|
714
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
715
|
+
|
716
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportIntentsRequest
|
717
|
+
|
718
|
+
# Converts hash and nil to an options object
|
719
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
720
|
+
|
721
|
+
# Customize the options with defaults
|
722
|
+
call_metadata = @config.rpcs.import_intents.metadata.to_h
|
723
|
+
|
724
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
725
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
726
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
727
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION,
|
728
|
+
transports_version_send: [:rest]
|
729
|
+
|
730
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
731
|
+
|
732
|
+
options.apply_defaults timeout: @config.rpcs.import_intents.timeout,
|
733
|
+
metadata: call_metadata,
|
734
|
+
retry_policy: @config.rpcs.import_intents.retry_policy
|
735
|
+
|
736
|
+
options.apply_defaults timeout: @config.timeout,
|
737
|
+
metadata: @config.metadata,
|
738
|
+
retry_policy: @config.retry_policy
|
739
|
+
|
740
|
+
@intents_stub.import_intents request, options do |result, operation|
|
741
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
742
|
+
yield result, operation if block_given?
|
743
|
+
return result
|
744
|
+
end
|
745
|
+
rescue ::Gapic::Rest::Error => e
|
746
|
+
raise ::Google::Cloud::Error.from_error(e)
|
747
|
+
end
|
748
|
+
|
749
|
+
##
|
750
|
+
# Exports the selected intents.
|
751
|
+
#
|
752
|
+
# This method is a [long-running
|
753
|
+
# operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
|
754
|
+
# The returned `Operation` type has the following method-specific fields:
|
755
|
+
#
|
756
|
+
# - `metadata`:
|
757
|
+
# {::Google::Cloud::Dialogflow::CX::V3::ExportIntentsMetadata ExportIntentsMetadata}
|
758
|
+
# - `response`:
|
759
|
+
# {::Google::Cloud::Dialogflow::CX::V3::ExportIntentsResponse ExportIntentsResponse}
|
760
|
+
#
|
761
|
+
# @overload export_intents(request, options = nil)
|
762
|
+
# Pass arguments to `export_intents` via a request object, either of type
|
763
|
+
# {::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest} or an equivalent Hash.
|
764
|
+
#
|
765
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest, ::Hash]
|
766
|
+
# A request object representing the call parameters. Required. To specify no
|
767
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
768
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
769
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
770
|
+
#
|
771
|
+
# @overload export_intents(parent: nil, intents: nil, intents_uri: nil, intents_content_inline: nil, data_format: nil)
|
772
|
+
# Pass arguments to `export_intents` via keyword arguments. Note that at
|
773
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
774
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
775
|
+
#
|
776
|
+
# @param parent [::String]
|
777
|
+
# Required. The name of the parent agent to export intents.
|
778
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
779
|
+
# ID>`.
|
780
|
+
# @param intents [::Array<::String>]
|
781
|
+
# Required. The name of the intents to export.
|
782
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
783
|
+
# ID>/intents/<Intent ID>`.
|
784
|
+
# @param intents_uri [::String]
|
785
|
+
# Optional. The [Google Cloud
|
786
|
+
# Storage](https://cloud.google.com/storage/docs/) URI to export the
|
787
|
+
# intents to. The format of this URI must be
|
788
|
+
# `gs://<bucket-name>/<object-name>`.
|
789
|
+
#
|
790
|
+
# Dialogflow performs a write operation for the Cloud Storage object
|
791
|
+
# on the caller's behalf, so your request authentication must
|
792
|
+
# have write permissions for the object. For more information, see
|
793
|
+
# [Dialogflow access
|
794
|
+
# control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage).
|
795
|
+
# @param intents_content_inline [::Boolean]
|
796
|
+
# Optional. The option to return the serialized intents inline.
|
797
|
+
# @param data_format [::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest::DataFormat]
|
798
|
+
# Optional. The data format of the exported intents. If not specified, `BLOB`
|
799
|
+
# is assumed.
|
800
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
801
|
+
# @yieldparam result [::Gapic::Operation]
|
802
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
803
|
+
#
|
804
|
+
# @return [::Gapic::Operation]
|
805
|
+
#
|
806
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
807
|
+
#
|
808
|
+
# @example Basic example
|
809
|
+
# require "google/cloud/dialogflow/cx/v3"
|
810
|
+
#
|
811
|
+
# # Create a client object. The client can be reused for multiple calls.
|
812
|
+
# client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new
|
813
|
+
#
|
814
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
815
|
+
# request = Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest.new
|
816
|
+
#
|
817
|
+
# # Call the export_intents method.
|
818
|
+
# result = client.export_intents request
|
819
|
+
#
|
820
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
821
|
+
# # check the status of an operation, cancel it, or wait for results.
|
822
|
+
# # Here is how to wait for a response.
|
823
|
+
# result.wait_until_done! timeout: 60
|
824
|
+
# if result.response?
|
825
|
+
# p result.response
|
826
|
+
# else
|
827
|
+
# puts "No response received."
|
828
|
+
# end
|
829
|
+
#
|
830
|
+
def export_intents request, options = nil
|
831
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
832
|
+
|
833
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportIntentsRequest
|
834
|
+
|
835
|
+
# Converts hash and nil to an options object
|
836
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
837
|
+
|
838
|
+
# Customize the options with defaults
|
839
|
+
call_metadata = @config.rpcs.export_intents.metadata.to_h
|
840
|
+
|
841
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
842
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
843
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
844
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION,
|
845
|
+
transports_version_send: [:rest]
|
846
|
+
|
847
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
848
|
+
|
849
|
+
options.apply_defaults timeout: @config.rpcs.export_intents.timeout,
|
850
|
+
metadata: call_metadata,
|
851
|
+
retry_policy: @config.rpcs.export_intents.retry_policy
|
852
|
+
|
853
|
+
options.apply_defaults timeout: @config.timeout,
|
854
|
+
metadata: @config.metadata,
|
855
|
+
retry_policy: @config.retry_policy
|
856
|
+
|
857
|
+
@intents_stub.export_intents request, options do |result, operation|
|
858
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
859
|
+
yield result, operation if block_given?
|
860
|
+
return result
|
861
|
+
end
|
862
|
+
rescue ::Gapic::Rest::Error => e
|
863
|
+
raise ::Google::Cloud::Error.from_error(e)
|
864
|
+
end
|
865
|
+
|
542
866
|
##
|
543
867
|
# Configuration class for the Intents REST API.
|
544
868
|
#
|
@@ -696,6 +1020,16 @@ module Google
|
|
696
1020
|
# @return [::Gapic::Config::Method]
|
697
1021
|
#
|
698
1022
|
attr_reader :delete_intent
|
1023
|
+
##
|
1024
|
+
# RPC-specific configuration for `import_intents`
|
1025
|
+
# @return [::Gapic::Config::Method]
|
1026
|
+
#
|
1027
|
+
attr_reader :import_intents
|
1028
|
+
##
|
1029
|
+
# RPC-specific configuration for `export_intents`
|
1030
|
+
# @return [::Gapic::Config::Method]
|
1031
|
+
#
|
1032
|
+
attr_reader :export_intents
|
699
1033
|
|
700
1034
|
# @private
|
701
1035
|
def initialize parent_rpcs = nil
|
@@ -709,6 +1043,10 @@ module Google
|
|
709
1043
|
@update_intent = ::Gapic::Config::Method.new update_intent_config
|
710
1044
|
delete_intent_config = parent_rpcs.delete_intent if parent_rpcs.respond_to? :delete_intent
|
711
1045
|
@delete_intent = ::Gapic::Config::Method.new delete_intent_config
|
1046
|
+
import_intents_config = parent_rpcs.import_intents if parent_rpcs.respond_to? :import_intents
|
1047
|
+
@import_intents = ::Gapic::Config::Method.new import_intents_config
|
1048
|
+
export_intents_config = parent_rpcs.export_intents if parent_rpcs.respond_to? :export_intents
|
1049
|
+
@export_intents = ::Gapic::Config::Method.new export_intents_config
|
712
1050
|
|
713
1051
|
yield self if block_given?
|
714
1052
|
end
|