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/v2/session.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_SESSIONS_CONNECTION_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_SESSIONS_CONNECTION_H
21
22#include "google/cloud/dialogflow_es/internal/sessions_retry_traits.h"
23#include "google/cloud/dialogflow_es/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/v2/session.pb.h>
30#include <memory>
31#include <string>
32
33namespace google {
34namespace cloud {
35namespace dialogflow_es {
36GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
37
38using SessionsRetryPolicy = ::google::cloud::internal::TraitBasedRetryPolicy<
39 dialogflow_es_internal::SessionsRetryTraits>;
40
41using SessionsLimitedTimeRetryPolicy =
42 ::google::cloud::internal::LimitedTimeRetryPolicy<
43 dialogflow_es_internal::SessionsRetryTraits>;
44
45using SessionsLimitedErrorCountRetryPolicy =
46 ::google::cloud::internal::LimitedErrorCountRetryPolicy<
47 dialogflow_es_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_es_mocks::MockSessionsConnection`.
60 */
62 public:
63 virtual ~SessionsConnection() = 0;
64
65 virtual Options options() { return Options{}; }
66
67 virtual StatusOr<google::cloud::dialogflow::v2::DetectIntentResponse>
69 google::cloud::dialogflow::v2::DetectIntentRequest const& request);
70
71 virtual std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc<
72 google::cloud::dialogflow::v2::StreamingDetectIntentRequest,
73 google::cloud::dialogflow::v2::StreamingDetectIntentResponse>>
75};
76
77/**
78 * A factory function to construct an object of type `SessionsConnection`.
79 *
80 * The returned connection object should not be used directly; instead it
81 * should be passed as an argument to the constructor of SessionsClient.
82 *
83 * The optional @p options argument may be used to configure aspects of the
84 * returned `SessionsConnection`. Expected options are any of the types in
85 * the following option lists:
86 *
87 * - `google::cloud::CommonOptionList`
88 * - `google::cloud::GrpcOptionList`
89 * - `google::cloud::UnifiedCredentialsOptionList`
90 * - `google::cloud::dialogflow_es::SessionsPolicyOptionList`
91 *
92 * @note Unexpected options will be ignored. To log unexpected options instead,
93 * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
94 *
95 * @param location Sets the prefix for the default `EndpointOption` value.
96 * @param options (optional) Configure the `SessionsConnection` created by
97 * this function.
98 */
100 std::string const& location, Options options = {});
101
102/**
103 * A backwards-compatible version of the previous factory function. Unless
104 * the service also offers a global endpoint, the default value of the
105 * `EndpointOption` may be useless, in which case it must be overridden.
106 *
107 * @deprecated Please use the `location` overload instead.
108 */
110 Options options = {});
111
112GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
113} // namespace dialogflow_es
114} // namespace cloud
115} // namespace google
116
117#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_SESSIONS_CONNECTION_H
The SessionsConnection object for SessionsClient.
Definition: sessions_connection.h:61
virtual StatusOr< google::cloud::dialogflow::v2::DetectIntentResponse > DetectIntent(google::cloud::dialogflow::v2::DetectIntentRequest const &request)
virtual Options options()
Definition: sessions_connection.h:65
virtual std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< google::cloud::dialogflow::v2::StreamingDetectIntentRequest, google::cloud::dialogflow::v2::StreamingDetectIntentResponse > > AsyncStreamingDetectIntent()
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.