google-cloud-dialogflow 1.5.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a26b7816f2f86721dbc45d4efb34b34673b47a1060d0a95fecd8a04201e9ea4
4
- data.tar.gz: f30bc854e8542b638c7ef4cf3592553bd2ede4cc01a824bc9728f30ce27877ff
3
+ metadata.gz: bf4b53c36df7d076b5eb5a7b5091af895a9a97c016ce158769d11c97237c9625
4
+ data.tar.gz: 3afb556a0d99260dde9a66ea7354ec31270522c4c4eb55b2119bac0e1a2c8f1e
5
5
  SHA512:
6
- metadata.gz: 2da2981c302da5a9ee8430b7314a9aa9dd89522e58530a1202882eef6569d5bf310f9ac0127811cf4512b6f00f5841cecaf1abc3b4bccb72b369a4466174de6f
7
- data.tar.gz: e2805ed9e9d3f090bcd01cde2ccbacc04ee9e0271befa14d4baf2502b87b7926148b5bfe7cf385e7ec22949756db4c1d8c117beb38329e608a2fc47dbfc22537
6
+ metadata.gz: fb658838595955b3866dd97bee873723e168adb55bfc503ef6ea324aea240ecde6dd9406e4e287992b6c8e163faea69eaeadd0d0a610f058c5e2164a0fab11a6
7
+ data.tar.gz: 3864ebb69100d1898a8e87301aa51560c470b738ad39ff9e27e50d7c957fc2178fc8c0bb0b80f34cc2b0620cdc10ca0080512804645f390ccce7bb1240c186d1
data/AUTHENTICATION.md CHANGED
@@ -1,151 +1,122 @@
1
1
  # Authentication
2
2
 
3
- In general, the google-cloud-dialogflow library uses
4
- [Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts)
5
- credentials to connect to Google Cloud services. When running within
6
- [Google Cloud Platform environments](#google-cloud-platform-environments) the
7
- credentials will be discovered automatically. When running on other
8
- environments, the Service Account credentials can be specified by providing the
9
- path to the
10
- [JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys)
11
- for the account (or the JSON itself) in
12
- [environment variables](#environment-variables). Additionally, Cloud SDK
13
- credentials can also be discovered automatically, but this is only recommended
14
- during development.
3
+ The recommended way to authenticate to the google-cloud-dialogflow library is to use
4
+ [Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials).
5
+ To review all of your authentication options, see [Credentials lookup](#credential-lookup).
15
6
 
16
7
  ## Quickstart
17
8
 
18
- 1. [Create a service account and credentials](#creating-a-service-account).
19
- 2. Set the [environment variable](#environment-variables).
9
+ The following example shows how to set up authentication for a local development
10
+ environment with your user credentials.
20
11
 
21
- ```sh
22
- export DIALOGFLOW_CREDENTIALS=path/to/keyfile.json
23
- ```
24
-
25
- 3. Initialize the client.
12
+ **NOTE:** This method is _not_ recommended for running in production. User credentials
13
+ should be used only during development.
26
14
 
27
- ```ruby
28
- require "google/cloud/dialogflow"
15
+ 1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk).
16
+ 2. Set up a local ADC file with your user credentials:
29
17
 
30
- client = Google::Cloud::Dialogflow.agents
18
+ ```sh
19
+ gcloud auth application-default login
31
20
  ```
32
21
 
33
- ## Credential Lookup
34
-
35
- The google-cloud-dialogflow library aims to make authentication
36
- as simple as possible, and provides several mechanisms to configure your system
37
- without requiring **Service Account Credentials** directly in code.
38
-
39
- **Credentials** are discovered in the following order:
40
-
41
- 1. Specify credentials in method arguments
42
- 2. Specify credentials in configuration
43
- 3. Discover credentials path in environment variables
44
- 4. Discover credentials JSON in environment variables
45
- 5. Discover credentials file in the Cloud SDK's path
46
- 6. Discover GCP credentials
47
-
48
- ### Google Cloud Platform environments
22
+ 3. Write code as if already authenticated.
49
23
 
50
- When running on Google Cloud Platform (GCP), including Google Compute Engine
51
- (GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud
52
- Functions (GCF) and Cloud Run, **Credentials** are discovered automatically.
53
- Code should be written as if already authenticated.
24
+ For more information about setting up authentication for a local development environment, see
25
+ [Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev).
54
26
 
55
- ### Environment Variables
27
+ ## Credential Lookup
56
28
 
57
- The **Credentials JSON** can be placed in environment variables instead of
58
- declaring them directly in code. Each service has its own environment variable,
59
- allowing for different service accounts to be used for different services. (See
60
- the READMEs for the individual service gems for details.) The path to the
61
- **Credentials JSON** file can be stored in the environment variable, or the
62
- **Credentials JSON** itself can be stored for environments such as Docker
63
- containers where writing files is difficult or not encouraged.
29
+ The google-cloud-dialogflow library provides several mechanisms to configure your system.
30
+ Generally, using Application Default Credentials to facilitate automatic
31
+ credentials discovery is the easist method. But if you need to explicitly specify
32
+ credentials, there are several methods available to you.
64
33
 
65
- The environment variables that google-cloud-dialogflow
66
- checks for credentials are configured on the service Credentials class (such as
67
- `::Google::Cloud::Dialogflow::V2::Agents::Credentials`):
34
+ Credentials are accepted in the following ways, in the following order or precedence:
68
35
 
69
- * `DIALOGFLOW_CREDENTIALS` - Path to JSON file, or JSON contents
70
- * `DIALOGFLOW_KEYFILE` - Path to JSON file, or JSON contents
71
- * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
- * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
- * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
36
+ 1. Credentials specified in method arguments
37
+ 2. Credentials specified in configuration
38
+ 3. Credentials pointed to or included in environment variables
39
+ 4. Credentials found in local ADC file
40
+ 5. Credentials returned by the metadata server for the attached service account (GCP)
74
41
 
75
- ```ruby
76
- require "google/cloud/dialogflow"
77
-
78
- ENV["DIALOGFLOW_CREDENTIALS"] = "path/to/keyfile.json"
42
+ ### Configuration
79
43
 
80
- client = Google::Cloud::Dialogflow.agents
81
- ```
44
+ You can configure a path to a JSON credentials file, either for an individual client object or
45
+ globally, for all client objects. The JSON file can contain credentials created for
46
+ [workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation),
47
+ [workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a
48
+ [service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key).
82
49
 
83
- ### Configuration
50
+ Note: Service account keys are a security risk if not managed correctly. You should
51
+ [choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree)
52
+ whenever possible.
84
53
 
85
- The path to the **Credentials JSON** file can be configured instead of storing
86
- it in an environment variable. Either on an individual client initialization:
54
+ To configure a credentials file for an individual client initialization:
87
55
 
88
56
  ```ruby
89
57
  require "google/cloud/dialogflow"
90
58
 
91
59
  client = Google::Cloud::Dialogflow.agents do |config|
92
- config.credentials = "path/to/keyfile.json"
60
+ config.credentials = "path/to/credentialfile.json"
93
61
  end
94
62
  ```
95
63
 
96
- Or globally for all clients:
64
+ To configure a credentials file globally for all clients:
97
65
 
98
66
  ```ruby
99
67
  require "google/cloud/dialogflow"
100
68
 
101
69
  Google::Cloud::Dialogflow.configure do |config|
102
- config.credentials = "path/to/keyfile.json"
70
+ config.credentials = "path/to/credentialfile.json"
103
71
  end
104
72
 
105
73
  client = Google::Cloud::Dialogflow.agents
106
74
  ```
107
75
 
108
- ### Cloud SDK
76
+ ### Environment Variables
109
77
 
110
- This option allows for an easy way to authenticate during development. If
111
- credentials are not provided in code or in environment variables, then Cloud SDK
112
- credentials are discovered.
78
+ You can also use an environment variable to provide a JSON credentials file.
79
+ The environment variable can contain a path to the credentials file or, for
80
+ environments such as Docker containers where writing files is not encouraged,
81
+ you can include the credentials file itself.
113
82
 
114
- To configure your system for this, simply:
83
+ The JSON file can contain credentials created for
84
+ [workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation),
85
+ [workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a
86
+ [service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key).
115
87
 
116
- 1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
117
- 2. Authenticate using OAuth 2.0 `$ gcloud auth login`
118
- 3. Write code as if already authenticated.
88
+ Note: Service account keys are a security risk if not managed correctly. You should
89
+ [choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree)
90
+ whenever possible.
91
+
92
+ The environment variables that google-cloud-dialogflow
93
+ checks for credentials are:
119
94
 
120
- **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
121
- *should* only be used during development.
95
+ * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
96
+ * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
122
97
 
123
- ## Creating a Service Account
98
+ ```ruby
99
+ require "google/cloud/dialogflow"
124
100
 
125
- Google Cloud requires **Service Account Credentials** to
126
- connect to the APIs. You will use the **JSON key file** to
127
- connect to most services with google-cloud-dialogflow.
101
+ ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
128
102
 
129
- If you are not running this client within
130
- [Google Cloud Platform environments](#google-cloud-platform-environments), you
131
- need a Google Developers service account.
103
+ client = Google::Cloud::Dialogflow.agents
104
+ ```
132
105
 
133
- 1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
134
- 2. Create a new project or click on an existing project.
135
- 3. Activate the menu in the upper left and select **APIs & Services**. From
136
- here, you will enable the APIs that your application requires.
106
+ ### Local ADC file
137
107
 
138
- *Note: You may need to enable billing in order to use these services.*
108
+ You can set up a local ADC file with your user credentials for authentication during
109
+ development. If credentials are not provided in code or in environment variables,
110
+ then the local ADC credentials are discovered.
139
111
 
140
- 4. Select **Credentials** from the side navigation.
112
+ Follow the steps in [Quickstart](#quickstart) to set up a local ADC file.
141
113
 
142
- Find the "Create credentials" drop down near the top of the page, and select
143
- "Service account" to be guided through downloading a new JSON key file.
114
+ ### Google Cloud Platform environments
144
115
 
145
- If you want to re-use an existing service account, you can easily generate a
146
- new key file. Just select the account you wish to re-use, click the pencil
147
- tool on the right side to edit the service account, select the **Keys** tab,
148
- and then select **Add Key**.
116
+ When running on Google Cloud Platform (GCP), including Google Compute Engine
117
+ (GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud
118
+ Functions (GCF) and Cloud Run, credentials are retrieved from the attached
119
+ service account automatically. Code should be written as if already authenticated.
149
120
 
150
- The key file you download will be used by this library to authenticate API
151
- requests and should be stored in a secure location.
121
+ For more information, see
122
+ [Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa).
data/README.md CHANGED
@@ -16,7 +16,7 @@ for this library, google-cloud-dialogflow, to see the convenience methods for
16
16
  constructing client objects. Reference documentation for the client objects
17
17
  themselves can be found in the client library documentation for the versioned
18
18
  client gems:
19
- [google-cloud-dialogflow-v2](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest).
19
+ [google-cloud-dialogflow-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest).
20
20
 
21
21
  See also the [Product Documentation](https://cloud.google.com/dialogflow)
22
22
  for more usage information.
@@ -42,32 +42,6 @@ and includes substantial interface changes. Existing code written for earlier
42
42
  versions of this library will likely require updates to use this version.
43
43
  See the {file:MIGRATING.md MIGRATING.md} document for more information.
44
44
 
45
- ## Enabling Logging
46
-
47
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
48
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
49
- or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
50
- 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)
51
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
52
-
53
- Configuring a Ruby stdlib logger:
54
-
55
- ```ruby
56
- require "logger"
57
-
58
- module MyLogger
59
- LOGGER = Logger.new $stderr, level: Logger::WARN
60
- def logger
61
- LOGGER
62
- end
63
- end
64
-
65
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
66
- module GRPC
67
- extend MyLogger
68
- end
69
- ```
70
-
71
45
  ## Supported Ruby Versions
72
46
 
73
47
  This library is supported on Ruby 2.6+.
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Dialogflow
19
- VERSION = "1.5.0".freeze
19
+ VERSION = "1.7.0".freeze
20
20
  end
21
21
  end
22
22
  end
@@ -29,7 +29,7 @@ require "google/cloud/config"
29
29
 
30
30
  # Set the default configuration
31
31
  ::Google::Cloud.configure.add_config! :dialogflow do |config|
32
- config.add_field! :endpoint, "dialogflow.googleapis.com", match: ::String
32
+ config.add_field! :endpoint, nil, match: ::String
33
33
  config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials]
34
34
  config.add_field! :scope, nil, match: [::Array, ::String]
35
35
  config.add_field! :lib_name, nil, match: ::String
@@ -39,6 +39,7 @@ require "google/cloud/config"
39
39
  config.add_field! :metadata, nil, match: ::Hash
40
40
  config.add_field! :retry_policy, nil, match: [::Hash, ::Proc]
41
41
  config.add_field! :quota_project, nil, match: ::String
42
+ config.add_field! :universe_domain, nil, match: ::String
42
43
  end
43
44
 
44
45
  module Google
@@ -48,12 +49,14 @@ module Google
48
49
  # Create a new client object for Agents.
49
50
  #
50
51
  # 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
52
+ # [Google::Cloud::Dialogflow::V2::Agents::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-Agents-Client)
53
+ # for a gRPC client for version V2 of the API.
54
+ # However, you can specify a different API version by passing it in the
54
55
  # `version` parameter. If the Agents service is
55
56
  # supported by that API version, and the corresponding gem is available, the
56
57
  # appropriate versioned client will be returned.
58
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
59
+ # the `transport` parameter.
57
60
  #
58
61
  # ## About Agents
59
62
  #
@@ -61,29 +64,33 @@ module Google
61
64
  #
62
65
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
63
66
  # Defaults to `:v2`.
64
- # @return [Agents::Client] A client object for the specified version.
67
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
68
+ # @return [::Object] A client object for the specified version.
65
69
  #
66
- def self.agents version: :v2, &block
70
+ def self.agents version: :v2, transport: :grpc, &block
67
71
  require "google/cloud/dialogflow/#{version.to_s.downcase}"
68
72
 
69
73
  package_name = Google::Cloud::Dialogflow
70
74
  .constants
71
75
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
72
76
  .first
73
- package_module = Google::Cloud::Dialogflow.const_get package_name
74
- package_module.const_get(:Agents).const_get(:Client).new(&block)
77
+ service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Agents)
78
+ service_module = service_module.const_get(:Rest) if transport == :rest
79
+ service_module.const_get(:Client).new(&block)
75
80
  end
76
81
 
77
82
  ##
78
83
  # Create a new client object for Contexts.
79
84
  #
80
85
  # 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
86
+ # [Google::Cloud::Dialogflow::V2::Contexts::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-Contexts-Client)
87
+ # for a gRPC client for version V2 of the API.
88
+ # However, you can specify a different API version by passing it in the
84
89
  # `version` parameter. If the Contexts service is
85
90
  # supported by that API version, and the corresponding gem is available, the
86
91
  # appropriate versioned client will be returned.
92
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
93
+ # the `transport` parameter.
87
94
  #
88
95
  # ## About Contexts
89
96
  #
@@ -91,29 +98,33 @@ module Google
91
98
  #
92
99
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
93
100
  # Defaults to `:v2`.
94
- # @return [Contexts::Client] A client object for the specified version.
101
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
102
+ # @return [::Object] A client object for the specified version.
95
103
  #
96
- def self.contexts version: :v2, &block
104
+ def self.contexts version: :v2, transport: :grpc, &block
97
105
  require "google/cloud/dialogflow/#{version.to_s.downcase}"
98
106
 
99
107
  package_name = Google::Cloud::Dialogflow
100
108
  .constants
101
109
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
102
110
  .first
103
- package_module = Google::Cloud::Dialogflow.const_get package_name
104
- package_module.const_get(:Contexts).const_get(:Client).new(&block)
111
+ service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Contexts)
112
+ service_module = service_module.const_get(:Rest) if transport == :rest
113
+ service_module.const_get(:Client).new(&block)
105
114
  end
106
115
 
107
116
  ##
108
117
  # Create a new client object for Intents.
109
118
  #
110
119
  # By default, this returns an instance of
111
- # [Google::Cloud::Dialogflow::V2::Intents::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/Intents/Client.html)
112
- # for version V2 of the API.
113
- # However, you can specify specify a different API version by passing it in the
120
+ # [Google::Cloud::Dialogflow::V2::Intents::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-Intents-Client)
121
+ # for a gRPC client for version V2 of the API.
122
+ # However, you can specify a different API version by passing it in the
114
123
  # `version` parameter. If the Intents service is
115
124
  # supported by that API version, and the corresponding gem is available, the
116
125
  # appropriate versioned client will be returned.
126
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
127
+ # the `transport` parameter.
117
128
  #
118
129
  # ## About Intents
119
130
  #
@@ -121,29 +132,33 @@ module Google
121
132
  #
122
133
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
123
134
  # Defaults to `:v2`.
124
- # @return [Intents::Client] A client object for the specified version.
135
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
136
+ # @return [::Object] A client object for the specified version.
125
137
  #
126
- def self.intents version: :v2, &block
138
+ def self.intents version: :v2, transport: :grpc, &block
127
139
  require "google/cloud/dialogflow/#{version.to_s.downcase}"
128
140
 
129
141
  package_name = Google::Cloud::Dialogflow
130
142
  .constants
131
143
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
132
144
  .first
133
- package_module = Google::Cloud::Dialogflow.const_get package_name
134
- package_module.const_get(:Intents).const_get(:Client).new(&block)
145
+ service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Intents)
146
+ service_module = service_module.const_get(:Rest) if transport == :rest
147
+ service_module.const_get(:Client).new(&block)
135
148
  end
136
149
 
137
150
  ##
138
151
  # Create a new client object for EntityTypes.
139
152
  #
140
153
  # By default, this returns an instance of
141
- # [Google::Cloud::Dialogflow::V2::EntityTypes::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/EntityTypes/Client.html)
142
- # for version V2 of the API.
143
- # However, you can specify specify a different API version by passing it in the
154
+ # [Google::Cloud::Dialogflow::V2::EntityTypes::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EntityTypes-Client)
155
+ # for a gRPC client for version V2 of the API.
156
+ # However, you can specify a different API version by passing it in the
144
157
  # `version` parameter. If the EntityTypes service is
145
158
  # supported by that API version, and the corresponding gem is available, the
146
159
  # appropriate versioned client will be returned.
160
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
161
+ # the `transport` parameter.
147
162
  #
148
163
  # ## About EntityTypes
149
164
  #
@@ -151,59 +166,68 @@ module Google
151
166
  #
152
167
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
153
168
  # Defaults to `:v2`.
154
- # @return [EntityTypes::Client] A client object for the specified version.
169
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
170
+ # @return [::Object] A client object for the specified version.
155
171
  #
156
- def self.entity_types version: :v2, &block
172
+ def self.entity_types version: :v2, transport: :grpc, &block
157
173
  require "google/cloud/dialogflow/#{version.to_s.downcase}"
158
174
 
159
175
  package_name = Google::Cloud::Dialogflow
160
176
  .constants
161
177
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
162
178
  .first
163
- package_module = Google::Cloud::Dialogflow.const_get package_name
164
- package_module.const_get(:EntityTypes).const_get(:Client).new(&block)
179
+ service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:EntityTypes)
180
+ service_module = service_module.const_get(:Rest) if transport == :rest
181
+ service_module.const_get(:Client).new(&block)
165
182
  end
166
183
 
167
184
  ##
168
185
  # Create a new client object for SessionEntityTypes.
169
186
  #
170
187
  # By default, this returns an instance of
171
- # [Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/SessionEntityTypes/Client.html)
172
- # for version V2 of the API.
173
- # However, you can specify specify a different API version by passing it in the
188
+ # [Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-SessionEntityTypes-Client)
189
+ # for a gRPC client for version V2 of the API.
190
+ # However, you can specify a different API version by passing it in the
174
191
  # `version` parameter. If the SessionEntityTypes service is
175
192
  # supported by that API version, and the corresponding gem is available, the
176
193
  # appropriate versioned client will be returned.
194
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
195
+ # the `transport` parameter.
177
196
  #
178
197
  # ## About SessionEntityTypes
179
198
  #
180
- # Service for managing SessionEntityTypes.
199
+ # Service for managing
200
+ # SessionEntityTypes.
181
201
  #
182
202
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
183
203
  # Defaults to `:v2`.
184
- # @return [SessionEntityTypes::Client] A client object for the specified version.
204
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
205
+ # @return [::Object] A client object for the specified version.
185
206
  #
186
- def self.session_entity_types version: :v2, &block
207
+ def self.session_entity_types version: :v2, transport: :grpc, &block
187
208
  require "google/cloud/dialogflow/#{version.to_s.downcase}"
188
209
 
189
210
  package_name = Google::Cloud::Dialogflow
190
211
  .constants
191
212
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
192
213
  .first
193
- package_module = Google::Cloud::Dialogflow.const_get package_name
194
- package_module.const_get(:SessionEntityTypes).const_get(:Client).new(&block)
214
+ service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:SessionEntityTypes)
215
+ service_module = service_module.const_get(:Rest) if transport == :rest
216
+ service_module.const_get(:Client).new(&block)
195
217
  end
196
218
 
197
219
  ##
198
220
  # Create a new client object for Sessions.
199
221
  #
200
222
  # By default, this returns an instance of
201
- # [Google::Cloud::Dialogflow::V2::Sessions::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/Sessions/Client.html)
202
- # for version V2 of the API.
203
- # However, you can specify specify a different API version by passing it in the
223
+ # [Google::Cloud::Dialogflow::V2::Sessions::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-Sessions-Client)
224
+ # for a gRPC client for version V2 of the API.
225
+ # However, you can specify a different API version by passing it in the
204
226
  # `version` parameter. If the Sessions service is
205
227
  # supported by that API version, and the corresponding gem is available, the
206
228
  # appropriate versioned client will be returned.
229
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
230
+ # the `transport` parameter.
207
231
  #
208
232
  # ## About Sessions
209
233
  #
@@ -214,29 +238,33 @@ module Google
214
238
  #
215
239
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
216
240
  # Defaults to `:v2`.
217
- # @return [Sessions::Client] A client object for the specified version.
241
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
242
+ # @return [::Object] A client object for the specified version.
218
243
  #
219
- def self.sessions version: :v2, &block
244
+ def self.sessions version: :v2, transport: :grpc, &block
220
245
  require "google/cloud/dialogflow/#{version.to_s.downcase}"
221
246
 
222
247
  package_name = Google::Cloud::Dialogflow
223
248
  .constants
224
249
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
225
250
  .first
226
- package_module = Google::Cloud::Dialogflow.const_get package_name
227
- package_module.const_get(:Sessions).const_get(:Client).new(&block)
251
+ service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Sessions)
252
+ service_module = service_module.const_get(:Rest) if transport == :rest
253
+ service_module.const_get(:Client).new(&block)
228
254
  end
229
255
 
230
256
  ##
231
257
  # Create a new client object for Participants.
232
258
  #
233
259
  # By default, this returns an instance of
234
- # [Google::Cloud::Dialogflow::V2::Participants::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/Participants/Client.html)
235
- # for version V2 of the API.
236
- # However, you can specify specify a different API version by passing it in the
260
+ # [Google::Cloud::Dialogflow::V2::Participants::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-Participants-Client)
261
+ # for a gRPC client for version V2 of the API.
262
+ # However, you can specify a different API version by passing it in the
237
263
  # `version` parameter. If the Participants service is
238
264
  # supported by that API version, and the corresponding gem is available, the
239
265
  # appropriate versioned client will be returned.
266
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
267
+ # the `transport` parameter.
240
268
  #
241
269
  # ## About Participants
242
270
  #
@@ -244,212 +272,244 @@ module Google
244
272
  #
245
273
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
246
274
  # Defaults to `:v2`.
247
- # @return [Participants::Client] A client object for the specified version.
275
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
276
+ # @return [::Object] A client object for the specified version.
248
277
  #
249
- def self.participants version: :v2, &block
278
+ def self.participants version: :v2, transport: :grpc, &block
250
279
  require "google/cloud/dialogflow/#{version.to_s.downcase}"
251
280
 
252
281
  package_name = Google::Cloud::Dialogflow
253
282
  .constants
254
283
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
255
284
  .first
256
- package_module = Google::Cloud::Dialogflow.const_get package_name
257
- package_module.const_get(:Participants).const_get(:Client).new(&block)
285
+ service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Participants)
286
+ service_module = service_module.const_get(:Rest) if transport == :rest
287
+ service_module.const_get(:Client).new(&block)
258
288
  end
259
289
 
260
290
  ##
261
291
  # Create a new client object for AnswerRecords.
262
292
  #
263
293
  # By default, this returns an instance of
264
- # [Google::Cloud::Dialogflow::V2::AnswerRecords::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/AnswerRecords/Client.html)
265
- # for version V2 of the API.
266
- # However, you can specify specify a different API version by passing it in the
294
+ # [Google::Cloud::Dialogflow::V2::AnswerRecords::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-AnswerRecords-Client)
295
+ # for a gRPC client for version V2 of the API.
296
+ # However, you can specify a different API version by passing it in the
267
297
  # `version` parameter. If the AnswerRecords service is
268
298
  # supported by that API version, and the corresponding gem is available, the
269
299
  # appropriate versioned client will be returned.
300
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
301
+ # the `transport` parameter.
270
302
  #
271
303
  # ## About AnswerRecords
272
304
  #
273
- # Service for managing AnswerRecords.
305
+ # Service for managing
306
+ # AnswerRecords.
274
307
  #
275
308
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
276
309
  # Defaults to `:v2`.
277
- # @return [AnswerRecords::Client] A client object for the specified version.
310
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
311
+ # @return [::Object] A client object for the specified version.
278
312
  #
279
- def self.answer_records version: :v2, &block
313
+ def self.answer_records version: :v2, transport: :grpc, &block
280
314
  require "google/cloud/dialogflow/#{version.to_s.downcase}"
281
315
 
282
316
  package_name = Google::Cloud::Dialogflow
283
317
  .constants
284
318
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
285
319
  .first
286
- package_module = Google::Cloud::Dialogflow.const_get package_name
287
- package_module.const_get(:AnswerRecords).const_get(:Client).new(&block)
320
+ service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:AnswerRecords)
321
+ service_module = service_module.const_get(:Rest) if transport == :rest
322
+ service_module.const_get(:Client).new(&block)
288
323
  end
289
324
 
290
325
  ##
291
- # Create a new client object for Conversations.
326
+ # Create a new client object for ConversationProfiles.
292
327
  #
293
328
  # By default, this returns an instance of
294
- # [Google::Cloud::Dialogflow::V2::Conversations::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/Conversations/Client.html)
295
- # for version V2 of the API.
296
- # However, you can specify specify a different API version by passing it in the
297
- # `version` parameter. If the Conversations service is
329
+ # [Google::Cloud::Dialogflow::V2::ConversationProfiles::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-ConversationProfiles-Client)
330
+ # for a gRPC client for version V2 of the API.
331
+ # However, you can specify a different API version by passing it in the
332
+ # `version` parameter. If the ConversationProfiles service is
298
333
  # supported by that API version, and the corresponding gem is available, the
299
334
  # appropriate versioned client will be returned.
335
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
336
+ # the `transport` parameter.
300
337
  #
301
- # ## About Conversations
338
+ # ## About ConversationProfiles
302
339
  #
303
- # Service for managing Conversations.
340
+ # Service for managing
341
+ # ConversationProfiles.
304
342
  #
305
343
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
306
344
  # Defaults to `:v2`.
307
- # @return [Conversations::Client] A client object for the specified version.
345
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
346
+ # @return [::Object] A client object for the specified version.
308
347
  #
309
- def self.conversations version: :v2, &block
348
+ def self.conversation_profiles version: :v2, transport: :grpc, &block
310
349
  require "google/cloud/dialogflow/#{version.to_s.downcase}"
311
350
 
312
351
  package_name = Google::Cloud::Dialogflow
313
352
  .constants
314
353
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
315
354
  .first
316
- package_module = Google::Cloud::Dialogflow.const_get package_name
317
- package_module.const_get(:Conversations).const_get(:Client).new(&block)
355
+ service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:ConversationProfiles)
356
+ service_module = service_module.const_get(:Rest) if transport == :rest
357
+ service_module.const_get(:Client).new(&block)
318
358
  end
319
359
 
320
360
  ##
321
- # Create a new client object for ConversationDatasets.
361
+ # Create a new client object for Conversations.
322
362
  #
323
363
  # By default, this returns an instance of
324
- # [Google::Cloud::Dialogflow::V2::ConversationDatasets::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/ConversationDatasets/Client.html)
325
- # for version V2 of the API.
326
- # However, you can specify specify a different API version by passing it in the
327
- # `version` parameter. If the ConversationDatasets service is
364
+ # [Google::Cloud::Dialogflow::V2::Conversations::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-Conversations-Client)
365
+ # for a gRPC client for version V2 of the API.
366
+ # However, you can specify a different API version by passing it in the
367
+ # `version` parameter. If the Conversations service is
328
368
  # supported by that API version, and the corresponding gem is available, the
329
369
  # appropriate versioned client will be returned.
370
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
371
+ # the `transport` parameter.
330
372
  #
331
- # ## About ConversationDatasets
332
- #
333
- # Conversation datasets.
373
+ # ## About Conversations
334
374
  #
335
- # Conversation datasets contain raw conversation files and their
336
- # customizable metadata that can be used for model training.
375
+ # Service for managing
376
+ # Conversations.
337
377
  #
338
378
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
339
379
  # Defaults to `:v2`.
340
- # @return [ConversationDatasets::Client] A client object for the specified version.
380
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
381
+ # @return [::Object] A client object for the specified version.
341
382
  #
342
- def self.conversation_datasets version: :v2, &block
383
+ def self.conversations version: :v2, transport: :grpc, &block
343
384
  require "google/cloud/dialogflow/#{version.to_s.downcase}"
344
385
 
345
386
  package_name = Google::Cloud::Dialogflow
346
387
  .constants
347
388
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
348
389
  .first
349
- package_module = Google::Cloud::Dialogflow.const_get package_name
350
- package_module.const_get(:ConversationDatasets).const_get(:Client).new(&block)
390
+ service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Conversations)
391
+ service_module = service_module.const_get(:Rest) if transport == :rest
392
+ service_module.const_get(:Client).new(&block)
351
393
  end
352
394
 
353
395
  ##
354
- # Create a new client object for ConversationModels.
396
+ # Create a new client object for ConversationDatasets.
355
397
  #
356
398
  # By default, this returns an instance of
357
- # [Google::Cloud::Dialogflow::V2::ConversationModels::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/ConversationModels/Client.html)
358
- # for version V2 of the API.
359
- # However, you can specify specify a different API version by passing it in the
360
- # `version` parameter. If the ConversationModels service is
399
+ # [Google::Cloud::Dialogflow::V2::ConversationDatasets::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-ConversationDatasets-Client)
400
+ # for a gRPC client for version V2 of the API.
401
+ # However, you can specify a different API version by passing it in the
402
+ # `version` parameter. If the ConversationDatasets service is
361
403
  # supported by that API version, and the corresponding gem is available, the
362
404
  # appropriate versioned client will be returned.
405
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
406
+ # the `transport` parameter.
363
407
  #
364
- # ## About ConversationModels
408
+ # ## About ConversationDatasets
365
409
  #
366
- # Manages a collection of models for human agent assistant.
410
+ # Conversation datasets.
411
+ #
412
+ # Conversation datasets contain raw conversation files and their
413
+ # customizable metadata that can be used for model training.
367
414
  #
368
415
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
369
416
  # Defaults to `:v2`.
370
- # @return [ConversationModels::Client] A client object for the specified version.
417
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
418
+ # @return [::Object] A client object for the specified version.
371
419
  #
372
- def self.conversation_models version: :v2, &block
420
+ def self.conversation_datasets version: :v2, transport: :grpc, &block
373
421
  require "google/cloud/dialogflow/#{version.to_s.downcase}"
374
422
 
375
423
  package_name = Google::Cloud::Dialogflow
376
424
  .constants
377
425
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
378
426
  .first
379
- package_module = Google::Cloud::Dialogflow.const_get package_name
380
- package_module.const_get(:ConversationModels).const_get(:Client).new(&block)
427
+ service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:ConversationDatasets)
428
+ service_module = service_module.const_get(:Rest) if transport == :rest
429
+ service_module.const_get(:Client).new(&block)
381
430
  end
382
431
 
383
432
  ##
384
- # Create a new client object for ConversationProfiles.
433
+ # Create a new client object for ConversationModels.
385
434
  #
386
435
  # By default, this returns an instance of
387
- # [Google::Cloud::Dialogflow::V2::ConversationProfiles::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/ConversationProfiles/Client.html)
388
- # for version V2 of the API.
389
- # However, you can specify specify a different API version by passing it in the
390
- # `version` parameter. If the ConversationProfiles service is
436
+ # [Google::Cloud::Dialogflow::V2::ConversationModels::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-ConversationModels-Client)
437
+ # for a gRPC client for version V2 of the API.
438
+ # However, you can specify a different API version by passing it in the
439
+ # `version` parameter. If the ConversationModels service is
391
440
  # supported by that API version, and the corresponding gem is available, the
392
441
  # appropriate versioned client will be returned.
442
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
443
+ # the `transport` parameter.
393
444
  #
394
- # ## About ConversationProfiles
445
+ # ## About ConversationModels
395
446
  #
396
- # Service for managing ConversationProfiles.
447
+ # Manages a collection of models for human agent assistant.
397
448
  #
398
449
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
399
450
  # Defaults to `:v2`.
400
- # @return [ConversationProfiles::Client] A client object for the specified version.
451
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
452
+ # @return [::Object] A client object for the specified version.
401
453
  #
402
- def self.conversation_profiles version: :v2, &block
454
+ def self.conversation_models version: :v2, transport: :grpc, &block
403
455
  require "google/cloud/dialogflow/#{version.to_s.downcase}"
404
456
 
405
457
  package_name = Google::Cloud::Dialogflow
406
458
  .constants
407
459
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
408
460
  .first
409
- package_module = Google::Cloud::Dialogflow.const_get package_name
410
- package_module.const_get(:ConversationProfiles).const_get(:Client).new(&block)
461
+ service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:ConversationModels)
462
+ service_module = service_module.const_get(:Rest) if transport == :rest
463
+ service_module.const_get(:Client).new(&block)
411
464
  end
412
465
 
413
466
  ##
414
467
  # Create a new client object for Documents.
415
468
  #
416
469
  # By default, this returns an instance of
417
- # [Google::Cloud::Dialogflow::V2::Documents::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/Documents/Client.html)
418
- # for version V2 of the API.
419
- # However, you can specify specify a different API version by passing it in the
470
+ # [Google::Cloud::Dialogflow::V2::Documents::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-Documents-Client)
471
+ # for a gRPC client for version V2 of the API.
472
+ # However, you can specify a different API version by passing it in the
420
473
  # `version` parameter. If the Documents service is
421
474
  # supported by that API version, and the corresponding gem is available, the
422
475
  # appropriate versioned client will be returned.
476
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
477
+ # the `transport` parameter.
423
478
  #
424
479
  # ## About Documents
425
480
  #
426
- # Service for managing knowledge Documents.
481
+ # Service for managing knowledge
482
+ # Documents.
427
483
  #
428
484
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
429
485
  # Defaults to `:v2`.
430
- # @return [Documents::Client] A client object for the specified version.
486
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
487
+ # @return [::Object] A client object for the specified version.
431
488
  #
432
- def self.documents version: :v2, &block
489
+ def self.documents version: :v2, transport: :grpc, &block
433
490
  require "google/cloud/dialogflow/#{version.to_s.downcase}"
434
491
 
435
492
  package_name = Google::Cloud::Dialogflow
436
493
  .constants
437
494
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
438
495
  .first
439
- package_module = Google::Cloud::Dialogflow.const_get package_name
440
- package_module.const_get(:Documents).const_get(:Client).new(&block)
496
+ service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Documents)
497
+ service_module = service_module.const_get(:Rest) if transport == :rest
498
+ service_module.const_get(:Client).new(&block)
441
499
  end
442
500
 
443
501
  ##
444
502
  # Create a new client object for Fulfillments.
445
503
  #
446
504
  # By default, this returns an instance of
447
- # [Google::Cloud::Dialogflow::V2::Fulfillments::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/Fulfillments/Client.html)
448
- # for version V2 of the API.
449
- # However, you can specify specify a different API version by passing it in the
505
+ # [Google::Cloud::Dialogflow::V2::Fulfillments::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-Fulfillments-Client)
506
+ # for a gRPC client for version V2 of the API.
507
+ # However, you can specify a different API version by passing it in the
450
508
  # `version` parameter. If the Fulfillments service is
451
509
  # supported by that API version, and the corresponding gem is available, the
452
510
  # appropriate versioned client will be returned.
511
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
512
+ # the `transport` parameter.
453
513
  #
454
514
  # ## About Fulfillments
455
515
  #
@@ -457,29 +517,33 @@ module Google
457
517
  #
458
518
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
459
519
  # Defaults to `:v2`.
460
- # @return [Fulfillments::Client] A client object for the specified version.
520
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
521
+ # @return [::Object] A client object for the specified version.
461
522
  #
462
- def self.fulfillments version: :v2, &block
523
+ def self.fulfillments version: :v2, transport: :grpc, &block
463
524
  require "google/cloud/dialogflow/#{version.to_s.downcase}"
464
525
 
465
526
  package_name = Google::Cloud::Dialogflow
466
527
  .constants
467
528
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
468
529
  .first
469
- package_module = Google::Cloud::Dialogflow.const_get package_name
470
- package_module.const_get(:Fulfillments).const_get(:Client).new(&block)
530
+ service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Fulfillments)
531
+ service_module = service_module.const_get(:Rest) if transport == :rest
532
+ service_module.const_get(:Client).new(&block)
471
533
  end
472
534
 
473
535
  ##
474
536
  # Create a new client object for Environments.
475
537
  #
476
538
  # By default, this returns an instance of
477
- # [Google::Cloud::Dialogflow::V2::Environments::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/Environments/Client.html)
478
- # for version V2 of the API.
479
- # However, you can specify specify a different API version by passing it in the
539
+ # [Google::Cloud::Dialogflow::V2::Environments::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-Environments-Client)
540
+ # for a gRPC client for version V2 of the API.
541
+ # However, you can specify a different API version by passing it in the
480
542
  # `version` parameter. If the Environments service is
481
543
  # supported by that API version, and the corresponding gem is available, the
482
544
  # appropriate versioned client will be returned.
545
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
546
+ # the `transport` parameter.
483
547
  #
484
548
  # ## About Environments
485
549
  #
@@ -487,59 +551,68 @@ module Google
487
551
  #
488
552
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
489
553
  # Defaults to `:v2`.
490
- # @return [Environments::Client] A client object for the specified version.
554
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
555
+ # @return [::Object] A client object for the specified version.
491
556
  #
492
- def self.environments version: :v2, &block
557
+ def self.environments version: :v2, transport: :grpc, &block
493
558
  require "google/cloud/dialogflow/#{version.to_s.downcase}"
494
559
 
495
560
  package_name = Google::Cloud::Dialogflow
496
561
  .constants
497
562
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
498
563
  .first
499
- package_module = Google::Cloud::Dialogflow.const_get package_name
500
- package_module.const_get(:Environments).const_get(:Client).new(&block)
564
+ service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Environments)
565
+ service_module = service_module.const_get(:Rest) if transport == :rest
566
+ service_module.const_get(:Client).new(&block)
501
567
  end
502
568
 
503
569
  ##
504
570
  # Create a new client object for KnowledgeBases.
505
571
  #
506
572
  # By default, this returns an instance of
507
- # [Google::Cloud::Dialogflow::V2::KnowledgeBases::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/KnowledgeBases/Client.html)
508
- # for version V2 of the API.
509
- # However, you can specify specify a different API version by passing it in the
573
+ # [Google::Cloud::Dialogflow::V2::KnowledgeBases::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-KnowledgeBases-Client)
574
+ # for a gRPC client for version V2 of the API.
575
+ # However, you can specify a different API version by passing it in the
510
576
  # `version` parameter. If the KnowledgeBases service is
511
577
  # supported by that API version, and the corresponding gem is available, the
512
578
  # appropriate versioned client will be returned.
579
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
580
+ # the `transport` parameter.
513
581
  #
514
582
  # ## About KnowledgeBases
515
583
  #
516
- # Service for managing KnowledgeBases.
584
+ # Service for managing
585
+ # KnowledgeBases.
517
586
  #
518
587
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
519
588
  # Defaults to `:v2`.
520
- # @return [KnowledgeBases::Client] A client object for the specified version.
589
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
590
+ # @return [::Object] A client object for the specified version.
521
591
  #
522
- def self.knowledge_bases version: :v2, &block
592
+ def self.knowledge_bases version: :v2, transport: :grpc, &block
523
593
  require "google/cloud/dialogflow/#{version.to_s.downcase}"
524
594
 
525
595
  package_name = Google::Cloud::Dialogflow
526
596
  .constants
527
597
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
528
598
  .first
529
- package_module = Google::Cloud::Dialogflow.const_get package_name
530
- package_module.const_get(:KnowledgeBases).const_get(:Client).new(&block)
599
+ service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:KnowledgeBases)
600
+ service_module = service_module.const_get(:Rest) if transport == :rest
601
+ service_module.const_get(:Client).new(&block)
531
602
  end
532
603
 
533
604
  ##
534
605
  # Create a new client object for Versions.
535
606
  #
536
607
  # By default, this returns an instance of
537
- # [Google::Cloud::Dialogflow::V2::Versions::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/Versions/Client.html)
538
- # for version V2 of the API.
539
- # However, you can specify specify a different API version by passing it in the
608
+ # [Google::Cloud::Dialogflow::V2::Versions::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-Versions-Client)
609
+ # for a gRPC client for version V2 of the API.
610
+ # However, you can specify a different API version by passing it in the
540
611
  # `version` parameter. If the Versions service is
541
612
  # supported by that API version, and the corresponding gem is available, the
542
613
  # appropriate versioned client will be returned.
614
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
615
+ # the `transport` parameter.
543
616
  #
544
617
  # ## About Versions
545
618
  #
@@ -547,17 +620,19 @@ module Google
547
620
  #
548
621
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
549
622
  # Defaults to `:v2`.
550
- # @return [Versions::Client] A client object for the specified version.
623
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
624
+ # @return [::Object] A client object for the specified version.
551
625
  #
552
- def self.versions version: :v2, &block
626
+ def self.versions version: :v2, transport: :grpc, &block
553
627
  require "google/cloud/dialogflow/#{version.to_s.downcase}"
554
628
 
555
629
  package_name = Google::Cloud::Dialogflow
556
630
  .constants
557
631
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
558
632
  .first
559
- package_module = Google::Cloud::Dialogflow.const_get package_name
560
- package_module.const_get(:Versions).const_get(:Client).new(&block)
633
+ service_module = Google::Cloud::Dialogflow.const_get(package_name).const_get(:Versions)
634
+ service_module = service_module.const_get(:Rest) if transport == :rest
635
+ service_module.const_get(:Client).new(&block)
561
636
  end
562
637
 
563
638
  ##
@@ -577,7 +652,7 @@ module Google
577
652
  # * `timeout` (*type:* `Numeric`) -
578
653
  # Default timeout in seconds.
579
654
  # * `metadata` (*type:* `Hash{Symbol=>String}`) -
580
- # Additional gRPC headers to be sent with the call.
655
+ # Additional headers to be sent with the call.
581
656
  # * `retry_policy` (*type:* `Hash`) -
582
657
  # The retry policy. The value is a hash with the following keys:
583
658
  # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-dialogflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-02 00:00:00.000000000 Z
11
+ date: 2024-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-core
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0.15'
33
+ version: '0.32'
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
36
  version: 2.a
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: '0.15'
43
+ version: '0.32'
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: 2.a
@@ -194,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
194
194
  - !ruby/object:Gem::Version
195
195
  version: '0'
196
196
  requirements: []
197
- rubygems_version: 3.3.14
197
+ rubygems_version: 3.5.3
198
198
  signing_key:
199
199
  specification_version: 4
200
200
  summary: API Client library for the Dialogflow API