|
| 1 | +// Copyright 2024 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/kms/v1/autokey_admin.proto |
| 18 | + |
| 19 | +#include "google/cloud/kms/v1/autokey_admin_client.h" |
| 20 | +#include <memory> |
| 21 | +#include <utility> |
| 22 | + |
| 23 | +namespace google { |
| 24 | +namespace cloud { |
| 25 | +namespace kms_v1 { |
| 26 | +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN |
| 27 | + |
| 28 | +AutokeyAdminClient::AutokeyAdminClient( |
| 29 | + std::shared_ptr<AutokeyAdminConnection> connection, Options opts) |
| 30 | + : connection_(std::move(connection)), |
| 31 | + options_( |
| 32 | + internal::MergeOptions(std::move(opts), connection_->options())) {} |
| 33 | +AutokeyAdminClient::~AutokeyAdminClient() = default; |
| 34 | + |
| 35 | +StatusOr<google::cloud::kms::v1::AutokeyConfig> |
| 36 | +AutokeyAdminClient::UpdateAutokeyConfig( |
| 37 | + google::cloud::kms::v1::AutokeyConfig const& autokey_config, |
| 38 | + google::protobuf::FieldMask const& update_mask, Options opts) { |
| 39 | + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); |
| 40 | + google::cloud::kms::v1::UpdateAutokeyConfigRequest request; |
| 41 | + *request.mutable_autokey_config() = autokey_config; |
| 42 | + *request.mutable_update_mask() = update_mask; |
| 43 | + return connection_->UpdateAutokeyConfig(request); |
| 44 | +} |
| 45 | + |
| 46 | +StatusOr<google::cloud::kms::v1::AutokeyConfig> |
| 47 | +AutokeyAdminClient::UpdateAutokeyConfig( |
| 48 | + google::cloud::kms::v1::UpdateAutokeyConfigRequest const& request, |
| 49 | + Options opts) { |
| 50 | + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); |
| 51 | + return connection_->UpdateAutokeyConfig(request); |
| 52 | +} |
| 53 | + |
| 54 | +StatusOr<google::cloud::kms::v1::AutokeyConfig> |
| 55 | +AutokeyAdminClient::GetAutokeyConfig(std::string const& name, Options opts) { |
| 56 | + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); |
| 57 | + google::cloud::kms::v1::GetAutokeyConfigRequest request; |
| 58 | + request.set_name(name); |
| 59 | + return connection_->GetAutokeyConfig(request); |
| 60 | +} |
| 61 | + |
| 62 | +StatusOr<google::cloud::kms::v1::AutokeyConfig> |
| 63 | +AutokeyAdminClient::GetAutokeyConfig( |
| 64 | + google::cloud::kms::v1::GetAutokeyConfigRequest const& request, |
| 65 | + Options opts) { |
| 66 | + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); |
| 67 | + return connection_->GetAutokeyConfig(request); |
| 68 | +} |
| 69 | + |
| 70 | +StatusOr<google::cloud::kms::v1::ShowEffectiveAutokeyConfigResponse> |
| 71 | +AutokeyAdminClient::ShowEffectiveAutokeyConfig(std::string const& parent, |
| 72 | + Options opts) { |
| 73 | + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); |
| 74 | + google::cloud::kms::v1::ShowEffectiveAutokeyConfigRequest request; |
| 75 | + request.set_parent(parent); |
| 76 | + return connection_->ShowEffectiveAutokeyConfig(request); |
| 77 | +} |
| 78 | + |
| 79 | +StatusOr<google::cloud::kms::v1::ShowEffectiveAutokeyConfigResponse> |
| 80 | +AutokeyAdminClient::ShowEffectiveAutokeyConfig( |
| 81 | + google::cloud::kms::v1::ShowEffectiveAutokeyConfigRequest const& request, |
| 82 | + Options opts) { |
| 83 | + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); |
| 84 | + return connection_->ShowEffectiveAutokeyConfig(request); |
| 85 | +} |
| 86 | + |
| 87 | +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END |
| 88 | +} // namespace kms_v1 |
| 89 | +} // namespace cloud |
| 90 | +} // namespace google |
0 commit comments