Dialogflow API C++ Client  2.4.0
A C++ Client Library for the Dialogflow API
pages_client.h
Go to the documentation of this file.
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/page.proto
18 
19 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_PAGES_CLIENT_H
20 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_PAGES_CLIENT_H
21 
22 #include "google/cloud/dialogflow_cx/pages_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 
30 namespace google {
31 namespace cloud {
32 namespace dialogflow_cx {
34 
35 ///
36 /// Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page].
37 ///
38 /// @par Equality
39 ///
40 /// Instances of this class created via copy-construction or copy-assignment
41 /// always compare equal. Instances created with equal
42 /// `std::shared_ptr<*Connection>` objects compare equal. Objects that compare
43 /// equal share the same underlying resources.
44 ///
45 /// @par Performance
46 ///
47 /// Creating a new instance of this class is a relatively expensive operation,
48 /// new objects establish new connections to the service. In contrast,
49 /// copy-construction, move-construction, and the corresponding assignment
50 /// operations are relatively efficient as the copies share all underlying
51 /// resources.
52 ///
53 /// @par Thread Safety
54 ///
55 /// Concurrent access to different instances of this class, even if they compare
56 /// equal, is guaranteed to work. Two or more threads operating on the same
57 /// instance of this class is not guaranteed to work. Since copy-construction
58 /// and move-construction is a relatively efficient operation, consider using
59 /// such a copy when using this class from multiple threads.
60 ///
61 class PagesClient {
62  public:
63  explicit PagesClient(std::shared_ptr<PagesConnection> connection,
64  Options opts = {});
66 
67  //@{
68  // @name Copy and move support
69  PagesClient(PagesClient const&) = default;
70  PagesClient& operator=(PagesClient const&) = default;
71  PagesClient(PagesClient&&) = default;
73  //@}
74 
75  //@{
76  // @name Equality
77  friend bool operator==(PagesClient const& a, PagesClient const& b) {
78  return a.connection_ == b.connection_;
79  }
80  friend bool operator!=(PagesClient const& a, PagesClient const& b) {
81  return !(a == b);
82  }
83  //@}
84 
85  ///
86  /// Returns the list of all pages in the specified flow.
87  ///
88  /// @param parent Required. The flow to list all pages for.
89  /// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
90  /// ID>/flows/<Flow ID>`.
91  /// @param opts Optional. Override the class-level options, such as retry and
92  /// backoff policies.
93  /// @return
94  /// @googleapis_link{google::cloud::dialogflow::cx::v3::Page,google/cloud/dialogflow/cx/v3/page.proto#L115}
95  ///
96  /// [google.cloud.dialogflow.cx.v3.ListPagesRequest]:
97  /// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/page.proto#L379}
98  /// [google.cloud.dialogflow.cx.v3.Page]:
99  /// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/page.proto#L115}
100  ///
101  StreamRange<google::cloud::dialogflow::cx::v3::Page> ListPages(
102  std::string const& parent, Options opts = {});
103 
104  ///
105  /// Returns the list of all pages in the specified flow.
106  ///
107  /// @param request
108  /// @googleapis_link{google::cloud::dialogflow::cx::v3::ListPagesRequest,google/cloud/dialogflow/cx/v3/page.proto#L379}
109  /// @param opts Optional. Override the class-level options, such as retry and
110  /// backoff policies.
111  /// @return
112  /// @googleapis_link{google::cloud::dialogflow::cx::v3::Page,google/cloud/dialogflow/cx/v3/page.proto#L115}
113  ///
114  /// [google.cloud.dialogflow.cx.v3.ListPagesRequest]:
115  /// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/page.proto#L379}
116  /// [google.cloud.dialogflow.cx.v3.Page]:
117  /// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/page.proto#L115}
118  ///
119  StreamRange<google::cloud::dialogflow::cx::v3::Page> ListPages(
120  google::cloud::dialogflow::cx::v3::ListPagesRequest request,
121  Options opts = {});
122 
123  ///
124  /// Retrieves the specified page.
125  ///
126  /// @param name Required. The name of the page.
127  /// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
128  /// ID>/flows/<Flow ID>/pages/<Page ID>`.
129  /// @param opts Optional. Override the class-level options, such as retry and
130  /// backoff policies.
131  /// @return
132  /// @googleapis_link{google::cloud::dialogflow::cx::v3::Page,google/cloud/dialogflow/cx/v3/page.proto#L115}
133  ///
134  /// [google.cloud.dialogflow.cx.v3.GetPageRequest]:
135  /// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/page.proto#L433}
136  /// [google.cloud.dialogflow.cx.v3.Page]:
137  /// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/page.proto#L115}
138  ///
139  StatusOr<google::cloud::dialogflow::cx::v3::Page> GetPage(
140  std::string const& name, Options opts = {});
141 
142  ///
143  /// Retrieves the specified page.
144  ///
145  /// @param request
146  /// @googleapis_link{google::cloud::dialogflow::cx::v3::GetPageRequest,google/cloud/dialogflow/cx/v3/page.proto#L433}
147  /// @param opts Optional. Override the class-level options, such as retry and
148  /// backoff policies.
149  /// @return
150  /// @googleapis_link{google::cloud::dialogflow::cx::v3::Page,google/cloud/dialogflow/cx/v3/page.proto#L115}
151  ///
152  /// [google.cloud.dialogflow.cx.v3.GetPageRequest]:
153  /// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/page.proto#L433}
154  /// [google.cloud.dialogflow.cx.v3.Page]:
155  /// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/page.proto#L115}
156  ///
157  StatusOr<google::cloud::dialogflow::cx::v3::Page> GetPage(
158  google::cloud::dialogflow::cx::v3::GetPageRequest const& request,
159  Options opts = {});
160 
161  ///
162  /// Creates a page in the specified flow.
163  ///
164  /// Note: You should always train a flow prior to sending it queries. See the
165  /// [training
166  /// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
167  ///
168  /// @param parent Required. The flow to create a page for.
169  /// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
170  /// ID>/flows/<Flow ID>`.
171  /// @param page Required. The page to create.
172  /// @param opts Optional. Override the class-level options, such as retry and
173  /// backoff policies.
174  /// @return
175  /// @googleapis_link{google::cloud::dialogflow::cx::v3::Page,google/cloud/dialogflow/cx/v3/page.proto#L115}
176  ///
177  /// [google.cloud.dialogflow.cx.v3.CreatePageRequest]:
178  /// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/page.proto#L469}
179  /// [google.cloud.dialogflow.cx.v3.Page]:
180  /// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/page.proto#L115}
181  ///
182  StatusOr<google::cloud::dialogflow::cx::v3::Page> CreatePage(
183  std::string const& parent,
184  google::cloud::dialogflow::cx::v3::Page const& page, Options opts = {});
185 
186  ///
187  /// Creates a page in the specified flow.
188  ///
189  /// Note: You should always train a flow prior to sending it queries. See the
190  /// [training
191  /// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
192  ///
193  /// @param request
194  /// @googleapis_link{google::cloud::dialogflow::cx::v3::CreatePageRequest,google/cloud/dialogflow/cx/v3/page.proto#L469}
195  /// @param opts Optional. Override the class-level options, such as retry and
196  /// backoff policies.
197  /// @return
198  /// @googleapis_link{google::cloud::dialogflow::cx::v3::Page,google/cloud/dialogflow/cx/v3/page.proto#L115}
199  ///
200  /// [google.cloud.dialogflow.cx.v3.CreatePageRequest]:
201  /// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/page.proto#L469}
202  /// [google.cloud.dialogflow.cx.v3.Page]:
203  /// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/page.proto#L115}
204  ///
205  StatusOr<google::cloud::dialogflow::cx::v3::Page> CreatePage(
206  google::cloud::dialogflow::cx::v3::CreatePageRequest const& request,
207  Options opts = {});
208 
209  ///
210  /// Updates the specified page.
211  ///
212  /// Note: You should always train a flow prior to sending it queries. See the
213  /// [training
214  /// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
215  ///
216  /// @param page Required. The page to update.
217  /// @param update_mask The mask to control which fields get updated. If the
218  /// mask is not present,
219  /// all fields will be updated.
220  /// @param opts Optional. Override the class-level options, such as retry and
221  /// backoff policies.
222  /// @return
223  /// @googleapis_link{google::cloud::dialogflow::cx::v3::Page,google/cloud/dialogflow/cx/v3/page.proto#L115}
224  ///
225  /// [google.cloud.dialogflow.cx.v3.UpdatePageRequest]:
226  /// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/page.proto#L507}
227  /// [google.cloud.dialogflow.cx.v3.Page]:
228  /// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/page.proto#L115}
229  ///
230  StatusOr<google::cloud::dialogflow::cx::v3::Page> UpdatePage(
231  google::cloud::dialogflow::cx::v3::Page const& page,
232  google::protobuf::FieldMask const& update_mask, Options opts = {});
233 
234  ///
235  /// Updates the specified page.
236  ///
237  /// Note: You should always train a flow prior to sending it queries. See the
238  /// [training
239  /// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
240  ///
241  /// @param request
242  /// @googleapis_link{google::cloud::dialogflow::cx::v3::UpdatePageRequest,google/cloud/dialogflow/cx/v3/page.proto#L507}
243  /// @param opts Optional. Override the class-level options, such as retry and
244  /// backoff policies.
245  /// @return
246  /// @googleapis_link{google::cloud::dialogflow::cx::v3::Page,google/cloud/dialogflow/cx/v3/page.proto#L115}
247  ///
248  /// [google.cloud.dialogflow.cx.v3.UpdatePageRequest]:
249  /// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/page.proto#L507}
250  /// [google.cloud.dialogflow.cx.v3.Page]:
251  /// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/page.proto#L115}
252  ///
253  StatusOr<google::cloud::dialogflow::cx::v3::Page> UpdatePage(
254  google::cloud::dialogflow::cx::v3::UpdatePageRequest const& request,
255  Options opts = {});
256 
257  ///
258  /// Deletes the specified page.
259  ///
260  /// Note: You should always train a flow prior to sending it queries. See the
261  /// [training
262  /// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
263  ///
264  /// @param name Required. The name of the page to delete.
265  /// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
266  /// ID>/Flows/<flow ID>/pages/<Page ID>`.
267  /// @param opts Optional. Override the class-level options, such as retry and
268  /// backoff policies.
269  ///
270  /// [google.cloud.dialogflow.cx.v3.DeletePageRequest]:
271  /// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/page.proto#L539}
272  ///
273  Status DeletePage(std::string const& name, Options opts = {});
274 
275  ///
276  /// Deletes the specified page.
277  ///
278  /// Note: You should always train a flow prior to sending it queries. See the
279  /// [training
280  /// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
281  ///
282  /// @param request
283  /// @googleapis_link{google::cloud::dialogflow::cx::v3::DeletePageRequest,google/cloud/dialogflow/cx/v3/page.proto#L539}
284  /// @param opts Optional. Override the class-level options, such as retry and
285  /// backoff policies.
286  ///
287  /// [google.cloud.dialogflow.cx.v3.DeletePageRequest]:
288  /// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/page.proto#L539}
289  ///
291  google::cloud::dialogflow::cx::v3::DeletePageRequest const& request,
292  Options opts = {});
293 
294  private:
295  std::shared_ptr<PagesConnection> connection_;
296  Options options_;
297 };
298 
300 } // namespace dialogflow_cx
301 } // namespace cloud
302 } // namespace google
303 
304 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_PAGES_CLIENT_H