Module: Google::Cloud::Dialogflow
- Defined in:
- lib/google/cloud/dialogflow.rb,
lib/google/cloud/dialogflow/version.rb
Constant Summary collapse
- VERSION =
"1.11.0".freeze
Class Method Summary collapse
-
.agents(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Agents.
-
.agents_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Agents service is supported by the current client.
-
.answer_records(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for AnswerRecords.
-
.answer_records_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the AnswerRecords service is supported by the current client.
-
.configure {|::Google::Cloud.configure.dialogflow| ... } ⇒ ::Google::Cloud::Config
Configure the google-cloud-dialogflow library.
-
.contexts(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Contexts.
-
.contexts_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Contexts service is supported by the current client.
-
.conversation_datasets(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for ConversationDatasets.
-
.conversation_datasets_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the ConversationDatasets service is supported by the current client.
-
.conversation_models(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for ConversationModels.
-
.conversation_models_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the ConversationModels service is supported by the current client.
-
.conversation_profiles(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for ConversationProfiles.
-
.conversation_profiles_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the ConversationProfiles service is supported by the current client.
-
.conversations(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Conversations.
-
.conversations_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Conversations service is supported by the current client.
-
.documents(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Documents.
-
.documents_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Documents service is supported by the current client.
-
.encryption_spec_service(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for EncryptionSpecService.
-
.encryption_spec_service_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the EncryptionSpecService service is supported by the current client.
-
.entity_types(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for EntityTypes.
-
.entity_types_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the EntityTypes service is supported by the current client.
-
.environments(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Environments.
-
.environments_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Environments service is supported by the current client.
-
.fulfillments(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Fulfillments.
-
.fulfillments_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Fulfillments service is supported by the current client.
-
.generators(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Generators.
-
.generators_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Generators service is supported by the current client.
-
.intents(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Intents.
-
.intents_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Intents service is supported by the current client.
-
.knowledge_bases(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for KnowledgeBases.
-
.knowledge_bases_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the KnowledgeBases service is supported by the current client.
-
.participants(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Participants.
-
.participants_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Participants service is supported by the current client.
-
.session_entity_types(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for SessionEntityTypes.
-
.session_entity_types_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the SessionEntityTypes service is supported by the current client.
-
.sessions(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Sessions.
-
.sessions_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Sessions service is supported by the current client.
-
.versions(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Versions.
-
.versions_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Versions service is supported by the current client.
Class Method Details
.agents(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Agents.
By default, this returns an instance of
Google::Cloud::Dialogflow::V2::Agents::Client
for a gRPC client for version V2 of the API.
However, you can specify a different API version by passing it in the
version
parameter. If the Agents service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
You can also specify a different transport by passing :rest
or :grpc
in
the transport
parameter.
Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the Agents service. You can determine whether the method will succeed by calling agents_available?.
About Agents
Service for managing Agents.
75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/google/cloud/dialogflow.rb', line 75 def self.agents version: :v2, transport: :grpc, &block require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Agents) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.agents_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Agents service is supported by the current client. If true, you can retrieve a client object by calling agents. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the Agents service, or if the versioned client gem needs an update to support the Agents service.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/google/cloud/dialogflow.rb', line 99 def self.agents_available? version: :v2, transport: :grpc require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::Dialogflow.const_get package_name return false unless service_module.const_defined? :Agents service_module = service_module.const_get :Agents if transport == :rest return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest end service_module.const_defined? :Client rescue ::LoadError false end |
.answer_records(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for AnswerRecords.
By default, this returns an instance of
Google::Cloud::Dialogflow::V2::AnswerRecords::Client
for a gRPC client for version V2 of the API.
However, you can specify a different API version by passing it in the
version
parameter. If the AnswerRecords service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
You can also specify a different transport by passing :rest
or :grpc
in
the transport
parameter.
Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the AnswerRecords service. You can determine whether the method will succeed by calling answer_records_available?.
About AnswerRecords
Service for managing AnswerRecords.
644 645 646 647 648 649 650 651 652 653 654 |
# File 'lib/google/cloud/dialogflow.rb', line 644 def self.answer_records version: :v2, transport: :grpc, &block require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:AnswerRecords) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.answer_records_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the AnswerRecords service is supported by the current client. If true, you can retrieve a client object by calling answer_records. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the AnswerRecords service, or if the versioned client gem needs an update to support the AnswerRecords service.
668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 |
# File 'lib/google/cloud/dialogflow.rb', line 668 def self.answer_records_available? version: :v2, transport: :grpc require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::Dialogflow.const_get package_name return false unless service_module.const_defined? :AnswerRecords service_module = service_module.const_get :AnswerRecords if transport == :rest return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest end service_module.const_defined? :Client rescue ::LoadError false end |
.configure {|::Google::Cloud.configure.dialogflow| ... } ⇒ ::Google::Cloud::Config
Configure the google-cloud-dialogflow library.
The following configuration parameters are supported:
credentials
(type:String, Hash, Google::Auth::Credentials
) - The path to the keyfile as a String, the contents of the keyfile as a Hash, or a Google::Auth::Credentials object.lib_name
(type:String
) - The library name as recorded in instrumentation and logging.lib_version
(type:String
) - The library version as recorded in instrumentation and logging.interceptors
(type:Array<GRPC::ClientInterceptor>
) - An array of interceptors that are run before calls are executed.timeout
(type:Numeric
) - Default timeout in seconds.metadata
(type:Hash{Symbol=>String}
) - Additional headers to be sent with the call.retry_policy
(type:Hash
) - The retry policy. The value is a hash with the following keys::initial_delay
(type:Numeric
) - The initial delay in seconds.:max_delay
(type:Numeric
) - The max delay in seconds.:multiplier
(type:Numeric
) - The incremental backoff multiplier.:retry_codes
(type:Array<String>
) - The error codes that should trigger a retry.
1422 1423 1424 1425 1426 |
# File 'lib/google/cloud/dialogflow.rb', line 1422 def self.configure yield ::Google::Cloud.configure.dialogflow if block_given? ::Google::Cloud.configure.dialogflow end |
.contexts(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Contexts.
By default, this returns an instance of
Google::Cloud::Dialogflow::V2::Contexts::Client
for a gRPC client for version V2 of the API.
However, you can specify a different API version by passing it in the
version
parameter. If the Contexts service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
You can also specify a different transport by passing :rest
or :grpc
in
the transport
parameter.
Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the Contexts service. You can determine whether the method will succeed by calling contexts_available?.
About Contexts
Service for managing Contexts.
219 220 221 222 223 224 225 226 227 228 229 |
# File 'lib/google/cloud/dialogflow.rb', line 219 def self.contexts version: :v2, transport: :grpc, &block require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Contexts) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.contexts_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Contexts service is supported by the current client. If true, you can retrieve a client object by calling contexts. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the Contexts service, or if the versioned client gem needs an update to support the Contexts service.
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/google/cloud/dialogflow.rb', line 243 def self.contexts_available? version: :v2, transport: :grpc require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::Dialogflow.const_get package_name return false unless service_module.const_defined? :Contexts service_module = service_module.const_get :Contexts if transport == :rest return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest end service_module.const_defined? :Client rescue ::LoadError false end |
.conversation_datasets(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for ConversationDatasets.
By default, this returns an instance of
Google::Cloud::Dialogflow::V2::ConversationDatasets::Client
for a gRPC client for version V2 of the API.
However, you can specify a different API version by passing it in the
version
parameter. If the ConversationDatasets service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
You can also specify a different transport by passing :rest
or :grpc
in
the transport
parameter.
Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the ConversationDatasets service. You can determine whether the method will succeed by calling conversation_datasets_available?.
About ConversationDatasets
Conversation datasets.
Conversation datasets contain raw conversation files and their customizable metadata that can be used for model training.
859 860 861 862 863 864 865 866 867 868 869 |
# File 'lib/google/cloud/dialogflow.rb', line 859 def self.conversation_datasets version: :v2, transport: :grpc, &block require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:ConversationDatasets) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.conversation_datasets_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the ConversationDatasets service is supported by the current client. If true, you can retrieve a client object by calling conversation_datasets. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the ConversationDatasets service, or if the versioned client gem needs an update to support the ConversationDatasets service.
883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 |
# File 'lib/google/cloud/dialogflow.rb', line 883 def self.conversation_datasets_available? version: :v2, transport: :grpc require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::Dialogflow.const_get package_name return false unless service_module.const_defined? :ConversationDatasets service_module = service_module.const_get :ConversationDatasets if transport == :rest return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest end service_module.const_defined? :Client rescue ::LoadError false end |
.conversation_models(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for ConversationModels.
By default, this returns an instance of
Google::Cloud::Dialogflow::V2::ConversationModels::Client
for a gRPC client for version V2 of the API.
However, you can specify a different API version by passing it in the
version
parameter. If the ConversationModels service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
You can also specify a different transport by passing :rest
or :grpc
in
the transport
parameter.
Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the ConversationModels service. You can determine whether the method will succeed by calling conversation_models_available?.
About ConversationModels
Manages a collection of models for human agent assistant.
929 930 931 932 933 934 935 936 937 938 939 |
# File 'lib/google/cloud/dialogflow.rb', line 929 def self.conversation_models version: :v2, transport: :grpc, &block require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:ConversationModels) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.conversation_models_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the ConversationModels service is supported by the current client. If true, you can retrieve a client object by calling conversation_models. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the ConversationModels service, or if the versioned client gem needs an update to support the ConversationModels service.
953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 |
# File 'lib/google/cloud/dialogflow.rb', line 953 def self.conversation_models_available? version: :v2, transport: :grpc require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::Dialogflow.const_get package_name return false unless service_module.const_defined? :ConversationModels service_module = service_module.const_get :ConversationModels if transport == :rest return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest end service_module.const_defined? :Client rescue ::LoadError false end |
.conversation_profiles(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for ConversationProfiles.
By default, this returns an instance of
Google::Cloud::Dialogflow::V2::ConversationProfiles::Client
for a gRPC client for version V2 of the API.
However, you can specify a different API version by passing it in the
version
parameter. If the ConversationProfiles service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
You can also specify a different transport by passing :rest
or :grpc
in
the transport
parameter.
Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the ConversationProfiles service. You can determine whether the method will succeed by calling conversation_profiles_available?.
About ConversationProfiles
Service for managing ConversationProfiles.
715 716 717 718 719 720 721 722 723 724 725 |
# File 'lib/google/cloud/dialogflow.rb', line 715 def self.conversation_profiles version: :v2, transport: :grpc, &block require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:ConversationProfiles) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.conversation_profiles_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the ConversationProfiles service is supported by the current client. If true, you can retrieve a client object by calling conversation_profiles. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the ConversationProfiles service, or if the versioned client gem needs an update to support the ConversationProfiles service.
739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 |
# File 'lib/google/cloud/dialogflow.rb', line 739 def self.conversation_profiles_available? version: :v2, transport: :grpc require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::Dialogflow.const_get package_name return false unless service_module.const_defined? :ConversationProfiles service_module = service_module.const_get :ConversationProfiles if transport == :rest return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest end service_module.const_defined? :Client rescue ::LoadError false end |
.conversations(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Conversations.
By default, this returns an instance of
Google::Cloud::Dialogflow::V2::Conversations::Client
for a gRPC client for version V2 of the API.
However, you can specify a different API version by passing it in the
version
parameter. If the Conversations service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
You can also specify a different transport by passing :rest
or :grpc
in
the transport
parameter.
Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the Conversations service. You can determine whether the method will succeed by calling conversations_available?.
About Conversations
Service for managing Conversations.
786 787 788 789 790 791 792 793 794 795 796 |
# File 'lib/google/cloud/dialogflow.rb', line 786 def self.conversations version: :v2, transport: :grpc, &block require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Conversations) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.conversations_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Conversations service is supported by the current client. If true, you can retrieve a client object by calling conversations. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the Conversations service, or if the versioned client gem needs an update to support the Conversations service.
810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 |
# File 'lib/google/cloud/dialogflow.rb', line 810 def self.conversations_available? version: :v2, transport: :grpc require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::Dialogflow.const_get package_name return false unless service_module.const_defined? :Conversations service_module = service_module.const_get :Conversations if transport == :rest return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest end service_module.const_defined? :Client rescue ::LoadError false end |
.documents(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Documents.
By default, this returns an instance of
Google::Cloud::Dialogflow::V2::Documents::Client
for a gRPC client for version V2 of the API.
However, you can specify a different API version by passing it in the
version
parameter. If the Documents service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
You can also specify a different transport by passing :rest
or :grpc
in
the transport
parameter.
Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the Documents service. You can determine whether the method will succeed by calling documents_available?.
About Documents
Service for managing knowledge Documents.
1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 |
# File 'lib/google/cloud/dialogflow.rb', line 1000 def self.documents version: :v2, transport: :grpc, &block require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Documents) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.documents_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Documents service is supported by the current client. If true, you can retrieve a client object by calling documents. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the Documents service, or if the versioned client gem needs an update to support the Documents service.
1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 |
# File 'lib/google/cloud/dialogflow.rb', line 1024 def self.documents_available? version: :v2, transport: :grpc require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::Dialogflow.const_get package_name return false unless service_module.const_defined? :Documents service_module = service_module.const_get :Documents if transport == :rest return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest end service_module.const_defined? :Client rescue ::LoadError false end |
.encryption_spec_service(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for EncryptionSpecService.
By default, this returns an instance of
Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client
for a gRPC client for version V2 of the API.
However, you can specify a different API version by passing it in the
version
parameter. If the EncryptionSpecService service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
You can also specify a different transport by passing :rest
or :grpc
in
the transport
parameter.
Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the EncryptionSpecService service. You can determine whether the method will succeed by calling encryption_spec_service_available?.
About EncryptionSpecService
Manages encryption spec settings for Dialogflow and Agent Assist.
1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 |
# File 'lib/google/cloud/dialogflow.rb', line 1070 def self.encryption_spec_service version: :v2, transport: :grpc, &block require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:EncryptionSpecService) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.encryption_spec_service_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the EncryptionSpecService service is supported by the current client. If true, you can retrieve a client object by calling encryption_spec_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the EncryptionSpecService service, or if the versioned client gem needs an update to support the EncryptionSpecService service.
1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 |
# File 'lib/google/cloud/dialogflow.rb', line 1094 def self.encryption_spec_service_available? version: :v2, transport: :grpc require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::Dialogflow.const_get package_name return false unless service_module.const_defined? :EncryptionSpecService service_module = service_module.const_get :EncryptionSpecService if transport == :rest return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest end service_module.const_defined? :Client rescue ::LoadError false end |
.entity_types(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for EntityTypes.
By default, this returns an instance of
Google::Cloud::Dialogflow::V2::EntityTypes::Client
for a gRPC client for version V2 of the API.
However, you can specify a different API version by passing it in the
version
parameter. If the EntityTypes service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
You can also specify a different transport by passing :rest
or :grpc
in
the transport
parameter.
Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the EntityTypes service. You can determine whether the method will succeed by calling entity_types_available?.
About EntityTypes
Service for managing EntityTypes.
359 360 361 362 363 364 365 366 367 368 369 |
# File 'lib/google/cloud/dialogflow.rb', line 359 def self.entity_types version: :v2, transport: :grpc, &block require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:EntityTypes) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.entity_types_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the EntityTypes service is supported by the current client. If true, you can retrieve a client object by calling entity_types. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the EntityTypes service, or if the versioned client gem needs an update to support the EntityTypes service.
383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 |
# File 'lib/google/cloud/dialogflow.rb', line 383 def self.entity_types_available? version: :v2, transport: :grpc require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::Dialogflow.const_get package_name return false unless service_module.const_defined? :EntityTypes service_module = service_module.const_get :EntityTypes if transport == :rest return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest end service_module.const_defined? :Client rescue ::LoadError false end |
.environments(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Environments.
By default, this returns an instance of
Google::Cloud::Dialogflow::V2::Environments::Client
for a gRPC client for version V2 of the API.
However, you can specify a different API version by passing it in the
version
parameter. If the Environments service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
You can also specify a different transport by passing :rest
or :grpc
in
the transport
parameter.
Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the Environments service. You can determine whether the method will succeed by calling environments_available?.
About Environments
Service for managing Environments.
1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 |
# File 'lib/google/cloud/dialogflow.rb', line 1210 def self.environments version: :v2, transport: :grpc, &block require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Environments) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.environments_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Environments service is supported by the current client. If true, you can retrieve a client object by calling environments. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the Environments service, or if the versioned client gem needs an update to support the Environments service.
1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 |
# File 'lib/google/cloud/dialogflow.rb', line 1234 def self.environments_available? version: :v2, transport: :grpc require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::Dialogflow.const_get package_name return false unless service_module.const_defined? :Environments service_module = service_module.const_get :Environments if transport == :rest return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest end service_module.const_defined? :Client rescue ::LoadError false end |
.fulfillments(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Fulfillments.
By default, this returns an instance of
Google::Cloud::Dialogflow::V2::Fulfillments::Client
for a gRPC client for version V2 of the API.
However, you can specify a different API version by passing it in the
version
parameter. If the Fulfillments service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
You can also specify a different transport by passing :rest
or :grpc
in
the transport
parameter.
Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the Fulfillments service. You can determine whether the method will succeed by calling fulfillments_available?.
About Fulfillments
Service for managing Fulfillments.
1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 |
# File 'lib/google/cloud/dialogflow.rb', line 1140 def self.fulfillments version: :v2, transport: :grpc, &block require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Fulfillments) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.fulfillments_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Fulfillments service is supported by the current client. If true, you can retrieve a client object by calling fulfillments. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the Fulfillments service, or if the versioned client gem needs an update to support the Fulfillments service.
1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 |
# File 'lib/google/cloud/dialogflow.rb', line 1164 def self.fulfillments_available? version: :v2, transport: :grpc require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::Dialogflow.const_get package_name return false unless service_module.const_defined? :Fulfillments service_module = service_module.const_get :Fulfillments if transport == :rest return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest end service_module.const_defined? :Client rescue ::LoadError false end |
.generators(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Generators.
By default, this returns an instance of
Google::Cloud::Dialogflow::V2::Generators::Client
for a gRPC client for version V2 of the API.
However, you can specify a different API version by passing it in the
version
parameter. If the Generators service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
You can also specify a different transport by passing :rest
or :grpc
in
the transport
parameter.
Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the Generators service. You can determine whether the method will succeed by calling generators_available?.
About Generators
Generator Service for LLM powered Agent Assist. This service manages the configurations of user owned Generators, such as description, context and instruction, input/output format, etc. The generator resources will be used inside a conversation and will be triggered by TriggerEvent to query LLM for answers.
149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/google/cloud/dialogflow.rb', line 149 def self.generators version: :v2, transport: :grpc, &block require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Generators) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.generators_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Generators service is supported by the current client. If true, you can retrieve a client object by calling generators. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the Generators service, or if the versioned client gem needs an update to support the Generators service.
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/google/cloud/dialogflow.rb', line 173 def self.generators_available? version: :v2, transport: :grpc require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::Dialogflow.const_get package_name return false unless service_module.const_defined? :Generators service_module = service_module.const_get :Generators if transport == :rest return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest end service_module.const_defined? :Client rescue ::LoadError false end |
.intents(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Intents.
By default, this returns an instance of
Google::Cloud::Dialogflow::V2::Intents::Client
for a gRPC client for version V2 of the API.
However, you can specify a different API version by passing it in the
version
parameter. If the Intents service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
You can also specify a different transport by passing :rest
or :grpc
in
the transport
parameter.
Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the Intents service. You can determine whether the method will succeed by calling intents_available?.
About Intents
Service for managing Intents.
289 290 291 292 293 294 295 296 297 298 299 |
# File 'lib/google/cloud/dialogflow.rb', line 289 def self.intents version: :v2, transport: :grpc, &block require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Intents) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.intents_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Intents service is supported by the current client. If true, you can retrieve a client object by calling intents. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the Intents service, or if the versioned client gem needs an update to support the Intents service.
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
# File 'lib/google/cloud/dialogflow.rb', line 313 def self.intents_available? version: :v2, transport: :grpc require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::Dialogflow.const_get package_name return false unless service_module.const_defined? :Intents service_module = service_module.const_get :Intents if transport == :rest return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest end service_module.const_defined? :Client rescue ::LoadError false end |
.knowledge_bases(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for KnowledgeBases.
By default, this returns an instance of
Google::Cloud::Dialogflow::V2::KnowledgeBases::Client
for a gRPC client for version V2 of the API.
However, you can specify a different API version by passing it in the
version
parameter. If the KnowledgeBases service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
You can also specify a different transport by passing :rest
or :grpc
in
the transport
parameter.
Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the KnowledgeBases service. You can determine whether the method will succeed by calling knowledge_bases_available?.
About KnowledgeBases
Service for managing KnowledgeBases.
1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 |
# File 'lib/google/cloud/dialogflow.rb', line 1281 def self.knowledge_bases version: :v2, transport: :grpc, &block require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:KnowledgeBases) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.knowledge_bases_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the KnowledgeBases service is supported by the current client. If true, you can retrieve a client object by calling knowledge_bases. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the KnowledgeBases service, or if the versioned client gem needs an update to support the KnowledgeBases service.
1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 |
# File 'lib/google/cloud/dialogflow.rb', line 1305 def self.knowledge_bases_available? version: :v2, transport: :grpc require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::Dialogflow.const_get package_name return false unless service_module.const_defined? :KnowledgeBases service_module = service_module.const_get :KnowledgeBases if transport == :rest return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest end service_module.const_defined? :Client rescue ::LoadError false end |
.participants(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Participants.
By default, this returns an instance of
Google::Cloud::Dialogflow::V2::Participants::Client
for a gRPC client for version V2 of the API.
However, you can specify a different API version by passing it in the
version
parameter. If the Participants service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
You can also specify a different transport by passing :rest
or :grpc
in
the transport
parameter.
Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the Participants service. You can determine whether the method will succeed by calling participants_available?.
About Participants
Service for managing Participants.
573 574 575 576 577 578 579 580 581 582 583 |
# File 'lib/google/cloud/dialogflow.rb', line 573 def self.participants version: :v2, transport: :grpc, &block require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Participants) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.participants_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Participants service is supported by the current client. If true, you can retrieve a client object by calling participants. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the Participants service, or if the versioned client gem needs an update to support the Participants service.
597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 |
# File 'lib/google/cloud/dialogflow.rb', line 597 def self.participants_available? version: :v2, transport: :grpc require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::Dialogflow.const_get package_name return false unless service_module.const_defined? :Participants service_module = service_module.const_get :Participants if transport == :rest return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest end service_module.const_defined? :Client rescue ::LoadError false end |
.session_entity_types(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for SessionEntityTypes.
By default, this returns an instance of
Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client
for a gRPC client for version V2 of the API.
However, you can specify a different API version by passing it in the
version
parameter. If the SessionEntityTypes service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
You can also specify a different transport by passing :rest
or :grpc
in
the transport
parameter.
Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the SessionEntityTypes service. You can determine whether the method will succeed by calling session_entity_types_available?.
About SessionEntityTypes
Service for managing SessionEntityTypes.
430 431 432 433 434 435 436 437 438 439 440 |
# File 'lib/google/cloud/dialogflow.rb', line 430 def self.session_entity_types version: :v2, transport: :grpc, &block require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:SessionEntityTypes) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.session_entity_types_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the SessionEntityTypes service is supported by the current client. If true, you can retrieve a client object by calling session_entity_types. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the SessionEntityTypes service, or if the versioned client gem needs an update to support the SessionEntityTypes service.
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 |
# File 'lib/google/cloud/dialogflow.rb', line 454 def self.session_entity_types_available? version: :v2, transport: :grpc require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::Dialogflow.const_get package_name return false unless service_module.const_defined? :SessionEntityTypes service_module = service_module.const_get :SessionEntityTypes if transport == :rest return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest end service_module.const_defined? :Client rescue ::LoadError false end |
.sessions(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Sessions.
By default, this returns an instance of
Google::Cloud::Dialogflow::V2::Sessions::Client
for a gRPC client for version V2 of the API.
However, you can specify a different API version by passing it in the
version
parameter. If the Sessions service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
You can also specify a different transport by passing :rest
or :grpc
in
the transport
parameter.
Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the Sessions service. You can determine whether the method will succeed by calling sessions_available?.
About Sessions
A service used for session interactions.
For more information, see the API interactions guide.
503 504 505 506 507 508 509 510 511 512 513 |
# File 'lib/google/cloud/dialogflow.rb', line 503 def self.sessions version: :v2, transport: :grpc, &block require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Sessions) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.sessions_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Sessions service is supported by the current client. If true, you can retrieve a client object by calling sessions. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the Sessions service, or if the versioned client gem needs an update to support the Sessions service.
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 |
# File 'lib/google/cloud/dialogflow.rb', line 527 def self.sessions_available? version: :v2, transport: :grpc require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::Dialogflow.const_get package_name return false unless service_module.const_defined? :Sessions service_module = service_module.const_get :Sessions if transport == :rest return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest end service_module.const_defined? :Client rescue ::LoadError false end |
.versions(version: :v2, transport: :grpc, &block) ⇒ ::Object
Create a new client object for Versions.
By default, this returns an instance of
Google::Cloud::Dialogflow::V2::Versions::Client
for a gRPC client for version V2 of the API.
However, you can specify a different API version by passing it in the
version
parameter. If the Versions service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
You can also specify a different transport by passing :rest
or :grpc
in
the transport
parameter.
Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the Versions service. You can determine whether the method will succeed by calling versions_available?.
About Versions
Service for managing Versions.
1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 |
# File 'lib/google/cloud/dialogflow.rb', line 1351 def self.versions version: :v2, transport: :grpc, &block require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Versions) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.versions_available?(version: :v2, transport: :grpc) ⇒ boolean
Determines whether the Versions service is supported by the current client. If true, you can retrieve a client object by calling versions. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the Versions service, or if the versioned client gem needs an update to support the Versions service.
1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 |
# File 'lib/google/cloud/dialogflow.rb', line 1375 def self.versions_available? version: :v2, transport: :grpc require "google/cloud/dialogflow/#{version.to_s.downcase}" package_name = Google::Cloud::Dialogflow .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::Dialogflow.const_get package_name return false unless service_module.const_defined? :Versions service_module = service_module.const_get :Versions if transport == :rest return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest end service_module.const_defined? :Client rescue ::LoadError false end |