Dialogflow API C++ Client 2.13.0
A C++ Client Library for the Dialogflow API
Loading...
Searching...
No Matches
sessions_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/session.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_SESSIONS_CONNECTION_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_SESSIONS_CONNECTION_H
21
22#include "google/cloud/dialogflow_cx/internal/sessions_retry_traits.h"
23#include "google/cloud/dialogflow_cx/sessions_connection_idempotency_policy.h"
24#include "google/cloud/backoff_policy.h"
25#include "google/cloud/internal/async_read_write_stream_impl.h"
26#include "google/cloud/options.h"
27#include "google/cloud/status_or.h"
28#include "google/cloud/version.h"
29#include <google/cloud/dialogflow/cx/v3/session.pb.h>
30#include <memory>
31#include <string>
32
33namespace google {
34namespace cloud {
35namespace dialogflow_cx {
36GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
37
38using SessionsRetryPolicy = ::google::cloud::internal::TraitBasedRetryPolicy<
39 dialogflow_cx_internal::SessionsRetryTraits>;
40
41using SessionsLimitedTimeRetryPolicy =
42 ::google::cloud::internal::LimitedTimeRetryPolicy<
43 dialogflow_cx_internal::SessionsRetryTraits>;
44
45using SessionsLimitedErrorCountRetryPolicy =
46 ::google::cloud::internal::LimitedErrorCountRetryPolicy<
47 dialogflow_cx_internal::SessionsRetryTraits>;
48
49/**
50 * The `SessionsConnection` object for `SessionsClient`.
51 *
52 * This interface defines virtual methods for each of the user-facing overload
53 * sets in `SessionsClient`. This allows users to inject custom behavior
54 * (e.g., with a Google Mock object) when writing tests that use objects of type
55 * `SessionsClient`.
56 *
57 * To create a concrete instance, see `MakeSessionsConnection()`.
58 *
59 * For mocking, see `dialogflow_cx_mocks::MockSessionsConnection`.
60 */
62 public:
63 virtual ~SessionsConnection() = 0;
64
65 virtual Options options() { return Options{}; }
66
67 virtual StatusOr<google::cloud::dialogflow::cx::v3::DetectIntentResponse>
69 google::cloud::dialogflow::cx::v3::DetectIntentRequest const& request);
70
71 virtual std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc<
72 google::cloud::dialogflow::cx::v3::StreamingDetectIntentRequest,
73 google::cloud::dialogflow::cx::v3::StreamingDetectIntentResponse>>
75
76 virtual StatusOr<google::cloud::dialogflow::cx::v3::MatchIntentResponse>
78 google::cloud::dialogflow::cx::v3::MatchIntentRequest const& request);
79
80 virtual StatusOr<google::cloud::dialogflow::cx::v3::FulfillIntentResponse>
82 google::cloud::dialogflow::cx::v3::FulfillIntentRequest const& request);
83};
84
85/**
86 * A factory function to construct an object of type `SessionsConnection`.
87 *
88 * The returned connection object should not be used directly; instead it
89 * should be passed as an argument to the constructor of SessionsClient.
90 *
91 * The optional @p options argument may be used to configure aspects of the
92 * returned `SessionsConnection`. Expected options are any of the types in
93 * the following option lists:
94 *
95 * - `google::cloud::CommonOptionList`
96 * - `google::cloud::GrpcOptionList`
97 * - `google::cloud::UnifiedCredentialsOptionList`
98 * - `google::cloud::dialogflow_cx::SessionsPolicyOptionList`
99 *
100 * @note Unexpected options will be ignored. To log unexpected options instead,
101 * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
102 *
103 * @param location Sets the prefix for the default `EndpointOption` value.
104 * @param options (optional) Configure the `SessionsConnection` created by
105 * this function.
106 */
108 std::string const& location, Options options = {});
109
110/**
111 * A backwards-compatible version of the previous factory function. Unless
112 * the service also offers a global endpoint, the default value of the
113 * `EndpointOption` may be useless, in which case it must be overridden.
114 *
115 * @deprecated Please use the `location` overload instead.
116 */
118 Options options = {});
119
120GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
121} // namespace dialogflow_cx
122} // namespace cloud
123} // namespace google
124
125#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_SESSIONS_CONNECTION_H
The SessionsConnection object for SessionsClient.
Definition: sessions_connection.h:61
virtual Options options()
Definition: sessions_connection.h:65
virtual StatusOr< google::cloud::dialogflow::cx::v3::MatchIntentResponse > MatchIntent(google::cloud::dialogflow::cx::v3::MatchIntentRequest const &request)
virtual std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::cloud::dialogflow::cx::v3::StreamingDetectIntentRequest, google::cloud::dialogflow::cx::v3::StreamingDetectIntentResponse > > AsyncStreamingDetectIntent()
virtual StatusOr< google::cloud::dialogflow::cx::v3::FulfillIntentResponse > FulfillIntent(google::cloud::dialogflow::cx::v3::FulfillIntentRequest const &request)
virtual StatusOr< google::cloud::dialogflow::cx::v3::DetectIntentResponse > DetectIntent(google::cloud::dialogflow::cx::v3::DetectIntentRequest const &request)
Definition: agents_client.h:33
std::shared_ptr< SessionsConnection > MakeSessionsConnection(std::string const &location, Options options={})
A factory function to construct an object of type SessionsConnection.
std::shared_ptr< SessionsConnection > MakeSessionsConnection(Options options={})
A backwards-compatible version of the previous factory function.