Google Cloud IAM C++ Client 2.13.0
A C++ Client Library for Google Cloud IAM
Loading...
Searching...
No Matches
iam_credentials_connection.h
1// Copyright 2020 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/credentials/v1/iamcredentials.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_CREDENTIALS_V1_IAM_CREDENTIALS_CONNECTION_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_CREDENTIALS_V1_IAM_CREDENTIALS_CONNECTION_H
21
22#include "google/cloud/iam/credentials/v1/iam_credentials_connection_idempotency_policy.h"
23#include "google/cloud/iam/credentials/v1/internal/iam_credentials_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/credentials/v1/iamcredentials.pb.h>
29#include <memory>
30
31namespace google {
32namespace cloud {
33namespace iam_credentials_v1 {
34GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
35
36using IAMCredentialsRetryPolicy =
37 ::google::cloud::internal::TraitBasedRetryPolicy<
38 iam_credentials_v1_internal::IAMCredentialsRetryTraits>;
39
40using IAMCredentialsLimitedTimeRetryPolicy =
41 ::google::cloud::internal::LimitedTimeRetryPolicy<
42 iam_credentials_v1_internal::IAMCredentialsRetryTraits>;
43
44using IAMCredentialsLimitedErrorCountRetryPolicy =
45 ::google::cloud::internal::LimitedErrorCountRetryPolicy<
46 iam_credentials_v1_internal::IAMCredentialsRetryTraits>;
47
48/**
49 * The `IAMCredentialsConnection` object for `IAMCredentialsClient`.
50 *
51 * This interface defines virtual methods for each of the user-facing overload
52 * sets in `IAMCredentialsClient`. This allows users to inject custom behavior
53 * (e.g., with a Google Mock object) when writing tests that use objects of type
54 * `IAMCredentialsClient`.
55 *
56 * To create a concrete instance, see `MakeIAMCredentialsConnection()`.
57 *
58 * For mocking, see `iam_credentials_v1_mocks::MockIAMCredentialsConnection`.
59 */
61 public:
62 virtual ~IAMCredentialsConnection() = 0;
63
64 virtual Options options() { return Options{}; }
65
66 virtual StatusOr<google::iam::credentials::v1::GenerateAccessTokenResponse>
68 google::iam::credentials::v1::GenerateAccessTokenRequest const& request);
69
70 virtual StatusOr<google::iam::credentials::v1::GenerateIdTokenResponse>
72 google::iam::credentials::v1::GenerateIdTokenRequest const& request);
73
74 virtual StatusOr<google::iam::credentials::v1::SignBlobResponse> SignBlob(
75 google::iam::credentials::v1::SignBlobRequest const& request);
76
77 virtual StatusOr<google::iam::credentials::v1::SignJwtResponse> SignJwt(
78 google::iam::credentials::v1::SignJwtRequest const& request);
79};
80
81/**
82 * A factory function to construct an object of type `IAMCredentialsConnection`.
83 *
84 * The returned connection object should not be used directly; instead it
85 * should be passed as an argument to the constructor of IAMCredentialsClient.
86 *
87 * The optional @p options argument may be used to configure aspects of the
88 * returned `IAMCredentialsConnection`. Expected options are any of the types in
89 * the following option lists:
90 *
91 * - `google::cloud::CommonOptionList`
92 * - `google::cloud::GrpcOptionList`
93 * - `google::cloud::UnifiedCredentialsOptionList`
94 * - `google::cloud::iam_credentials_v1::IAMCredentialsPolicyOptionList`
95 *
96 * @note Unexpected options will be ignored. To log unexpected options instead,
97 * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
98 *
99 * @param options (optional) Configure the `IAMCredentialsConnection` created by
100 * this function.
101 */
103 Options options = {});
104
105GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
106namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls)
107} // namespace iam_credentials_v1
108} // namespace cloud
109} // namespace google
110
111#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_CREDENTIALS_V1_IAM_CREDENTIALS_CONNECTION_H
The IAMCredentialsConnection object for IAMCredentialsClient.
Definition: iam_credentials_connection.h:60
virtual StatusOr< google::iam::credentials::v1::SignBlobResponse > SignBlob(google::iam::credentials::v1::SignBlobRequest const &request)
virtual StatusOr< google::iam::credentials::v1::SignJwtResponse > SignJwt(google::iam::credentials::v1::SignJwtRequest const &request)
virtual StatusOr< google::iam::credentials::v1::GenerateAccessTokenResponse > GenerateAccessToken(google::iam::credentials::v1::GenerateAccessTokenRequest const &request)
virtual StatusOr< google::iam::credentials::v1::GenerateIdTokenResponse > GenerateIdToken(google::iam::credentials::v1::GenerateIdTokenRequest const &request)
virtual Options options()
Definition: iam_credentials_connection.h:64
Definition: iam_credentials_client.h:33
std::shared_ptr< IAMCredentialsConnection > MakeIAMCredentialsConnection(Options options={})
A factory function to construct an object of type IAMCredentialsConnection.