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/cx/v3/agent.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_AGENTS_CONNECTION_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_AGENTS_CONNECTION_H
21
22#include "google/cloud/dialogflow_cx/agents_connection_idempotency_policy.h"
23#include "google/cloud/dialogflow_cx/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/cx/v3/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_cx {
40GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
41
42using AgentsRetryPolicy = ::google::cloud::internal::TraitBasedRetryPolicy<
43 dialogflow_cx_internal::AgentsRetryTraits>;
44
45using AgentsLimitedTimeRetryPolicy =
46 ::google::cloud::internal::LimitedTimeRetryPolicy<
47 dialogflow_cx_internal::AgentsRetryTraits>;
48
49using AgentsLimitedErrorCountRetryPolicy =
50 ::google::cloud::internal::LimitedErrorCountRetryPolicy<
51 dialogflow_cx_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_cx_mocks::MockAgentsConnection`.
64 */
65class AgentsConnection {
66 public:
67 virtual ~AgentsConnection() = 0;
68
69 virtual Options options() { return Options{}; }
70
71 virtual StreamRange<google::cloud::dialogflow::cx::v3::Agent> ListAgents(
72 google::cloud::dialogflow::cx::v3::ListAgentsRequest request);
73
74 virtual StatusOr<google::cloud::dialogflow::cx::v3::Agent> GetAgent(
75 google::cloud::dialogflow::cx::v3::GetAgentRequest const& request);
76
77 virtual StatusOr<google::cloud::dialogflow::cx::v3::Agent> CreateAgent(
78 google::cloud::dialogflow::cx::v3::CreateAgentRequest const& request);
79
80 virtual StatusOr<google::cloud::dialogflow::cx::v3::Agent> UpdateAgent(
81 google::cloud::dialogflow::cx::v3::UpdateAgentRequest const& request);
82
83 virtual Status DeleteAgent(
84 google::cloud::dialogflow::cx::v3::DeleteAgentRequest const& request);
85
86 virtual future<
87 StatusOr<google::cloud::dialogflow::cx::v3::ExportAgentResponse>>
89 google::cloud::dialogflow::cx::v3::ExportAgentRequest const& request);
90
91 virtual future<StatusOr<google::protobuf::Struct>> RestoreAgent(
92 google::cloud::dialogflow::cx::v3::RestoreAgentRequest const& request);
93
94 virtual StatusOr<google::cloud::dialogflow::cx::v3::AgentValidationResult>
96 google::cloud::dialogflow::cx::v3::ValidateAgentRequest const& request);
97
98 virtual StatusOr<google::cloud::dialogflow::cx::v3::AgentValidationResult>
100 google::cloud::dialogflow::cx::v3::GetAgentValidationResultRequest const&
101 request);
102};
103
104/**
105 * A factory function to construct an object of type `AgentsConnection`.
106 *
107 * The returned connection object should not be used directly; instead it
108 * should be passed as an argument to the constructor of AgentsClient.
109 *
110 * The optional @p options argument may be used to configure aspects of the
111 * returned `AgentsConnection`. Expected options are any of the types in
112 * the following option lists:
113 *
114 * - `google::cloud::CommonOptionList`
115 * - `google::cloud::GrpcOptionList`
116 * - `google::cloud::UnifiedCredentialsOptionList`
117 * - `google::cloud::dialogflow_cx::AgentsPolicyOptionList`
118 *
119 * @note Unexpected options will be ignored. To log unexpected options instead,
120 * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
121 *
122 * @param location Sets the prefix for the default `EndpointOption` value.
123 * @param options (optional) Configure the `AgentsConnection` created by
124 * this function.
125 */
127 std::string const& location, Options options = {});
128
129/**
130 * A backwards-compatible version of the previous factory function. Unless
131 * the service also offers a global endpoint, the default value of the
132 * `EndpointOption` may be useless, in which case it must be overridden.
133 *
134 * @deprecated Please use the `location` overload instead.
135 */
136std::shared_ptr<AgentsConnection> MakeAgentsConnection(Options options = {});
137
138GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
139} // namespace dialogflow_cx
140} // namespace cloud
141} // namespace google
142
143#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_AGENTS_CONNECTION_H
The AgentsConnection object for AgentsClient.
Definition: agents_connection.h:65
virtual Options options()
Definition: agents_connection.h:69
virtual StatusOr< google::cloud::dialogflow::cx::v3::AgentValidationResult > ValidateAgent(google::cloud::dialogflow::cx::v3::ValidateAgentRequest const &request)
virtual Status DeleteAgent(google::cloud::dialogflow::cx::v3::DeleteAgentRequest const &request)
virtual StatusOr< google::cloud::dialogflow::cx::v3::Agent > GetAgent(google::cloud::dialogflow::cx::v3::GetAgentRequest const &request)
virtual StatusOr< google::cloud::dialogflow::cx::v3::Agent > CreateAgent(google::cloud::dialogflow::cx::v3::CreateAgentRequest const &request)
virtual StatusOr< google::cloud::dialogflow::cx::v3::Agent > UpdateAgent(google::cloud::dialogflow::cx::v3::UpdateAgentRequest const &request)
virtual future< StatusOr< google::cloud::dialogflow::cx::v3::ExportAgentResponse > > ExportAgent(google::cloud::dialogflow::cx::v3::ExportAgentRequest const &request)
virtual StreamRange< google::cloud::dialogflow::cx::v3::Agent > ListAgents(google::cloud::dialogflow::cx::v3::ListAgentsRequest request)
virtual StatusOr< google::cloud::dialogflow::cx::v3::AgentValidationResult > GetAgentValidationResult(google::cloud::dialogflow::cx::v3::GetAgentValidationResultRequest const &request)
virtual future< StatusOr< google::protobuf::Struct > > RestoreAgent(google::cloud::dialogflow::cx::v3::RestoreAgentRequest const &request)
friend friend class future
Definition: agents_client.h:33
std::shared_ptr< AgentsConnection > MakeAgentsConnection(std::string const &location, Options options={})
A factory function to construct an object of type AgentsConnection.
std::shared_ptr< AgentsConnection > MakeAgentsConnection(Options options={})
A backwards-compatible version of the previous factory function.