forked from googleapis/google-cloud-cpp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathiam_credentials_client.gcpcxx.pb.cc
107 lines (94 loc) · 4.2 KB
/
iam_credentials_client.gcpcxx.pb.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Generated by the Codegen C++ plugin.
// If you make any local changes, they will be lost.
// source: google/iam/credentials/v1/iamcredentials.proto
#include "google/cloud/iam/iam_credentials_client.gcpcxx.pb.h"
#include <memory>
namespace google {
namespace cloud {
inline namespace GOOGLE_CLOUD_CPP_NS {
namespace iam {
IAMCredentialsClient::IAMCredentialsClient(
std::shared_ptr<IAMCredentialsConnection> connection)
: connection_(std::move(connection)) {}
IAMCredentialsClient::~IAMCredentialsClient() = default;
StatusOr<::google::iam::credentials::v1::GenerateAccessTokenResponse>
IAMCredentialsClient::GenerateAccessToken(
std::string const& name, std::vector<std::string> const& delegates,
std::vector<std::string> const& scope,
::google::protobuf::Duration const& lifetime) {
::google::iam::credentials::v1::GenerateAccessTokenRequest request;
request.set_name(name);
*request.mutable_delegates() = {delegates.begin(), delegates.end()};
*request.mutable_scope() = {scope.begin(), scope.end()};
*request.mutable_lifetime() = lifetime;
return connection_->GenerateAccessToken(request);
}
StatusOr<::google::iam::credentials::v1::GenerateIdTokenResponse>
IAMCredentialsClient::GenerateIdToken(std::string const& name,
std::vector<std::string> const& delegates,
std::string const& audience,
bool include_email) {
::google::iam::credentials::v1::GenerateIdTokenRequest request;
request.set_name(name);
*request.mutable_delegates() = {delegates.begin(), delegates.end()};
request.set_audience(audience);
request.set_include_email(include_email);
return connection_->GenerateIdToken(request);
}
StatusOr<::google::iam::credentials::v1::SignBlobResponse>
IAMCredentialsClient::SignBlob(std::string const& name,
std::vector<std::string> const& delegates,
std::string const& payload) {
::google::iam::credentials::v1::SignBlobRequest request;
request.set_name(name);
*request.mutable_delegates() = {delegates.begin(), delegates.end()};
request.set_payload(payload);
return connection_->SignBlob(request);
}
StatusOr<::google::iam::credentials::v1::SignJwtResponse>
IAMCredentialsClient::SignJwt(std::string const& name,
std::vector<std::string> const& delegates,
std::string const& payload) {
::google::iam::credentials::v1::SignJwtRequest request;
request.set_name(name);
*request.mutable_delegates() = {delegates.begin(), delegates.end()};
request.set_payload(payload);
return connection_->SignJwt(request);
}
StatusOr<::google::iam::credentials::v1::GenerateAccessTokenResponse>
IAMCredentialsClient::GenerateAccessToken(
::google::iam::credentials::v1::GenerateAccessTokenRequest const& request) {
return connection_->GenerateAccessToken(request);
}
StatusOr<::google::iam::credentials::v1::GenerateIdTokenResponse>
IAMCredentialsClient::GenerateIdToken(
::google::iam::credentials::v1::GenerateIdTokenRequest const& request) {
return connection_->GenerateIdToken(request);
}
StatusOr<::google::iam::credentials::v1::SignBlobResponse>
IAMCredentialsClient::SignBlob(
::google::iam::credentials::v1::SignBlobRequest const& request) {
return connection_->SignBlob(request);
}
StatusOr<::google::iam::credentials::v1::SignJwtResponse>
IAMCredentialsClient::SignJwt(
::google::iam::credentials::v1::SignJwtRequest const& request) {
return connection_->SignJwt(request);
}
} // namespace iam
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace cloud
} // namespace google