Dialogflow API C++ Client 2.13.0
A C++ Client Library for the Dialogflow API
Loading...
Searching...
No Matches
pages_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/page.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_PAGES_CONNECTION_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_PAGES_CONNECTION_H
21
22#include "google/cloud/dialogflow_cx/internal/pages_retry_traits.h"
23#include "google/cloud/dialogflow_cx/pages_connection_idempotency_policy.h"
24#include "google/cloud/backoff_policy.h"
25#include "google/cloud/options.h"
26#include "google/cloud/status_or.h"
27#include "google/cloud/stream_range.h"
28#include "google/cloud/version.h"
29#include <google/cloud/dialogflow/cx/v3/page.pb.h>
30#include <memory>
31#include <string>
32
33namespace google {
34namespace cloud {
35namespace dialogflow_cx {
36GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
37
38using PagesRetryPolicy = ::google::cloud::internal::TraitBasedRetryPolicy<
39 dialogflow_cx_internal::PagesRetryTraits>;
40
41using PagesLimitedTimeRetryPolicy =
42 ::google::cloud::internal::LimitedTimeRetryPolicy<
43 dialogflow_cx_internal::PagesRetryTraits>;
44
45using PagesLimitedErrorCountRetryPolicy =
46 ::google::cloud::internal::LimitedErrorCountRetryPolicy<
47 dialogflow_cx_internal::PagesRetryTraits>;
48
49/**
50 * The `PagesConnection` object for `PagesClient`.
51 *
52 * This interface defines virtual methods for each of the user-facing overload
53 * sets in `PagesClient`. This allows users to inject custom behavior
54 * (e.g., with a Google Mock object) when writing tests that use objects of type
55 * `PagesClient`.
56 *
57 * To create a concrete instance, see `MakePagesConnection()`.
58 *
59 * For mocking, see `dialogflow_cx_mocks::MockPagesConnection`.
60 */
61class PagesConnection {
62 public:
63 virtual ~PagesConnection() = 0;
64
65 virtual Options options() { return Options{}; }
66
67 virtual StreamRange<google::cloud::dialogflow::cx::v3::Page> ListPages(
68 google::cloud::dialogflow::cx::v3::ListPagesRequest request);
69
70 virtual StatusOr<google::cloud::dialogflow::cx::v3::Page> GetPage(
71 google::cloud::dialogflow::cx::v3::GetPageRequest const& request);
72
73 virtual StatusOr<google::cloud::dialogflow::cx::v3::Page> CreatePage(
74 google::cloud::dialogflow::cx::v3::CreatePageRequest const& request);
75
76 virtual StatusOr<google::cloud::dialogflow::cx::v3::Page> UpdatePage(
77 google::cloud::dialogflow::cx::v3::UpdatePageRequest const& request);
78
79 virtual Status DeletePage(
80 google::cloud::dialogflow::cx::v3::DeletePageRequest const& request);
81};
82
83/**
84 * A factory function to construct an object of type `PagesConnection`.
85 *
86 * The returned connection object should not be used directly; instead it
87 * should be passed as an argument to the constructor of PagesClient.
88 *
89 * The optional @p options argument may be used to configure aspects of the
90 * returned `PagesConnection`. Expected options are any of the types in
91 * the following option lists:
92 *
93 * - `google::cloud::CommonOptionList`
94 * - `google::cloud::GrpcOptionList`
95 * - `google::cloud::UnifiedCredentialsOptionList`
96 * - `google::cloud::dialogflow_cx::PagesPolicyOptionList`
97 *
98 * @note Unexpected options will be ignored. To log unexpected options instead,
99 * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
100 *
101 * @param location Sets the prefix for the default `EndpointOption` value.
102 * @param options (optional) Configure the `PagesConnection` created by
103 * this function.
104 */
105std::shared_ptr<PagesConnection> MakePagesConnection(
106 std::string const& location, Options options = {});
107
108/**
109 * A backwards-compatible version of the previous factory function. Unless
110 * the service also offers a global endpoint, the default value of the
111 * `EndpointOption` may be useless, in which case it must be overridden.
112 *
113 * @deprecated Please use the `location` overload instead.
114 */
115std::shared_ptr<PagesConnection> MakePagesConnection(Options options = {});
116
117GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
118} // namespace dialogflow_cx
119} // namespace cloud
120} // namespace google
121
122#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_PAGES_CONNECTION_H
The PagesConnection object for PagesClient.
Definition: pages_connection.h:61
virtual StreamRange< google::cloud::dialogflow::cx::v3::Page > ListPages(google::cloud::dialogflow::cx::v3::ListPagesRequest request)
virtual Options options()
Definition: pages_connection.h:65
virtual StatusOr< google::cloud::dialogflow::cx::v3::Page > UpdatePage(google::cloud::dialogflow::cx::v3::UpdatePageRequest const &request)
virtual Status DeletePage(google::cloud::dialogflow::cx::v3::DeletePageRequest const &request)
virtual StatusOr< google::cloud::dialogflow::cx::v3::Page > GetPage(google::cloud::dialogflow::cx::v3::GetPageRequest const &request)
virtual StatusOr< google::cloud::dialogflow::cx::v3::Page > CreatePage(google::cloud::dialogflow::cx::v3::CreatePageRequest const &request)
Definition: agents_client.h:33
std::shared_ptr< PagesConnection > MakePagesConnection(std::string const &location, Options options={})
A factory function to construct an object of type PagesConnection.
std::shared_ptr< PagesConnection > MakePagesConnection(Options options={})
A backwards-compatible version of the previous factory function.