Dialogflow API C++ Client 2.13.0
A C++ Client Library for the Dialogflow API
Loading...
Searching...
No Matches
flows_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/flow.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_FLOWS_CLIENT_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_FLOWS_CLIENT_H
21
22#include "google/cloud/dialogflow_cx/flows_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 [Flows][google.cloud.dialogflow.cx.v3.Flow].
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.Flow]:
63/// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L251}
64///
65class FlowsClient {
66 public:
67 explicit FlowsClient(std::shared_ptr<FlowsConnection> connection,
68 Options opts = {});
69 ~FlowsClient();
70
71 ///@{
72 /// @name Copy and move support
73 FlowsClient(FlowsClient const&) = default;
74 FlowsClient& operator=(FlowsClient const&) = default;
75 FlowsClient(FlowsClient&&) = default;
76 FlowsClient& operator=(FlowsClient&&) = default;
77 ///@}
78
79 ///@{
80 /// @name Equality
81 friend bool operator==(FlowsClient const& a, FlowsClient const& b) {
82 return a.connection_ == b.connection_;
83 }
84 friend bool operator!=(FlowsClient const& a, FlowsClient const& b) {
85 return !(a == b);
86 }
87 ///@}
88
89 // clang-format off
90 ///
91 /// Creates a flow in the specified agent.
92 ///
93 /// Note: You should always train a flow prior to sending it queries. See the
94 /// [training
95 /// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
96 ///
97 /// @param parent Required. The agent to create a flow for.
98 /// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
99 /// @param flow Required. The flow to create.
100 /// @param opts Optional. Override the class-level options, such as retry and
101 /// backoff policies.
102 /// @return the result of the RPC. The response message type
103 /// ([google.cloud.dialogflow.cx.v3.Flow])
104 /// is mapped to a C++ class using the [Protobuf mapping rules].
105 /// If the request fails, the [`StatusOr`] contains the error details.
106 ///
107 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
108 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
109 /// [Long Running Operation]: https://google.aip.dev/151
110 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
111 /// [`future`]: @ref google::cloud::future
112 /// [`StatusOr`]: @ref google::cloud::StatusOr
113 /// [`Status`]: @ref google::cloud::Status
114 /// [google.cloud.dialogflow.cx.v3.CreateFlowRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L323}
115 /// [google.cloud.dialogflow.cx.v3.Flow]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L251}
116 ///
117 // clang-format on
118 StatusOr<google::cloud::dialogflow::cx::v3::Flow> CreateFlow(
119 std::string const& parent,
120 google::cloud::dialogflow::cx::v3::Flow const& flow, Options opts = {});
121
122 // clang-format off
123 ///
124 /// Creates a flow in the specified agent.
125 ///
126 /// Note: You should always train a flow prior to sending it queries. See the
127 /// [training
128 /// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
129 ///
130 /// @param request Unary RPCs, such as the one wrapped by this
131 /// function, receive a single `request` proto message which includes all
132 /// the inputs for the RPC. In this case, the proto message is a
133 /// [google.cloud.dialogflow.cx.v3.CreateFlowRequest].
134 /// Proto messages are converted to C++ classes by Protobuf, using the
135 /// [Protobuf mapping rules].
136 /// @param opts Optional. Override the class-level options, such as retry and
137 /// backoff policies.
138 /// @return the result of the RPC. The response message type
139 /// ([google.cloud.dialogflow.cx.v3.Flow])
140 /// is mapped to a C++ class using the [Protobuf mapping rules].
141 /// If the request fails, the [`StatusOr`] contains the error details.
142 ///
143 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
144 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
145 /// [Long Running Operation]: https://google.aip.dev/151
146 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
147 /// [`future`]: @ref google::cloud::future
148 /// [`StatusOr`]: @ref google::cloud::StatusOr
149 /// [`Status`]: @ref google::cloud::Status
150 /// [google.cloud.dialogflow.cx.v3.CreateFlowRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L323}
151 /// [google.cloud.dialogflow.cx.v3.Flow]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L251}
152 ///
153 // clang-format on
154 StatusOr<google::cloud::dialogflow::cx::v3::Flow> CreateFlow(
155 google::cloud::dialogflow::cx::v3::CreateFlowRequest const& request,
156 Options opts = {});
157
158 // clang-format off
159 ///
160 /// Deletes a specified flow.
161 ///
162 /// @param name Required. The name of the flow to delete.
163 /// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
164 /// ID>/flows/<Flow ID>`.
165 /// @param opts Optional. Override the class-level options, such as retry and
166 /// backoff policies.
167 /// @return a [`Status`] object. If the request failed, the
168 /// status contains the details of the failure.
169 ///
170 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
171 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
172 /// [Long Running Operation]: https://google.aip.dev/151
173 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
174 /// [`future`]: @ref google::cloud::future
175 /// [`StatusOr`]: @ref google::cloud::StatusOr
176 /// [`Status`]: @ref google::cloud::Status
177 /// [google.cloud.dialogflow.cx.v3.DeleteFlowRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L353}
178 ///
179 // clang-format on
180 Status DeleteFlow(std::string const& name, Options opts = {});
181
182 // clang-format off
183 ///
184 /// Deletes a specified flow.
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.cx.v3.DeleteFlowRequest].
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 a [`Status`] object. If the request failed, the
195 /// status contains the details of the failure.
196 ///
197 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
198 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
199 /// [Long Running Operation]: https://google.aip.dev/151
200 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
201 /// [`future`]: @ref google::cloud::future
202 /// [`StatusOr`]: @ref google::cloud::StatusOr
203 /// [`Status`]: @ref google::cloud::Status
204 /// [google.cloud.dialogflow.cx.v3.DeleteFlowRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L353}
205 ///
206 // clang-format on
208 google::cloud::dialogflow::cx::v3::DeleteFlowRequest const& request,
209 Options opts = {});
210
211 // clang-format off
212 ///
213 /// Returns the list of all flows in the specified agent.
214 ///
215 /// @param parent Required. The agent containing the flows.
216 /// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
217 /// @param opts Optional. Override the class-level options, such as retry and
218 /// backoff policies.
219 /// @return a [StreamRange](@ref google::cloud::StreamRange)
220 /// to iterate of the results. See the documentation of this type for
221 /// details. In brief, this class has `begin()` and `end()` member
222 /// functions returning a iterator class meeting the
223 /// [input iterator requirements]. The value type for this iterator is a
224 /// [`StatusOr`] as the iteration may fail even after some values are
225 /// retrieved successfully, for example, if there is a network disconnect.
226 /// An empty set of results does not indicate an error, it indicates
227 /// that there are no resources meeting the request criteria.
228 /// On a successful iteration the `StatusOr<T>` contains elements of type
229 /// [google.cloud.dialogflow.cx.v3.Flow], or rather,
230 /// the C++ class generated by Protobuf from that type. Please consult the
231 /// Protobuf documentation for details on the [Protobuf mapping rules].
232 ///
233 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
234 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
235 /// [Long Running Operation]: https://google.aip.dev/151
236 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
237 /// [`future`]: @ref google::cloud::future
238 /// [`StatusOr`]: @ref google::cloud::StatusOr
239 /// [`Status`]: @ref google::cloud::Status
240 /// [google.cloud.dialogflow.cx.v3.Flow]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L251}
241 /// [google.cloud.dialogflow.cx.v3.ListFlowsRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L377}
242 ///
243 // clang-format on
244 StreamRange<google::cloud::dialogflow::cx::v3::Flow> ListFlows(
245 std::string const& parent, Options opts = {});
246
247 // clang-format off
248 ///
249 /// Returns the list of all flows in the specified agent.
250 ///
251 /// @param request Unary RPCs, such as the one wrapped by this
252 /// function, receive a single `request` proto message which includes all
253 /// the inputs for the RPC. In this case, the proto message is a
254 /// [google.cloud.dialogflow.cx.v3.ListFlowsRequest].
255 /// Proto messages are converted to C++ classes by Protobuf, using the
256 /// [Protobuf mapping rules].
257 /// @param opts Optional. Override the class-level options, such as retry and
258 /// backoff policies.
259 /// @return a [StreamRange](@ref google::cloud::StreamRange)
260 /// to iterate of the results. See the documentation of this type for
261 /// details. In brief, this class has `begin()` and `end()` member
262 /// functions returning a iterator class meeting the
263 /// [input iterator requirements]. The value type for this iterator is a
264 /// [`StatusOr`] as the iteration may fail even after some values are
265 /// retrieved successfully, for example, if there is a network disconnect.
266 /// An empty set of results does not indicate an error, it indicates
267 /// that there are no resources meeting the request criteria.
268 /// On a successful iteration the `StatusOr<T>` contains elements of type
269 /// [google.cloud.dialogflow.cx.v3.Flow], or rather,
270 /// the C++ class generated by Protobuf from that type. Please consult the
271 /// Protobuf documentation for details on the [Protobuf mapping rules].
272 ///
273 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
274 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
275 /// [Long Running Operation]: https://google.aip.dev/151
276 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
277 /// [`future`]: @ref google::cloud::future
278 /// [`StatusOr`]: @ref google::cloud::StatusOr
279 /// [`Status`]: @ref google::cloud::Status
280 /// [google.cloud.dialogflow.cx.v3.Flow]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L251}
281 /// [google.cloud.dialogflow.cx.v3.ListFlowsRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L377}
282 ///
283 // clang-format on
284 StreamRange<google::cloud::dialogflow::cx::v3::Flow> ListFlows(
285 google::cloud::dialogflow::cx::v3::ListFlowsRequest request,
286 Options opts = {});
287
288 // clang-format off
289 ///
290 /// Retrieves the specified flow.
291 ///
292 /// @param name Required. The name of the flow to get.
293 /// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
294 /// ID>/flows/<Flow ID>`.
295 /// @param opts Optional. Override the class-level options, such as retry and
296 /// backoff policies.
297 /// @return the result of the RPC. The response message type
298 /// ([google.cloud.dialogflow.cx.v3.Flow])
299 /// is mapped to a C++ class using the [Protobuf mapping rules].
300 /// If the request fails, the [`StatusOr`] contains the error details.
301 ///
302 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
303 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
304 /// [Long Running Operation]: https://google.aip.dev/151
305 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
306 /// [`future`]: @ref google::cloud::future
307 /// [`StatusOr`]: @ref google::cloud::StatusOr
308 /// [`Status`]: @ref google::cloud::Status
309 /// [google.cloud.dialogflow.cx.v3.Flow]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L251}
310 /// [google.cloud.dialogflow.cx.v3.GetFlowRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L424}
311 ///
312 // clang-format on
313 StatusOr<google::cloud::dialogflow::cx::v3::Flow> GetFlow(
314 std::string const& name, Options opts = {});
315
316 // clang-format off
317 ///
318 /// Retrieves the specified flow.
319 ///
320 /// @param request Unary RPCs, such as the one wrapped by this
321 /// function, receive a single `request` proto message which includes all
322 /// the inputs for the RPC. In this case, the proto message is a
323 /// [google.cloud.dialogflow.cx.v3.GetFlowRequest].
324 /// Proto messages are converted to C++ classes by Protobuf, using the
325 /// [Protobuf mapping rules].
326 /// @param opts Optional. Override the class-level options, such as retry and
327 /// backoff policies.
328 /// @return the result of the RPC. The response message type
329 /// ([google.cloud.dialogflow.cx.v3.Flow])
330 /// is mapped to a C++ class using the [Protobuf mapping rules].
331 /// If the request fails, the [`StatusOr`] contains the error details.
332 ///
333 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
334 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
335 /// [Long Running Operation]: https://google.aip.dev/151
336 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
337 /// [`future`]: @ref google::cloud::future
338 /// [`StatusOr`]: @ref google::cloud::StatusOr
339 /// [`Status`]: @ref google::cloud::Status
340 /// [google.cloud.dialogflow.cx.v3.Flow]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L251}
341 /// [google.cloud.dialogflow.cx.v3.GetFlowRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L424}
342 ///
343 // clang-format on
344 StatusOr<google::cloud::dialogflow::cx::v3::Flow> GetFlow(
345 google::cloud::dialogflow::cx::v3::GetFlowRequest const& request,
346 Options opts = {});
347
348 // clang-format off
349 ///
350 /// Updates the specified flow.
351 ///
352 /// Note: You should always train a flow prior to sending it queries. See the
353 /// [training
354 /// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
355 ///
356 /// @param flow Required. The flow to update.
357 /// @param update_mask The mask to control which fields get updated. If the mask is not present,
358 /// all fields will be updated.
359 /// @param opts Optional. Override the class-level options, such as retry and
360 /// backoff policies.
361 /// @return the result of the RPC. The response message type
362 /// ([google.cloud.dialogflow.cx.v3.Flow])
363 /// is mapped to a C++ class using the [Protobuf mapping rules].
364 /// If the request fails, the [`StatusOr`] contains the error details.
365 ///
366 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
367 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
368 /// [Long Running Operation]: https://google.aip.dev/151
369 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
370 /// [`future`]: @ref google::cloud::future
371 /// [`StatusOr`]: @ref google::cloud::StatusOr
372 /// [`Status`]: @ref google::cloud::Status
373 /// [google.cloud.dialogflow.cx.v3.Flow]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L251}
374 /// [google.cloud.dialogflow.cx.v3.UpdateFlowRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L451}
375 ///
376 // clang-format on
377 StatusOr<google::cloud::dialogflow::cx::v3::Flow> UpdateFlow(
378 google::cloud::dialogflow::cx::v3::Flow const& flow,
379 google::protobuf::FieldMask const& update_mask, Options opts = {});
380
381 // clang-format off
382 ///
383 /// Updates the specified flow.
384 ///
385 /// Note: You should always train a flow prior to sending it queries. See the
386 /// [training
387 /// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
388 ///
389 /// @param request Unary RPCs, such as the one wrapped by this
390 /// function, receive a single `request` proto message which includes all
391 /// the inputs for the RPC. In this case, the proto message is a
392 /// [google.cloud.dialogflow.cx.v3.UpdateFlowRequest].
393 /// Proto messages are converted to C++ classes by Protobuf, using the
394 /// [Protobuf mapping rules].
395 /// @param opts Optional. Override the class-level options, such as retry and
396 /// backoff policies.
397 /// @return the result of the RPC. The response message type
398 /// ([google.cloud.dialogflow.cx.v3.Flow])
399 /// is mapped to a C++ class using the [Protobuf mapping rules].
400 /// If the request fails, the [`StatusOr`] contains the error details.
401 ///
402 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
403 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
404 /// [Long Running Operation]: https://google.aip.dev/151
405 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
406 /// [`future`]: @ref google::cloud::future
407 /// [`StatusOr`]: @ref google::cloud::StatusOr
408 /// [`Status`]: @ref google::cloud::Status
409 /// [google.cloud.dialogflow.cx.v3.Flow]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L251}
410 /// [google.cloud.dialogflow.cx.v3.UpdateFlowRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L451}
411 ///
412 // clang-format on
413 StatusOr<google::cloud::dialogflow::cx::v3::Flow> UpdateFlow(
414 google::cloud::dialogflow::cx::v3::UpdateFlowRequest const& request,
415 Options opts = {});
416
417 // clang-format off
418 ///
419 /// Trains the specified flow. Note that only the flow in 'draft' environment
420 /// is trained.
421 ///
422 /// This method is a [long-running
423 /// operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
424 /// The returned `Operation` type has the following method-specific fields:
425 ///
426 /// - `metadata`: An empty [Struct
427 /// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
428 /// - `response`: An [Empty
429 /// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
430 ///
431 /// Note: You should always train a flow prior to sending it queries. See the
432 /// [training
433 /// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
434 ///
435 /// @param name Required. The flow to train.
436 /// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
437 /// ID>/flows/<Flow ID>`.
438 /// @param opts Optional. Override the class-level options, such as retry and
439 /// backoff policies.
440 /// @return A [`future`] that becomes satisfied when the LRO
441 /// ([Long Running Operation]) completes or the polling policy in effect
442 /// for this call is exhausted. The future is satisfied with an error if
443 /// the LRO completes with an error or the polling policy is exhausted.
444 /// In this case the [`StatusOr`] returned by the future contains the
445 /// error. If the LRO completes successfully the value of the future
446 /// contains the LRO's result. For this RPC the result is a
447 /// [google.protobuf.Struct] proto message.
448 /// The C++ class representing this message is created by Protobuf, using
449 /// the [Protobuf mapping rules].
450 ///
451 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
452 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
453 /// [Long Running Operation]: https://google.aip.dev/151
454 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
455 /// [`future`]: @ref google::cloud::future
456 /// [`StatusOr`]: @ref google::cloud::StatusOr
457 /// [`Status`]: @ref google::cloud::Status
458 /// [google.cloud.dialogflow.cx.v3.TrainFlowRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L476}
459 /// [google.protobuf.Struct]: @googleapis_reference_link{google/protobuf/struct.proto#L51}
460 ///
461 // clang-format on
462 future<StatusOr<google::protobuf::Struct>> TrainFlow(std::string const& name,
463 Options opts = {});
464
465 // clang-format off
466 ///
467 /// Trains the specified flow. Note that only the flow in 'draft' environment
468 /// is trained.
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 a flow prior to sending it 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.TrainFlowRequest].
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.TrainFlowRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L476}
510 /// [google.protobuf.Struct]: @googleapis_reference_link{google/protobuf/struct.proto#L51}
511 ///
512 // clang-format on
513 future<StatusOr<google::protobuf::Struct>> TrainFlow(
514 google::cloud::dialogflow::cx::v3::TrainFlowRequest const& request,
515 Options opts = {});
516
517 // clang-format off
518 ///
519 /// Validates the specified flow and creates or updates validation results.
520 /// Please call this API after the training is completed to get the complete
521 /// 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.ValidateFlowRequest].
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.FlowValidationResult])
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.FlowValidationResult]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L520}
544 /// [google.cloud.dialogflow.cx.v3.ValidateFlowRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L488}
545 ///
546 // clang-format on
547 StatusOr<google::cloud::dialogflow::cx::v3::FlowValidationResult>
549 google::cloud::dialogflow::cx::v3::ValidateFlowRequest const& request,
550 Options opts = {});
551
552 // clang-format off
553 ///
554 /// Gets the latest flow validation result. Flow validation is performed
555 /// when ValidateFlow is called.
556 ///
557 /// @param name Required. The flow name.
558 /// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
559 /// ID>/flows/<Flow 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.FlowValidationResult])
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.FlowValidationResult]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L520}
575 /// [google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L503}
576 ///
577 // clang-format on
578 StatusOr<google::cloud::dialogflow::cx::v3::FlowValidationResult>
579 GetFlowValidationResult(std::string const& name, Options opts = {});
580
581 // clang-format off
582 ///
583 /// Gets the latest flow validation result. Flow validation is performed
584 /// when ValidateFlow 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.GetFlowValidationResultRequest].
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.FlowValidationResult])
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.FlowValidationResult]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L520}
607 /// [google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L503}
608 ///
609 // clang-format on
610 StatusOr<google::cloud::dialogflow::cx::v3::FlowValidationResult>
612 google::cloud::dialogflow::cx::v3::GetFlowValidationResultRequest const&
613 request,
614 Options opts = {});
615
616 // clang-format off
617 ///
618 /// Imports the specified flow to the specified agent from a binary file.
619 ///
620 /// This method is a [long-running
621 /// operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
622 /// The returned `Operation` type has the following method-specific fields:
623 ///
624 /// - `metadata`: An empty [Struct
625 /// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
626 /// - `response`:
627 /// [ImportFlowResponse][google.cloud.dialogflow.cx.v3.ImportFlowResponse]
628 ///
629 /// Note: You should always train a flow prior to sending it queries. See the
630 /// [training
631 /// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
632 ///
633 /// @param request Unary RPCs, such as the one wrapped by this
634 /// function, receive a single `request` proto message which includes all
635 /// the inputs for the RPC. In this case, the proto message is a
636 /// [google.cloud.dialogflow.cx.v3.ImportFlowRequest].
637 /// Proto messages are converted to C++ classes by Protobuf, using the
638 /// [Protobuf mapping rules].
639 /// @param opts Optional. Override the class-level options, such as retry and
640 /// backoff policies.
641 /// @return A [`future`] that becomes satisfied when the LRO
642 /// ([Long Running Operation]) completes or the polling policy in effect
643 /// for this call is exhausted. The future is satisfied with an error if
644 /// the LRO completes with an error or the polling policy is exhausted.
645 /// In this case the [`StatusOr`] returned by the future contains the
646 /// error. If the LRO completes successfully the value of the future
647 /// contains the LRO's result. For this RPC the result is a
648 /// [google.cloud.dialogflow.cx.v3.ImportFlowResponse] proto message.
649 /// The C++ class representing this message is created by Protobuf, using
650 /// the [Protobuf mapping rules].
651 ///
652 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
653 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
654 /// [Long Running Operation]: https://google.aip.dev/151
655 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
656 /// [`future`]: @ref google::cloud::future
657 /// [`StatusOr`]: @ref google::cloud::StatusOr
658 /// [`Status`]: @ref google::cloud::Status
659 /// [google.cloud.dialogflow.cx.v3.ImportFlowRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L540}
660 /// [google.cloud.dialogflow.cx.v3.ImportFlowResponse]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L589}
661 ///
662 // clang-format on
663 future<StatusOr<google::cloud::dialogflow::cx::v3::ImportFlowResponse>>
665 google::cloud::dialogflow::cx::v3::ImportFlowRequest const& request,
666 Options opts = {});
667
668 // clang-format off
669 ///
670 /// Exports the specified flow to a binary file.
671 ///
672 /// This method is a [long-running
673 /// operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
674 /// The returned `Operation` type has the following method-specific fields:
675 ///
676 /// - `metadata`: An empty [Struct
677 /// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
678 /// - `response`:
679 /// [ExportFlowResponse][google.cloud.dialogflow.cx.v3.ExportFlowResponse]
680 ///
681 /// Note that resources (e.g. intents, entities, webhooks) that the flow
682 /// references will also be exported.
683 ///
684 /// @param request Unary RPCs, such as the one wrapped by this
685 /// function, receive a single `request` proto message which includes all
686 /// the inputs for the RPC. In this case, the proto message is a
687 /// [google.cloud.dialogflow.cx.v3.ExportFlowRequest].
688 /// Proto messages are converted to C++ classes by Protobuf, using the
689 /// [Protobuf mapping rules].
690 /// @param opts Optional. Override the class-level options, such as retry and
691 /// backoff policies.
692 /// @return A [`future`] that becomes satisfied when the LRO
693 /// ([Long Running Operation]) completes or the polling policy in effect
694 /// for this call is exhausted. The future is satisfied with an error if
695 /// the LRO completes with an error or the polling policy is exhausted.
696 /// In this case the [`StatusOr`] returned by the future contains the
697 /// error. If the LRO completes successfully the value of the future
698 /// contains the LRO's result. For this RPC the result is a
699 /// [google.cloud.dialogflow.cx.v3.ExportFlowResponse] proto message.
700 /// The C++ class representing this message is created by Protobuf, using
701 /// the [Protobuf mapping rules].
702 ///
703 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
704 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
705 /// [Long Running Operation]: https://google.aip.dev/151
706 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
707 /// [`future`]: @ref google::cloud::future
708 /// [`StatusOr`]: @ref google::cloud::StatusOr
709 /// [`Status`]: @ref google::cloud::Status
710 /// [google.cloud.dialogflow.cx.v3.ExportFlowRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L600}
711 /// [google.cloud.dialogflow.cx.v3.ExportFlowResponse]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/flow.proto#L627}
712 ///
713 // clang-format on
714 future<StatusOr<google::cloud::dialogflow::cx::v3::ExportFlowResponse>>
716 google::cloud::dialogflow::cx::v3::ExportFlowRequest const& request,
717 Options opts = {});
718
719 private:
720 std::shared_ptr<FlowsConnection> connection_;
721 Options options_;
722};
723
724GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
725} // namespace dialogflow_cx
726} // namespace cloud
727} // namespace google
728
729#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_FLOWS_CLIENT_H
Service for managing Flows.
Definition: flows_client.h:65
friend bool operator==(FlowsClient const &a, FlowsClient const &b)
Definition: flows_client.h:81
StreamRange< google::cloud::dialogflow::cx::v3::Flow > ListFlows(google::cloud::dialogflow::cx::v3::ListFlowsRequest request, Options opts={})
Returns the list of all flows in the specified agent.
StatusOr< google::cloud::dialogflow::cx::v3::Flow > GetFlow(google::cloud::dialogflow::cx::v3::GetFlowRequest const &request, Options opts={})
Retrieves the specified flow.
StatusOr< google::cloud::dialogflow::cx::v3::Flow > UpdateFlow(google::cloud::dialogflow::cx::v3::Flow const &flow, google::protobuf::FieldMask const &update_mask, Options opts={})
Updates the specified flow.
FlowsClient & operator=(FlowsClient const &)=default
StatusOr< google::cloud::dialogflow::cx::v3::Flow > UpdateFlow(google::cloud::dialogflow::cx::v3::UpdateFlowRequest const &request, Options opts={})
Updates the specified flow.
StatusOr< google::cloud::dialogflow::cx::v3::Flow > GetFlow(std::string const &name, Options opts={})
Retrieves the specified flow.
FlowsClient(std::shared_ptr< FlowsConnection > connection, Options opts={})
StatusOr< google::cloud::dialogflow::cx::v3::FlowValidationResult > ValidateFlow(google::cloud::dialogflow::cx::v3::ValidateFlowRequest const &request, Options opts={})
Validates the specified flow and creates or updates validation results.
Status DeleteFlow(std::string const &name, Options opts={})
Deletes a specified flow.
friend bool operator!=(FlowsClient const &a, FlowsClient const &b)
Definition: flows_client.h:84
future< StatusOr< google::cloud::dialogflow::cx::v3::ExportFlowResponse > > ExportFlow(google::cloud::dialogflow::cx::v3::ExportFlowRequest const &request, Options opts={})
Exports the specified flow to a binary file.
future< StatusOr< google::protobuf::Struct > > TrainFlow(std::string const &name, Options opts={})
Trains the specified flow.
StatusOr< google::cloud::dialogflow::cx::v3::Flow > CreateFlow(std::string const &parent, google::cloud::dialogflow::cx::v3::Flow const &flow, Options opts={})
Creates a flow in the specified agent.
StatusOr< google::cloud::dialogflow::cx::v3::Flow > CreateFlow(google::cloud::dialogflow::cx::v3::CreateFlowRequest const &request, Options opts={})
Creates a flow in the specified agent.
StreamRange< google::cloud::dialogflow::cx::v3::Flow > ListFlows(std::string const &parent, Options opts={})
Returns the list of all flows in the specified agent.
Status DeleteFlow(google::cloud::dialogflow::cx::v3::DeleteFlowRequest const &request, Options opts={})
Deletes a specified flow.
FlowsClient(FlowsClient const &)=default
StatusOr< google::cloud::dialogflow::cx::v3::FlowValidationResult > GetFlowValidationResult(std::string const &name, Options opts={})
Gets the latest flow validation result.
FlowsClient & operator=(FlowsClient &&)=default
future< StatusOr< google::protobuf::Struct > > TrainFlow(google::cloud::dialogflow::cx::v3::TrainFlowRequest const &request, Options opts={})
Trains the specified flow.
future< StatusOr< google::cloud::dialogflow::cx::v3::ImportFlowResponse > > ImportFlow(google::cloud::dialogflow::cx::v3::ImportFlowRequest const &request, Options opts={})
Imports the specified flow to the specified agent from a binary file.
StatusOr< google::cloud::dialogflow::cx::v3::FlowValidationResult > GetFlowValidationResult(google::cloud::dialogflow::cx::v3::GetFlowValidationResultRequest const &request, Options opts={})
Gets the latest flow validation result.
The FlowsConnection object for FlowsClient.
Definition: flows_connection.h:65
friend friend class future
Definition: agents_client.h:33