google-cloud-dialogflow 1.0.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.md +188 -190
- data/MIGRATING.md +49 -1
- data/README.md +63 -4
- data/lib/google/cloud/dialogflow.rb +227 -159
- data/lib/google/cloud/dialogflow/version.rb +1 -1
- metadata +6 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59ec37dceb23cfd8da87f96a434c137c8a6a7b2b1c0440156b97fa8a6c6b4a99
|
4
|
+
data.tar.gz: 02c47103c5435d09da8f4ec4c67afa2196f3f3e57895914b2e6698f9be72624a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7a68598755e3f9ee0a90ba75ee81143bcac7eaacf17a3c609a1fe6ae54cd96076e362c36f2262db0efabc3c798beb8d36c7b75080ce0ab40636b65eb7dffaab
|
7
|
+
data.tar.gz: 84407be246b75f68208880b81b77752facf0bcb1ce245e12e9d32c130f7de241a32e8e7483c74596afd352046cf5cec35bace9b764489131c22650dee34b83b4
|
data/LICENSE.md
CHANGED
@@ -1,192 +1,190 @@
|
|
1
|
-
Apache License
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
same "printed page" as the copyright notice for easier
|
189
|
-
identification within third-party archives.
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
190
188
|
|
191
189
|
Copyright [yyyy] [name of copyright owner]
|
192
190
|
|
@@ -194,7 +192,7 @@ identification within third-party archives.
|
|
194
192
|
you may not use this file except in compliance with the License.
|
195
193
|
You may obtain a copy of the License at
|
196
194
|
|
197
|
-
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
198
196
|
|
199
197
|
Unless required by applicable law or agreed to in writing, software
|
200
198
|
distributed under the License is distributed on an "AS IS" BASIS,
|
data/MIGRATING.md
CHANGED
@@ -34,6 +34,10 @@ To summarize:
|
|
34
34
|
current client retains this method, but improves it with a more powerful
|
35
35
|
interface to match streaming methods in other Ruby clients. See
|
36
36
|
[Streaming Interface](#streaming-interface) for more info.
|
37
|
+
* Previously, clients reported RPC errors by raising instances of
|
38
|
+
`Google::Gax::GaxError` and its subclasses. Now, RPC exceptions are of type
|
39
|
+
`Google::Cloud::Error` and its subclasses. See
|
40
|
+
[Handling Errors](#handling-errors) for more info.
|
37
41
|
* Some classes have moved into different namespaces. See
|
38
42
|
[Class Namespaces](#class-namespaces) for more info.
|
39
43
|
|
@@ -274,7 +278,7 @@ Finally, in the 1.0 client, you can also use the paths module as a convenience m
|
|
274
278
|
|
275
279
|
New:
|
276
280
|
```
|
277
|
-
# Bring the
|
281
|
+
# Bring the path helper methods into the current class
|
278
282
|
include Google::Cloud::Dialogflow::V2::Sessions::Paths
|
279
283
|
|
280
284
|
def foo
|
@@ -378,6 +382,50 @@ request_stream.close
|
|
378
382
|
response_thread.join
|
379
383
|
```
|
380
384
|
|
385
|
+
### Handling Errors
|
386
|
+
|
387
|
+
The client reports standard
|
388
|
+
[gRPC error codes](https://github.com/grpc/grpc/blob/master/doc/statuscodes.md)
|
389
|
+
by raising exceptions. In older releases, these exceptions were located in the
|
390
|
+
`Google::Gax` namespace and were subclasses of the `Google::Gax::GaxError` base
|
391
|
+
exception class, defined in the `google-gax` gem. However, these classes were
|
392
|
+
different from the standard exceptions (subclasses of `Google::Cloud::Error`)
|
393
|
+
thrown by other client libraries such as `google-cloud-storage`.
|
394
|
+
|
395
|
+
The 1.0 client library now uses the `Google::Cloud::Error` exception hierarchy,
|
396
|
+
for consistency across all the Google Cloud client libraries. In general, these
|
397
|
+
exceptions have the same name as their counterparts from older releases, but
|
398
|
+
are located in the `Google::Cloud` namespace rather than the `Google::Gax`
|
399
|
+
namespace.
|
400
|
+
|
401
|
+
Old:
|
402
|
+
```
|
403
|
+
client = Google::Cloud::Dialogflow::Sessions.new
|
404
|
+
|
405
|
+
session = "projects/my-project/agent/sessions/my-session"
|
406
|
+
query = { text: { text: "book a meeting room", language_code: "en-US" } }
|
407
|
+
|
408
|
+
begin
|
409
|
+
response = client.detect_intent session, query
|
410
|
+
rescue Google::Gax::Error => e
|
411
|
+
# Handle exceptions that subclass Google::Gax::Error
|
412
|
+
end
|
413
|
+
```
|
414
|
+
|
415
|
+
New:
|
416
|
+
```
|
417
|
+
client = Google::Cloud::Dialogflow.sessions
|
418
|
+
|
419
|
+
session = "projects/my-project/agent/sessions/my-session"
|
420
|
+
query = { text: { text: "book a meeting room", language_code: "en-US" } }
|
421
|
+
|
422
|
+
begin
|
423
|
+
response = client.detect_intent session: session, query_input: query
|
424
|
+
rescue Google::Cloud::Error => e
|
425
|
+
# Handle exceptions that subclass Google::Cloud::Error
|
426
|
+
end
|
427
|
+
```
|
428
|
+
|
381
429
|
### Class Namespaces
|
382
430
|
|
383
431
|
In older releases, the client object was of classes with names like:
|
data/README.md
CHANGED
@@ -6,9 +6,10 @@ Dialogflow is an end-to-end, build-once deploy-everywhere development suite for
|
|
6
6
|
|
7
7
|
Actual client classes for the various versions of this API are defined in
|
8
8
|
_versioned_ client gems, with names of the form `google-cloud-dialogflow-v*`.
|
9
|
-
The gem `google-cloud-dialogflow` is
|
9
|
+
The gem `google-cloud-dialogflow` is the main client library that brings the
|
10
10
|
verisoned gems in as dependencies, and provides high-level methods for
|
11
|
-
constructing clients.
|
11
|
+
constructing clients. More information on versioned clients can be found below
|
12
|
+
in the section titled *Which client should I use?*.
|
12
13
|
|
13
14
|
View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-dialogflow/latest)
|
14
15
|
for this library, google-cloud-dialogflow, to see the convenience methods for
|
@@ -69,11 +70,69 @@ end
|
|
69
70
|
|
70
71
|
## Supported Ruby Versions
|
71
72
|
|
72
|
-
This library is supported on Ruby 2.
|
73
|
+
This library is supported on Ruby 2.5+.
|
73
74
|
|
74
75
|
Google provides official support for Ruby versions that are actively supported
|
75
76
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
76
|
-
in security maintenance, and not end of life. Currently, this means Ruby 2.
|
77
|
+
in security maintenance, and not end of life. Currently, this means Ruby 2.5
|
77
78
|
and later. Older versions of Ruby _may_ still work, but are unsupported and not
|
78
79
|
recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
|
79
80
|
about the Ruby support schedule.
|
81
|
+
|
82
|
+
## Which client should I use?
|
83
|
+
|
84
|
+
Most modern Ruby client libraries for Google APIs come in two flavors: the main
|
85
|
+
client library with a name such as `google-cloud-dialogflow`,
|
86
|
+
and lower-level _versioned_ client libraries with names such as
|
87
|
+
`google-cloud-dialogflow-v2`.
|
88
|
+
_In most cases, you should install the main client._
|
89
|
+
|
90
|
+
### What's the difference between the main client and a versioned client?
|
91
|
+
|
92
|
+
A _versioned client_ provides a basic set of data types and client classes for
|
93
|
+
a _single version_ of a specific service. (That is, for a service with multiple
|
94
|
+
versions, there might be a separate versioned client for each service version.)
|
95
|
+
Most versioned clients are written and maintained by a code generator.
|
96
|
+
|
97
|
+
The _main client_ is designed to provide you with the _recommended_ client
|
98
|
+
interfaces for the service. There will be only one main client for any given
|
99
|
+
service, even a service with multiple versions. The main client includes
|
100
|
+
factory methods for constructing the client objects we recommend for most
|
101
|
+
users. In some cases, those will be classes provided by an underlying versioned
|
102
|
+
client; in other cases, they will be handwritten higher-level client objects
|
103
|
+
with additional capabilities, convenience methods, or best practices built in.
|
104
|
+
Generally, the main client will default to a recommended service version,
|
105
|
+
although in some cases you can override this if you need to talk to a specific
|
106
|
+
service version.
|
107
|
+
|
108
|
+
### Why would I want to use the main client?
|
109
|
+
|
110
|
+
We recommend that most users install the main client gem for a service. You can
|
111
|
+
identify this gem as the one _without_ a version in its name, e.g.
|
112
|
+
`google-cloud-dialogflow`.
|
113
|
+
The main client is recommended because it will embody the best practices for
|
114
|
+
accessing the service, and may also provide more convenient interfaces or
|
115
|
+
tighter integration into frameworks and third-party libraries. In addition, the
|
116
|
+
documentation and samples published by Google will generally demonstrate use of
|
117
|
+
the main client.
|
118
|
+
|
119
|
+
### Why would I want to use a versioned client?
|
120
|
+
|
121
|
+
You can use a versioned client if you are content with a possibly lower-level
|
122
|
+
class interface, you explicitly want to avoid features provided by the main
|
123
|
+
client, or you want to access a specific service version not be covered by the
|
124
|
+
main client. You can identify versioned client gems because the service version
|
125
|
+
is part of the name, e.g. `google-cloud-dialogflow-v2`.
|
126
|
+
|
127
|
+
### What about the google-apis-<name> clients?
|
128
|
+
|
129
|
+
Client library gems with names that begin with `google-apis-` are based on an
|
130
|
+
older code generation technology. They talk to a REST/JSON backend (whereas
|
131
|
+
most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may
|
132
|
+
not offer the same performance, features, and ease of use provided by more
|
133
|
+
modern clients.
|
134
|
+
|
135
|
+
The `google-apis-` clients have wide coverage across Google services, so you
|
136
|
+
might need to use one if there is no modern client available for the service.
|
137
|
+
However, if a modern client is available, we generally recommend it over the
|
138
|
+
older `google-apis-` clients.
|
@@ -29,13 +29,16 @@ 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! :
|
33
|
-
config.add_field! :
|
34
|
-
config.add_field! :
|
35
|
-
config.add_field! :
|
36
|
-
config.add_field! :
|
37
|
-
config.add_field! :
|
38
|
-
config.add_field! :
|
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
|
39
42
|
end
|
40
43
|
|
41
44
|
module Google
|
@@ -54,34 +57,7 @@ module Google
|
|
54
57
|
#
|
55
58
|
# ## About Agents
|
56
59
|
#
|
57
|
-
#
|
58
|
-
# that transform user requests into actionable data. You can include agents
|
59
|
-
# in your app, product, or service to determine user intent and respond to the
|
60
|
-
# user in a natural way.
|
61
|
-
#
|
62
|
-
# After you create an agent, you can add Intents, Contexts,
|
63
|
-
# Entity Types, Webhooks, and so on to
|
64
|
-
# manage the flow of a conversation and match user input to predefined intents
|
65
|
-
# and actions.
|
66
|
-
#
|
67
|
-
# You can create an agent using both Dialogflow Standard Edition and
|
68
|
-
# Dialogflow Enterprise Edition. For details, see
|
69
|
-
# [Dialogflow
|
70
|
-
# Editions](https://cloud.google.com/dialogflow/docs/editions).
|
71
|
-
#
|
72
|
-
# You can save your agent for backup or versioning by exporting the agent by
|
73
|
-
# using the ExportAgent method. You can import a saved
|
74
|
-
# agent by using the ImportAgent method.
|
75
|
-
#
|
76
|
-
# Dialogflow provides several
|
77
|
-
# [prebuilt
|
78
|
-
# agents](https://cloud.google.com/dialogflow/docs/agents-prebuilt)
|
79
|
-
# for common conversation scenarios such as determining a date and time,
|
80
|
-
# converting currency, and so on.
|
81
|
-
#
|
82
|
-
# For more information about agents, see the
|
83
|
-
# [Dialogflow
|
84
|
-
# documentation](https://cloud.google.com/dialogflow/docs/agents-overview).
|
60
|
+
# Service for managing Agents.
|
85
61
|
#
|
86
62
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
87
63
|
# Defaults to `:v2`.
|
@@ -111,24 +87,7 @@ module Google
|
|
111
87
|
#
|
112
88
|
# ## About Contexts
|
113
89
|
#
|
114
|
-
#
|
115
|
-
# an intent returned by the Dialogflow API. Contexts are helpful for
|
116
|
-
# differentiating user input which may be vague or have a different meaning
|
117
|
-
# depending on additional details from your application such as user setting
|
118
|
-
# and preferences, previous user input, where the user is in your application,
|
119
|
-
# geographic location, and so on.
|
120
|
-
#
|
121
|
-
# You can include contexts as input parameters of a
|
122
|
-
# DetectIntent (or
|
123
|
-
# StreamingDetectIntent) request,
|
124
|
-
# or as output contexts included in the returned intent.
|
125
|
-
# Contexts expire when an intent is matched, after the number of `DetectIntent`
|
126
|
-
# requests specified by the `lifespan_count` parameter, or after 20 minutes
|
127
|
-
# if no intents are matched for a `DetectIntent` request.
|
128
|
-
#
|
129
|
-
# For more information about contexts, see the
|
130
|
-
# [Dialogflow
|
131
|
-
# documentation](https://cloud.google.com/dialogflow/docs/contexts-overview).
|
90
|
+
# Service for managing Contexts.
|
132
91
|
#
|
133
92
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
134
93
|
# Defaults to `:v2`.
|
@@ -145,6 +104,36 @@ module Google
|
|
145
104
|
package_module.const_get(:Contexts).const_get(:Client).new(&block)
|
146
105
|
end
|
147
106
|
|
107
|
+
##
|
108
|
+
# Create a new client object for Intents.
|
109
|
+
#
|
110
|
+
# 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
|
114
|
+
# `version` parameter. If the Intents 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 Intents
|
119
|
+
#
|
120
|
+
# Service for managing Intents.
|
121
|
+
#
|
122
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
123
|
+
# Defaults to `:v2`.
|
124
|
+
# @return [Intents::Client] A client object for the specified version.
|
125
|
+
#
|
126
|
+
def self.intents version: :v2, &block
|
127
|
+
require "google/cloud/dialogflow/#{version.to_s.downcase}"
|
128
|
+
|
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(:Intents).const_get(:Client).new(&block)
|
135
|
+
end
|
136
|
+
|
148
137
|
##
|
149
138
|
# Create a new client object for EntityTypes.
|
150
139
|
#
|
@@ -158,40 +147,76 @@ module Google
|
|
158
147
|
#
|
159
148
|
# ## About EntityTypes
|
160
149
|
#
|
161
|
-
#
|
162
|
-
#
|
163
|
-
#
|
164
|
-
#
|
150
|
+
# Service for managing EntityTypes.
|
151
|
+
#
|
152
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
153
|
+
# Defaults to `:v2`.
|
154
|
+
# @return [EntityTypes::Client] A client object for the specified version.
|
155
|
+
#
|
156
|
+
def self.entity_types version: :v2, &block
|
157
|
+
require "google/cloud/dialogflow/#{version.to_s.downcase}"
|
158
|
+
|
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(:EntityTypes).const_get(:Client).new(&block)
|
165
|
+
end
|
166
|
+
|
167
|
+
##
|
168
|
+
# Create a new client object for SessionEntityTypes.
|
169
|
+
#
|
170
|
+
# 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
|
174
|
+
# `version` parameter. If the SessionEntityTypes 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 SessionEntityTypes
|
179
|
+
#
|
180
|
+
# Service for managing SessionEntityTypes.
|
165
181
|
#
|
166
|
-
#
|
167
|
-
#
|
182
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
183
|
+
# Defaults to `:v2`.
|
184
|
+
# @return [SessionEntityTypes::Client] A client object for the specified version.
|
168
185
|
#
|
169
|
-
|
186
|
+
def self.session_entity_types version: :v2, &block
|
187
|
+
require "google/cloud/dialogflow/#{version.to_s.downcase}"
|
188
|
+
|
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(:SessionEntityTypes).const_get(:Client).new(&block)
|
195
|
+
end
|
196
|
+
|
197
|
+
##
|
198
|
+
# Create a new client object for Sessions.
|
170
199
|
#
|
171
|
-
#
|
172
|
-
#
|
173
|
-
#
|
200
|
+
# 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
|
204
|
+
# `version` parameter. If the Sessions service is
|
205
|
+
# supported by that API version, and the corresponding gem is available, the
|
206
|
+
# appropriate versioned client will be returned.
|
174
207
|
#
|
175
|
-
#
|
176
|
-
# actionable data that is meaningful to your application. For example,
|
177
|
-
# you could define a `pizza.sauce` entity for red or white pizza sauce,
|
178
|
-
# a `pizza.cheese` entity for the different types of cheese on a pizza,
|
179
|
-
# a `pizza.topping` entity for different toppings, and so on. A custom
|
180
|
-
# entity is represented by the `EntityType` type.
|
208
|
+
# ## About Sessions
|
181
209
|
#
|
182
|
-
#
|
183
|
-
# favorites, preferences, playlists, and so on. A user entity is
|
184
|
-
# represented by the SessionEntityType type.
|
210
|
+
# A service used for session interactions.
|
185
211
|
#
|
186
|
-
# For more information
|
187
|
-
#
|
188
|
-
# documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
|
212
|
+
# For more information, see the [API interactions
|
213
|
+
# guide](https://cloud.google.com/dialogflow/docs/api-overview).
|
189
214
|
#
|
190
215
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
191
216
|
# Defaults to `:v2`.
|
192
|
-
# @return [
|
217
|
+
# @return [Sessions::Client] A client object for the specified version.
|
193
218
|
#
|
194
|
-
def self.
|
219
|
+
def self.sessions version: :v2, &block
|
195
220
|
require "google/cloud/dialogflow/#{version.to_s.downcase}"
|
196
221
|
|
197
222
|
package_name = Google::Cloud::Dialogflow
|
@@ -199,29 +224,29 @@ module Google
|
|
199
224
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
200
225
|
.first
|
201
226
|
package_module = Google::Cloud::Dialogflow.const_get package_name
|
202
|
-
package_module.const_get(:
|
227
|
+
package_module.const_get(:Sessions).const_get(:Client).new(&block)
|
203
228
|
end
|
204
229
|
|
205
230
|
##
|
206
|
-
# Create a new client object for
|
231
|
+
# Create a new client object for Participants.
|
207
232
|
#
|
208
233
|
# By default, this returns an instance of
|
209
|
-
# [Google::Cloud::Dialogflow::V2::
|
234
|
+
# [Google::Cloud::Dialogflow::V2::Participants::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/Participants/Client.html)
|
210
235
|
# for version V2 of the API.
|
211
236
|
# However, you can specify specify a different API version by passing it in the
|
212
|
-
# `version` parameter. If the
|
237
|
+
# `version` parameter. If the Participants service is
|
213
238
|
# supported by that API version, and the corresponding gem is available, the
|
214
239
|
# appropriate versioned client will be returned.
|
215
240
|
#
|
216
|
-
# ## About
|
241
|
+
# ## About Participants
|
217
242
|
#
|
218
|
-
#
|
243
|
+
# Service for managing Participants.
|
219
244
|
#
|
220
245
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
221
246
|
# Defaults to `:v2`.
|
222
|
-
# @return [
|
247
|
+
# @return [Participants::Client] A client object for the specified version.
|
223
248
|
#
|
224
|
-
def self.
|
249
|
+
def self.participants version: :v2, &block
|
225
250
|
require "google/cloud/dialogflow/#{version.to_s.downcase}"
|
226
251
|
|
227
252
|
package_name = Google::Cloud::Dialogflow
|
@@ -229,60 +254,29 @@ module Google
|
|
229
254
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
230
255
|
.first
|
231
256
|
package_module = Google::Cloud::Dialogflow.const_get package_name
|
232
|
-
package_module.const_get(:
|
257
|
+
package_module.const_get(:Participants).const_get(:Client).new(&block)
|
233
258
|
end
|
234
259
|
|
235
260
|
##
|
236
|
-
# Create a new client object for
|
261
|
+
# Create a new client object for AnswerRecords.
|
237
262
|
#
|
238
263
|
# By default, this returns an instance of
|
239
|
-
# [Google::Cloud::Dialogflow::V2::
|
264
|
+
# [Google::Cloud::Dialogflow::V2::AnswerRecords::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/AnswerRecords/Client.html)
|
240
265
|
# for version V2 of the API.
|
241
266
|
# However, you can specify specify a different API version by passing it in the
|
242
|
-
# `version` parameter. If the
|
267
|
+
# `version` parameter. If the AnswerRecords service is
|
243
268
|
# supported by that API version, and the corresponding gem is available, the
|
244
269
|
# appropriate versioned client will be returned.
|
245
270
|
#
|
246
|
-
# ## About
|
271
|
+
# ## About AnswerRecords
|
247
272
|
#
|
248
|
-
#
|
249
|
-
# be taken by your application. When you pass user input to the
|
250
|
-
# DetectIntent (or
|
251
|
-
# StreamingDetectIntent) method, the
|
252
|
-
# Dialogflow API analyzes the input and searches
|
253
|
-
# for a matching intent. If no match is found, the Dialogflow API returns a
|
254
|
-
# fallback intent (`is_fallback` = true).
|
255
|
-
#
|
256
|
-
# You can provide additional information for the Dialogflow API to use to
|
257
|
-
# match user input to an intent by adding the following to your intent.
|
258
|
-
#
|
259
|
-
# * **Contexts** - provide additional context for intent analysis. For
|
260
|
-
# example, if an intent is related to an object in your application that
|
261
|
-
# plays music, you can provide a context to determine when to match the
|
262
|
-
# intent if the user input is "turn it off". You can include a context
|
263
|
-
# that matches the intent when there is previous user input of
|
264
|
-
# "play music", and not when there is previous user input of
|
265
|
-
# "turn on the light".
|
266
|
-
#
|
267
|
-
# * **Events** - allow for matching an intent by using an event name
|
268
|
-
# instead of user input. Your application can provide an event name and
|
269
|
-
# related parameters to the Dialogflow API to match an intent. For
|
270
|
-
# example, when your application starts, you can send a welcome event
|
271
|
-
# with a user name parameter to the Dialogflow API to match an intent with
|
272
|
-
# a personalized welcome message for the user.
|
273
|
-
#
|
274
|
-
# * **Training phrases** - provide examples of user input to train the
|
275
|
-
# Dialogflow API agent to better match intents.
|
276
|
-
#
|
277
|
-
# For more information about intents, see the
|
278
|
-
# [Dialogflow
|
279
|
-
# documentation](https://cloud.google.com/dialogflow/docs/intents-overview).
|
273
|
+
# Service for managing AnswerRecords.
|
280
274
|
#
|
281
275
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
282
276
|
# Defaults to `:v2`.
|
283
|
-
# @return [
|
277
|
+
# @return [AnswerRecords::Client] A client object for the specified version.
|
284
278
|
#
|
285
|
-
def self.
|
279
|
+
def self.answer_records version: :v2, &block
|
286
280
|
require "google/cloud/dialogflow/#{version.to_s.downcase}"
|
287
281
|
|
288
282
|
package_name = Google::Cloud::Dialogflow
|
@@ -290,45 +284,59 @@ module Google
|
|
290
284
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
291
285
|
.first
|
292
286
|
package_module = Google::Cloud::Dialogflow.const_get package_name
|
293
|
-
package_module.const_get(:
|
287
|
+
package_module.const_get(:AnswerRecords).const_get(:Client).new(&block)
|
294
288
|
end
|
295
289
|
|
296
290
|
##
|
297
|
-
# Create a new client object for
|
291
|
+
# Create a new client object for Conversations.
|
298
292
|
#
|
299
293
|
# By default, this returns an instance of
|
300
|
-
# [Google::Cloud::Dialogflow::V2::
|
294
|
+
# [Google::Cloud::Dialogflow::V2::Conversations::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/Conversations/Client.html)
|
301
295
|
# for version V2 of the API.
|
302
296
|
# However, you can specify specify a different API version by passing it in the
|
303
|
-
# `version` parameter. If the
|
297
|
+
# `version` parameter. If the Conversations service is
|
304
298
|
# supported by that API version, and the corresponding gem is available, the
|
305
299
|
# appropriate versioned client will be returned.
|
306
300
|
#
|
307
|
-
# ## About
|
301
|
+
# ## About Conversations
|
302
|
+
#
|
303
|
+
# Service for managing Conversations.
|
304
|
+
#
|
305
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
306
|
+
# Defaults to `:v2`.
|
307
|
+
# @return [Conversations::Client] A client object for the specified version.
|
308
308
|
#
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
309
|
+
def self.conversations version: :v2, &block
|
310
|
+
require "google/cloud/dialogflow/#{version.to_s.downcase}"
|
311
|
+
|
312
|
+
package_name = Google::Cloud::Dialogflow
|
313
|
+
.constants
|
314
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
315
|
+
.first
|
316
|
+
package_module = Google::Cloud::Dialogflow.const_get package_name
|
317
|
+
package_module.const_get(:Conversations).const_get(:Client).new(&block)
|
318
|
+
end
|
319
|
+
|
320
|
+
##
|
321
|
+
# Create a new client object for ConversationProfiles.
|
313
322
|
#
|
314
|
-
#
|
315
|
-
#
|
316
|
-
#
|
317
|
-
#
|
323
|
+
# By default, this returns an instance of
|
324
|
+
# [Google::Cloud::Dialogflow::V2::ConversationProfiles::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/ConversationProfiles/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 ConversationProfiles service is
|
328
|
+
# supported by that API version, and the corresponding gem is available, the
|
329
|
+
# appropriate versioned client will be returned.
|
318
330
|
#
|
319
|
-
#
|
320
|
-
# Contact Dialogflow support if you need to use session entities
|
321
|
-
# with Google Assistant integration.
|
331
|
+
# ## About ConversationProfiles
|
322
332
|
#
|
323
|
-
#
|
324
|
-
# [Dialogflow
|
325
|
-
# documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
|
333
|
+
# Service for managing ConversationProfiles.
|
326
334
|
#
|
327
335
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
328
336
|
# Defaults to `:v2`.
|
329
|
-
# @return [
|
337
|
+
# @return [ConversationProfiles::Client] A client object for the specified version.
|
330
338
|
#
|
331
|
-
def self.
|
339
|
+
def self.conversation_profiles version: :v2, &block
|
332
340
|
require "google/cloud/dialogflow/#{version.to_s.downcase}"
|
333
341
|
|
334
342
|
package_name = Google::Cloud::Dialogflow
|
@@ -336,32 +344,29 @@ module Google
|
|
336
344
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
337
345
|
.first
|
338
346
|
package_module = Google::Cloud::Dialogflow.const_get package_name
|
339
|
-
package_module.const_get(:
|
347
|
+
package_module.const_get(:ConversationProfiles).const_get(:Client).new(&block)
|
340
348
|
end
|
341
349
|
|
342
350
|
##
|
343
|
-
# Create a new client object for
|
351
|
+
# Create a new client object for Documents.
|
344
352
|
#
|
345
353
|
# By default, this returns an instance of
|
346
|
-
# [Google::Cloud::Dialogflow::V2::
|
354
|
+
# [Google::Cloud::Dialogflow::V2::Documents::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/Documents/Client.html)
|
347
355
|
# for version V2 of the API.
|
348
356
|
# However, you can specify specify a different API version by passing it in the
|
349
|
-
# `version` parameter. If the
|
357
|
+
# `version` parameter. If the Documents service is
|
350
358
|
# supported by that API version, and the corresponding gem is available, the
|
351
359
|
# appropriate versioned client will be returned.
|
352
360
|
#
|
353
|
-
# ## About
|
361
|
+
# ## About Documents
|
354
362
|
#
|
355
|
-
#
|
356
|
-
# and pass it to the DetectIntent (or
|
357
|
-
# StreamingDetectIntent) method to determine
|
358
|
-
# user intent and respond.
|
363
|
+
# Service for managing knowledge Documents.
|
359
364
|
#
|
360
365
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
361
366
|
# Defaults to `:v2`.
|
362
|
-
# @return [
|
367
|
+
# @return [Documents::Client] A client object for the specified version.
|
363
368
|
#
|
364
|
-
def self.
|
369
|
+
def self.documents version: :v2, &block
|
365
370
|
require "google/cloud/dialogflow/#{version.to_s.downcase}"
|
366
371
|
|
367
372
|
package_name = Google::Cloud::Dialogflow
|
@@ -369,7 +374,67 @@ module Google
|
|
369
374
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
370
375
|
.first
|
371
376
|
package_module = Google::Cloud::Dialogflow.const_get package_name
|
372
|
-
package_module.const_get(:
|
377
|
+
package_module.const_get(:Documents).const_get(:Client).new(&block)
|
378
|
+
end
|
379
|
+
|
380
|
+
##
|
381
|
+
# Create a new client object for Environments.
|
382
|
+
#
|
383
|
+
# By default, this returns an instance of
|
384
|
+
# [Google::Cloud::Dialogflow::V2::Environments::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/Environments/Client.html)
|
385
|
+
# for version V2 of the API.
|
386
|
+
# However, you can specify specify a different API version by passing it in the
|
387
|
+
# `version` parameter. If the Environments service is
|
388
|
+
# supported by that API version, and the corresponding gem is available, the
|
389
|
+
# appropriate versioned client will be returned.
|
390
|
+
#
|
391
|
+
# ## About Environments
|
392
|
+
#
|
393
|
+
# Service for managing Environments.
|
394
|
+
#
|
395
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
396
|
+
# Defaults to `:v2`.
|
397
|
+
# @return [Environments::Client] A client object for the specified version.
|
398
|
+
#
|
399
|
+
def self.environments version: :v2, &block
|
400
|
+
require "google/cloud/dialogflow/#{version.to_s.downcase}"
|
401
|
+
|
402
|
+
package_name = Google::Cloud::Dialogflow
|
403
|
+
.constants
|
404
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
405
|
+
.first
|
406
|
+
package_module = Google::Cloud::Dialogflow.const_get package_name
|
407
|
+
package_module.const_get(:Environments).const_get(:Client).new(&block)
|
408
|
+
end
|
409
|
+
|
410
|
+
##
|
411
|
+
# Create a new client object for KnowledgeBases.
|
412
|
+
#
|
413
|
+
# By default, this returns an instance of
|
414
|
+
# [Google::Cloud::Dialogflow::V2::KnowledgeBases::Client](https://googleapis.dev/ruby/google-cloud-dialogflow-v2/latest/Google/Cloud/Dialogflow/V2/KnowledgeBases/Client.html)
|
415
|
+
# for version V2 of the API.
|
416
|
+
# However, you can specify specify a different API version by passing it in the
|
417
|
+
# `version` parameter. If the KnowledgeBases service is
|
418
|
+
# supported by that API version, and the corresponding gem is available, the
|
419
|
+
# appropriate versioned client will be returned.
|
420
|
+
#
|
421
|
+
# ## About KnowledgeBases
|
422
|
+
#
|
423
|
+
# Service for managing KnowledgeBases.
|
424
|
+
#
|
425
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
426
|
+
# Defaults to `:v2`.
|
427
|
+
# @return [KnowledgeBases::Client] A client object for the specified version.
|
428
|
+
#
|
429
|
+
def self.knowledge_bases version: :v2, &block
|
430
|
+
require "google/cloud/dialogflow/#{version.to_s.downcase}"
|
431
|
+
|
432
|
+
package_name = Google::Cloud::Dialogflow
|
433
|
+
.constants
|
434
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
435
|
+
.first
|
436
|
+
package_module = Google::Cloud::Dialogflow.const_get package_name
|
437
|
+
package_module.const_get(:KnowledgeBases).const_get(:Client).new(&block)
|
373
438
|
end
|
374
439
|
|
375
440
|
##
|
@@ -386,8 +451,8 @@ module Google
|
|
386
451
|
# The library version as recorded in instrumentation and logging.
|
387
452
|
# * `interceptors` (*type:* `Array<GRPC::ClientInterceptor>`) -
|
388
453
|
# An array of interceptors that are run before calls are executed.
|
389
|
-
# * `timeout` (*type:* `
|
390
|
-
# Default timeout in
|
454
|
+
# * `timeout` (*type:* `Numeric`) -
|
455
|
+
# Default timeout in seconds.
|
391
456
|
# * `metadata` (*type:* `Hash{Symbol=>String}`) -
|
392
457
|
# Additional gRPC headers to be sent with the call.
|
393
458
|
# * `retry_policy` (*type:* `Hash`) -
|
@@ -408,3 +473,6 @@ module Google
|
|
408
473
|
end
|
409
474
|
end
|
410
475
|
end
|
476
|
+
|
477
|
+
helper_path = ::File.join __dir__, "dialogflow", "helpers.rb"
|
478
|
+
require "google/cloud/dialogflow/helpers" if ::File.file? helper_path
|
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.
|
4
|
+
version: 1.2.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:
|
11
|
+
date: 2021-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-core
|
@@ -38,34 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0.1'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: autotest-suffix
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '1.1'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '1.1'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: google-style
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
45
|
- - "~>"
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
47
|
+
version: 1.25.1
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
52
|
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
54
|
+
version: 1.25.1
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: minitest
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,20 +66,6 @@ dependencies:
|
|
80
66
|
- - "~>"
|
81
67
|
- !ruby/object:Gem::Version
|
82
68
|
version: '5.14'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: minitest-autotest
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '1.0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '1.0'
|
97
69
|
- !ruby/object:Gem::Dependency
|
98
70
|
name: minitest-focus
|
99
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -208,14 +180,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
208
180
|
requirements:
|
209
181
|
- - ">="
|
210
182
|
- !ruby/object:Gem::Version
|
211
|
-
version: '2.
|
183
|
+
version: '2.5'
|
212
184
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
213
185
|
requirements:
|
214
186
|
- - ">="
|
215
187
|
- !ruby/object:Gem::Version
|
216
188
|
version: '0'
|
217
189
|
requirements: []
|
218
|
-
rubygems_version: 3.
|
190
|
+
rubygems_version: 3.2.13
|
219
191
|
signing_key:
|
220
192
|
specification_version: 4
|
221
193
|
summary: API Client library for the Dialogflow API
|