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/cx/v3/agent.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_AGENTS_CLIENT_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_AGENTS_CLIENT_H
21
22#include "google/cloud/dialogflow_cx/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_cx {
34GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
35
36///
37/// Service for managing [Agents][google.cloud.dialogflow.cx.v3.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.cx.v3.Agent]:
63/// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L185}
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 /// Returns the list of all agents in the specified location.
92 ///
93 /// @param parent Required. The location to list all agents for.
94 /// Format: `projects/<Project ID>/locations/<Location ID>`.
95 /// @param opts Optional. Override the class-level options, such as retry and
96 /// backoff policies.
97 /// @return a [StreamRange](@ref google::cloud::StreamRange)
98 /// to iterate of the results. See the documentation of this type for
99 /// details. In brief, this class has `begin()` and `end()` member
100 /// functions returning a iterator class meeting the
101 /// [input iterator requirements]. The value type for this iterator is a
102 /// [`StatusOr`] as the iteration may fail even after some values are
103 /// retrieved successfully, for example, if there is a network disconnect.
104 /// An empty set of results does not indicate an error, it indicates
105 /// that there are no resources meeting the request criteria.
106 /// On a successful iteration the `StatusOr<T>` contains elements of type
107 /// [google.cloud.dialogflow.cx.v3.Agent], or rather,
108 /// the C++ class generated by Protobuf from that type. Please consult the
109 /// Protobuf documentation for details on the [Protobuf mapping rules].
110 ///
111 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
112 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
113 /// [Long Running Operation]: https://google.aip.dev/151
114 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
115 /// [`future`]: @ref google::cloud::future
116 /// [`StatusOr`]: @ref google::cloud::StatusOr
117 /// [`Status`]: @ref google::cloud::Status
118 /// [google.cloud.dialogflow.cx.v3.Agent]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L185}
119 /// [google.cloud.dialogflow.cx.v3.ListAgentsRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L279}
120 ///
121 // clang-format on
122 StreamRange<google::cloud::dialogflow::cx::v3::Agent> ListAgents(
123 std::string const& parent, Options opts = {});
124
125 // clang-format off
126 ///
127 /// Returns the list of all agents in the specified location.
128 ///
129 /// @param request Unary RPCs, such as the one wrapped by this
130 /// function, receive a single `request` proto message which includes all
131 /// the inputs for the RPC. In this case, the proto message is a
132 /// [google.cloud.dialogflow.cx.v3.ListAgentsRequest].
133 /// Proto messages are converted to C++ classes by Protobuf, using the
134 /// [Protobuf mapping rules].
135 /// @param opts Optional. Override the class-level options, such as retry and
136 /// backoff policies.
137 /// @return a [StreamRange](@ref google::cloud::StreamRange)
138 /// to iterate of the results. See the documentation of this type for
139 /// details. In brief, this class has `begin()` and `end()` member
140 /// functions returning a iterator class meeting the
141 /// [input iterator requirements]. The value type for this iterator is a
142 /// [`StatusOr`] as the iteration may fail even after some values are
143 /// retrieved successfully, for example, if there is a network disconnect.
144 /// An empty set of results does not indicate an error, it indicates
145 /// that there are no resources meeting the request criteria.
146 /// On a successful iteration the `StatusOr<T>` contains elements of type
147 /// [google.cloud.dialogflow.cx.v3.Agent], or rather,
148 /// the C++ class generated by Protobuf from that type. Please consult the
149 /// Protobuf documentation for details on the [Protobuf mapping rules].
150 ///
151 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
152 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
153 /// [Long Running Operation]: https://google.aip.dev/151
154 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
155 /// [`future`]: @ref google::cloud::future
156 /// [`StatusOr`]: @ref google::cloud::StatusOr
157 /// [`Status`]: @ref google::cloud::Status
158 /// [google.cloud.dialogflow.cx.v3.Agent]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L185}
159 /// [google.cloud.dialogflow.cx.v3.ListAgentsRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L279}
160 ///
161 // clang-format on
162 StreamRange<google::cloud::dialogflow::cx::v3::Agent> ListAgents(
163 google::cloud::dialogflow::cx::v3::ListAgentsRequest request,
164 Options opts = {});
165
166 // clang-format off
167 ///
168 /// Retrieves the specified agent.
169 ///
170 /// @param name Required. The name of the agent.
171 /// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
172 /// @param opts Optional. Override the class-level options, such as retry and
173 /// backoff policies.
174 /// @return the result of the RPC. The response message type
175 /// ([google.cloud.dialogflow.cx.v3.Agent])
176 /// is mapped to a C++ class using the [Protobuf mapping rules].
177 /// If the request fails, the [`StatusOr`] contains the error details.
178 ///
179 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
180 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
181 /// [Long Running Operation]: https://google.aip.dev/151
182 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
183 /// [`future`]: @ref google::cloud::future
184 /// [`StatusOr`]: @ref google::cloud::StatusOr
185 /// [`Status`]: @ref google::cloud::Status
186 /// [google.cloud.dialogflow.cx.v3.Agent]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L185}
187 /// [google.cloud.dialogflow.cx.v3.GetAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L311}
188 ///
189 // clang-format on
190 StatusOr<google::cloud::dialogflow::cx::v3::Agent> GetAgent(
191 std::string const& name, Options opts = {});
192
193 // clang-format off
194 ///
195 /// Retrieves the specified agent.
196 ///
197 /// @param request Unary RPCs, such as the one wrapped by this
198 /// function, receive a single `request` proto message which includes all
199 /// the inputs for the RPC. In this case, the proto message is a
200 /// [google.cloud.dialogflow.cx.v3.GetAgentRequest].
201 /// Proto messages are converted to C++ classes by Protobuf, using the
202 /// [Protobuf mapping rules].
203 /// @param opts Optional. Override the class-level options, such as retry and
204 /// backoff policies.
205 /// @return the result of the RPC. The response message type
206 /// ([google.cloud.dialogflow.cx.v3.Agent])
207 /// is mapped to a C++ class using the [Protobuf mapping rules].
208 /// If the request fails, the [`StatusOr`] contains the error details.
209 ///
210 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
211 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
212 /// [Long Running Operation]: https://google.aip.dev/151
213 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
214 /// [`future`]: @ref google::cloud::future
215 /// [`StatusOr`]: @ref google::cloud::StatusOr
216 /// [`Status`]: @ref google::cloud::Status
217 /// [google.cloud.dialogflow.cx.v3.Agent]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L185}
218 /// [google.cloud.dialogflow.cx.v3.GetAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L311}
219 ///
220 // clang-format on
221 StatusOr<google::cloud::dialogflow::cx::v3::Agent> GetAgent(
222 google::cloud::dialogflow::cx::v3::GetAgentRequest const& request,
223 Options opts = {});
224
225 // clang-format off
226 ///
227 /// Creates an agent in the specified location.
228 ///
229 /// Note: You should always train flows prior to sending them queries. See the
230 /// [training
231 /// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
232 ///
233 /// @param parent Required. The location to create a agent for.
234 /// Format: `projects/<Project ID>/locations/<Location ID>`.
235 /// @param agent Required. The agent to create.
236 /// @param opts Optional. Override the class-level options, such as retry and
237 /// backoff policies.
238 /// @return the result of the RPC. The response message type
239 /// ([google.cloud.dialogflow.cx.v3.Agent])
240 /// is mapped to a C++ class using the [Protobuf mapping rules].
241 /// If the request fails, the [`StatusOr`] contains the error details.
242 ///
243 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
244 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
245 /// [Long Running Operation]: https://google.aip.dev/151
246 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
247 /// [`future`]: @ref google::cloud::future
248 /// [`StatusOr`]: @ref google::cloud::StatusOr
249 /// [`Status`]: @ref google::cloud::Status
250 /// [google.cloud.dialogflow.cx.v3.Agent]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L185}
251 /// [google.cloud.dialogflow.cx.v3.CreateAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L324}
252 ///
253 // clang-format on
254 StatusOr<google::cloud::dialogflow::cx::v3::Agent> CreateAgent(
255 std::string const& parent,
256 google::cloud::dialogflow::cx::v3::Agent const& agent, Options opts = {});
257
258 // clang-format off
259 ///
260 /// Creates an agent in the specified location.
261 ///
262 /// Note: You should always train flows prior to sending them queries. See the
263 /// [training
264 /// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
265 ///
266 /// @param request Unary RPCs, such as the one wrapped by this
267 /// function, receive a single `request` proto message which includes all
268 /// the inputs for the RPC. In this case, the proto message is a
269 /// [google.cloud.dialogflow.cx.v3.CreateAgentRequest].
270 /// Proto messages are converted to C++ classes by Protobuf, using the
271 /// [Protobuf mapping rules].
272 /// @param opts Optional. Override the class-level options, such as retry and
273 /// backoff policies.
274 /// @return the result of the RPC. The response message type
275 /// ([google.cloud.dialogflow.cx.v3.Agent])
276 /// is mapped to a C++ class using the [Protobuf mapping rules].
277 /// If the request fails, the [`StatusOr`] contains the error details.
278 ///
279 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
280 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
281 /// [Long Running Operation]: https://google.aip.dev/151
282 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
283 /// [`future`]: @ref google::cloud::future
284 /// [`StatusOr`]: @ref google::cloud::StatusOr
285 /// [`Status`]: @ref google::cloud::Status
286 /// [google.cloud.dialogflow.cx.v3.Agent]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L185}
287 /// [google.cloud.dialogflow.cx.v3.CreateAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L324}
288 ///
289 // clang-format on
290 StatusOr<google::cloud::dialogflow::cx::v3::Agent> CreateAgent(
291 google::cloud::dialogflow::cx::v3::CreateAgentRequest const& request,
292 Options opts = {});
293
294 // clang-format off
295 ///
296 /// Updates the specified agent.
297 ///
298 /// Note: You should always train flows prior to sending them queries. See the
299 /// [training
300 /// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
301 ///
302 /// @param agent Required. The agent to update.
303 /// @param update_mask The mask to control which fields get updated. If the mask is not present,
304 /// all fields will be updated.
305 /// @param opts Optional. Override the class-level options, such as retry and
306 /// backoff policies.
307 /// @return the result of the RPC. The response message type
308 /// ([google.cloud.dialogflow.cx.v3.Agent])
309 /// is mapped to a C++ class using the [Protobuf mapping rules].
310 /// If the request fails, the [`StatusOr`] contains the error details.
311 ///
312 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
313 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
314 /// [Long Running Operation]: https://google.aip.dev/151
315 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
316 /// [`future`]: @ref google::cloud::future
317 /// [`StatusOr`]: @ref google::cloud::StatusOr
318 /// [`Status`]: @ref google::cloud::Status
319 /// [google.cloud.dialogflow.cx.v3.Agent]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L185}
320 /// [google.cloud.dialogflow.cx.v3.UpdateAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L340}
321 ///
322 // clang-format on
323 StatusOr<google::cloud::dialogflow::cx::v3::Agent> UpdateAgent(
324 google::cloud::dialogflow::cx::v3::Agent const& agent,
325 google::protobuf::FieldMask const& update_mask, Options opts = {});
326
327 // clang-format off
328 ///
329 /// Updates the specified agent.
330 ///
331 /// Note: You should always train flows prior to sending them queries. See the
332 /// [training
333 /// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
334 ///
335 /// @param request Unary RPCs, such as the one wrapped by this
336 /// function, receive a single `request` proto message which includes all
337 /// the inputs for the RPC. In this case, the proto message is a
338 /// [google.cloud.dialogflow.cx.v3.UpdateAgentRequest].
339 /// Proto messages are converted to C++ classes by Protobuf, using the
340 /// [Protobuf mapping rules].
341 /// @param opts Optional. Override the class-level options, such as retry and
342 /// backoff policies.
343 /// @return the result of the RPC. The response message type
344 /// ([google.cloud.dialogflow.cx.v3.Agent])
345 /// is mapped to a C++ class using the [Protobuf mapping rules].
346 /// If the request fails, the [`StatusOr`] contains the error details.
347 ///
348 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
349 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
350 /// [Long Running Operation]: https://google.aip.dev/151
351 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
352 /// [`future`]: @ref google::cloud::future
353 /// [`StatusOr`]: @ref google::cloud::StatusOr
354 /// [`Status`]: @ref google::cloud::Status
355 /// [google.cloud.dialogflow.cx.v3.Agent]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L185}
356 /// [google.cloud.dialogflow.cx.v3.UpdateAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L340}
357 ///
358 // clang-format on
359 StatusOr<google::cloud::dialogflow::cx::v3::Agent> UpdateAgent(
360 google::cloud::dialogflow::cx::v3::UpdateAgentRequest const& request,
361 Options opts = {});
362
363 // clang-format off
364 ///
365 /// Deletes the specified agent.
366 ///
367 /// @param name Required. The name of the agent to delete.
368 /// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
369 /// @param opts Optional. Override the class-level options, such as retry and
370 /// backoff policies.
371 /// @return a [`Status`] object. If the request failed, the
372 /// status contains the details of the failure.
373 ///
374 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
375 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
376 /// [Long Running Operation]: https://google.aip.dev/151
377 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
378 /// [`future`]: @ref google::cloud::future
379 /// [`StatusOr`]: @ref google::cloud::StatusOr
380 /// [`Status`]: @ref google::cloud::Status
381 /// [google.cloud.dialogflow.cx.v3.DeleteAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L351}
382 ///
383 // clang-format on
384 Status DeleteAgent(std::string const& name, Options opts = {});
385
386 // clang-format off
387 ///
388 /// Deletes the specified agent.
389 ///
390 /// @param request Unary RPCs, such as the one wrapped by this
391 /// function, receive a single `request` proto message which includes all
392 /// the inputs for the RPC. In this case, the proto message is a
393 /// [google.cloud.dialogflow.cx.v3.DeleteAgentRequest].
394 /// Proto messages are converted to C++ classes by Protobuf, using the
395 /// [Protobuf mapping rules].
396 /// @param opts Optional. Override the class-level options, such as retry and
397 /// backoff policies.
398 /// @return a [`Status`] object. If the request failed, the
399 /// status contains the details of the failure.
400 ///
401 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
402 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
403 /// [Long Running Operation]: https://google.aip.dev/151
404 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
405 /// [`future`]: @ref google::cloud::future
406 /// [`StatusOr`]: @ref google::cloud::StatusOr
407 /// [`Status`]: @ref google::cloud::Status
408 /// [google.cloud.dialogflow.cx.v3.DeleteAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L351}
409 ///
410 // clang-format on
412 google::cloud::dialogflow::cx::v3::DeleteAgentRequest const& request,
413 Options opts = {});
414
415 // clang-format off
416 ///
417 /// Exports the specified agent to a binary file.
418 ///
419 /// This method is a [long-running
420 /// operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
421 /// The returned `Operation` type has the following method-specific fields:
422 ///
423 /// - `metadata`: An empty [Struct
424 /// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
425 /// - `response`:
426 /// [ExportAgentResponse][google.cloud.dialogflow.cx.v3.ExportAgentResponse]
427 ///
428 /// @param request Unary RPCs, such as the one wrapped by this
429 /// function, receive a single `request` proto message which includes all
430 /// the inputs for the RPC. In this case, the proto message is a
431 /// [google.cloud.dialogflow.cx.v3.ExportAgentRequest].
432 /// Proto messages are converted to C++ classes by Protobuf, using the
433 /// [Protobuf mapping rules].
434 /// @param opts Optional. Override the class-level options, such as retry and
435 /// backoff policies.
436 /// @return A [`future`] that becomes satisfied when the LRO
437 /// ([Long Running Operation]) completes or the polling policy in effect
438 /// for this call is exhausted. The future is satisfied with an error if
439 /// the LRO completes with an error or the polling policy is exhausted.
440 /// In this case the [`StatusOr`] returned by the future contains the
441 /// error. If the LRO completes successfully the value of the future
442 /// contains the LRO's result. For this RPC the result is a
443 /// [google.cloud.dialogflow.cx.v3.ExportAgentResponse] proto message.
444 /// The C++ class representing this message is created by Protobuf, using
445 /// the [Protobuf mapping rules].
446 ///
447 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
448 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
449 /// [Long Running Operation]: https://google.aip.dev/151
450 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
451 /// [`future`]: @ref google::cloud::future
452 /// [`StatusOr`]: @ref google::cloud::StatusOr
453 /// [`Status`]: @ref google::cloud::Status
454 /// [google.cloud.dialogflow.cx.v3.ExportAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L364}
455 /// [google.cloud.dialogflow.cx.v3.ExportAgentResponse]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L419}
456 ///
457 // clang-format on
458 future<StatusOr<google::cloud::dialogflow::cx::v3::ExportAgentResponse>>
460 google::cloud::dialogflow::cx::v3::ExportAgentRequest const& request,
461 Options opts = {});
462
463 // clang-format off
464 ///
465 /// Restores the specified agent from a binary file.
466 ///
467 /// Replaces the current agent with a new one. Note that all existing resources
468 /// in agent (e.g. intents, entity types, flows) will be removed.
469 ///
470 /// This method is a [long-running
471 /// operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
472 /// The returned `Operation` type has the following method-specific fields:
473 ///
474 /// - `metadata`: An empty [Struct
475 /// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
476 /// - `response`: An [Empty
477 /// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
478 ///
479 /// Note: You should always train flows prior to sending them queries. See the
480 /// [training
481 /// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
482 ///
483 /// @param request Unary RPCs, such as the one wrapped by this
484 /// function, receive a single `request` proto message which includes all
485 /// the inputs for the RPC. In this case, the proto message is a
486 /// [google.cloud.dialogflow.cx.v3.RestoreAgentRequest].
487 /// Proto messages are converted to C++ classes by Protobuf, using the
488 /// [Protobuf mapping rules].
489 /// @param opts Optional. Override the class-level options, such as retry and
490 /// backoff policies.
491 /// @return A [`future`] that becomes satisfied when the LRO
492 /// ([Long Running Operation]) completes or the polling policy in effect
493 /// for this call is exhausted. The future is satisfied with an error if
494 /// the LRO completes with an error or the polling policy is exhausted.
495 /// In this case the [`StatusOr`] returned by the future contains the
496 /// error. If the LRO completes successfully the value of the future
497 /// contains the LRO's result. For this RPC the result is a
498 /// [google.protobuf.Struct] proto message.
499 /// The C++ class representing this message is created by Protobuf, using
500 /// the [Protobuf mapping rules].
501 ///
502 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
503 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
504 /// [Long Running Operation]: https://google.aip.dev/151
505 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
506 /// [`future`]: @ref google::cloud::future
507 /// [`StatusOr`]: @ref google::cloud::StatusOr
508 /// [`Status`]: @ref google::cloud::Status
509 /// [google.cloud.dialogflow.cx.v3.RestoreAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L434}
510 /// [google.protobuf.Struct]: @googleapis_reference_link{google/protobuf/struct.proto#L51}
511 ///
512 // clang-format on
513 future<StatusOr<google::protobuf::Struct>> RestoreAgent(
514 google::cloud::dialogflow::cx::v3::RestoreAgentRequest const& request,
515 Options opts = {});
516
517 // clang-format off
518 ///
519 /// Validates the specified agent and creates or updates validation results.
520 /// The agent in draft version is validated. Please call this API after the
521 /// training is completed to get the complete validation results.
522 ///
523 /// @param request Unary RPCs, such as the one wrapped by this
524 /// function, receive a single `request` proto message which includes all
525 /// the inputs for the RPC. In this case, the proto message is a
526 /// [google.cloud.dialogflow.cx.v3.ValidateAgentRequest].
527 /// Proto messages are converted to C++ classes by Protobuf, using the
528 /// [Protobuf mapping rules].
529 /// @param opts Optional. Override the class-level options, such as retry and
530 /// backoff policies.
531 /// @return the result of the RPC. The response message type
532 /// ([google.cloud.dialogflow.cx.v3.AgentValidationResult])
533 /// is mapped to a C++ class using the [Protobuf mapping rules].
534 /// If the request fails, the [`StatusOr`] contains the error details.
535 ///
536 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
537 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
538 /// [Long Running Operation]: https://google.aip.dev/151
539 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
540 /// [`future`]: @ref google::cloud::future
541 /// [`StatusOr`]: @ref google::cloud::StatusOr
542 /// [`Status`]: @ref google::cloud::Status
543 /// [google.cloud.dialogflow.cx.v3.AgentValidationResult]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L515}
544 /// [google.cloud.dialogflow.cx.v3.ValidateAgentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L482}
545 ///
546 // clang-format on
547 StatusOr<google::cloud::dialogflow::cx::v3::AgentValidationResult>
549 google::cloud::dialogflow::cx::v3::ValidateAgentRequest const& request,
550 Options opts = {});
551
552 // clang-format off
553 ///
554 /// Gets the latest agent validation result. Agent validation is performed
555 /// when ValidateAgent is called.
556 ///
557 /// @param name Required. The agent name.
558 /// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
559 /// ID>/validationResult`.
560 /// @param opts Optional. Override the class-level options, such as retry and
561 /// backoff policies.
562 /// @return the result of the RPC. The response message type
563 /// ([google.cloud.dialogflow.cx.v3.AgentValidationResult])
564 /// is mapped to a C++ class using the [Protobuf mapping rules].
565 /// If the request fails, the [`StatusOr`] contains the error details.
566 ///
567 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
568 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
569 /// [Long Running Operation]: https://google.aip.dev/151
570 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
571 /// [`future`]: @ref google::cloud::future
572 /// [`StatusOr`]: @ref google::cloud::StatusOr
573 /// [`Status`]: @ref google::cloud::Status
574 /// [google.cloud.dialogflow.cx.v3.AgentValidationResult]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L515}
575 /// [google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L498}
576 ///
577 // clang-format on
578 StatusOr<google::cloud::dialogflow::cx::v3::AgentValidationResult>
579 GetAgentValidationResult(std::string const& name, Options opts = {});
580
581 // clang-format off
582 ///
583 /// Gets the latest agent validation result. Agent validation is performed
584 /// when ValidateAgent is called.
585 ///
586 /// @param request Unary RPCs, such as the one wrapped by this
587 /// function, receive a single `request` proto message which includes all
588 /// the inputs for the RPC. In this case, the proto message is a
589 /// [google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest].
590 /// Proto messages are converted to C++ classes by Protobuf, using the
591 /// [Protobuf mapping rules].
592 /// @param opts Optional. Override the class-level options, such as retry and
593 /// backoff policies.
594 /// @return the result of the RPC. The response message type
595 /// ([google.cloud.dialogflow.cx.v3.AgentValidationResult])
596 /// is mapped to a C++ class using the [Protobuf mapping rules].
597 /// If the request fails, the [`StatusOr`] contains the error details.
598 ///
599 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
600 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
601 /// [Long Running Operation]: https://google.aip.dev/151
602 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
603 /// [`future`]: @ref google::cloud::future
604 /// [`StatusOr`]: @ref google::cloud::StatusOr
605 /// [`Status`]: @ref google::cloud::Status
606 /// [google.cloud.dialogflow.cx.v3.AgentValidationResult]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L515}
607 /// [google.cloud.dialogflow.cx.v3.GetAgentValidationResultRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/agent.proto#L498}
608 ///
609 // clang-format on
610 StatusOr<google::cloud::dialogflow::cx::v3::AgentValidationResult>
612 google::cloud::dialogflow::cx::v3::GetAgentValidationResultRequest const&
613 request,
614 Options opts = {});
615
616 private:
617 std::shared_ptr<AgentsConnection> connection_;
618 Options options_;
619};
620
621GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
622} // namespace dialogflow_cx
623} // namespace cloud
624} // namespace google
625
626#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_AGENTS_CLIENT_H
Service for managing Agents.
Definition: agents_client.h:65
StatusOr< google::cloud::dialogflow::cx::v3::Agent > UpdateAgent(google::cloud::dialogflow::cx::v3::UpdateAgentRequest const &request, Options opts={})
Updates the specified agent.
StatusOr< google::cloud::dialogflow::cx::v3::Agent > CreateAgent(std::string const &parent, google::cloud::dialogflow::cx::v3::Agent const &agent, Options opts={})
Creates an agent in the specified location.
StatusOr< google::cloud::dialogflow::cx::v3::Agent > GetAgent(google::cloud::dialogflow::cx::v3::GetAgentRequest const &request, Options opts={})
Retrieves the specified agent.
friend bool operator!=(AgentsClient const &a, AgentsClient const &b)
Definition: agents_client.h:84
AgentsClient & operator=(AgentsClient &&)=default
Status DeleteAgent(std::string const &name, Options opts={})
Deletes the specified agent.
future< StatusOr< google::cloud::dialogflow::cx::v3::ExportAgentResponse > > ExportAgent(google::cloud::dialogflow::cx::v3::ExportAgentRequest const &request, Options opts={})
Exports the specified agent to a binary file.
friend bool operator==(AgentsClient const &a, AgentsClient const &b)
Definition: agents_client.h:81
StreamRange< google::cloud::dialogflow::cx::v3::Agent > ListAgents(std::string const &parent, Options opts={})
Returns the list of all agents in the specified location.
StatusOr< google::cloud::dialogflow::cx::v3::AgentValidationResult > GetAgentValidationResult(std::string const &name, Options opts={})
Gets the latest agent validation result.
StatusOr< google::cloud::dialogflow::cx::v3::AgentValidationResult > GetAgentValidationResult(google::cloud::dialogflow::cx::v3::GetAgentValidationResultRequest const &request, Options opts={})
Gets the latest agent validation result.
future< StatusOr< google::protobuf::Struct > > RestoreAgent(google::cloud::dialogflow::cx::v3::RestoreAgentRequest const &request, Options opts={})
Restores the specified agent from a binary file.
AgentsClient(AgentsClient const &)=default
StatusOr< google::cloud::dialogflow::cx::v3::AgentValidationResult > ValidateAgent(google::cloud::dialogflow::cx::v3::ValidateAgentRequest const &request, Options opts={})
Validates the specified agent and creates or updates validation results.
StatusOr< google::cloud::dialogflow::cx::v3::Agent > UpdateAgent(google::cloud::dialogflow::cx::v3::Agent const &agent, google::protobuf::FieldMask const &update_mask, Options opts={})
Updates the specified agent.
StatusOr< google::cloud::dialogflow::cx::v3::Agent > GetAgent(std::string const &name, Options opts={})
Retrieves the specified agent.
StatusOr< google::cloud::dialogflow::cx::v3::Agent > CreateAgent(google::cloud::dialogflow::cx::v3::CreateAgentRequest const &request, Options opts={})
Creates an agent in the specified location.
AgentsClient(std::shared_ptr< AgentsConnection > connection, Options opts={})
Status DeleteAgent(google::cloud::dialogflow::cx::v3::DeleteAgentRequest const &request, Options opts={})
Deletes the specified agent.
AgentsClient & operator=(AgentsClient const &)=default
StreamRange< google::cloud::dialogflow::cx::v3::Agent > ListAgents(google::cloud::dialogflow::cx::v3::ListAgentsRequest request, Options opts={})
Returns the list of all agents in the specified location.
The AgentsConnection object for AgentsClient.
Definition: agents_connection.h:65
friend friend class future
Definition: agents_client.h:33