Google Cloud IAM C++ Client 2.13.0
A C++ Client Library for Google Cloud IAM
Loading...
Searching...
No Matches
iam_policy_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/v1/iam_policy.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V1_IAM_POLICY_CONNECTION_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V1_IAM_POLICY_CONNECTION_H
21
22#include "google/cloud/iam/v1/iam_policy_connection_idempotency_policy.h"
23#include "google/cloud/iam/v1/internal/iam_policy_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/version.h"
28#include <google/iam/v1/iam_policy.pb.h>
29#include <memory>
30
31namespace google {
32namespace cloud {
33namespace iam_v1 {
34GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
35
36using IAMPolicyRetryPolicy = ::google::cloud::internal::TraitBasedRetryPolicy<
37 iam_v1_internal::IAMPolicyRetryTraits>;
38
39using IAMPolicyLimitedTimeRetryPolicy =
40 ::google::cloud::internal::LimitedTimeRetryPolicy<
41 iam_v1_internal::IAMPolicyRetryTraits>;
42
43using IAMPolicyLimitedErrorCountRetryPolicy =
44 ::google::cloud::internal::LimitedErrorCountRetryPolicy<
45 iam_v1_internal::IAMPolicyRetryTraits>;
46
47/**
48 * The `IAMPolicyConnection` object for `IAMPolicyClient`.
49 *
50 * This interface defines virtual methods for each of the user-facing overload
51 * sets in `IAMPolicyClient`. This allows users to inject custom behavior
52 * (e.g., with a Google Mock object) when writing tests that use objects of type
53 * `IAMPolicyClient`.
54 *
55 * To create a concrete instance, see `MakeIAMPolicyConnection()`.
56 *
57 * For mocking, see `iam_v1_mocks::MockIAMPolicyConnection`.
58 */
60 public:
61 virtual ~IAMPolicyConnection() = 0;
62
63 virtual Options options() { return Options{}; }
64
65 virtual StatusOr<google::iam::v1::Policy> SetIamPolicy(
66 google::iam::v1::SetIamPolicyRequest const& request);
67
68 virtual StatusOr<google::iam::v1::Policy> GetIamPolicy(
69 google::iam::v1::GetIamPolicyRequest const& request);
70
71 virtual StatusOr<google::iam::v1::TestIamPermissionsResponse>
72 TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const& request);
73};
74
75/**
76 * A factory function to construct an object of type `IAMPolicyConnection`.
77 *
78 * The returned connection object should not be used directly; instead it
79 * should be passed as an argument to the constructor of IAMPolicyClient.
80 *
81 * The optional @p options argument may be used to configure aspects of the
82 * returned `IAMPolicyConnection`. 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::iam_v1::IAMPolicyPolicyOptionList`
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 options (optional) Configure the `IAMPolicyConnection` created by
94 * this function.
95 */
97 Options options = {});
98
99GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
100} // namespace iam_v1
101} // namespace cloud
102} // namespace google
103
104#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V1_IAM_POLICY_CONNECTION_H
The IAMPolicyConnection object for IAMPolicyClient.
Definition: iam_policy_connection.h:59
virtual StatusOr< google::iam::v1::Policy > SetIamPolicy(google::iam::v1::SetIamPolicyRequest const &request)
virtual StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const &request)
virtual Options options()
Definition: iam_policy_connection.h:63
virtual StatusOr< google::iam::v1::Policy > GetIamPolicy(google::iam::v1::GetIamPolicyRequest const &request)
Definition: iam_policy_client.h:32
std::shared_ptr< IAMPolicyConnection > MakeIAMPolicyConnection(Options options={})
A factory function to construct an object of type IAMPolicyConnection.