Dialogflow API C++ Client 2.13.0
A C++ Client Library for the Dialogflow API
Loading...
Searching...
No Matches
flows_connection.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_CONNECTION_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_FLOWS_CONNECTION_H
21
22#include "google/cloud/dialogflow_cx/flows_connection_idempotency_policy.h"
23#include "google/cloud/dialogflow_cx/internal/flows_retry_traits.h"
24#include "google/cloud/backoff_policy.h"
25#include "google/cloud/future.h"
26#include "google/cloud/options.h"
27#include "google/cloud/polling_policy.h"
28#include "google/cloud/status_or.h"
29#include "google/cloud/stream_range.h"
30#include "google/cloud/version.h"
31#include <google/cloud/dialogflow/cx/v3/flow.pb.h>
32#include <google/longrunning/operations.grpc.pb.h>
33#include <google/protobuf/struct.pb.h>
34#include <memory>
35#include <string>
36
37namespace google {
38namespace cloud {
39namespace dialogflow_cx {
40GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
41
42using FlowsRetryPolicy = ::google::cloud::internal::TraitBasedRetryPolicy<
43 dialogflow_cx_internal::FlowsRetryTraits>;
44
45using FlowsLimitedTimeRetryPolicy =
46 ::google::cloud::internal::LimitedTimeRetryPolicy<
47 dialogflow_cx_internal::FlowsRetryTraits>;
48
49using FlowsLimitedErrorCountRetryPolicy =
50 ::google::cloud::internal::LimitedErrorCountRetryPolicy<
51 dialogflow_cx_internal::FlowsRetryTraits>;
52
53/**
54 * The `FlowsConnection` object for `FlowsClient`.
55 *
56 * This interface defines virtual methods for each of the user-facing overload
57 * sets in `FlowsClient`. This allows users to inject custom behavior
58 * (e.g., with a Google Mock object) when writing tests that use objects of type
59 * `FlowsClient`.
60 *
61 * To create a concrete instance, see `MakeFlowsConnection()`.
62 *
63 * For mocking, see `dialogflow_cx_mocks::MockFlowsConnection`.
64 */
65class FlowsConnection {
66 public:
67 virtual ~FlowsConnection() = 0;
68
69 virtual Options options() { return Options{}; }
70
71 virtual StatusOr<google::cloud::dialogflow::cx::v3::Flow> CreateFlow(
72 google::cloud::dialogflow::cx::v3::CreateFlowRequest const& request);
73
74 virtual Status DeleteFlow(
75 google::cloud::dialogflow::cx::v3::DeleteFlowRequest const& request);
76
77 virtual StreamRange<google::cloud::dialogflow::cx::v3::Flow> ListFlows(
78 google::cloud::dialogflow::cx::v3::ListFlowsRequest request);
79
80 virtual StatusOr<google::cloud::dialogflow::cx::v3::Flow> GetFlow(
81 google::cloud::dialogflow::cx::v3::GetFlowRequest const& request);
82
83 virtual StatusOr<google::cloud::dialogflow::cx::v3::Flow> UpdateFlow(
84 google::cloud::dialogflow::cx::v3::UpdateFlowRequest const& request);
85
86 virtual future<StatusOr<google::protobuf::Struct>> TrainFlow(
87 google::cloud::dialogflow::cx::v3::TrainFlowRequest const& request);
88
89 virtual StatusOr<google::cloud::dialogflow::cx::v3::FlowValidationResult>
91 google::cloud::dialogflow::cx::v3::ValidateFlowRequest const& request);
92
93 virtual StatusOr<google::cloud::dialogflow::cx::v3::FlowValidationResult>
95 google::cloud::dialogflow::cx::v3::GetFlowValidationResultRequest const&
96 request);
97
98 virtual future<
99 StatusOr<google::cloud::dialogflow::cx::v3::ImportFlowResponse>>
101 google::cloud::dialogflow::cx::v3::ImportFlowRequest const& request);
102
103 virtual future<
104 StatusOr<google::cloud::dialogflow::cx::v3::ExportFlowResponse>>
106 google::cloud::dialogflow::cx::v3::ExportFlowRequest const& request);
107};
108
109/**
110 * A factory function to construct an object of type `FlowsConnection`.
111 *
112 * The returned connection object should not be used directly; instead it
113 * should be passed as an argument to the constructor of FlowsClient.
114 *
115 * The optional @p options argument may be used to configure aspects of the
116 * returned `FlowsConnection`. Expected options are any of the types in
117 * the following option lists:
118 *
119 * - `google::cloud::CommonOptionList`
120 * - `google::cloud::GrpcOptionList`
121 * - `google::cloud::UnifiedCredentialsOptionList`
122 * - `google::cloud::dialogflow_cx::FlowsPolicyOptionList`
123 *
124 * @note Unexpected options will be ignored. To log unexpected options instead,
125 * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
126 *
127 * @param location Sets the prefix for the default `EndpointOption` value.
128 * @param options (optional) Configure the `FlowsConnection` created by
129 * this function.
130 */
131std::shared_ptr<FlowsConnection> MakeFlowsConnection(
132 std::string const& location, Options options = {});
133
134/**
135 * A backwards-compatible version of the previous factory function. Unless
136 * the service also offers a global endpoint, the default value of the
137 * `EndpointOption` may be useless, in which case it must be overridden.
138 *
139 * @deprecated Please use the `location` overload instead.
140 */
141std::shared_ptr<FlowsConnection> MakeFlowsConnection(Options options = {});
142
143GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
144} // namespace dialogflow_cx
145} // namespace cloud
146} // namespace google
147
148#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_FLOWS_CONNECTION_H
The FlowsConnection object for FlowsClient.
Definition: flows_connection.h:65
virtual Options options()
Definition: flows_connection.h:69
virtual StatusOr< google::cloud::dialogflow::cx::v3::Flow > GetFlow(google::cloud::dialogflow::cx::v3::GetFlowRequest const &request)
virtual StatusOr< google::cloud::dialogflow::cx::v3::FlowValidationResult > ValidateFlow(google::cloud::dialogflow::cx::v3::ValidateFlowRequest const &request)
virtual future< StatusOr< google::protobuf::Struct > > TrainFlow(google::cloud::dialogflow::cx::v3::TrainFlowRequest const &request)
virtual StatusOr< google::cloud::dialogflow::cx::v3::Flow > UpdateFlow(google::cloud::dialogflow::cx::v3::UpdateFlowRequest const &request)
virtual StreamRange< google::cloud::dialogflow::cx::v3::Flow > ListFlows(google::cloud::dialogflow::cx::v3::ListFlowsRequest request)
virtual future< StatusOr< google::cloud::dialogflow::cx::v3::ImportFlowResponse > > ImportFlow(google::cloud::dialogflow::cx::v3::ImportFlowRequest const &request)
virtual Status DeleteFlow(google::cloud::dialogflow::cx::v3::DeleteFlowRequest const &request)
virtual future< StatusOr< google::cloud::dialogflow::cx::v3::ExportFlowResponse > > ExportFlow(google::cloud::dialogflow::cx::v3::ExportFlowRequest const &request)
virtual StatusOr< google::cloud::dialogflow::cx::v3::Flow > CreateFlow(google::cloud::dialogflow::cx::v3::CreateFlowRequest const &request)
virtual StatusOr< google::cloud::dialogflow::cx::v3::FlowValidationResult > GetFlowValidationResult(google::cloud::dialogflow::cx::v3::GetFlowValidationResultRequest const &request)
friend friend class future
Definition: agents_client.h:33
std::shared_ptr< FlowsConnection > MakeFlowsConnection(Options options={})
A backwards-compatible version of the previous factory function.
std::shared_ptr< FlowsConnection > MakeFlowsConnection(std::string const &location, Options options={})
A factory function to construct an object of type FlowsConnection.