google-cloud-dialogflow 0.14.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +2 -1
- data/AUTHENTICATION.md +51 -59
- data/LICENSE.md +203 -0
- data/MIGRATING.md +445 -0
- data/README.md +35 -25
- data/lib/{google/cloud/dialogflow/v2/doc/google/protobuf/empty.rb → google-cloud-dialogflow.rb} +4 -14
- data/lib/google/cloud/dialogflow.rb +256 -506
- data/lib/google/cloud/dialogflow/version.rb +1 -1
- metadata +63 -86
- data/LICENSE +0 -201
- data/lib/google/cloud/dialogflow/v2.rb +0 -598
- data/lib/google/cloud/dialogflow/v2/agent_pb.rb +0 -121
- data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +0 -111
- data/lib/google/cloud/dialogflow/v2/agents_client.rb +0 -807
- data/lib/google/cloud/dialogflow/v2/agents_client_config.json +0 -71
- data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +0 -96
- data/lib/google/cloud/dialogflow/v2/context_pb.rb +0 -63
- data/lib/google/cloud/dialogflow/v2/context_services_pb.rb +0 -75
- data/lib/google/cloud/dialogflow/v2/contexts_client.rb +0 -519
- data/lib/google/cloud/dialogflow/v2/contexts_client_config.json +0 -56
- data/lib/google/cloud/dialogflow/v2/credentials.rb +0 -42
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/agent.rb +0 -247
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/audio_config.rb +0 -341
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/context.rb +0 -116
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/entity_type.rb +0 -305
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/intent.rb +0 -937
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/session.rb +0 -498
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/session_entity_type.rb +0 -130
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/validation_result.rb +0 -71
- data/lib/google/cloud/dialogflow/v2/doc/google/longrunning/operations.rb +0 -51
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/any.rb +0 -131
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/duration.rb +0 -91
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/field_mask.rb +0 -222
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/struct.rb +0 -74
- data/lib/google/cloud/dialogflow/v2/doc/google/rpc/status.rb +0 -39
- data/lib/google/cloud/dialogflow/v2/doc/google/type/latlng.rb +0 -31
- data/lib/google/cloud/dialogflow/v2/entity_type_pb.rb +0 -125
- data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +0 -105
- data/lib/google/cloud/dialogflow/v2/entity_types_client.rb +0 -994
- data/lib/google/cloud/dialogflow/v2/entity_types_client_config.json +0 -76
- data/lib/google/cloud/dialogflow/v2/intent_pb.rb +0 -367
- data/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +0 -93
- data/lib/google/cloud/dialogflow/v2/intents_client.rb +0 -760
- data/lib/google/cloud/dialogflow/v2/intents_client_config.json +0 -61
- data/lib/google/cloud/dialogflow/v2/session_entity_type_pb.rb +0 -65
- data/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb +0 -93
- data/lib/google/cloud/dialogflow/v2/session_entity_types_client.rb +0 -504
- data/lib/google/cloud/dialogflow/v2/session_entity_types_client_config.json +0 -51
- data/lib/google/cloud/dialogflow/v2/session_pb.rb +0 -141
- data/lib/google/cloud/dialogflow/v2/session_services_pb.rb +0 -56
- data/lib/google/cloud/dialogflow/v2/sessions_client.rb +0 -337
- data/lib/google/cloud/dialogflow/v2/sessions_client_config.json +0 -36
- data/lib/google/cloud/dialogflow/v2/validation_result_pb.rb +0 -36
- data/lib/google/cloud/dialogflow/v2/webhook_pb.rb +0 -46
data/README.md
CHANGED
@@ -1,42 +1,52 @@
|
|
1
|
-
# Ruby Client for Dialogflow API
|
1
|
+
# Ruby Client for the Dialogflow API
|
2
2
|
|
3
|
-
|
4
|
-
Builds conversational interfaces (for example, chatbots, and voice-powered
|
5
|
-
apps and devices).
|
6
|
-
- [Client Library Documentation][]
|
7
|
-
- [Product Documentation][]
|
3
|
+
API Client library for the Dialogflow API
|
8
4
|
|
9
|
-
|
10
|
-
In order to use this library, you first need to go through the following
|
11
|
-
steps:
|
5
|
+
Dialogflow is an end-to-end, build-once deploy-everywhere development suite for creating conversational interfaces for websites, mobile applications, popular messaging platforms, and IoT devices. You can use it to build interfaces (such as chatbots and conversational IVR) that enable natural and rich interactions between your users and your business.
|
12
6
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
7
|
+
Actual client classes for the various versions of this API are defined in
|
8
|
+
_versioned_ client gems, with names of the form `google-cloud-dialogflow-v*`.
|
9
|
+
The gem `google-cloud-dialogflow` is a convenience wrapper library that brings the
|
10
|
+
verisoned gems in as dependencies, and provides high-level methods for
|
11
|
+
constructing clients.
|
12
|
+
|
13
|
+
View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-dialogflow/latest)
|
14
|
+
for this library, google-cloud-dialogflow, to see the convenience methods for
|
15
|
+
constructing client objects. Reference documentation for the client objects
|
16
|
+
themselves can be found in the client library documentation for the versioned
|
17
|
+
client gems:
|
18
|
+
[google-cloud-dialogflow-v2](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest).
|
19
|
+
|
20
|
+
See also the [Product Documentation](https://cloud.google.com/dialogflow)
|
21
|
+
for more usage information.
|
22
|
+
|
23
|
+
## Quick Start
|
17
24
|
|
18
|
-
### Installation
|
19
25
|
```
|
20
26
|
$ gem install google-cloud-dialogflow
|
21
27
|
```
|
22
28
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
29
|
+
In order to use this library, you first need to go through the following steps:
|
30
|
+
|
31
|
+
1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
32
|
+
1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
33
|
+
1. [Enable the API.](https://console.cloud.google.com/apis/library/dialogflow.googleapis.com)
|
34
|
+
1. {file:AUTHENTICATION.md Set up authentication.}
|
35
|
+
|
36
|
+
## Migrating from 0.x versions
|
30
37
|
|
31
|
-
|
32
|
-
[
|
38
|
+
The 1.0 release of the google-cloud-dialogflow client is a significant upgrade
|
39
|
+
based on a [next-gen code generator](https://github.com/googleapis/gapic-generator-ruby),
|
40
|
+
and includes substantial interface changes. Existing code written for earlier
|
41
|
+
versions of this library will likely require updates to use this version.
|
42
|
+
See the {file:MIGRATING.md MIGRATING.md} document for more information.
|
33
43
|
|
34
44
|
## Enabling Logging
|
35
45
|
|
36
46
|
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
37
|
-
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib
|
47
|
+
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
|
38
48
|
or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
39
|
-
that will write logs to [
|
49
|
+
that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
40
50
|
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
41
51
|
|
42
52
|
Configuring a Ruby stdlib logger:
|
data/lib/{google/cloud/dialogflow/v2/doc/google/protobuf/empty.rb → google-cloud-dialogflow.rb}
RENAMED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Copyright 2020 Google LLC
|
2
4
|
#
|
3
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -12,18 +14,6 @@
|
|
12
14
|
# See the License for the specific language governing permissions and
|
13
15
|
# limitations under the License.
|
14
16
|
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
15
18
|
|
16
|
-
|
17
|
-
module Protobuf
|
18
|
-
# A generic empty message that you can re-use to avoid defining duplicated
|
19
|
-
# empty messages in your APIs. A typical example is to use it as the request
|
20
|
-
# or the response type of an API method. For instance:
|
21
|
-
#
|
22
|
-
# service Foo {
|
23
|
-
# rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
24
|
-
# }
|
25
|
-
#
|
26
|
-
# The JSON representation for `Empty` is empty JSON object `{}`.
|
27
|
-
class Empty; end
|
28
|
-
end
|
29
|
-
end
|
19
|
+
require "google/cloud/dialogflow" unless defined? Google::Cloud::Dialogflow::VERSION
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Copyright 2020 Google LLC
|
2
4
|
#
|
3
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -12,537 +14,285 @@
|
|
12
14
|
# See the License for the specific language governing permissions and
|
13
15
|
# limitations under the License.
|
14
16
|
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
# Require this file early so that the version constant gets defined before
|
20
|
+
# requiring "google/cloud". This is because google-cloud-core will load the
|
21
|
+
# entrypoint (gem name) file, which in turn re-requires this file (hence
|
22
|
+
# causing a require cycle) unless the version constant is already defined.
|
23
|
+
require "google/cloud/dialogflow/version"
|
15
24
|
|
16
|
-
require "
|
17
|
-
|
25
|
+
require "googleauth"
|
26
|
+
gem "google-cloud-core"
|
27
|
+
require "google/cloud" unless defined? ::Google::Cloud.new
|
28
|
+
require "google/cloud/config"
|
29
|
+
|
30
|
+
# Set the default configuration
|
31
|
+
::Google::Cloud.configure.add_config! :dialogflow do |config|
|
32
|
+
config.add_field! :endpoint, "dialogflow.googleapis.com", match: ::String
|
33
|
+
config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials]
|
34
|
+
config.add_field! :scope, nil, match: [::Array, ::String]
|
35
|
+
config.add_field! :lib_name, nil, match: ::String
|
36
|
+
config.add_field! :lib_version, nil, match: ::String
|
37
|
+
config.add_field! :interceptors, nil, match: ::Array
|
38
|
+
config.add_field! :timeout, nil, match: ::Numeric
|
39
|
+
config.add_field! :metadata, nil, match: ::Hash
|
40
|
+
config.add_field! :retry_policy, nil, match: [::Hash, ::Proc]
|
41
|
+
config.add_field! :quota_project, nil, match: ::String
|
42
|
+
end
|
18
43
|
|
19
44
|
module Google
|
20
45
|
module Cloud
|
21
|
-
# rubocop:disable LineLength
|
22
|
-
|
23
|
-
##
|
24
|
-
# # Ruby Client for Dialogflow API
|
25
|
-
#
|
26
|
-
# [Dialogflow API][Product Documentation]:
|
27
|
-
# Builds conversational interfaces (for example, chatbots, and voice-powered
|
28
|
-
# apps and devices).
|
29
|
-
# - [Product Documentation][]
|
30
|
-
#
|
31
|
-
# ## Quick Start
|
32
|
-
# In order to use this library, you first need to go through the following
|
33
|
-
# steps:
|
34
|
-
#
|
35
|
-
# 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
36
|
-
# 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
37
|
-
# 3. [Enable the Dialogflow API.](https://console.cloud.google.com/apis/library/dialogflow.googleapis.com)
|
38
|
-
# 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-dialogflow/latest/file.AUTHENTICATION.html)
|
39
|
-
#
|
40
|
-
# ### Installation
|
41
|
-
# ```
|
42
|
-
# $ gem install google-cloud-dialogflow
|
43
|
-
# ```
|
44
|
-
#
|
45
|
-
# ### Next Steps
|
46
|
-
# - Read the [Dialogflow API Product documentation][Product Documentation]
|
47
|
-
# to learn more about the product and see How-to Guides.
|
48
|
-
# - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
|
49
|
-
# to see the full list of Cloud APIs that we cover.
|
50
|
-
#
|
51
|
-
# [Product Documentation]: https://cloud.google.com/dialogflow
|
52
|
-
#
|
53
|
-
# ## Enabling Logging
|
54
|
-
#
|
55
|
-
# To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
56
|
-
# The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
|
57
|
-
# or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
58
|
-
# that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
59
|
-
# and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
60
|
-
#
|
61
|
-
# Configuring a Ruby stdlib logger:
|
62
|
-
#
|
63
|
-
# ```ruby
|
64
|
-
# require "logger"
|
65
|
-
#
|
66
|
-
# module MyLogger
|
67
|
-
# LOGGER = Logger.new $stderr, level: Logger::WARN
|
68
|
-
# def logger
|
69
|
-
# LOGGER
|
70
|
-
# end
|
71
|
-
# end
|
72
|
-
#
|
73
|
-
# # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
74
|
-
# module GRPC
|
75
|
-
# extend MyLogger
|
76
|
-
# end
|
77
|
-
# ```
|
78
|
-
#
|
79
46
|
module Dialogflow
|
80
|
-
|
47
|
+
##
|
48
|
+
# Create a new client object for Agents.
|
49
|
+
#
|
50
|
+
# By default, this returns an instance of
|
51
|
+
# [Google::Cloud::Dialogflow::V2::Agents::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/Agents/Client.html)
|
52
|
+
# for version V2 of the API.
|
53
|
+
# However, you can specify specify a different API version by passing it in the
|
54
|
+
# `version` parameter. If the Agents service is
|
55
|
+
# supported by that API version, and the corresponding gem is available, the
|
56
|
+
# appropriate versioned client will be returned.
|
57
|
+
#
|
58
|
+
# ## About Agents
|
59
|
+
#
|
60
|
+
# Service for managing Agents.
|
61
|
+
#
|
62
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
63
|
+
# Defaults to `:v2`.
|
64
|
+
# @return [Agents::Client] A client object for the specified version.
|
65
|
+
#
|
66
|
+
def self.agents version: :v2, &block
|
67
|
+
require "google/cloud/dialogflow/#{version.to_s.downcase}"
|
81
68
|
|
82
|
-
|
69
|
+
package_name = Google::Cloud::Dialogflow
|
70
|
+
.constants
|
71
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
72
|
+
.first
|
73
|
+
package_module = Google::Cloud::Dialogflow.const_get package_name
|
74
|
+
package_module.const_get(:Agents).const_get(:Client).new(&block)
|
75
|
+
end
|
76
|
+
|
77
|
+
##
|
78
|
+
# Create a new client object for Contexts.
|
79
|
+
#
|
80
|
+
# By default, this returns an instance of
|
81
|
+
# [Google::Cloud::Dialogflow::V2::Contexts::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/Contexts/Client.html)
|
82
|
+
# for version V2 of the API.
|
83
|
+
# However, you can specify specify a different API version by passing it in the
|
84
|
+
# `version` parameter. If the Contexts service is
|
85
|
+
# supported by that API version, and the corresponding gem is available, the
|
86
|
+
# appropriate versioned client will be returned.
|
87
|
+
#
|
88
|
+
# ## About Contexts
|
89
|
+
#
|
90
|
+
# Service for managing Contexts.
|
91
|
+
#
|
92
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
93
|
+
# Defaults to `:v2`.
|
94
|
+
# @return [Contexts::Client] A client object for the specified version.
|
95
|
+
#
|
96
|
+
def self.contexts version: :v2, &block
|
97
|
+
require "google/cloud/dialogflow/#{version.to_s.downcase}"
|
83
98
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
99
|
+
package_name = Google::Cloud::Dialogflow
|
100
|
+
.constants
|
101
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
102
|
+
.first
|
103
|
+
package_module = Google::Cloud::Dialogflow.const_get package_name
|
104
|
+
package_module.const_get(:Contexts).const_get(:Client).new(&block)
|
105
|
+
end
|
89
106
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
# Dialogflow provides several
|
112
|
-
# [prebuilt
|
113
|
-
# agents](https://cloud.google.com/dialogflow/docs/agents-prebuilt)
|
114
|
-
# for common conversation scenarios such as determining a date and time,
|
115
|
-
# converting currency, and so on.
|
116
|
-
#
|
117
|
-
# For more information about agents, see the
|
118
|
-
# [Dialogflow
|
119
|
-
# documentation](https://cloud.google.com/dialogflow/docs/agents-overview).
|
120
|
-
#
|
121
|
-
# @param version [Symbol, String]
|
122
|
-
# The major version of the service to be used. By default :v2
|
123
|
-
# is used.
|
124
|
-
# @overload new(version:, credentials:, scopes:, client_config:, timeout:)
|
125
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
126
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
127
|
-
# be many types.
|
128
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
129
|
-
# authenticating requests made by this client.
|
130
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
131
|
-
# credentials for this client.
|
132
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
133
|
-
# credentials for this client.
|
134
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
135
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
136
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
137
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
138
|
-
# metadata for requests, generally, to give OAuth credentials.
|
139
|
-
# @param scopes [Array<String>]
|
140
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
141
|
-
# an updater_proc is supplied.
|
142
|
-
# @param client_config [Hash]
|
143
|
-
# A Hash for call options for each method. See
|
144
|
-
# Google::Gax#construct_settings for the structure of
|
145
|
-
# this data. Falls back to the default config if not specified
|
146
|
-
# or the specified config is missing data points.
|
147
|
-
# @param timeout [Numeric]
|
148
|
-
# The default timeout, in seconds, for calls made through this client.
|
149
|
-
# @param metadata [Hash]
|
150
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
151
|
-
# @param service_address [String]
|
152
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
153
|
-
# @param service_port [Integer]
|
154
|
-
# Override for the service port, or `nil` to leave as the default.
|
155
|
-
# @param exception_transformer [Proc]
|
156
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
157
|
-
# custom error handling.
|
158
|
-
def self.new(*args, version: :v2, **kwargs)
|
159
|
-
unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
|
160
|
-
raise "The version: #{version} is not available. The available versions " \
|
161
|
-
"are: [#{AVAILABLE_VERSIONS.join(", ")}]"
|
162
|
-
end
|
107
|
+
##
|
108
|
+
# Create a new client object for EntityTypes.
|
109
|
+
#
|
110
|
+
# By default, this returns an instance of
|
111
|
+
# [Google::Cloud::Dialogflow::V2::EntityTypes::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/EntityTypes/Client.html)
|
112
|
+
# for version V2 of the API.
|
113
|
+
# However, you can specify specify a different API version by passing it in the
|
114
|
+
# `version` parameter. If the EntityTypes service is
|
115
|
+
# supported by that API version, and the corresponding gem is available, the
|
116
|
+
# appropriate versioned client will be returned.
|
117
|
+
#
|
118
|
+
# ## About EntityTypes
|
119
|
+
#
|
120
|
+
# Service for managing EntityTypes.
|
121
|
+
#
|
122
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
123
|
+
# Defaults to `:v2`.
|
124
|
+
# @return [EntityTypes::Client] A client object for the specified version.
|
125
|
+
#
|
126
|
+
def self.entity_types version: :v2, &block
|
127
|
+
require "google/cloud/dialogflow/#{version.to_s.downcase}"
|
163
128
|
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
end
|
129
|
+
package_name = Google::Cloud::Dialogflow
|
130
|
+
.constants
|
131
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
132
|
+
.first
|
133
|
+
package_module = Google::Cloud::Dialogflow.const_get package_name
|
134
|
+
package_module.const_get(:EntityTypes).const_get(:Client).new(&block)
|
171
135
|
end
|
172
136
|
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
# @param version [Symbol, String]
|
195
|
-
# The major version of the service to be used. By default :v2
|
196
|
-
# is used.
|
197
|
-
# @overload new(version:, credentials:, scopes:, client_config:, timeout:)
|
198
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
199
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
200
|
-
# be many types.
|
201
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
202
|
-
# authenticating requests made by this client.
|
203
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
204
|
-
# credentials for this client.
|
205
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
206
|
-
# credentials for this client.
|
207
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
208
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
209
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
210
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
211
|
-
# metadata for requests, generally, to give OAuth credentials.
|
212
|
-
# @param scopes [Array<String>]
|
213
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
214
|
-
# an updater_proc is supplied.
|
215
|
-
# @param client_config [Hash]
|
216
|
-
# A Hash for call options for each method. See
|
217
|
-
# Google::Gax#construct_settings for the structure of
|
218
|
-
# this data. Falls back to the default config if not specified
|
219
|
-
# or the specified config is missing data points.
|
220
|
-
# @param timeout [Numeric]
|
221
|
-
# The default timeout, in seconds, for calls made through this client.
|
222
|
-
# @param metadata [Hash]
|
223
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
224
|
-
# @param service_address [String]
|
225
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
226
|
-
# @param service_port [Integer]
|
227
|
-
# Override for the service port, or `nil` to leave as the default.
|
228
|
-
# @param exception_transformer [Proc]
|
229
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
230
|
-
# custom error handling.
|
231
|
-
def self.new(*args, version: :v2, **kwargs)
|
232
|
-
unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
|
233
|
-
raise "The version: #{version} is not available. The available versions " \
|
234
|
-
"are: [#{AVAILABLE_VERSIONS.join(", ")}]"
|
235
|
-
end
|
137
|
+
##
|
138
|
+
# Create a new client object for Environments.
|
139
|
+
#
|
140
|
+
# By default, this returns an instance of
|
141
|
+
# [Google::Cloud::Dialogflow::V2::Environments::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/Environments/Client.html)
|
142
|
+
# for version V2 of the API.
|
143
|
+
# However, you can specify specify a different API version by passing it in the
|
144
|
+
# `version` parameter. If the Environments service is
|
145
|
+
# supported by that API version, and the corresponding gem is available, the
|
146
|
+
# appropriate versioned client will be returned.
|
147
|
+
#
|
148
|
+
# ## About Environments
|
149
|
+
#
|
150
|
+
# Service for managing Environments.
|
151
|
+
#
|
152
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
153
|
+
# Defaults to `:v2`.
|
154
|
+
# @return [Environments::Client] A client object for the specified version.
|
155
|
+
#
|
156
|
+
def self.environments version: :v2, &block
|
157
|
+
require "google/cloud/dialogflow/#{version.to_s.downcase}"
|
236
158
|
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
end
|
159
|
+
package_name = Google::Cloud::Dialogflow
|
160
|
+
.constants
|
161
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
162
|
+
.first
|
163
|
+
package_module = Google::Cloud::Dialogflow.const_get package_name
|
164
|
+
package_module.const_get(:Environments).const_get(:Client).new(&block)
|
244
165
|
end
|
245
166
|
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
# entity is represented by the `EntityType` type.
|
268
|
-
#
|
269
|
-
# * **User** - entities that are built for an individual user such as
|
270
|
-
# favorites, preferences, playlists, and so on. A user entity is
|
271
|
-
# represented by the {Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityType} type.
|
272
|
-
#
|
273
|
-
# For more information about entity types, see the
|
274
|
-
# [Dialogflow
|
275
|
-
# documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
|
276
|
-
#
|
277
|
-
# @param version [Symbol, String]
|
278
|
-
# The major version of the service to be used. By default :v2
|
279
|
-
# is used.
|
280
|
-
# @overload new(version:, credentials:, scopes:, client_config:, timeout:)
|
281
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
282
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
283
|
-
# be many types.
|
284
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
285
|
-
# authenticating requests made by this client.
|
286
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
287
|
-
# credentials for this client.
|
288
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
289
|
-
# credentials for this client.
|
290
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
291
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
292
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
293
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
294
|
-
# metadata for requests, generally, to give OAuth credentials.
|
295
|
-
# @param scopes [Array<String>]
|
296
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
297
|
-
# an updater_proc is supplied.
|
298
|
-
# @param client_config [Hash]
|
299
|
-
# A Hash for call options for each method. See
|
300
|
-
# Google::Gax#construct_settings for the structure of
|
301
|
-
# this data. Falls back to the default config if not specified
|
302
|
-
# or the specified config is missing data points.
|
303
|
-
# @param timeout [Numeric]
|
304
|
-
# The default timeout, in seconds, for calls made through this client.
|
305
|
-
# @param metadata [Hash]
|
306
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
307
|
-
# @param service_address [String]
|
308
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
309
|
-
# @param service_port [Integer]
|
310
|
-
# Override for the service port, or `nil` to leave as the default.
|
311
|
-
# @param exception_transformer [Proc]
|
312
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
313
|
-
# custom error handling.
|
314
|
-
def self.new(*args, version: :v2, **kwargs)
|
315
|
-
unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
|
316
|
-
raise "The version: #{version} is not available. The available versions " \
|
317
|
-
"are: [#{AVAILABLE_VERSIONS.join(", ")}]"
|
318
|
-
end
|
167
|
+
##
|
168
|
+
# Create a new client object for Intents.
|
169
|
+
#
|
170
|
+
# By default, this returns an instance of
|
171
|
+
# [Google::Cloud::Dialogflow::V2::Intents::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/Intents/Client.html)
|
172
|
+
# for version V2 of the API.
|
173
|
+
# However, you can specify specify a different API version by passing it in the
|
174
|
+
# `version` parameter. If the Intents service is
|
175
|
+
# supported by that API version, and the corresponding gem is available, the
|
176
|
+
# appropriate versioned client will be returned.
|
177
|
+
#
|
178
|
+
# ## About Intents
|
179
|
+
#
|
180
|
+
# Service for managing Intents.
|
181
|
+
#
|
182
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
183
|
+
# Defaults to `:v2`.
|
184
|
+
# @return [Intents::Client] A client object for the specified version.
|
185
|
+
#
|
186
|
+
def self.intents version: :v2, &block
|
187
|
+
require "google/cloud/dialogflow/#{version.to_s.downcase}"
|
319
188
|
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
end
|
189
|
+
package_name = Google::Cloud::Dialogflow
|
190
|
+
.constants
|
191
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
192
|
+
.first
|
193
|
+
package_module = Google::Cloud::Dialogflow.const_get package_name
|
194
|
+
package_module.const_get(:Intents).const_get(:Client).new(&block)
|
327
195
|
end
|
328
196
|
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
# * **Events** - allow for matching an intent by using an event name
|
351
|
-
# instead of user input. Your application can provide an event name and
|
352
|
-
# related parameters to the Dialogflow API to match an intent. For
|
353
|
-
# example, when your application starts, you can send a welcome event
|
354
|
-
# with a user name parameter to the Dialogflow API to match an intent with
|
355
|
-
# a personalized welcome message for the user.
|
356
|
-
#
|
357
|
-
# * **Training phrases** - provide examples of user input to train the
|
358
|
-
# Dialogflow API agent to better match intents.
|
359
|
-
#
|
360
|
-
# For more information about intents, see the
|
361
|
-
# [Dialogflow
|
362
|
-
# documentation](https://cloud.google.com/dialogflow/docs/intents-overview).
|
363
|
-
#
|
364
|
-
# @param version [Symbol, String]
|
365
|
-
# The major version of the service to be used. By default :v2
|
366
|
-
# is used.
|
367
|
-
# @overload new(version:, credentials:, scopes:, client_config:, timeout:)
|
368
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
369
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
370
|
-
# be many types.
|
371
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
372
|
-
# authenticating requests made by this client.
|
373
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
374
|
-
# credentials for this client.
|
375
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
376
|
-
# credentials for this client.
|
377
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
378
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
379
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
380
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
381
|
-
# metadata for requests, generally, to give OAuth credentials.
|
382
|
-
# @param scopes [Array<String>]
|
383
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
384
|
-
# an updater_proc is supplied.
|
385
|
-
# @param client_config [Hash]
|
386
|
-
# A Hash for call options for each method. See
|
387
|
-
# Google::Gax#construct_settings for the structure of
|
388
|
-
# this data. Falls back to the default config if not specified
|
389
|
-
# or the specified config is missing data points.
|
390
|
-
# @param timeout [Numeric]
|
391
|
-
# The default timeout, in seconds, for calls made through this client.
|
392
|
-
# @param metadata [Hash]
|
393
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
394
|
-
# @param service_address [String]
|
395
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
396
|
-
# @param service_port [Integer]
|
397
|
-
# Override for the service port, or `nil` to leave as the default.
|
398
|
-
# @param exception_transformer [Proc]
|
399
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
400
|
-
# custom error handling.
|
401
|
-
def self.new(*args, version: :v2, **kwargs)
|
402
|
-
unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
|
403
|
-
raise "The version: #{version} is not available. The available versions " \
|
404
|
-
"are: [#{AVAILABLE_VERSIONS.join(", ")}]"
|
405
|
-
end
|
197
|
+
##
|
198
|
+
# Create a new client object for SessionEntityTypes.
|
199
|
+
#
|
200
|
+
# By default, this returns an instance of
|
201
|
+
# [Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/SessionEntityTypes/Client.html)
|
202
|
+
# for version V2 of the API.
|
203
|
+
# However, you can specify specify a different API version by passing it in the
|
204
|
+
# `version` parameter. If the SessionEntityTypes service is
|
205
|
+
# supported by that API version, and the corresponding gem is available, the
|
206
|
+
# appropriate versioned client will be returned.
|
207
|
+
#
|
208
|
+
# ## About SessionEntityTypes
|
209
|
+
#
|
210
|
+
# Service for managing SessionEntityTypes.
|
211
|
+
#
|
212
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
213
|
+
# Defaults to `:v2`.
|
214
|
+
# @return [SessionEntityTypes::Client] A client object for the specified version.
|
215
|
+
#
|
216
|
+
def self.session_entity_types version: :v2, &block
|
217
|
+
require "google/cloud/dialogflow/#{version.to_s.downcase}"
|
406
218
|
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
end
|
219
|
+
package_name = Google::Cloud::Dialogflow
|
220
|
+
.constants
|
221
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
222
|
+
.first
|
223
|
+
package_module = Google::Cloud::Dialogflow.const_get package_name
|
224
|
+
package_module.const_get(:SessionEntityTypes).const_get(:Client).new(&block)
|
414
225
|
end
|
415
226
|
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
441
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
442
|
-
# be many types.
|
443
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
444
|
-
# authenticating requests made by this client.
|
445
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
446
|
-
# credentials for this client.
|
447
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
448
|
-
# credentials for this client.
|
449
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
450
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
451
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
452
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
453
|
-
# metadata for requests, generally, to give OAuth credentials.
|
454
|
-
# @param scopes [Array<String>]
|
455
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
456
|
-
# an updater_proc is supplied.
|
457
|
-
# @param client_config [Hash]
|
458
|
-
# A Hash for call options for each method. See
|
459
|
-
# Google::Gax#construct_settings for the structure of
|
460
|
-
# this data. Falls back to the default config if not specified
|
461
|
-
# or the specified config is missing data points.
|
462
|
-
# @param timeout [Numeric]
|
463
|
-
# The default timeout, in seconds, for calls made through this client.
|
464
|
-
# @param metadata [Hash]
|
465
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
466
|
-
# @param service_address [String]
|
467
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
468
|
-
# @param service_port [Integer]
|
469
|
-
# Override for the service port, or `nil` to leave as the default.
|
470
|
-
# @param exception_transformer [Proc]
|
471
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
472
|
-
# custom error handling.
|
473
|
-
def self.new(*args, version: :v2, **kwargs)
|
474
|
-
unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
|
475
|
-
raise "The version: #{version} is not available. The available versions " \
|
476
|
-
"are: [#{AVAILABLE_VERSIONS.join(", ")}]"
|
477
|
-
end
|
227
|
+
##
|
228
|
+
# Create a new client object for Sessions.
|
229
|
+
#
|
230
|
+
# By default, this returns an instance of
|
231
|
+
# [Google::Cloud::Dialogflow::V2::Sessions::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/Sessions/Client.html)
|
232
|
+
# for version V2 of the API.
|
233
|
+
# However, you can specify specify a different API version by passing it in the
|
234
|
+
# `version` parameter. If the Sessions service is
|
235
|
+
# supported by that API version, and the corresponding gem is available, the
|
236
|
+
# appropriate versioned client will be returned.
|
237
|
+
#
|
238
|
+
# ## About Sessions
|
239
|
+
#
|
240
|
+
# A service used for session interactions.
|
241
|
+
#
|
242
|
+
# For more information, see the [API interactions
|
243
|
+
# guide](https://cloud.google.com/dialogflow/docs/api-overview).
|
244
|
+
#
|
245
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
246
|
+
# Defaults to `:v2`.
|
247
|
+
# @return [Sessions::Client] A client object for the specified version.
|
248
|
+
#
|
249
|
+
def self.sessions version: :v2, &block
|
250
|
+
require "google/cloud/dialogflow/#{version.to_s.downcase}"
|
478
251
|
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
end
|
252
|
+
package_name = Google::Cloud::Dialogflow
|
253
|
+
.constants
|
254
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
255
|
+
.first
|
256
|
+
package_module = Google::Cloud::Dialogflow.const_get package_name
|
257
|
+
package_module.const_get(:Sessions).const_get(:Client).new(&block)
|
486
258
|
end
|
487
259
|
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
# Google::Gax#construct_settings for the structure of
|
519
|
-
# this data. Falls back to the default config if not specified
|
520
|
-
# or the specified config is missing data points.
|
521
|
-
# @param timeout [Numeric]
|
522
|
-
# The default timeout, in seconds, for calls made through this client.
|
523
|
-
# @param metadata [Hash]
|
524
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
525
|
-
# @param service_address [String]
|
526
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
527
|
-
# @param service_port [Integer]
|
528
|
-
# Override for the service port, or `nil` to leave as the default.
|
529
|
-
# @param exception_transformer [Proc]
|
530
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
531
|
-
# custom error handling.
|
532
|
-
def self.new(*args, version: :v2, **kwargs)
|
533
|
-
unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
|
534
|
-
raise "The version: #{version} is not available. The available versions " \
|
535
|
-
"are: [#{AVAILABLE_VERSIONS.join(", ")}]"
|
536
|
-
end
|
260
|
+
##
|
261
|
+
# Configure the google-cloud-dialogflow library.
|
262
|
+
#
|
263
|
+
# The following configuration parameters are supported:
|
264
|
+
#
|
265
|
+
# * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) -
|
266
|
+
# The path to the keyfile as a String, the contents of the keyfile as a
|
267
|
+
# Hash, or a Google::Auth::Credentials object.
|
268
|
+
# * `lib_name` (*type:* `String`) -
|
269
|
+
# The library name as recorded in instrumentation and logging.
|
270
|
+
# * `lib_version` (*type:* `String`) -
|
271
|
+
# The library version as recorded in instrumentation and logging.
|
272
|
+
# * `interceptors` (*type:* `Array<GRPC::ClientInterceptor>`) -
|
273
|
+
# An array of interceptors that are run before calls are executed.
|
274
|
+
# * `timeout` (*type:* `Numeric`) -
|
275
|
+
# Default timeout in seconds.
|
276
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) -
|
277
|
+
# Additional gRPC headers to be sent with the call.
|
278
|
+
# * `retry_policy` (*type:* `Hash`) -
|
279
|
+
# The retry policy. The value is a hash with the following keys:
|
280
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
281
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
282
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
283
|
+
# * `:retry_codes` (*type:* `Array<String>`) -
|
284
|
+
# The error codes that should trigger a retry.
|
285
|
+
#
|
286
|
+
# @return [::Google::Cloud::Config] The default configuration used by this library
|
287
|
+
#
|
288
|
+
def self.configure
|
289
|
+
yield ::Google::Cloud.configure.dialogflow if block_given?
|
537
290
|
|
538
|
-
|
539
|
-
version_module = Google::Cloud::Dialogflow
|
540
|
-
.constants
|
541
|
-
.select {|sym| sym.to_s.downcase == version.to_s.downcase}
|
542
|
-
.first
|
543
|
-
Google::Cloud::Dialogflow.const_get(version_module)::Sessions.new(*args, **kwargs)
|
544
|
-
end
|
291
|
+
::Google::Cloud.configure.dialogflow
|
545
292
|
end
|
546
293
|
end
|
547
294
|
end
|
548
295
|
end
|
296
|
+
|
297
|
+
helper_path = ::File.join __dir__, "dialogflow", "helpers.rb"
|
298
|
+
require "google/cloud/dialogflow/helpers" if ::File.file? helper_path
|