Dialogflow API C++ Client 2.13.0
A C++ Client Library for the Dialogflow API
Loading...
Searching...
No Matches
versions_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/version.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_VERSIONS_CONNECTION_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_VERSIONS_CONNECTION_H
21
22#include "google/cloud/dialogflow_cx/internal/versions_retry_traits.h"
23#include "google/cloud/dialogflow_cx/versions_connection_idempotency_policy.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/version.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 VersionsRetryPolicy = ::google::cloud::internal::TraitBasedRetryPolicy<
43 dialogflow_cx_internal::VersionsRetryTraits>;
44
45using VersionsLimitedTimeRetryPolicy =
46 ::google::cloud::internal::LimitedTimeRetryPolicy<
47 dialogflow_cx_internal::VersionsRetryTraits>;
48
49using VersionsLimitedErrorCountRetryPolicy =
50 ::google::cloud::internal::LimitedErrorCountRetryPolicy<
51 dialogflow_cx_internal::VersionsRetryTraits>;
52
53/**
54 * The `VersionsConnection` object for `VersionsClient`.
55 *
56 * This interface defines virtual methods for each of the user-facing overload
57 * sets in `VersionsClient`. This allows users to inject custom behavior
58 * (e.g., with a Google Mock object) when writing tests that use objects of type
59 * `VersionsClient`.
60 *
61 * To create a concrete instance, see `MakeVersionsConnection()`.
62 *
63 * For mocking, see `dialogflow_cx_mocks::MockVersionsConnection`.
64 */
66 public:
67 virtual ~VersionsConnection() = 0;
68
69 virtual Options options() { return Options{}; }
70
71 virtual StreamRange<google::cloud::dialogflow::cx::v3::Version> ListVersions(
72 google::cloud::dialogflow::cx::v3::ListVersionsRequest request);
73
74 virtual StatusOr<google::cloud::dialogflow::cx::v3::Version> GetVersion(
75 google::cloud::dialogflow::cx::v3::GetVersionRequest const& request);
76
77 virtual future<StatusOr<google::cloud::dialogflow::cx::v3::Version>>
79 google::cloud::dialogflow::cx::v3::CreateVersionRequest const& request);
80
81 virtual StatusOr<google::cloud::dialogflow::cx::v3::Version> UpdateVersion(
82 google::cloud::dialogflow::cx::v3::UpdateVersionRequest const& request);
83
84 virtual Status DeleteVersion(
85 google::cloud::dialogflow::cx::v3::DeleteVersionRequest const& request);
86
87 virtual future<StatusOr<google::protobuf::Struct>> LoadVersion(
88 google::cloud::dialogflow::cx::v3::LoadVersionRequest const& request);
89
90 virtual StatusOr<google::cloud::dialogflow::cx::v3::CompareVersionsResponse>
92 google::cloud::dialogflow::cx::v3::CompareVersionsRequest const& request);
93};
94
95/**
96 * A factory function to construct an object of type `VersionsConnection`.
97 *
98 * The returned connection object should not be used directly; instead it
99 * should be passed as an argument to the constructor of VersionsClient.
100 *
101 * The optional @p options argument may be used to configure aspects of the
102 * returned `VersionsConnection`. Expected options are any of the types in
103 * the following option lists:
104 *
105 * - `google::cloud::CommonOptionList`
106 * - `google::cloud::GrpcOptionList`
107 * - `google::cloud::UnifiedCredentialsOptionList`
108 * - `google::cloud::dialogflow_cx::VersionsPolicyOptionList`
109 *
110 * @note Unexpected options will be ignored. To log unexpected options instead,
111 * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
112 *
113 * @param location Sets the prefix for the default `EndpointOption` value.
114 * @param options (optional) Configure the `VersionsConnection` created by
115 * this function.
116 */
118 std::string const& location, Options options = {});
119
120/**
121 * A backwards-compatible version of the previous factory function. Unless
122 * the service also offers a global endpoint, the default value of the
123 * `EndpointOption` may be useless, in which case it must be overridden.
124 *
125 * @deprecated Please use the `location` overload instead.
126 */
128 Options options = {});
129
130GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
131} // namespace dialogflow_cx
132} // namespace cloud
133} // namespace google
134
135#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_VERSIONS_CONNECTION_H
The VersionsConnection object for VersionsClient.
Definition: versions_connection.h:65
virtual future< StatusOr< google::protobuf::Struct > > LoadVersion(google::cloud::dialogflow::cx::v3::LoadVersionRequest const &request)
virtual future< StatusOr< google::cloud::dialogflow::cx::v3::Version > > CreateVersion(google::cloud::dialogflow::cx::v3::CreateVersionRequest const &request)
virtual StatusOr< google::cloud::dialogflow::cx::v3::Version > UpdateVersion(google::cloud::dialogflow::cx::v3::UpdateVersionRequest const &request)
virtual Options options()
Definition: versions_connection.h:69
virtual StreamRange< google::cloud::dialogflow::cx::v3::Version > ListVersions(google::cloud::dialogflow::cx::v3::ListVersionsRequest request)
virtual Status DeleteVersion(google::cloud::dialogflow::cx::v3::DeleteVersionRequest const &request)
virtual StatusOr< google::cloud::dialogflow::cx::v3::Version > GetVersion(google::cloud::dialogflow::cx::v3::GetVersionRequest const &request)
virtual StatusOr< google::cloud::dialogflow::cx::v3::CompareVersionsResponse > CompareVersions(google::cloud::dialogflow::cx::v3::CompareVersionsRequest const &request)
friend friend class future
Definition: agents_client.h:33
std::shared_ptr< VersionsConnection > MakeVersionsConnection(Options options={})
A backwards-compatible version of the previous factory function.
std::shared_ptr< VersionsConnection > MakeVersionsConnection(std::string const &location, Options options={})
A factory function to construct an object of type VersionsConnection.