Dialogflow API C++ Client 2.13.0
A C++ Client Library for the Dialogflow API
Loading...
Searching...
No Matches
agents_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/agent.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_AGENTS_CONNECTION_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_AGENTS_CONNECTION_H
21
22#include "google/cloud/dialogflow_es/agents_connection_idempotency_policy.h"
23#include "google/cloud/dialogflow_es/internal/agents_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/v2/agent.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_es {
40GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
41
42using AgentsRetryPolicy = ::google::cloud::internal::TraitBasedRetryPolicy<
43 dialogflow_es_internal::AgentsRetryTraits>;
44
45using AgentsLimitedTimeRetryPolicy =
46 ::google::cloud::internal::LimitedTimeRetryPolicy<
47 dialogflow_es_internal::AgentsRetryTraits>;
48
49using AgentsLimitedErrorCountRetryPolicy =
50 ::google::cloud::internal::LimitedErrorCountRetryPolicy<
51 dialogflow_es_internal::AgentsRetryTraits>;
52
53/**
54 * The `AgentsConnection` object for `AgentsClient`.
55 *
56 * This interface defines virtual methods for each of the user-facing overload
57 * sets in `AgentsClient`. This allows users to inject custom behavior
58 * (e.g., with a Google Mock object) when writing tests that use objects of type
59 * `AgentsClient`.
60 *
61 * To create a concrete instance, see `MakeAgentsConnection()`.
62 *
63 * For mocking, see `dialogflow_es_mocks::MockAgentsConnection`.
64 */
65class AgentsConnection {
66 public:
67 virtual ~AgentsConnection() = 0;
68
69 virtual Options options() { return Options{}; }
70
71 virtual StatusOr<google::cloud::dialogflow::v2::Agent> GetAgent(
72 google::cloud::dialogflow::v2::GetAgentRequest const& request);
73
74 virtual StatusOr<google::cloud::dialogflow::v2::Agent> SetAgent(
75 google::cloud::dialogflow::v2::SetAgentRequest const& request);
76
77 virtual Status DeleteAgent(
78 google::cloud::dialogflow::v2::DeleteAgentRequest const& request);
79
80 virtual StreamRange<google::cloud::dialogflow::v2::Agent> SearchAgents(
81 google::cloud::dialogflow::v2::SearchAgentsRequest request);
82
83 virtual future<StatusOr<google::protobuf::Struct>> TrainAgent(
84 google::cloud::dialogflow::v2::TrainAgentRequest const& request);
85
86 virtual future<StatusOr<google::cloud::dialogflow::v2::ExportAgentResponse>>
87 ExportAgent(google::cloud::dialogflow::v2::ExportAgentRequest const& request);
88
89 virtual future<StatusOr<google::protobuf::Struct>> ImportAgent(
90 google::cloud::dialogflow::v2::ImportAgentRequest const& request);
91
92 virtual future<StatusOr<google::protobuf::Struct>> RestoreAgent(
93 google::cloud::dialogflow::v2::RestoreAgentRequest const& request);
94
95 virtual StatusOr<google::cloud::dialogflow::v2::ValidationResult>
97 google::cloud::dialogflow::v2::GetValidationResultRequest const& request);
98};
99
100/**
101 * A factory function to construct an object of type `AgentsConnection`.
102 *
103 * The returned connection object should not be used directly; instead it
104 * should be passed as an argument to the constructor of AgentsClient.
105 *
106 * The optional @p options argument may be used to configure aspects of the
107 * returned `AgentsConnection`. Expected options are any of the types in
108 * the following option lists:
109 *
110 * - `google::cloud::CommonOptionList`
111 * - `google::cloud::GrpcOptionList`
112 * - `google::cloud::UnifiedCredentialsOptionList`
113 * - `google::cloud::dialogflow_es::AgentsPolicyOptionList`
114 *
115 * @note Unexpected options will be ignored. To log unexpected options instead,
116 * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
117 *
118 * @param location Sets the prefix for the default `EndpointOption` value.
119 * @param options (optional) Configure the `AgentsConnection` created by
120 * this function.
121 */
123 std::string const& location, Options options = {});
124
125/**
126 * A backwards-compatible version of the previous factory function. Unless
127 * the service also offers a global endpoint, the default value of the
128 * `EndpointOption` may be useless, in which case it must be overridden.
129 *
130 * @deprecated Please use the `location` overload instead.
131 */
132std::shared_ptr<AgentsConnection> MakeAgentsConnection(Options options = {});
133
134GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
135} // namespace dialogflow_es
136} // namespace cloud
137} // namespace google
138
139#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_AGENTS_CONNECTION_H
The AgentsConnection object for AgentsClient.
Definition: agents_connection.h:65
virtual future< StatusOr< google::cloud::dialogflow::v2::ExportAgentResponse > > ExportAgent(google::cloud::dialogflow::v2::ExportAgentRequest const &request)
virtual Status DeleteAgent(google::cloud::dialogflow::v2::DeleteAgentRequest const &request)
virtual future< StatusOr< google::protobuf::Struct > > RestoreAgent(google::cloud::dialogflow::v2::RestoreAgentRequest const &request)
virtual future< StatusOr< google::protobuf::Struct > > ImportAgent(google::cloud::dialogflow::v2::ImportAgentRequest const &request)
virtual StreamRange< google::cloud::dialogflow::v2::Agent > SearchAgents(google::cloud::dialogflow::v2::SearchAgentsRequest request)
virtual future< StatusOr< google::protobuf::Struct > > TrainAgent(google::cloud::dialogflow::v2::TrainAgentRequest const &request)
virtual StatusOr< google::cloud::dialogflow::v2::Agent > GetAgent(google::cloud::dialogflow::v2::GetAgentRequest const &request)
virtual StatusOr< google::cloud::dialogflow::v2::ValidationResult > GetValidationResult(google::cloud::dialogflow::v2::GetValidationResultRequest const &request)
virtual Options options()
Definition: agents_connection.h:69
virtual StatusOr< google::cloud::dialogflow::v2::Agent > SetAgent(google::cloud::dialogflow::v2::SetAgentRequest const &request)
friend friend class future
Definition: agents_client.h:33
std::shared_ptr< AgentsConnection > MakeAgentsConnection(Options options={})
A backwards-compatible version of the previous factory function.
std::shared_ptr< AgentsConnection > MakeAgentsConnection(std::string const &location, Options options={})
A factory function to construct an object of type AgentsConnection.