Dialogflow API C++ Client 2.13.0
A C++ Client Library for the Dialogflow API
Loading...
Searching...
No Matches
agents_client.h
1// Copyright 2022 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// Generated by the Codegen C++ plugin.
16// If you make any local changes, they will be lost.
17// source: google/cloud/dialogflow/v2/agent.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_AGENTS_CLIENT_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_AGENTS_CLIENT_H
21
22#include "google/cloud/dialogflow_es/agents_connection.h"
23#include "google/cloud/future.h"
24#include "google/cloud/options.h"
25#include "google/cloud/polling_policy.h"
26#include "google/cloud/status_or.h"
27#include "google/cloud/version.h"
28#include <google/longrunning/operations.grpc.pb.h>
29#include <memory>
30
31namespace google {
32namespace cloud {
33namespace dialogflow_es {
34GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
35
36///
37/// Service for managing [Agents][google.cloud.dialogflow.v2.Agent].
38///
39/// @par Equality
40///
41/// Instances of this class created via copy-construction or copy-assignment
42/// always compare equal. Instances created with equal
43/// `std::shared_ptr<*Connection>` objects compare equal. Objects that compare
44/// equal share the same underlying resources.
45///
46/// @par Performance
47///
48/// Creating a new instance of this class is a relatively expensive operation,
49/// new objects establish new connections to the service. In contrast,
50/// copy-construction, move-construction, and the corresponding assignment
51/// operations are relatively efficient as the copies share all underlying
52/// resources.
53///
54/// @par Thread Safety
55///
56/// Concurrent access to different instances of this class, even if they compare
57/// equal, is guaranteed to work. Two or more threads operating on the same
58/// instance of this class is not guaranteed to work. Since copy-construction
59/// and move-construction is a relatively efficient operation, consider using
60/// such a copy when using this class from multiple threads.
61///
62/// [google.cloud.dialogflow.v2.Agent]:
63/// @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L259}
64///
65class AgentsClient {
66 public:
67 explicit AgentsClient(std::shared_ptr<AgentsConnection> connection,
68 Options opts = {});
69 ~AgentsClient();
70
71 ///@{
72 /// @name Copy and move support
73 AgentsClient(AgentsClient const&) = default;
74 AgentsClient& operator=(AgentsClient const&) = default;
75 AgentsClient(AgentsClient&&) = default;
76 AgentsClient& operator=(AgentsClient&&) = default;
77 ///@}
78
79 ///@{
80 /// @name Equality
81 friend bool operator==(AgentsClient const& a, AgentsClient const& b) {
82 return a.connection_ == b.connection_;
83 }
84 friend bool operator!=(AgentsClient const& a, AgentsClient const& b) {
85 return !(a == b);
86 }
87 ///@}
88
89 // clang-format off
90 ///
91 /// Retrieves the specified agent.
92 ///
93 /// @param parent Required. The project that the agent to fetch is associated with.
94 /// Format: `projects/<Project ID>`.
95 /// @param opts Optional. Override the class-level options, such as retry and
96 /// backoff policies.
97 /// @return the result of the RPC. The response message type
98 /// ([google.cloud.dialogflow.v2.Agent])
99 /// is mapped to a C++ class using the [Protobuf mapping rules].
100 /// If the request fails, the [`StatusOr`] contains the error details.
101 ///
102 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
103 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
104 /// [Long Running Operation]: https://google.aip.dev/151
105 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
106 /// [`future`]: @ref google::cloud::future
107 /// [`StatusOr`]: @ref google::cloud::StatusOr
108 /// [`Status`]: @ref google::cloud::Status
109 /// [google.cloud.dialogflow.v2.Agent]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L259}
110 /// [google.cloud.dialogflow.v2.GetAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L379}
111 ///
112 // clang-format on
113 StatusOr<google::cloud::dialogflow::v2::Agent> GetAgent(
114 std::string const& parent, Options opts = {});
115
116 // clang-format off
117 ///
118 /// Retrieves the specified agent.
119 ///
120 /// @param request Unary RPCs, such as the one wrapped by this
121 /// function, receive a single `request` proto message which includes all
122 /// the inputs for the RPC. In this case, the proto message is a
123 /// [google.cloud.dialogflow.v2.GetAgentRequest].
124 /// Proto messages are converted to C++ classes by Protobuf, using the
125 /// [Protobuf mapping rules].
126 /// @param opts Optional. Override the class-level options, such as retry and
127 /// backoff policies.
128 /// @return the result of the RPC. The response message type
129 /// ([google.cloud.dialogflow.v2.Agent])
130 /// is mapped to a C++ class using the [Protobuf mapping rules].
131 /// If the request fails, the [`StatusOr`] contains the error details.
132 ///
133 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
134 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
135 /// [Long Running Operation]: https://google.aip.dev/151
136 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
137 /// [`future`]: @ref google::cloud::future
138 /// [`StatusOr`]: @ref google::cloud::StatusOr
139 /// [`Status`]: @ref google::cloud::Status
140 /// [google.cloud.dialogflow.v2.Agent]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L259}
141 /// [google.cloud.dialogflow.v2.GetAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L379}
142 ///
143 // clang-format on
144 StatusOr<google::cloud::dialogflow::v2::Agent> GetAgent(
145 google::cloud::dialogflow::v2::GetAgentRequest const& request,
146 Options opts = {});
147
148 // clang-format off
149 ///
150 /// Creates/updates the specified agent.
151 ///
152 /// Note: You should always train an agent prior to sending it queries. See the
153 /// [training
154 /// documentation](https://cloud.google.com/dialogflow/es/docs/training).
155 ///
156 /// @param agent Required. The agent to update.
157 /// @param opts Optional. Override the class-level options, such as retry and
158 /// backoff policies.
159 /// @return the result of the RPC. The response message type
160 /// ([google.cloud.dialogflow.v2.Agent])
161 /// is mapped to a C++ class using the [Protobuf mapping rules].
162 /// If the request fails, the [`StatusOr`] contains the error details.
163 ///
164 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
165 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
166 /// [Long Running Operation]: https://google.aip.dev/151
167 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
168 /// [`future`]: @ref google::cloud::future
169 /// [`StatusOr`]: @ref google::cloud::StatusOr
170 /// [`Status`]: @ref google::cloud::Status
171 /// [google.cloud.dialogflow.v2.Agent]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L259}
172 /// [google.cloud.dialogflow.v2.SetAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L392}
173 ///
174 // clang-format on
175 StatusOr<google::cloud::dialogflow::v2::Agent> SetAgent(
176 google::cloud::dialogflow::v2::Agent const& agent, Options opts = {});
177
178 // clang-format off
179 ///
180 /// Creates/updates the specified agent.
181 ///
182 /// Note: You should always train an agent prior to sending it queries. See the
183 /// [training
184 /// documentation](https://cloud.google.com/dialogflow/es/docs/training).
185 ///
186 /// @param request Unary RPCs, such as the one wrapped by this
187 /// function, receive a single `request` proto message which includes all
188 /// the inputs for the RPC. In this case, the proto message is a
189 /// [google.cloud.dialogflow.v2.SetAgentRequest].
190 /// Proto messages are converted to C++ classes by Protobuf, using the
191 /// [Protobuf mapping rules].
192 /// @param opts Optional. Override the class-level options, such as retry and
193 /// backoff policies.
194 /// @return the result of the RPC. The response message type
195 /// ([google.cloud.dialogflow.v2.Agent])
196 /// is mapped to a C++ class using the [Protobuf mapping rules].
197 /// If the request fails, the [`StatusOr`] contains the error details.
198 ///
199 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
200 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
201 /// [Long Running Operation]: https://google.aip.dev/151
202 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
203 /// [`future`]: @ref google::cloud::future
204 /// [`StatusOr`]: @ref google::cloud::StatusOr
205 /// [`Status`]: @ref google::cloud::Status
206 /// [google.cloud.dialogflow.v2.Agent]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L259}
207 /// [google.cloud.dialogflow.v2.SetAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L392}
208 ///
209 // clang-format on
210 StatusOr<google::cloud::dialogflow::v2::Agent> SetAgent(
211 google::cloud::dialogflow::v2::SetAgentRequest const& request,
212 Options opts = {});
213
214 // clang-format off
215 ///
216 /// Deletes the specified agent.
217 ///
218 /// @param parent Required. The project that the agent to delete is associated with.
219 /// Format: `projects/<Project ID>`.
220 /// @param opts Optional. Override the class-level options, such as retry and
221 /// backoff policies.
222 /// @return a [`Status`] object. If the request failed, the
223 /// status contains the details of the failure.
224 ///
225 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
226 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
227 /// [Long Running Operation]: https://google.aip.dev/151
228 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
229 /// [`future`]: @ref google::cloud::future
230 /// [`StatusOr`]: @ref google::cloud::StatusOr
231 /// [`Status`]: @ref google::cloud::Status
232 /// [google.cloud.dialogflow.v2.DeleteAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L403}
233 ///
234 // clang-format on
235 Status DeleteAgent(std::string const& parent, Options opts = {});
236
237 // clang-format off
238 ///
239 /// Deletes the specified agent.
240 ///
241 /// @param request Unary RPCs, such as the one wrapped by this
242 /// function, receive a single `request` proto message which includes all
243 /// the inputs for the RPC. In this case, the proto message is a
244 /// [google.cloud.dialogflow.v2.DeleteAgentRequest].
245 /// Proto messages are converted to C++ classes by Protobuf, using the
246 /// [Protobuf mapping rules].
247 /// @param opts Optional. Override the class-level options, such as retry and
248 /// backoff policies.
249 /// @return a [`Status`] object. If the request failed, the
250 /// status contains the details of the failure.
251 ///
252 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
253 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
254 /// [Long Running Operation]: https://google.aip.dev/151
255 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
256 /// [`future`]: @ref google::cloud::future
257 /// [`StatusOr`]: @ref google::cloud::StatusOr
258 /// [`Status`]: @ref google::cloud::Status
259 /// [google.cloud.dialogflow.v2.DeleteAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L403}
260 ///
261 // clang-format on
263 google::cloud::dialogflow::v2::DeleteAgentRequest const& request,
264 Options opts = {});
265
266 // clang-format off
267 ///
268 /// Returns the list of agents.
269 ///
270 /// Since there is at most one conversational agent per project, this method is
271 /// useful primarily for listing all agents across projects the caller has
272 /// access to. One can achieve that with a wildcard project collection id "-".
273 /// Refer to [List
274 /// Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections).
275 ///
276 /// @param parent Required. The project to list agents from.
277 /// Format: ``projects/<Project ID or '-'>``.
278 /// @param opts Optional. Override the class-level options, such as retry and
279 /// backoff policies.
280 /// @return a [StreamRange](@ref google::cloud::StreamRange)
281 /// to iterate of the results. See the documentation of this type for
282 /// details. In brief, this class has `begin()` and `end()` member
283 /// functions returning a iterator class meeting the
284 /// [input iterator requirements]. The value type for this iterator is a
285 /// [`StatusOr`] as the iteration may fail even after some values are
286 /// retrieved successfully, for example, if there is a network disconnect.
287 /// An empty set of results does not indicate an error, it indicates
288 /// that there are no resources meeting the request criteria.
289 /// On a successful iteration the `StatusOr<T>` contains elements of type
290 /// [google.cloud.dialogflow.v2.Agent], or rather,
291 /// the C++ class generated by Protobuf from that type. Please consult the
292 /// Protobuf documentation for details on the [Protobuf mapping rules].
293 ///
294 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
295 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
296 /// [Long Running Operation]: https://google.aip.dev/151
297 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
298 /// [`future`]: @ref google::cloud::future
299 /// [`StatusOr`]: @ref google::cloud::StatusOr
300 /// [`Status`]: @ref google::cloud::Status
301 /// [google.cloud.dialogflow.v2.Agent]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L259}
302 /// [google.cloud.dialogflow.v2.SearchAgentsRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L416}
303 ///
304 // clang-format on
305 StreamRange<google::cloud::dialogflow::v2::Agent> SearchAgents(
306 std::string const& parent, Options opts = {});
307
308 // clang-format off
309 ///
310 /// Returns the list of agents.
311 ///
312 /// Since there is at most one conversational agent per project, this method is
313 /// useful primarily for listing all agents across projects the caller has
314 /// access to. One can achieve that with a wildcard project collection id "-".
315 /// Refer to [List
316 /// Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections).
317 ///
318 /// @param request Unary RPCs, such as the one wrapped by this
319 /// function, receive a single `request` proto message which includes all
320 /// the inputs for the RPC. In this case, the proto message is a
321 /// [google.cloud.dialogflow.v2.SearchAgentsRequest].
322 /// Proto messages are converted to C++ classes by Protobuf, using the
323 /// [Protobuf mapping rules].
324 /// @param opts Optional. Override the class-level options, such as retry and
325 /// backoff policies.
326 /// @return a [StreamRange](@ref google::cloud::StreamRange)
327 /// to iterate of the results. See the documentation of this type for
328 /// details. In brief, this class has `begin()` and `end()` member
329 /// functions returning a iterator class meeting the
330 /// [input iterator requirements]. The value type for this iterator is a
331 /// [`StatusOr`] as the iteration may fail even after some values are
332 /// retrieved successfully, for example, if there is a network disconnect.
333 /// An empty set of results does not indicate an error, it indicates
334 /// that there are no resources meeting the request criteria.
335 /// On a successful iteration the `StatusOr<T>` contains elements of type
336 /// [google.cloud.dialogflow.v2.Agent], or rather,
337 /// the C++ class generated by Protobuf from that type. Please consult the
338 /// Protobuf documentation for details on the [Protobuf mapping rules].
339 ///
340 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
341 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
342 /// [Long Running Operation]: https://google.aip.dev/151
343 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
344 /// [`future`]: @ref google::cloud::future
345 /// [`StatusOr`]: @ref google::cloud::StatusOr
346 /// [`Status`]: @ref google::cloud::Status
347 /// [google.cloud.dialogflow.v2.Agent]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L259}
348 /// [google.cloud.dialogflow.v2.SearchAgentsRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L416}
349 ///
350 // clang-format on
351 StreamRange<google::cloud::dialogflow::v2::Agent> SearchAgents(
352 google::cloud::dialogflow::v2::SearchAgentsRequest request,
353 Options opts = {});
354
355 // clang-format off
356 ///
357 /// Trains the specified agent.
358 ///
359 /// This method is a [long-running
360 /// operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
361 /// The returned `Operation` type has the following method-specific fields:
362 ///
363 /// - `metadata`: An empty [Struct
364 /// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
365 /// - `response`: An [Empty
366 /// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
367 ///
368 /// Note: You should always train an agent prior to sending it queries. See the
369 /// [training
370 /// documentation](https://cloud.google.com/dialogflow/es/docs/training).
371 ///
372 /// @param parent Required. The project that the agent to train is associated with.
373 /// Format: `projects/<Project ID>`.
374 /// @param opts Optional. Override the class-level options, such as retry and
375 /// backoff policies.
376 /// @return A [`future`] that becomes satisfied when the LRO
377 /// ([Long Running Operation]) completes or the polling policy in effect
378 /// for this call is exhausted. The future is satisfied with an error if
379 /// the LRO completes with an error or the polling policy is exhausted.
380 /// In this case the [`StatusOr`] returned by the future contains the
381 /// error. If the LRO completes successfully the value of the future
382 /// contains the LRO's result. For this RPC the result is a
383 /// [google.protobuf.Struct] proto message.
384 /// The C++ class representing this message is created by Protobuf, using
385 /// the [Protobuf mapping rules].
386 ///
387 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
388 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
389 /// [Long Running Operation]: https://google.aip.dev/151
390 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
391 /// [`future`]: @ref google::cloud::future
392 /// [`StatusOr`]: @ref google::cloud::StatusOr
393 /// [`Status`]: @ref google::cloud::Status
394 /// [google.cloud.dialogflow.v2.TrainAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L448}
395 /// [google.protobuf.Struct]: @googleapis_reference_link{google/protobuf/struct.proto#L51}
396 ///
397 // clang-format on
398 future<StatusOr<google::protobuf::Struct>> TrainAgent(
399 std::string const& parent, Options opts = {});
400
401 // clang-format off
402 ///
403 /// Trains the specified agent.
404 ///
405 /// This method is a [long-running
406 /// operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
407 /// The returned `Operation` type has the following method-specific fields:
408 ///
409 /// - `metadata`: An empty [Struct
410 /// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
411 /// - `response`: An [Empty
412 /// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
413 ///
414 /// Note: You should always train an agent prior to sending it queries. See the
415 /// [training
416 /// documentation](https://cloud.google.com/dialogflow/es/docs/training).
417 ///
418 /// @param request Unary RPCs, such as the one wrapped by this
419 /// function, receive a single `request` proto message which includes all
420 /// the inputs for the RPC. In this case, the proto message is a
421 /// [google.cloud.dialogflow.v2.TrainAgentRequest].
422 /// Proto messages are converted to C++ classes by Protobuf, using the
423 /// [Protobuf mapping rules].
424 /// @param opts Optional. Override the class-level options, such as retry and
425 /// backoff policies.
426 /// @return A [`future`] that becomes satisfied when the LRO
427 /// ([Long Running Operation]) completes or the polling policy in effect
428 /// for this call is exhausted. The future is satisfied with an error if
429 /// the LRO completes with an error or the polling policy is exhausted.
430 /// In this case the [`StatusOr`] returned by the future contains the
431 /// error. If the LRO completes successfully the value of the future
432 /// contains the LRO's result. For this RPC the result is a
433 /// [google.protobuf.Struct] proto message.
434 /// The C++ class representing this message is created by Protobuf, using
435 /// the [Protobuf mapping rules].
436 ///
437 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
438 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
439 /// [Long Running Operation]: https://google.aip.dev/151
440 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
441 /// [`future`]: @ref google::cloud::future
442 /// [`StatusOr`]: @ref google::cloud::StatusOr
443 /// [`Status`]: @ref google::cloud::Status
444 /// [google.cloud.dialogflow.v2.TrainAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L448}
445 /// [google.protobuf.Struct]: @googleapis_reference_link{google/protobuf/struct.proto#L51}
446 ///
447 // clang-format on
448 future<StatusOr<google::protobuf::Struct>> TrainAgent(
449 google::cloud::dialogflow::v2::TrainAgentRequest const& request,
450 Options opts = {});
451
452 // clang-format off
453 ///
454 /// Exports the specified agent to a ZIP file.
455 ///
456 /// This method is a [long-running
457 /// operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
458 /// The returned `Operation` type has the following method-specific fields:
459 ///
460 /// - `metadata`: An empty [Struct
461 /// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
462 /// - `response`:
463 /// [ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse]
464 ///
465 /// @param parent Required. The project that the agent to export is associated with.
466 /// Format: `projects/<Project ID>`.
467 /// @param opts Optional. Override the class-level options, such as retry and
468 /// backoff policies.
469 /// @return A [`future`] that becomes satisfied when the LRO
470 /// ([Long Running Operation]) completes or the polling policy in effect
471 /// for this call is exhausted. The future is satisfied with an error if
472 /// the LRO completes with an error or the polling policy is exhausted.
473 /// In this case the [`StatusOr`] returned by the future contains the
474 /// error. If the LRO completes successfully the value of the future
475 /// contains the LRO's result. For this RPC the result is a
476 /// [google.cloud.dialogflow.v2.ExportAgentResponse] proto message.
477 /// The C++ class representing this message is created by Protobuf, using
478 /// the [Protobuf mapping rules].
479 ///
480 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
481 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
482 /// [Long Running Operation]: https://google.aip.dev/151
483 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
484 /// [`future`]: @ref google::cloud::future
485 /// [`StatusOr`]: @ref google::cloud::StatusOr
486 /// [`Status`]: @ref google::cloud::Status
487 /// [google.cloud.dialogflow.v2.ExportAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L461}
488 /// [google.cloud.dialogflow.v2.ExportAgentResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L486}
489 ///
490 // clang-format on
491 future<StatusOr<google::cloud::dialogflow::v2::ExportAgentResponse>>
492 ExportAgent(std::string const& parent, Options opts = {});
493
494 // clang-format off
495 ///
496 /// Exports the specified agent to a ZIP file.
497 ///
498 /// This method is a [long-running
499 /// operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
500 /// The returned `Operation` type has the following method-specific fields:
501 ///
502 /// - `metadata`: An empty [Struct
503 /// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
504 /// - `response`:
505 /// [ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse]
506 ///
507 /// @param request Unary RPCs, such as the one wrapped by this
508 /// function, receive a single `request` proto message which includes all
509 /// the inputs for the RPC. In this case, the proto message is a
510 /// [google.cloud.dialogflow.v2.ExportAgentRequest].
511 /// Proto messages are converted to C++ classes by Protobuf, using the
512 /// [Protobuf mapping rules].
513 /// @param opts Optional. Override the class-level options, such as retry and
514 /// backoff policies.
515 /// @return A [`future`] that becomes satisfied when the LRO
516 /// ([Long Running Operation]) completes or the polling policy in effect
517 /// for this call is exhausted. The future is satisfied with an error if
518 /// the LRO completes with an error or the polling policy is exhausted.
519 /// In this case the [`StatusOr`] returned by the future contains the
520 /// error. If the LRO completes successfully the value of the future
521 /// contains the LRO's result. For this RPC the result is a
522 /// [google.cloud.dialogflow.v2.ExportAgentResponse] proto message.
523 /// The C++ class representing this message is created by Protobuf, using
524 /// the [Protobuf mapping rules].
525 ///
526 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
527 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
528 /// [Long Running Operation]: https://google.aip.dev/151
529 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
530 /// [`future`]: @ref google::cloud::future
531 /// [`StatusOr`]: @ref google::cloud::StatusOr
532 /// [`Status`]: @ref google::cloud::Status
533 /// [google.cloud.dialogflow.v2.ExportAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L461}
534 /// [google.cloud.dialogflow.v2.ExportAgentResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L486}
535 ///
536 // clang-format on
537 future<StatusOr<google::cloud::dialogflow::v2::ExportAgentResponse>>
538 ExportAgent(google::cloud::dialogflow::v2::ExportAgentRequest const& request,
539 Options opts = {});
540
541 // clang-format off
542 ///
543 /// Imports the specified agent from a ZIP file.
544 ///
545 /// Uploads new intents and entity types without deleting the existing ones.
546 /// Intents and entity types with the same name are replaced with the new
547 /// versions from
548 /// [ImportAgentRequest][google.cloud.dialogflow.v2.ImportAgentRequest]. After
549 /// the import, the imported draft agent will be trained automatically (unless
550 /// disabled in agent settings). However, once the import is done, training may
551 /// not be completed yet. Please call
552 /// [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the
553 /// operation it returns in order to train explicitly.
554 ///
555 /// This method is a [long-running
556 /// operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
557 /// The returned `Operation` type has the following method-specific fields:
558 ///
559 /// - `metadata`: An empty [Struct
560 /// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
561 /// - `response`: An [Empty
562 /// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
563 ///
564 /// The operation only tracks when importing is complete, not when it is done
565 /// training.
566 ///
567 /// Note: You should always train an agent prior to sending it queries. See the
568 /// [training
569 /// documentation](https://cloud.google.com/dialogflow/es/docs/training).
570 ///
571 /// @param request Unary RPCs, such as the one wrapped by this
572 /// function, receive a single `request` proto message which includes all
573 /// the inputs for the RPC. In this case, the proto message is a
574 /// [google.cloud.dialogflow.v2.ImportAgentRequest].
575 /// Proto messages are converted to C++ classes by Protobuf, using the
576 /// [Protobuf mapping rules].
577 /// @param opts Optional. Override the class-level options, such as retry and
578 /// backoff policies.
579 /// @return A [`future`] that becomes satisfied when the LRO
580 /// ([Long Running Operation]) completes or the polling policy in effect
581 /// for this call is exhausted. The future is satisfied with an error if
582 /// the LRO completes with an error or the polling policy is exhausted.
583 /// In this case the [`StatusOr`] returned by the future contains the
584 /// error. If the LRO completes successfully the value of the future
585 /// contains the LRO's result. For this RPC the result is a
586 /// [google.protobuf.Struct] proto message.
587 /// The C++ class representing this message is created by Protobuf, using
588 /// the [Protobuf mapping rules].
589 ///
590 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
591 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
592 /// [Long Running Operation]: https://google.aip.dev/151
593 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
594 /// [`future`]: @ref google::cloud::future
595 /// [`StatusOr`]: @ref google::cloud::StatusOr
596 /// [`Status`]: @ref google::cloud::Status
597 /// [google.cloud.dialogflow.v2.Agents.TrainAgent]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L112}
598 /// [google.cloud.dialogflow.v2.ImportAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L500}
599 /// [google.protobuf.Struct]: @googleapis_reference_link{google/protobuf/struct.proto#L51}
600 ///
601 // clang-format on
602 future<StatusOr<google::protobuf::Struct>> ImportAgent(
603 google::cloud::dialogflow::v2::ImportAgentRequest const& request,
604 Options opts = {});
605
606 // clang-format off
607 ///
608 /// Restores the specified agent from a ZIP file.
609 ///
610 /// Replaces the current agent version with a new one. All the intents and
611 /// entity types in the older version are deleted. After the restore, the
612 /// restored draft agent will be trained automatically (unless disabled in
613 /// agent settings). However, once the restore is done, training may not be
614 /// completed yet. Please call
615 /// [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the
616 /// operation it returns in order to train explicitly.
617 ///
618 /// This method is a [long-running
619 /// operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
620 /// The returned `Operation` type has the following method-specific fields:
621 ///
622 /// - `metadata`: An empty [Struct
623 /// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
624 /// - `response`: An [Empty
625 /// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
626 ///
627 /// The operation only tracks when restoring is complete, not when it is done
628 /// training.
629 ///
630 /// Note: You should always train an agent prior to sending it queries. See the
631 /// [training
632 /// documentation](https://cloud.google.com/dialogflow/es/docs/training).
633 ///
634 /// @param request Unary RPCs, such as the one wrapped by this
635 /// function, receive a single `request` proto message which includes all
636 /// the inputs for the RPC. In this case, the proto message is a
637 /// [google.cloud.dialogflow.v2.RestoreAgentRequest].
638 /// Proto messages are converted to C++ classes by Protobuf, using the
639 /// [Protobuf mapping rules].
640 /// @param opts Optional. Override the class-level options, such as retry and
641 /// backoff policies.
642 /// @return A [`future`] that becomes satisfied when the LRO
643 /// ([Long Running Operation]) completes or the polling policy in effect
644 /// for this call is exhausted. The future is satisfied with an error if
645 /// the LRO completes with an error or the polling policy is exhausted.
646 /// In this case the [`StatusOr`] returned by the future contains the
647 /// error. If the LRO completes successfully the value of the future
648 /// contains the LRO's result. For this RPC the result is a
649 /// [google.protobuf.Struct] proto message.
650 /// The C++ class representing this message is created by Protobuf, using
651 /// the [Protobuf mapping rules].
652 ///
653 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
654 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
655 /// [Long Running Operation]: https://google.aip.dev/151
656 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
657 /// [`future`]: @ref google::cloud::future
658 /// [`StatusOr`]: @ref google::cloud::StatusOr
659 /// [`Status`]: @ref google::cloud::Status
660 /// [google.cloud.dialogflow.v2.Agents.TrainAgent]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L112}
661 /// [google.cloud.dialogflow.v2.RestoreAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L529}
662 /// [google.protobuf.Struct]: @googleapis_reference_link{google/protobuf/struct.proto#L51}
663 ///
664 // clang-format on
665 future<StatusOr<google::protobuf::Struct>> RestoreAgent(
666 google::cloud::dialogflow::v2::RestoreAgentRequest const& request,
667 Options opts = {});
668
669 // clang-format off
670 ///
671 /// Gets agent validation result. Agent validation is performed during
672 /// training time and is updated automatically when training is completed.
673 ///
674 /// @param request Unary RPCs, such as the one wrapped by this
675 /// function, receive a single `request` proto message which includes all
676 /// the inputs for the RPC. In this case, the proto message is a
677 /// [google.cloud.dialogflow.v2.GetValidationResultRequest].
678 /// Proto messages are converted to C++ classes by Protobuf, using the
679 /// [Protobuf mapping rules].
680 /// @param opts Optional. Override the class-level options, such as retry and
681 /// backoff policies.
682 /// @return the result of the RPC. The response message type
683 /// ([google.cloud.dialogflow.v2.ValidationResult])
684 /// is mapped to a C++ class using the [Protobuf mapping rules].
685 /// If the request fails, the [`StatusOr`] contains the error details.
686 ///
687 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
688 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
689 /// [Long Running Operation]: https://google.aip.dev/151
690 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
691 /// [`future`]: @ref google::cloud::future
692 /// [`StatusOr`]: @ref google::cloud::StatusOr
693 /// [`Status`]: @ref google::cloud::Status
694 /// [google.cloud.dialogflow.v2.GetValidationResultRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/agent.proto#L558}
695 /// [google.cloud.dialogflow.v2.ValidationResult]: @googleapis_reference_link{google/cloud/dialogflow/v2/validation_result.proto#L71}
696 ///
697 // clang-format on
698 StatusOr<google::cloud::dialogflow::v2::ValidationResult> GetValidationResult(
699 google::cloud::dialogflow::v2::GetValidationResultRequest const& request,
700 Options opts = {});
701
702 private:
703 std::shared_ptr<AgentsConnection> connection_;
704 Options options_;
705};
706
707GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
708} // namespace dialogflow_es
709} // namespace cloud
710} // namespace google
711
712#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_AGENTS_CLIENT_H
Service for managing Agents.
Definition: agents_client.h:65
StatusOr< google::cloud::dialogflow::v2::Agent > SetAgent(google::cloud::dialogflow::v2::Agent const &agent, Options opts={})
Creates/updates the specified agent.
future< StatusOr< google::cloud::dialogflow::v2::ExportAgentResponse > > ExportAgent(google::cloud::dialogflow::v2::ExportAgentRequest const &request, Options opts={})
Exports the specified agent to a ZIP file.
StatusOr< google::cloud::dialogflow::v2::Agent > GetAgent(google::cloud::dialogflow::v2::GetAgentRequest const &request, Options opts={})
Retrieves the specified agent.
future< StatusOr< google::protobuf::Struct > > RestoreAgent(google::cloud::dialogflow::v2::RestoreAgentRequest const &request, Options opts={})
Restores the specified agent from a ZIP file.
Status DeleteAgent(std::string const &parent, Options opts={})
Deletes the specified agent.
friend bool operator!=(AgentsClient const &a, AgentsClient const &b)
Definition: agents_client.h:84
StatusOr< google::cloud::dialogflow::v2::Agent > GetAgent(std::string const &parent, Options opts={})
Retrieves the specified agent.
StreamRange< google::cloud::dialogflow::v2::Agent > SearchAgents(google::cloud::dialogflow::v2::SearchAgentsRequest request, Options opts={})
Returns the list of agents.
future< StatusOr< google::protobuf::Struct > > ImportAgent(google::cloud::dialogflow::v2::ImportAgentRequest const &request, Options opts={})
Imports the specified agent from a ZIP file.
StreamRange< google::cloud::dialogflow::v2::Agent > SearchAgents(std::string const &parent, Options opts={})
Returns the list of agents.
Status DeleteAgent(google::cloud::dialogflow::v2::DeleteAgentRequest const &request, Options opts={})
Deletes the specified agent.
AgentsClient(std::shared_ptr< AgentsConnection > connection, Options opts={})
friend bool operator==(AgentsClient const &a, AgentsClient const &b)
Definition: agents_client.h:81
AgentsClient(AgentsClient const &)=default
AgentsClient & operator=(AgentsClient const &)=default
StatusOr< google::cloud::dialogflow::v2::ValidationResult > GetValidationResult(google::cloud::dialogflow::v2::GetValidationResultRequest const &request, Options opts={})
Gets agent validation result.
StatusOr< google::cloud::dialogflow::v2::Agent > SetAgent(google::cloud::dialogflow::v2::SetAgentRequest const &request, Options opts={})
Creates/updates the specified agent.
future< StatusOr< google::protobuf::Struct > > TrainAgent(std::string const &parent, Options opts={})
Trains the specified agent.
future< StatusOr< google::protobuf::Struct > > TrainAgent(google::cloud::dialogflow::v2::TrainAgentRequest const &request, Options opts={})
Trains the specified agent.
AgentsClient & operator=(AgentsClient &&)=default
future< StatusOr< google::cloud::dialogflow::v2::ExportAgentResponse > > ExportAgent(std::string const &parent, Options opts={})
Exports the specified agent to a ZIP file.
The AgentsConnection object for AgentsClient.
Definition: agents_connection.h:65
friend friend class future
Definition: agents_client.h:33