Google Cloud IAM C++ Client 2.13.0
A C++ Client Library for Google Cloud IAM
Loading...
Searching...
No Matches
policies_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/iam/v2/policy.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V2_POLICIES_CONNECTION_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V2_POLICIES_CONNECTION_H
21
22#include "google/cloud/iam/v2/internal/policies_retry_traits.h"
23#include "google/cloud/iam/v2/policies_connection_idempotency_policy.h"
24#include "google/cloud/backoff_policy.h"
25#include "google/cloud/future.h"
26#include "google/cloud/options.h"
27#include "google/cloud/polling_policy.h"
28#include "google/cloud/status_or.h"
29#include "google/cloud/stream_range.h"
30#include "google/cloud/version.h"
31#include <google/iam/v2/policy.pb.h>
32#include <google/longrunning/operations.grpc.pb.h>
33#include <memory>
34
35namespace google {
36namespace cloud {
37namespace iam_v2 {
38GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
39
40using PoliciesRetryPolicy = ::google::cloud::internal::TraitBasedRetryPolicy<
41 iam_v2_internal::PoliciesRetryTraits>;
42
43using PoliciesLimitedTimeRetryPolicy =
44 ::google::cloud::internal::LimitedTimeRetryPolicy<
45 iam_v2_internal::PoliciesRetryTraits>;
46
47using PoliciesLimitedErrorCountRetryPolicy =
48 ::google::cloud::internal::LimitedErrorCountRetryPolicy<
49 iam_v2_internal::PoliciesRetryTraits>;
50
51/**
52 * The `PoliciesConnection` object for `PoliciesClient`.
53 *
54 * This interface defines virtual methods for each of the user-facing overload
55 * sets in `PoliciesClient`. This allows users to inject custom behavior
56 * (e.g., with a Google Mock object) when writing tests that use objects of type
57 * `PoliciesClient`.
58 *
59 * To create a concrete instance, see `MakePoliciesConnection()`.
60 *
61 * For mocking, see `iam_v2_mocks::MockPoliciesConnection`.
62 */
64 public:
65 virtual ~PoliciesConnection() = 0;
66
67 virtual Options options() { return Options{}; }
68
69 virtual StreamRange<google::iam::v2::Policy> ListPolicies(
70 google::iam::v2::ListPoliciesRequest request);
71
72 virtual StatusOr<google::iam::v2::Policy> GetPolicy(
73 google::iam::v2::GetPolicyRequest const& request);
74
75 virtual future<StatusOr<google::iam::v2::Policy>> CreatePolicy(
76 google::iam::v2::CreatePolicyRequest const& request);
77
78 virtual future<StatusOr<google::iam::v2::Policy>> UpdatePolicy(
79 google::iam::v2::UpdatePolicyRequest const& request);
80
81 virtual future<StatusOr<google::iam::v2::Policy>> DeletePolicy(
82 google::iam::v2::DeletePolicyRequest const& request);
83};
84
85/**
86 * A factory function to construct an object of type `PoliciesConnection`.
87 *
88 * The returned connection object should not be used directly; instead it
89 * should be passed as an argument to the constructor of PoliciesClient.
90 *
91 * The optional @p options argument may be used to configure aspects of the
92 * returned `PoliciesConnection`. Expected options are any of the types in
93 * the following option lists:
94 *
95 * - `google::cloud::CommonOptionList`
96 * - `google::cloud::GrpcOptionList`
97 * - `google::cloud::UnifiedCredentialsOptionList`
98 * - `google::cloud::iam_v2::PoliciesPolicyOptionList`
99 *
100 * @note Unexpected options will be ignored. To log unexpected options instead,
101 * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
102 *
103 * @param options (optional) Configure the `PoliciesConnection` created by
104 * this function.
105 */
107 Options options = {});
108
109GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
110} // namespace iam_v2
111} // namespace cloud
112} // namespace google
113
114#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V2_POLICIES_CONNECTION_H
friend friend class future
The PoliciesConnection object for PoliciesClient.
Definition: policies_connection.h:63
virtual StreamRange< google::iam::v2::Policy > ListPolicies(google::iam::v2::ListPoliciesRequest request)
virtual future< StatusOr< google::iam::v2::Policy > > CreatePolicy(google::iam::v2::CreatePolicyRequest const &request)
virtual future< StatusOr< google::iam::v2::Policy > > UpdatePolicy(google::iam::v2::UpdatePolicyRequest const &request)
virtual Options options()
Definition: policies_connection.h:67
virtual future< StatusOr< google::iam::v2::Policy > > DeletePolicy(google::iam::v2::DeletePolicyRequest const &request)
virtual StatusOr< google::iam::v2::Policy > GetPolicy(google::iam::v2::GetPolicyRequest const &request)
Definition: policies_client.h:34
std::shared_ptr< PoliciesConnection > MakePoliciesConnection(Options options={})
A factory function to construct an object of type PoliciesConnection.