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