google-cloud-dialogflow-cx-v3 0.24.2 → 0.25.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/agent_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/audio_config_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/changelog_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/deployment_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/entity_type_pb.rb +13 -1
- data/lib/google/cloud/dialogflow/cx/v3/entity_type_services_pb.rb +4 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb +273 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/operations.rb +803 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb +259 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/operations.rb +917 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb +120 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest.rb +1 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_types.rb +1 -0
- data/lib/google/cloud/dialogflow/cx/v3/environment_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/experiment_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/gcs_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/generative_settings_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/generator_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/inline_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/intent_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/page_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/safety_settings_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_type_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/session_pb.rb +3 -1
- data/lib/google/cloud/dialogflow/cx/v3/session_services_pb.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +122 -0
- data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb +116 -0
- data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb +63 -0
- data/lib/google/cloud/dialogflow/cx/v3/test_case_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_group_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/version.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/version_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb +1 -1
- data/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb +2 -1
- data/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb +10 -31
- data/proto_docs/google/cloud/dialogflow/cx/v3/changelog.rb +3 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/entity_type.rb +190 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/generative_settings.rb +4 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/page.rb +3 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +24 -6
- metadata +4 -2
@@ -150,6 +150,13 @@ module Google
|
|
150
150
|
@quota_project_id = @config.quota_project
|
151
151
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
152
152
|
|
153
|
+
@operations_client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Operations.new do |config|
|
154
|
+
config.credentials = credentials
|
155
|
+
config.quota_project = @quota_project_id
|
156
|
+
config.endpoint = @config.endpoint
|
157
|
+
config.universe_domain = @config.universe_domain
|
158
|
+
end
|
159
|
+
|
153
160
|
@entity_types_stub = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::ServiceStub.new(
|
154
161
|
endpoint: @config.endpoint,
|
155
162
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
@@ -166,6 +173,13 @@ module Google
|
|
166
173
|
end
|
167
174
|
end
|
168
175
|
|
176
|
+
##
|
177
|
+
# Get the associated client for long-running operations.
|
178
|
+
#
|
179
|
+
# @return [::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Operations]
|
180
|
+
#
|
181
|
+
attr_reader :operations_client
|
182
|
+
|
169
183
|
##
|
170
184
|
# Get the associated client for mix-in of the Locations.
|
171
185
|
#
|
@@ -660,6 +674,237 @@ module Google
|
|
660
674
|
raise ::Google::Cloud::Error.from_error(e)
|
661
675
|
end
|
662
676
|
|
677
|
+
##
|
678
|
+
# Exports the selected entity types.
|
679
|
+
#
|
680
|
+
# @overload export_entity_types(request, options = nil)
|
681
|
+
# Pass arguments to `export_entity_types` via a request object, either of type
|
682
|
+
# {::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest} or an equivalent Hash.
|
683
|
+
#
|
684
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest, ::Hash]
|
685
|
+
# A request object representing the call parameters. Required. To specify no
|
686
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
687
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
688
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
689
|
+
#
|
690
|
+
# @overload export_entity_types(parent: nil, entity_types: nil, entity_types_uri: nil, entity_types_content_inline: nil, data_format: nil, language_code: nil)
|
691
|
+
# Pass arguments to `export_entity_types` via keyword arguments. Note that at
|
692
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
693
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
694
|
+
#
|
695
|
+
# @param parent [::String]
|
696
|
+
# Required. The name of the parent agent to export entity types.
|
697
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
698
|
+
# ID>`.
|
699
|
+
# @param entity_types [::Array<::String>]
|
700
|
+
# Required. The name of the entity types to export.
|
701
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
702
|
+
# ID>/entityTypes/<EntityType ID>`.
|
703
|
+
# @param entity_types_uri [::String]
|
704
|
+
# Optional. The [Google Cloud
|
705
|
+
# Storage](https://cloud.google.com/storage/docs/) URI to export the entity
|
706
|
+
# types to. The format of this URI must be
|
707
|
+
# `gs://<bucket-name>/<object-name>`.
|
708
|
+
#
|
709
|
+
# Dialogflow performs a write operation for the Cloud Storage object
|
710
|
+
# on the caller's behalf, so your request authentication must
|
711
|
+
# have write permissions for the object. For more information, see
|
712
|
+
# [Dialogflow access
|
713
|
+
# control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage).
|
714
|
+
# @param entity_types_content_inline [::Boolean]
|
715
|
+
# Optional. The option to return the serialized entity types inline.
|
716
|
+
# @param data_format [::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest::DataFormat]
|
717
|
+
# Optional. The data format of the exported entity types. If not specified,
|
718
|
+
# `BLOB` is assumed.
|
719
|
+
# @param language_code [::String]
|
720
|
+
# Optional. The language to retrieve the entity type for. The following
|
721
|
+
# fields are language dependent:
|
722
|
+
#
|
723
|
+
# * `EntityType.entities.value`
|
724
|
+
# * `EntityType.entities.synonyms`
|
725
|
+
# * `EntityType.excluded_phrases.value`
|
726
|
+
#
|
727
|
+
# If not specified, all language dependent fields will be retrieved.
|
728
|
+
# [Many
|
729
|
+
# languages](https://cloud.google.com/dialogflow/docs/reference/language)
|
730
|
+
# are supported.
|
731
|
+
# Note: languages must be enabled in the agent before they can be used.
|
732
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
733
|
+
# @yieldparam result [::Gapic::Operation]
|
734
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
735
|
+
#
|
736
|
+
# @return [::Gapic::Operation]
|
737
|
+
#
|
738
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
739
|
+
#
|
740
|
+
# @example Basic example
|
741
|
+
# require "google/cloud/dialogflow/cx/v3"
|
742
|
+
#
|
743
|
+
# # Create a client object. The client can be reused for multiple calls.
|
744
|
+
# client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new
|
745
|
+
#
|
746
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
747
|
+
# request = Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest.new
|
748
|
+
#
|
749
|
+
# # Call the export_entity_types method.
|
750
|
+
# result = client.export_entity_types request
|
751
|
+
#
|
752
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
753
|
+
# # check the status of an operation, cancel it, or wait for results.
|
754
|
+
# # Here is how to wait for a response.
|
755
|
+
# result.wait_until_done! timeout: 60
|
756
|
+
# if result.response?
|
757
|
+
# p result.response
|
758
|
+
# else
|
759
|
+
# puts "No response received."
|
760
|
+
# end
|
761
|
+
#
|
762
|
+
def export_entity_types request, options = nil
|
763
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
764
|
+
|
765
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportEntityTypesRequest
|
766
|
+
|
767
|
+
# Converts hash and nil to an options object
|
768
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
769
|
+
|
770
|
+
# Customize the options with defaults
|
771
|
+
call_metadata = @config.rpcs.export_entity_types.metadata.to_h
|
772
|
+
|
773
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
774
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
775
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
776
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION,
|
777
|
+
transports_version_send: [:rest]
|
778
|
+
|
779
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
780
|
+
|
781
|
+
options.apply_defaults timeout: @config.rpcs.export_entity_types.timeout,
|
782
|
+
metadata: call_metadata,
|
783
|
+
retry_policy: @config.rpcs.export_entity_types.retry_policy
|
784
|
+
|
785
|
+
options.apply_defaults timeout: @config.timeout,
|
786
|
+
metadata: @config.metadata,
|
787
|
+
retry_policy: @config.retry_policy
|
788
|
+
|
789
|
+
@entity_types_stub.export_entity_types request, options do |result, operation|
|
790
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
791
|
+
yield result, operation if block_given?
|
792
|
+
return result
|
793
|
+
end
|
794
|
+
rescue ::Gapic::Rest::Error => e
|
795
|
+
raise ::Google::Cloud::Error.from_error(e)
|
796
|
+
end
|
797
|
+
|
798
|
+
##
|
799
|
+
# Imports the specified entitytypes into the agent.
|
800
|
+
#
|
801
|
+
# @overload import_entity_types(request, options = nil)
|
802
|
+
# Pass arguments to `import_entity_types` via a request object, either of type
|
803
|
+
# {::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest} or an equivalent Hash.
|
804
|
+
#
|
805
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest, ::Hash]
|
806
|
+
# A request object representing the call parameters. Required. To specify no
|
807
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
808
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
809
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
810
|
+
#
|
811
|
+
# @overload import_entity_types(parent: nil, entity_types_uri: nil, entity_types_content: nil, merge_option: nil, target_entity_type: nil)
|
812
|
+
# Pass arguments to `import_entity_types` via keyword arguments. Note that at
|
813
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
814
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
815
|
+
#
|
816
|
+
# @param parent [::String]
|
817
|
+
# Required. The agent to import the entity types into.
|
818
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
|
819
|
+
# @param entity_types_uri [::String]
|
820
|
+
# The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI
|
821
|
+
# to import entity types from. The format of this URI must be
|
822
|
+
# `gs://<bucket-name>/<object-name>`.
|
823
|
+
#
|
824
|
+
# Dialogflow performs a read operation for the Cloud Storage object
|
825
|
+
# on the caller's behalf, so your request authentication must
|
826
|
+
# have read permissions for the object. For more information, see
|
827
|
+
# [Dialogflow access
|
828
|
+
# control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage).
|
829
|
+
# @param entity_types_content [::Google::Cloud::Dialogflow::CX::V3::InlineSource, ::Hash]
|
830
|
+
# Uncompressed byte content of entity types.
|
831
|
+
# @param merge_option [::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest::MergeOption]
|
832
|
+
# Required. Merge option for importing entity types.
|
833
|
+
# @param target_entity_type [::String]
|
834
|
+
# Optional. The target entity type to import into.
|
835
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
836
|
+
# ID>/entity_types/<EntityType ID>`.
|
837
|
+
# If set, there should be only one entity type included in
|
838
|
+
# [entity_types][google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.entity_types],
|
839
|
+
# of which the type should match the type of the target entity type. All
|
840
|
+
# {::Google::Cloud::Dialogflow::CX::V3::EntityType#entities entities} in the
|
841
|
+
# imported entity type will be added to the target entity type.
|
842
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
843
|
+
# @yieldparam result [::Gapic::Operation]
|
844
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
845
|
+
#
|
846
|
+
# @return [::Gapic::Operation]
|
847
|
+
#
|
848
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
849
|
+
#
|
850
|
+
# @example Basic example
|
851
|
+
# require "google/cloud/dialogflow/cx/v3"
|
852
|
+
#
|
853
|
+
# # Create a client object. The client can be reused for multiple calls.
|
854
|
+
# client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new
|
855
|
+
#
|
856
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
857
|
+
# request = Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest.new
|
858
|
+
#
|
859
|
+
# # Call the import_entity_types method.
|
860
|
+
# result = client.import_entity_types request
|
861
|
+
#
|
862
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
863
|
+
# # check the status of an operation, cancel it, or wait for results.
|
864
|
+
# # Here is how to wait for a response.
|
865
|
+
# result.wait_until_done! timeout: 60
|
866
|
+
# if result.response?
|
867
|
+
# p result.response
|
868
|
+
# else
|
869
|
+
# puts "No response received."
|
870
|
+
# end
|
871
|
+
#
|
872
|
+
def import_entity_types request, options = nil
|
873
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
874
|
+
|
875
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportEntityTypesRequest
|
876
|
+
|
877
|
+
# Converts hash and nil to an options object
|
878
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
879
|
+
|
880
|
+
# Customize the options with defaults
|
881
|
+
call_metadata = @config.rpcs.import_entity_types.metadata.to_h
|
882
|
+
|
883
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
884
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
885
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
886
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION,
|
887
|
+
transports_version_send: [:rest]
|
888
|
+
|
889
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
890
|
+
|
891
|
+
options.apply_defaults timeout: @config.rpcs.import_entity_types.timeout,
|
892
|
+
metadata: call_metadata,
|
893
|
+
retry_policy: @config.rpcs.import_entity_types.retry_policy
|
894
|
+
|
895
|
+
options.apply_defaults timeout: @config.timeout,
|
896
|
+
metadata: @config.metadata,
|
897
|
+
retry_policy: @config.retry_policy
|
898
|
+
|
899
|
+
@entity_types_stub.import_entity_types request, options do |result, operation|
|
900
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
901
|
+
yield result, operation if block_given?
|
902
|
+
return result
|
903
|
+
end
|
904
|
+
rescue ::Gapic::Rest::Error => e
|
905
|
+
raise ::Google::Cloud::Error.from_error(e)
|
906
|
+
end
|
907
|
+
|
663
908
|
##
|
664
909
|
# Configuration class for the EntityTypes REST API.
|
665
910
|
#
|
@@ -825,6 +1070,16 @@ module Google
|
|
825
1070
|
# @return [::Gapic::Config::Method]
|
826
1071
|
#
|
827
1072
|
attr_reader :list_entity_types
|
1073
|
+
##
|
1074
|
+
# RPC-specific configuration for `export_entity_types`
|
1075
|
+
# @return [::Gapic::Config::Method]
|
1076
|
+
#
|
1077
|
+
attr_reader :export_entity_types
|
1078
|
+
##
|
1079
|
+
# RPC-specific configuration for `import_entity_types`
|
1080
|
+
# @return [::Gapic::Config::Method]
|
1081
|
+
#
|
1082
|
+
attr_reader :import_entity_types
|
828
1083
|
|
829
1084
|
# @private
|
830
1085
|
def initialize parent_rpcs = nil
|
@@ -838,6 +1093,10 @@ module Google
|
|
838
1093
|
@delete_entity_type = ::Gapic::Config::Method.new delete_entity_type_config
|
839
1094
|
list_entity_types_config = parent_rpcs.list_entity_types if parent_rpcs.respond_to? :list_entity_types
|
840
1095
|
@list_entity_types = ::Gapic::Config::Method.new list_entity_types_config
|
1096
|
+
export_entity_types_config = parent_rpcs.export_entity_types if parent_rpcs.respond_to? :export_entity_types
|
1097
|
+
@export_entity_types = ::Gapic::Config::Method.new export_entity_types_config
|
1098
|
+
import_entity_types_config = parent_rpcs.import_entity_types if parent_rpcs.respond_to? :import_entity_types
|
1099
|
+
@import_entity_types = ::Gapic::Config::Method.new import_entity_types_config
|
841
1100
|
|
842
1101
|
yield self if block_given?
|
843
1102
|
end
|