Dialogflow API C++ Client 2.13.0
A C++ Client Library for the Dialogflow API
Loading...
Searching...
No Matches
deployments_client.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/deployment.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_DEPLOYMENTS_CLIENT_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_DEPLOYMENTS_CLIENT_H
21
22#include "google/cloud/dialogflow_cx/deployments_connection.h"
23#include "google/cloud/future.h"
24#include "google/cloud/options.h"
25#include "google/cloud/polling_policy.h"
26#include "google/cloud/status_or.h"
27#include "google/cloud/version.h"
28#include <memory>
29
30namespace google {
31namespace cloud {
32namespace dialogflow_cx {
33GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
34
35///
36/// Service for managing
37/// [Deployments][google.cloud.dialogflow.cx.v3.Deployment].
38///
39/// @par Equality
40///
41/// Instances of this class created via copy-construction or copy-assignment
42/// always compare equal. Instances created with equal
43/// `std::shared_ptr<*Connection>` objects compare equal. Objects that compare
44/// equal share the same underlying resources.
45///
46/// @par Performance
47///
48/// Creating a new instance of this class is a relatively expensive operation,
49/// new objects establish new connections to the service. In contrast,
50/// copy-construction, move-construction, and the corresponding assignment
51/// operations are relatively efficient as the copies share all underlying
52/// resources.
53///
54/// @par Thread Safety
55///
56/// Concurrent access to different instances of this class, even if they compare
57/// equal, is guaranteed to work. Two or more threads operating on the same
58/// instance of this class is not guaranteed to work. Since copy-construction
59/// and move-construction is a relatively efficient operation, consider using
60/// such a copy when using this class from multiple threads.
61///
62/// [google.cloud.dialogflow.cx.v3.Deployment]:
63/// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/deployment.proto#L65}
64///
66 public:
67 explicit DeploymentsClient(std::shared_ptr<DeploymentsConnection> connection,
68 Options opts = {});
70
71 ///@{
72 /// @name Copy and move support
73 DeploymentsClient(DeploymentsClient const&) = default;
77 ///@}
78
79 ///@{
80 /// @name Equality
81 friend bool operator==(DeploymentsClient const& a,
82 DeploymentsClient const& b) {
83 return a.connection_ == b.connection_;
84 }
85 friend bool operator!=(DeploymentsClient const& a,
86 DeploymentsClient const& b) {
87 return !(a == b);
88 }
89 ///@}
90
91 // clang-format off
92 ///
93 /// Returns the list of all deployments in the specified
94 /// [Environment][google.cloud.dialogflow.cx.v3.Environment].
95 ///
96 /// @param parent Required. The [Environment][google.cloud.dialogflow.cx.v3.Environment] to
97 /// list all environments for. Format:
98 /// @n
99 /// @code
100 /// projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/environments/<Environment ID>
101 /// @endcode
102 /// @param opts Optional. Override the class-level options, such as retry and
103 /// backoff policies.
104 /// @return a [StreamRange](@ref google::cloud::StreamRange)
105 /// to iterate of the results. See the documentation of this type for
106 /// details. In brief, this class has `begin()` and `end()` member
107 /// functions returning a iterator class meeting the
108 /// [input iterator requirements]. The value type for this iterator is a
109 /// [`StatusOr`] as the iteration may fail even after some values are
110 /// retrieved successfully, for example, if there is a network disconnect.
111 /// An empty set of results does not indicate an error, it indicates
112 /// that there are no resources meeting the request criteria.
113 /// On a successful iteration the `StatusOr<T>` contains elements of type
114 /// [google.cloud.dialogflow.cx.v3.Deployment], or rather,
115 /// the C++ class generated by Protobuf from that type. Please consult the
116 /// Protobuf documentation for details on the [Protobuf mapping rules].
117 ///
118 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
119 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
120 /// [Long Running Operation]: https://google.aip.dev/151
121 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
122 /// [`future`]: @ref google::cloud::future
123 /// [`StatusOr`]: @ref google::cloud::StatusOr
124 /// [`Status`]: @ref google::cloud::Status
125 /// [google.cloud.dialogflow.cx.v3.Deployment]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/deployment.proto#L65}
126 /// [google.cloud.dialogflow.cx.v3.ListDeploymentsRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/deployment.proto#L131}
127 ///
128 // clang-format on
129 StreamRange<google::cloud::dialogflow::cx::v3::Deployment> ListDeployments(
130 std::string const& parent, Options opts = {});
131
132 // clang-format off
133 ///
134 /// Returns the list of all deployments in the specified
135 /// [Environment][google.cloud.dialogflow.cx.v3.Environment].
136 ///
137 /// @param request Unary RPCs, such as the one wrapped by this
138 /// function, receive a single `request` proto message which includes all
139 /// the inputs for the RPC. In this case, the proto message is a
140 /// [google.cloud.dialogflow.cx.v3.ListDeploymentsRequest].
141 /// Proto messages are converted to C++ classes by Protobuf, using the
142 /// [Protobuf mapping rules].
143 /// @param opts Optional. Override the class-level options, such as retry and
144 /// backoff policies.
145 /// @return a [StreamRange](@ref google::cloud::StreamRange)
146 /// to iterate of the results. See the documentation of this type for
147 /// details. In brief, this class has `begin()` and `end()` member
148 /// functions returning a iterator class meeting the
149 /// [input iterator requirements]. The value type for this iterator is a
150 /// [`StatusOr`] as the iteration may fail even after some values are
151 /// retrieved successfully, for example, if there is a network disconnect.
152 /// An empty set of results does not indicate an error, it indicates
153 /// that there are no resources meeting the request criteria.
154 /// On a successful iteration the `StatusOr<T>` contains elements of type
155 /// [google.cloud.dialogflow.cx.v3.Deployment], or rather,
156 /// the C++ class generated by Protobuf from that type. Please consult the
157 /// Protobuf documentation for details on the [Protobuf mapping rules].
158 ///
159 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
160 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
161 /// [Long Running Operation]: https://google.aip.dev/151
162 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
163 /// [`future`]: @ref google::cloud::future
164 /// [`StatusOr`]: @ref google::cloud::StatusOr
165 /// [`Status`]: @ref google::cloud::Status
166 /// [google.cloud.dialogflow.cx.v3.Deployment]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/deployment.proto#L65}
167 /// [google.cloud.dialogflow.cx.v3.ListDeploymentsRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/deployment.proto#L131}
168 ///
169 // clang-format on
170 StreamRange<google::cloud::dialogflow::cx::v3::Deployment> ListDeployments(
171 google::cloud::dialogflow::cx::v3::ListDeploymentsRequest request,
172 Options opts = {});
173
174 // clang-format off
175 ///
176 /// Retrieves the specified
177 /// [Deployment][google.cloud.dialogflow.cx.v3.Deployment].
178 ///
179 /// @param name Required. The name of the
180 /// [Deployment][google.cloud.dialogflow.cx.v3.Deployment]. Format:
181 /// `projects/<Project ID>/locations/<Location ID>/agents/<Agent
182 /// ID>/environments/<Environment ID>/deployments/<Deployment ID>`.
183 /// @param opts Optional. Override the class-level options, such as retry and
184 /// backoff policies.
185 /// @return the result of the RPC. The response message type
186 /// ([google.cloud.dialogflow.cx.v3.Deployment])
187 /// is mapped to a C++ class using the [Protobuf mapping rules].
188 /// If the request fails, the [`StatusOr`] contains the error details.
189 ///
190 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
191 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
192 /// [Long Running Operation]: https://google.aip.dev/151
193 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
194 /// [`future`]: @ref google::cloud::future
195 /// [`StatusOr`]: @ref google::cloud::StatusOr
196 /// [`Status`]: @ref google::cloud::Status
197 /// [google.cloud.dialogflow.cx.v3.Deployment]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/deployment.proto#L65}
198 /// [google.cloud.dialogflow.cx.v3.GetDeploymentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/deployment.proto#L167}
199 ///
200 // clang-format on
201 StatusOr<google::cloud::dialogflow::cx::v3::Deployment> GetDeployment(
202 std::string const& name, Options opts = {});
203
204 // clang-format off
205 ///
206 /// Retrieves the specified
207 /// [Deployment][google.cloud.dialogflow.cx.v3.Deployment].
208 ///
209 /// @param request Unary RPCs, such as the one wrapped by this
210 /// function, receive a single `request` proto message which includes all
211 /// the inputs for the RPC. In this case, the proto message is a
212 /// [google.cloud.dialogflow.cx.v3.GetDeploymentRequest].
213 /// Proto messages are converted to C++ classes by Protobuf, using the
214 /// [Protobuf mapping rules].
215 /// @param opts Optional. Override the class-level options, such as retry and
216 /// backoff policies.
217 /// @return the result of the RPC. The response message type
218 /// ([google.cloud.dialogflow.cx.v3.Deployment])
219 /// is mapped to a C++ class using the [Protobuf mapping rules].
220 /// If the request fails, the [`StatusOr`] contains the error details.
221 ///
222 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
223 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
224 /// [Long Running Operation]: https://google.aip.dev/151
225 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
226 /// [`future`]: @ref google::cloud::future
227 /// [`StatusOr`]: @ref google::cloud::StatusOr
228 /// [`Status`]: @ref google::cloud::Status
229 /// [google.cloud.dialogflow.cx.v3.Deployment]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/deployment.proto#L65}
230 /// [google.cloud.dialogflow.cx.v3.GetDeploymentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/deployment.proto#L167}
231 ///
232 // clang-format on
233 StatusOr<google::cloud::dialogflow::cx::v3::Deployment> GetDeployment(
234 google::cloud::dialogflow::cx::v3::GetDeploymentRequest const& request,
235 Options opts = {});
236
237 private:
238 std::shared_ptr<DeploymentsConnection> connection_;
239 Options options_;
240};
241
242GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
243} // namespace dialogflow_cx
244} // namespace cloud
245} // namespace google
246
247#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_DEPLOYMENTS_CLIENT_H
Service for managing Deployments.
Definition: deployments_client.h:65
StatusOr< google::cloud::dialogflow::cx::v3::Deployment > GetDeployment(std::string const &name, Options opts={})
Retrieves the specified Deployment.
DeploymentsClient(DeploymentsClient &&)=default
StatusOr< google::cloud::dialogflow::cx::v3::Deployment > GetDeployment(google::cloud::dialogflow::cx::v3::GetDeploymentRequest const &request, Options opts={})
Retrieves the specified Deployment.
friend bool operator==(DeploymentsClient const &a, DeploymentsClient const &b)
Definition: deployments_client.h:81
DeploymentsClient(std::shared_ptr< DeploymentsConnection > connection, Options opts={})
StreamRange< google::cloud::dialogflow::cx::v3::Deployment > ListDeployments(google::cloud::dialogflow::cx::v3::ListDeploymentsRequest request, Options opts={})
Returns the list of all deployments in the specified [Environment][google.cloud.dialogflow....
StreamRange< google::cloud::dialogflow::cx::v3::Deployment > ListDeployments(std::string const &parent, Options opts={})
Returns the list of all deployments in the specified [Environment][google.cloud.dialogflow....
DeploymentsClient(DeploymentsClient const &)=default
DeploymentsClient & operator=(DeploymentsClient &&)=default
friend bool operator!=(DeploymentsClient const &a, DeploymentsClient const &b)
Definition: deployments_client.h:85
DeploymentsClient & operator=(DeploymentsClient const &)=default
The DeploymentsConnection object for DeploymentsClient.
Definition: deployments_connection.h:61
Definition: agents_client.h:33