Dialogflow API C++ Client 2.13.0
A C++ Client Library for the Dialogflow API
Loading...
Searching...
No Matches
experiments_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/experiment.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_EXPERIMENTS_CONNECTION_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_EXPERIMENTS_CONNECTION_H
21
22#include "google/cloud/dialogflow_cx/experiments_connection_idempotency_policy.h"
23#include "google/cloud/dialogflow_cx/internal/experiments_retry_traits.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/experiment.pb.h>
30#include <memory>
31#include <string>
32
33namespace google {
34namespace cloud {
35namespace dialogflow_cx {
36GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
37
38using ExperimentsRetryPolicy = ::google::cloud::internal::TraitBasedRetryPolicy<
39 dialogflow_cx_internal::ExperimentsRetryTraits>;
40
41using ExperimentsLimitedTimeRetryPolicy =
42 ::google::cloud::internal::LimitedTimeRetryPolicy<
43 dialogflow_cx_internal::ExperimentsRetryTraits>;
44
45using ExperimentsLimitedErrorCountRetryPolicy =
46 ::google::cloud::internal::LimitedErrorCountRetryPolicy<
47 dialogflow_cx_internal::ExperimentsRetryTraits>;
48
49/**
50 * The `ExperimentsConnection` object for `ExperimentsClient`.
51 *
52 * This interface defines virtual methods for each of the user-facing overload
53 * sets in `ExperimentsClient`. This allows users to inject custom behavior
54 * (e.g., with a Google Mock object) when writing tests that use objects of type
55 * `ExperimentsClient`.
56 *
57 * To create a concrete instance, see `MakeExperimentsConnection()`.
58 *
59 * For mocking, see `dialogflow_cx_mocks::MockExperimentsConnection`.
60 */
62 public:
63 virtual ~ExperimentsConnection() = 0;
64
65 virtual Options options() { return Options{}; }
66
67 virtual StreamRange<google::cloud::dialogflow::cx::v3::Experiment>
69 google::cloud::dialogflow::cx::v3::ListExperimentsRequest request);
70
71 virtual StatusOr<google::cloud::dialogflow::cx::v3::Experiment> GetExperiment(
72 google::cloud::dialogflow::cx::v3::GetExperimentRequest const& request);
73
74 virtual StatusOr<google::cloud::dialogflow::cx::v3::Experiment>
76 google::cloud::dialogflow::cx::v3::CreateExperimentRequest const&
77 request);
78
79 virtual StatusOr<google::cloud::dialogflow::cx::v3::Experiment>
81 google::cloud::dialogflow::cx::v3::UpdateExperimentRequest const&
82 request);
83
85 google::cloud::dialogflow::cx::v3::DeleteExperimentRequest const&
86 request);
87
88 virtual StatusOr<google::cloud::dialogflow::cx::v3::Experiment>
90 google::cloud::dialogflow::cx::v3::StartExperimentRequest const& request);
91
92 virtual StatusOr<google::cloud::dialogflow::cx::v3::Experiment>
94 google::cloud::dialogflow::cx::v3::StopExperimentRequest const& request);
95};
96
97/**
98 * A factory function to construct an object of type `ExperimentsConnection`.
99 *
100 * The returned connection object should not be used directly; instead it
101 * should be passed as an argument to the constructor of ExperimentsClient.
102 *
103 * The optional @p options argument may be used to configure aspects of the
104 * returned `ExperimentsConnection`. Expected options are any of the types in
105 * the following option lists:
106 *
107 * - `google::cloud::CommonOptionList`
108 * - `google::cloud::GrpcOptionList`
109 * - `google::cloud::UnifiedCredentialsOptionList`
110 * - `google::cloud::dialogflow_cx::ExperimentsPolicyOptionList`
111 *
112 * @note Unexpected options will be ignored. To log unexpected options instead,
113 * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
114 *
115 * @param location Sets the prefix for the default `EndpointOption` value.
116 * @param options (optional) Configure the `ExperimentsConnection` created by
117 * this function.
118 */
120 std::string const& location, Options options = {});
121
122/**
123 * A backwards-compatible version of the previous factory function. Unless
124 * the service also offers a global endpoint, the default value of the
125 * `EndpointOption` may be useless, in which case it must be overridden.
126 *
127 * @deprecated Please use the `location` overload instead.
128 */
130 Options options = {});
131
132GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
133} // namespace dialogflow_cx
134} // namespace cloud
135} // namespace google
136
137#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_CX_EXPERIMENTS_CONNECTION_H
The ExperimentsConnection object for ExperimentsClient.
Definition: experiments_connection.h:61
virtual StreamRange< google::cloud::dialogflow::cx::v3::Experiment > ListExperiments(google::cloud::dialogflow::cx::v3::ListExperimentsRequest request)
virtual Options options()
Definition: experiments_connection.h:65
virtual StatusOr< google::cloud::dialogflow::cx::v3::Experiment > CreateExperiment(google::cloud::dialogflow::cx::v3::CreateExperimentRequest const &request)
virtual StatusOr< google::cloud::dialogflow::cx::v3::Experiment > StopExperiment(google::cloud::dialogflow::cx::v3::StopExperimentRequest const &request)
virtual StatusOr< google::cloud::dialogflow::cx::v3::Experiment > GetExperiment(google::cloud::dialogflow::cx::v3::GetExperimentRequest const &request)
virtual StatusOr< google::cloud::dialogflow::cx::v3::Experiment > UpdateExperiment(google::cloud::dialogflow::cx::v3::UpdateExperimentRequest const &request)
virtual Status DeleteExperiment(google::cloud::dialogflow::cx::v3::DeleteExperimentRequest const &request)
virtual StatusOr< google::cloud::dialogflow::cx::v3::Experiment > StartExperiment(google::cloud::dialogflow::cx::v3::StartExperimentRequest const &request)
Definition: agents_client.h:33
std::shared_ptr< ExperimentsConnection > MakeExperimentsConnection(Options options={})
A backwards-compatible version of the previous factory function.
std::shared_ptr< ExperimentsConnection > MakeExperimentsConnection(std::string const &location, Options options={})
A factory function to construct an object of type ExperimentsConnection.