Dialogflow API C++ Client 2.13.0
A C++ Client Library for the Dialogflow API
Loading...
Searching...
No Matches
webhooks_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/webhook.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_WEBHOOKS_CONNECTION_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_WEBHOOKS_CONNECTION_H
21
22#include "google/cloud/dialogflow_cx/internal/webhooks_retry_traits.h"
23#include "google/cloud/dialogflow_cx/webhooks_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/webhook.pb.h>
30#include <memory>
31#include <string>
32
33namespace google {
34namespace cloud {
35namespace dialogflow_cx {
36GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
37
38using WebhooksRetryPolicy = ::google::cloud::internal::TraitBasedRetryPolicy<
39 dialogflow_cx_internal::WebhooksRetryTraits>;
40
41using WebhooksLimitedTimeRetryPolicy =
42 ::google::cloud::internal::LimitedTimeRetryPolicy<
43 dialogflow_cx_internal::WebhooksRetryTraits>;
44
45using WebhooksLimitedErrorCountRetryPolicy =
46 ::google::cloud::internal::LimitedErrorCountRetryPolicy<
47 dialogflow_cx_internal::WebhooksRetryTraits>;
48
49/**
50 * The `WebhooksConnection` object for `WebhooksClient`.
51 *
52 * This interface defines virtual methods for each of the user-facing overload
53 * sets in `WebhooksClient`. This allows users to inject custom behavior
54 * (e.g., with a Google Mock object) when writing tests that use objects of type
55 * `WebhooksClient`.
56 *
57 * To create a concrete instance, see `MakeWebhooksConnection()`.
58 *
59 * For mocking, see `dialogflow_cx_mocks::MockWebhooksConnection`.
60 */
62 public:
63 virtual ~WebhooksConnection() = 0;
64
65 virtual Options options() { return Options{}; }
66
67 virtual StreamRange<google::cloud::dialogflow::cx::v3::Webhook> ListWebhooks(
68 google::cloud::dialogflow::cx::v3::ListWebhooksRequest request);
69
70 virtual StatusOr<google::cloud::dialogflow::cx::v3::Webhook> GetWebhook(
71 google::cloud::dialogflow::cx::v3::GetWebhookRequest const& request);
72
73 virtual StatusOr<google::cloud::dialogflow::cx::v3::Webhook> CreateWebhook(
74 google::cloud::dialogflow::cx::v3::CreateWebhookRequest const& request);
75
76 virtual StatusOr<google::cloud::dialogflow::cx::v3::Webhook> UpdateWebhook(
77 google::cloud::dialogflow::cx::v3::UpdateWebhookRequest const& request);
78
79 virtual Status DeleteWebhook(
80 google::cloud::dialogflow::cx::v3::DeleteWebhookRequest const& request);
81};
82
83/**
84 * A factory function to construct an object of type `WebhooksConnection`.
85 *
86 * The returned connection object should not be used directly; instead it
87 * should be passed as an argument to the constructor of WebhooksClient.
88 *
89 * The optional @p options argument may be used to configure aspects of the
90 * returned `WebhooksConnection`. 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::WebhooksPolicyOptionList`
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 `WebhooksConnection` created by
103 * this function.
104 */
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 */
116 Options options = {});
117
118GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
119} // namespace dialogflow_cx
120} // namespace cloud
121} // namespace google
122
123#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_WEBHOOKS_CONNECTION_H
The WebhooksConnection object for WebhooksClient.
Definition: webhooks_connection.h:61
virtual Options options()
Definition: webhooks_connection.h:65
virtual StatusOr< google::cloud::dialogflow::cx::v3::Webhook > GetWebhook(google::cloud::dialogflow::cx::v3::GetWebhookRequest const &request)
virtual StatusOr< google::cloud::dialogflow::cx::v3::Webhook > UpdateWebhook(google::cloud::dialogflow::cx::v3::UpdateWebhookRequest const &request)
virtual Status DeleteWebhook(google::cloud::dialogflow::cx::v3::DeleteWebhookRequest const &request)
virtual StatusOr< google::cloud::dialogflow::cx::v3::Webhook > CreateWebhook(google::cloud::dialogflow::cx::v3::CreateWebhookRequest const &request)
virtual StreamRange< google::cloud::dialogflow::cx::v3::Webhook > ListWebhooks(google::cloud::dialogflow::cx::v3::ListWebhooksRequest request)
Definition: agents_client.h:33
std::shared_ptr< WebhooksConnection > MakeWebhooksConnection(Options options={})
A backwards-compatible version of the previous factory function.
std::shared_ptr< WebhooksConnection > MakeWebhooksConnection(std::string const &location, Options options={})
A factory function to construct an object of type WebhooksConnection.