diff --git a/generator/generator_config.textproto b/generator/generator_config.textproto index 9d81f195a3386..87389e686d327 100644 --- a/generator/generator_config.textproto +++ b/generator/generator_config.textproto @@ -3683,6 +3683,18 @@ service { "WriteObject" ] omit_repo_metadata: true + omitted_rpcs: [ + "GetServiceAccount", + "CreateHmacKey", + "DeleteHmacKey", + "GetHmacKey", + "ListHmacKeys", + "UpdateHmacKey", + "DeleteNotificationConfig", + "GetNotificationConfig", + "CreateNotificationConfig", + "ListNotificationConfigs" + ] } # Storage Control diff --git a/google/cloud/storage/google_cloud_cpp_storage_grpc.bzl b/google/cloud/storage/google_cloud_cpp_storage_grpc.bzl index 26fb6dcb974dc..5b6397a0a1e1a 100644 --- a/google/cloud/storage/google_cloud_cpp_storage_grpc.bzl +++ b/google/cloud/storage/google_cloud_cpp_storage_grpc.bzl @@ -71,7 +71,6 @@ google_cloud_cpp_storage_grpc_hdrs = [ "internal/grpc/metrics_histograms.h", "internal/grpc/metrics_meter_provider.h", "internal/grpc/monitoring_project.h", - "internal/grpc/notification_metadata_parser.h", "internal/grpc/object_access_control_parser.h", "internal/grpc/object_metadata_parser.h", "internal/grpc/object_read_source.h", @@ -133,7 +132,6 @@ google_cloud_cpp_storage_grpc_srcs = [ "internal/grpc/metrics_histograms.cc", "internal/grpc/metrics_meter_provider.cc", "internal/grpc/monitoring_project.cc", - "internal/grpc/notification_metadata_parser.cc", "internal/grpc/object_access_control_parser.cc", "internal/grpc/object_metadata_parser.cc", "internal/grpc/object_read_source.cc", diff --git a/google/cloud/storage/google_cloud_cpp_storage_grpc.cmake b/google/cloud/storage/google_cloud_cpp_storage_grpc.cmake index d1012b7ec677e..f1f1b62806a79 100644 --- a/google/cloud/storage/google_cloud_cpp_storage_grpc.cmake +++ b/google/cloud/storage/google_cloud_cpp_storage_grpc.cmake @@ -163,8 +163,6 @@ add_library( internal/grpc/metrics_meter_provider.h internal/grpc/monitoring_project.cc internal/grpc/monitoring_project.h - internal/grpc/notification_metadata_parser.cc - internal/grpc/notification_metadata_parser.h internal/grpc/object_access_control_parser.cc internal/grpc/object_access_control_parser.h internal/grpc/object_metadata_parser.cc @@ -440,7 +438,6 @@ set(storage_client_grpc_unit_tests internal/grpc/metrics_histograms_test.cc internal/grpc/metrics_meter_provider_test.cc internal/grpc/monitoring_project_test.cc - internal/grpc/notification_metadata_parser_test.cc internal/grpc/object_access_control_parser_test.cc internal/grpc/object_metadata_parser_test.cc internal/grpc/object_read_source_test.cc diff --git a/google/cloud/storage/internal/grpc/notification_metadata_parser.cc b/google/cloud/storage/internal/grpc/notification_metadata_parser.cc deleted file mode 100644 index 94c4746caac42..0000000000000 --- a/google/cloud/storage/internal/grpc/notification_metadata_parser.cc +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2022 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. - -#include "google/cloud/storage/internal/grpc/notification_metadata_parser.h" -#include "google/cloud/storage/internal/grpc/bucket_name.h" -#include "absl/strings/str_split.h" -#include "absl/strings/strip.h" - -namespace google { -namespace cloud { -namespace storage_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -storage::NotificationMetadata FromProto( - google::storage::v2::NotificationConfig const& rhs) { - std::vector components = absl::StrSplit(rhs.name(), '/'); - auto id = components.empty() ? std::string{} : std::string{components.back()}; - - storage::NotificationMetadata result(std::move(id), rhs.etag()); - absl::string_view topic = rhs.topic(); - absl::ConsumePrefix(&topic, "//pubsub.googleapis.com/"); - result.set_topic(std::string{topic}); - for (auto const& e : rhs.event_types()) { - result.append_event_type(e); - } - for (auto const& kv : rhs.custom_attributes()) { - result.upsert_custom_attributes(kv.first, kv.second); - } - result.set_object_name_prefix(rhs.object_name_prefix()); - result.set_payload_format(rhs.payload_format()); - return result; -} - -google::storage::v2::NotificationConfig ToProto( - storage::NotificationMetadata const& rhs) { - google::storage::v2::NotificationConfig result; - result.set_topic("//pubsub.googleapis.com/" + rhs.topic()); - result.set_etag(rhs.etag()); - for (auto const& e : rhs.event_types()) { - result.add_event_types(e); - } - for (auto const& kv : rhs.custom_attributes()) { - (*result.mutable_custom_attributes())[kv.first] = kv.second; - } - result.set_object_name_prefix(rhs.object_name_prefix()); - result.set_payload_format(rhs.payload_format()); - return result; -} - -google::storage::v2::NotificationConfig ToProto( - storage::NotificationMetadata const& rhs, std::string const& bucket_name) { - auto result = ToProto(rhs); - result.set_name(GrpcBucketIdToName(bucket_name) + "/notificationConfigs/" + - rhs.id()); - return result; -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/internal/grpc/notification_metadata_parser.h b/google/cloud/storage/internal/grpc/notification_metadata_parser.h deleted file mode 100644 index 5e91beb9cc1d1..0000000000000 --- a/google/cloud/storage/internal/grpc/notification_metadata_parser.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2022 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. - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_GRPC_NOTIFICATION_METADATA_PARSER_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_GRPC_NOTIFICATION_METADATA_PARSER_H - -#include "google/cloud/storage/notification_metadata.h" -#include "google/cloud/storage/version.h" -#include - -namespace google { -namespace cloud { -namespace storage_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -storage::NotificationMetadata FromProto( - google::storage::v2::NotificationConfig const& rhs); -google::storage::v2::NotificationConfig ToProto( - storage::NotificationMetadata const& rhs); -google::storage::v2::NotificationConfig ToProto( - storage::NotificationMetadata const& rhs, std::string const& bucket_name); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_INTERNAL_GRPC_NOTIFICATION_METADATA_PARSER_H diff --git a/google/cloud/storage/internal/grpc/notification_metadata_parser_test.cc b/google/cloud/storage/internal/grpc/notification_metadata_parser_test.cc deleted file mode 100644 index 72a26f49e9f08..0000000000000 --- a/google/cloud/storage/internal/grpc/notification_metadata_parser_test.cc +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2022 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. - -#include "google/cloud/storage/internal/grpc/notification_metadata_parser.h" -#include "google/cloud/storage/internal/notification_metadata_parser.h" -#include "google/cloud/testing_util/is_proto_equal.h" -#include -#include - -namespace google { -namespace cloud { -namespace storage_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -namespace storage_proto = ::google::storage::v2; -using ::google::cloud::testing_util::IsProtoEqual; -using ::google::protobuf::TextFormat; -using ::testing::Pair; -using ::testing::UnorderedElementsAre; - -TEST(GrpcNotificationMetadataParser, Roundtrip) { - storage_proto::NotificationConfig input; - auto constexpr kProtoText = R"pb( - name: "projects/_/buckets/test-bucket-name/notificationConfigs/test-notification-id" - topic: "//pubsub.googleapis.com/projects/test-project-id/topics/test-topic-id" - etag: "test-etag" - event_types: "OBJECT_FINALIZE" - event_types: "OBJECT_METADATA_UPDATE" - event_types: "OBJECT_DELETE" - event_types: "OBJECT_ARCHIVE" - custom_attributes { key: "test-key-0" value: "test-value-0" } - custom_attributes { key: "test-key-1" value: "test-value-1" } - object_name_prefix: "test-object-name-prefix/" - payload_format: "JSON_API_V1" - )pb"; - EXPECT_TRUE(TextFormat::ParseFromString(kProtoText, &input)); - - auto const actual = FromProto(input); - EXPECT_EQ(actual.id(), "test-notification-id"); - EXPECT_EQ(actual.topic(), "projects/test-project-id/topics/test-topic-id"); - EXPECT_EQ(actual.etag(), "test-etag"); - EXPECT_THAT(actual.event_types(), - UnorderedElementsAre("OBJECT_FINALIZE", "OBJECT_METADATA_UPDATE", - "OBJECT_DELETE", "OBJECT_ARCHIVE")); - EXPECT_THAT(actual.custom_attributes(), - UnorderedElementsAre(Pair("test-key-0", "test-value-0"), - Pair("test-key-1", "test-value-1"))); - EXPECT_EQ(actual.object_name_prefix(), "test-object-name-prefix/"); - EXPECT_EQ(actual.payload_format(), "JSON_API_V1"); - - auto const output = ToProto(actual, "test-bucket-name"); - EXPECT_THAT(output, IsProtoEqual(input)); -} - -} // namespace -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace storage_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/storage/internal/grpc/stub.cc b/google/cloud/storage/internal/grpc/stub.cc index ed350e984c734..1c73127954366 100644 --- a/google/cloud/storage/internal/grpc/stub.cc +++ b/google/cloud/storage/internal/grpc/stub.cc @@ -21,7 +21,6 @@ #include "google/cloud/storage/internal/grpc/configure_client_context.h" #include "google/cloud/storage/internal/grpc/ctype_cord_workaround.h" #include "google/cloud/storage/internal/grpc/default_options.h" -#include "google/cloud/storage/internal/grpc/notification_metadata_parser.h" #include "google/cloud/storage/internal/grpc/object_access_control_parser.h" #include "google/cloud/storage/internal/grpc/object_metadata_parser.h" #include "google/cloud/storage/internal/grpc/object_read_source.h" diff --git a/google/cloud/storage/internal/storage_auth_decorator.cc b/google/cloud/storage/internal/storage_auth_decorator.cc index 2322178cf5dcc..be3c9ec652f67 100644 --- a/google/cloud/storage/internal/storage_auth_decorator.cc +++ b/google/cloud/storage/internal/storage_auth_decorator.cc @@ -235,89 +235,6 @@ StorageAuth::QueryWriteStatus( return child_->QueryWriteStatus(context, options, request); } -StatusOr StorageAuth::GetServiceAccount( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetServiceAccountRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->GetServiceAccount(context, options, request); -} - -StatusOr StorageAuth::CreateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateHmacKeyRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->CreateHmacKey(context, options, request); -} - -Status StorageAuth::DeleteHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteHmacKeyRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->DeleteHmacKey(context, options, request); -} - -StatusOr StorageAuth::GetHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetHmacKeyRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->GetHmacKey(context, options, request); -} - -StatusOr StorageAuth::ListHmacKeys( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListHmacKeysRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->ListHmacKeys(context, options, request); -} - -StatusOr StorageAuth::UpdateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::UpdateHmacKeyRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->UpdateHmacKey(context, options, request); -} - -Status StorageAuth::DeleteNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteNotificationConfigRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->DeleteNotificationConfig(context, options, request); -} - -StatusOr -StorageAuth::GetNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetNotificationConfigRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->GetNotificationConfig(context, options, request); -} - -StatusOr -StorageAuth::CreateNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateNotificationConfigRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->CreateNotificationConfig(context, options, request); -} - -StatusOr -StorageAuth::ListNotificationConfigs( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListNotificationConfigsRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->ListNotificationConfigs(context, options, request); -} - future> StorageAuth::AsyncComposeObject( google::cloud::CompletionQueue& cq, std::shared_ptr context, diff --git a/google/cloud/storage/internal/storage_auth_decorator.h b/google/cloud/storage/internal/storage_auth_decorator.h index 9596dd1552ec5..d8a10ff7002cf 100644 --- a/google/cloud/storage/internal/storage_auth_decorator.h +++ b/google/cloud/storage/internal/storage_auth_decorator.h @@ -137,51 +137,6 @@ class StorageAuth : public StorageStub { grpc::ClientContext& context, Options const& options, google::storage::v2::QueryWriteStatusRequest const& request) override; - StatusOr GetServiceAccount( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetServiceAccountRequest const& request) override; - - StatusOr CreateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateHmacKeyRequest const& request) override; - - Status DeleteHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteHmacKeyRequest const& request) override; - - StatusOr GetHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetHmacKeyRequest const& request) override; - - StatusOr ListHmacKeys( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListHmacKeysRequest const& request) override; - - StatusOr UpdateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::UpdateHmacKeyRequest const& request) override; - - Status DeleteNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteNotificationConfigRequest const& request) - override; - - StatusOr GetNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetNotificationConfigRequest const& request) - override; - - StatusOr CreateNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateNotificationConfigRequest const& request) - override; - - StatusOr - ListNotificationConfigs( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListNotificationConfigsRequest const& request) - override; - future> AsyncComposeObject( google::cloud::CompletionQueue& cq, std::shared_ptr context, diff --git a/google/cloud/storage/internal/storage_logging_decorator.cc b/google/cloud/storage/internal/storage_logging_decorator.cc index 372afee340bd7..952780ca32682 100644 --- a/google/cloud/storage/internal/storage_logging_decorator.cc +++ b/google/cloud/storage/internal/storage_logging_decorator.cc @@ -322,124 +322,6 @@ StorageLogging::QueryWriteStatus( context, options, request, __func__, tracing_options_); } -StatusOr StorageLogging::GetServiceAccount( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetServiceAccountRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::storage::v2::GetServiceAccountRequest const& request) { - return child_->GetServiceAccount(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -StatusOr -StorageLogging::CreateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateHmacKeyRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateHmacKeyRequest const& request) { - return child_->CreateHmacKey(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -Status StorageLogging::DeleteHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteHmacKeyRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteHmacKeyRequest const& request) { - return child_->DeleteHmacKey(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -StatusOr StorageLogging::GetHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetHmacKeyRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::storage::v2::GetHmacKeyRequest const& request) { - return child_->GetHmacKey(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -StatusOr -StorageLogging::ListHmacKeys( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListHmacKeysRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::storage::v2::ListHmacKeysRequest const& request) { - return child_->ListHmacKeys(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -StatusOr StorageLogging::UpdateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::UpdateHmacKeyRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::storage::v2::UpdateHmacKeyRequest const& request) { - return child_->UpdateHmacKey(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -Status StorageLogging::DeleteNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteNotificationConfigRequest const& request) { - return google::cloud::internal::LogWrapper( - [this]( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteNotificationConfigRequest const& request) { - return child_->DeleteNotificationConfig(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -StatusOr -StorageLogging::GetNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetNotificationConfigRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::storage::v2::GetNotificationConfigRequest const& request) { - return child_->GetNotificationConfig(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -StatusOr -StorageLogging::CreateNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateNotificationConfigRequest const& request) { - return google::cloud::internal::LogWrapper( - [this]( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateNotificationConfigRequest const& request) { - return child_->CreateNotificationConfig(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -StatusOr -StorageLogging::ListNotificationConfigs( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListNotificationConfigsRequest const& request) { - return google::cloud::internal::LogWrapper( - [this]( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListNotificationConfigsRequest const& request) { - return child_->ListNotificationConfigs(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - future> StorageLogging::AsyncComposeObject( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/storage/internal/storage_logging_decorator.h b/google/cloud/storage/internal/storage_logging_decorator.h index e892adcf919cf..d5d6deaea7265 100644 --- a/google/cloud/storage/internal/storage_logging_decorator.h +++ b/google/cloud/storage/internal/storage_logging_decorator.h @@ -137,51 +137,6 @@ class StorageLogging : public StorageStub { grpc::ClientContext& context, Options const& options, google::storage::v2::QueryWriteStatusRequest const& request) override; - StatusOr GetServiceAccount( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetServiceAccountRequest const& request) override; - - StatusOr CreateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateHmacKeyRequest const& request) override; - - Status DeleteHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteHmacKeyRequest const& request) override; - - StatusOr GetHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetHmacKeyRequest const& request) override; - - StatusOr ListHmacKeys( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListHmacKeysRequest const& request) override; - - StatusOr UpdateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::UpdateHmacKeyRequest const& request) override; - - Status DeleteNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteNotificationConfigRequest const& request) - override; - - StatusOr GetNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetNotificationConfigRequest const& request) - override; - - StatusOr CreateNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateNotificationConfigRequest const& request) - override; - - StatusOr - ListNotificationConfigs( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListNotificationConfigsRequest const& request) - override; - future> AsyncComposeObject( google::cloud::CompletionQueue& cq, std::shared_ptr context, diff --git a/google/cloud/storage/internal/storage_metadata_decorator.cc b/google/cloud/storage/internal/storage_metadata_decorator.cc index 466e02a6a3ccd..f55f4e1cf627d 100644 --- a/google/cloud/storage/internal/storage_metadata_decorator.cc +++ b/google/cloud/storage/internal/storage_metadata_decorator.cc @@ -494,218 +494,6 @@ StorageMetadata::QueryWriteStatus( return child_->QueryWriteStatus(context, options, request); } -StatusOr -StorageMetadata::GetServiceAccount( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetServiceAccountRequest const& request) { - std::vector params; - params.reserve(1); - - if (!request.project().empty()) { - params.push_back( - absl::StrCat("project=", internal::UrlEncode(request.project()))); - } - - if (params.empty()) { - SetMetadata(context, options); - } else { - SetMetadata(context, options, absl::StrJoin(params, "&")); - } - return child_->GetServiceAccount(context, options, request); -} - -StatusOr -StorageMetadata::CreateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateHmacKeyRequest const& request) { - std::vector params; - params.reserve(1); - - if (!request.project().empty()) { - params.push_back( - absl::StrCat("project=", internal::UrlEncode(request.project()))); - } - - if (params.empty()) { - SetMetadata(context, options); - } else { - SetMetadata(context, options, absl::StrJoin(params, "&")); - } - return child_->CreateHmacKey(context, options, request); -} - -Status StorageMetadata::DeleteHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteHmacKeyRequest const& request) { - std::vector params; - params.reserve(1); - - if (!request.project().empty()) { - params.push_back( - absl::StrCat("project=", internal::UrlEncode(request.project()))); - } - - if (params.empty()) { - SetMetadata(context, options); - } else { - SetMetadata(context, options, absl::StrJoin(params, "&")); - } - return child_->DeleteHmacKey(context, options, request); -} - -StatusOr StorageMetadata::GetHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetHmacKeyRequest const& request) { - std::vector params; - params.reserve(1); - - if (!request.project().empty()) { - params.push_back( - absl::StrCat("project=", internal::UrlEncode(request.project()))); - } - - if (params.empty()) { - SetMetadata(context, options); - } else { - SetMetadata(context, options, absl::StrJoin(params, "&")); - } - return child_->GetHmacKey(context, options, request); -} - -StatusOr -StorageMetadata::ListHmacKeys( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListHmacKeysRequest const& request) { - std::vector params; - params.reserve(1); - - if (!request.project().empty()) { - params.push_back( - absl::StrCat("project=", internal::UrlEncode(request.project()))); - } - - if (params.empty()) { - SetMetadata(context, options); - } else { - SetMetadata(context, options, absl::StrJoin(params, "&")); - } - return child_->ListHmacKeys(context, options, request); -} - -StatusOr StorageMetadata::UpdateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::UpdateHmacKeyRequest const& request) { - std::vector params; - params.reserve(1); - - if (!request.hmac_key().project().empty()) { - params.push_back(absl::StrCat( - "project=", internal::UrlEncode(request.hmac_key().project()))); - } - - if (params.empty()) { - SetMetadata(context, options); - } else { - SetMetadata(context, options, absl::StrJoin(params, "&")); - } - return child_->UpdateHmacKey(context, options, request); -} - -Status StorageMetadata::DeleteNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteNotificationConfigRequest const& request) { - std::vector params; - params.reserve(1); - - static auto* bucket_matcher = [] { - return new google::cloud::internal::RoutingMatcher< - google::storage::v2::DeleteNotificationConfigRequest>{ - "bucket=", - { - {[](google::storage::v2::DeleteNotificationConfigRequest const& - request) -> std::string const& { return request.name(); }, - std::regex{"(projects/[^/]+/buckets/[^/]+)/.*", - std::regex::optimize}}, - }}; - }(); - bucket_matcher->AppendParam(request, params); - - if (params.empty()) { - SetMetadata(context, options); - } else { - SetMetadata(context, options, absl::StrJoin(params, "&")); - } - return child_->DeleteNotificationConfig(context, options, request); -} - -StatusOr -StorageMetadata::GetNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetNotificationConfigRequest const& request) { - std::vector params; - params.reserve(1); - - static auto* bucket_matcher = [] { - return new google::cloud::internal::RoutingMatcher< - google::storage::v2::GetNotificationConfigRequest>{ - "bucket=", - { - {[](google::storage::v2::GetNotificationConfigRequest const& - request) -> std::string const& { return request.name(); }, - std::regex{"(projects/[^/]+/buckets/[^/]+)/.*", - std::regex::optimize}}, - }}; - }(); - bucket_matcher->AppendParam(request, params); - - if (params.empty()) { - SetMetadata(context, options); - } else { - SetMetadata(context, options, absl::StrJoin(params, "&")); - } - return child_->GetNotificationConfig(context, options, request); -} - -StatusOr -StorageMetadata::CreateNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateNotificationConfigRequest const& request) { - std::vector params; - params.reserve(1); - - if (!request.parent().empty()) { - params.push_back( - absl::StrCat("bucket=", internal::UrlEncode(request.parent()))); - } - - if (params.empty()) { - SetMetadata(context, options); - } else { - SetMetadata(context, options, absl::StrJoin(params, "&")); - } - return child_->CreateNotificationConfig(context, options, request); -} - -StatusOr -StorageMetadata::ListNotificationConfigs( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListNotificationConfigsRequest const& request) { - std::vector params; - params.reserve(1); - - if (!request.parent().empty()) { - params.push_back( - absl::StrCat("bucket=", internal::UrlEncode(request.parent()))); - } - - if (params.empty()) { - SetMetadata(context, options); - } else { - SetMetadata(context, options, absl::StrJoin(params, "&")); - } - return child_->ListNotificationConfigs(context, options, request); -} - future> StorageMetadata::AsyncComposeObject( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/storage/internal/storage_metadata_decorator.h b/google/cloud/storage/internal/storage_metadata_decorator.h index 2044f77dc3d0a..cc7c62270cbbb 100644 --- a/google/cloud/storage/internal/storage_metadata_decorator.h +++ b/google/cloud/storage/internal/storage_metadata_decorator.h @@ -137,51 +137,6 @@ class StorageMetadata : public StorageStub { grpc::ClientContext& context, Options const& options, google::storage::v2::QueryWriteStatusRequest const& request) override; - StatusOr GetServiceAccount( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetServiceAccountRequest const& request) override; - - StatusOr CreateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateHmacKeyRequest const& request) override; - - Status DeleteHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteHmacKeyRequest const& request) override; - - StatusOr GetHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetHmacKeyRequest const& request) override; - - StatusOr ListHmacKeys( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListHmacKeysRequest const& request) override; - - StatusOr UpdateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::UpdateHmacKeyRequest const& request) override; - - Status DeleteNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteNotificationConfigRequest const& request) - override; - - StatusOr GetNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetNotificationConfigRequest const& request) - override; - - StatusOr CreateNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateNotificationConfigRequest const& request) - override; - - StatusOr - ListNotificationConfigs( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListNotificationConfigsRequest const& request) - override; - future> AsyncComposeObject( google::cloud::CompletionQueue& cq, std::shared_ptr context, diff --git a/google/cloud/storage/internal/storage_round_robin_decorator.cc b/google/cloud/storage/internal/storage_round_robin_decorator.cc index f1bb336828bbb..f6f1862cadc7c 100644 --- a/google/cloud/storage/internal/storage_round_robin_decorator.cc +++ b/google/cloud/storage/internal/storage_round_robin_decorator.cc @@ -178,72 +178,6 @@ StorageRoundRobin::QueryWriteStatus( return Child()->QueryWriteStatus(context, options, request); } -StatusOr -StorageRoundRobin::GetServiceAccount( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetServiceAccountRequest const& request) { - return Child()->GetServiceAccount(context, options, request); -} - -StatusOr -StorageRoundRobin::CreateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateHmacKeyRequest const& request) { - return Child()->CreateHmacKey(context, options, request); -} - -Status StorageRoundRobin::DeleteHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteHmacKeyRequest const& request) { - return Child()->DeleteHmacKey(context, options, request); -} - -StatusOr StorageRoundRobin::GetHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetHmacKeyRequest const& request) { - return Child()->GetHmacKey(context, options, request); -} - -StatusOr -StorageRoundRobin::ListHmacKeys( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListHmacKeysRequest const& request) { - return Child()->ListHmacKeys(context, options, request); -} - -StatusOr StorageRoundRobin::UpdateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::UpdateHmacKeyRequest const& request) { - return Child()->UpdateHmacKey(context, options, request); -} - -Status StorageRoundRobin::DeleteNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteNotificationConfigRequest const& request) { - return Child()->DeleteNotificationConfig(context, options, request); -} - -StatusOr -StorageRoundRobin::GetNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetNotificationConfigRequest const& request) { - return Child()->GetNotificationConfig(context, options, request); -} - -StatusOr -StorageRoundRobin::CreateNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateNotificationConfigRequest const& request) { - return Child()->CreateNotificationConfig(context, options, request); -} - -StatusOr -StorageRoundRobin::ListNotificationConfigs( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListNotificationConfigsRequest const& request) { - return Child()->ListNotificationConfigs(context, options, request); -} - future> StorageRoundRobin::AsyncComposeObject( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/storage/internal/storage_round_robin_decorator.h b/google/cloud/storage/internal/storage_round_robin_decorator.h index a78e19b96a832..600869d74145b 100644 --- a/google/cloud/storage/internal/storage_round_robin_decorator.h +++ b/google/cloud/storage/internal/storage_round_robin_decorator.h @@ -135,51 +135,6 @@ class StorageRoundRobin : public StorageStub { grpc::ClientContext& context, Options const& options, google::storage::v2::QueryWriteStatusRequest const& request) override; - StatusOr GetServiceAccount( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetServiceAccountRequest const& request) override; - - StatusOr CreateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateHmacKeyRequest const& request) override; - - Status DeleteHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteHmacKeyRequest const& request) override; - - StatusOr GetHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetHmacKeyRequest const& request) override; - - StatusOr ListHmacKeys( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListHmacKeysRequest const& request) override; - - StatusOr UpdateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::UpdateHmacKeyRequest const& request) override; - - Status DeleteNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteNotificationConfigRequest const& request) - override; - - StatusOr GetNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetNotificationConfigRequest const& request) - override; - - StatusOr CreateNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateNotificationConfigRequest const& request) - override; - - StatusOr - ListNotificationConfigs( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListNotificationConfigsRequest const& request) - override; - future> AsyncComposeObject( google::cloud::CompletionQueue& cq, std::shared_ptr context, diff --git a/google/cloud/storage/internal/storage_stub.cc b/google/cloud/storage/internal/storage_stub.cc index 9aed3aeb7d87a..d07722fa0e3c0 100644 --- a/google/cloud/storage/internal/storage_stub.cc +++ b/google/cloud/storage/internal/storage_stub.cc @@ -292,126 +292,6 @@ DefaultStorageStub::QueryWriteStatus( return response; } -StatusOr -DefaultStorageStub::GetServiceAccount( - grpc::ClientContext& context, Options const&, - google::storage::v2::GetServiceAccountRequest const& request) { - google::storage::v2::ServiceAccount response; - auto status = grpc_stub_->GetServiceAccount(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -StatusOr -DefaultStorageStub::CreateHmacKey( - grpc::ClientContext& context, Options const&, - google::storage::v2::CreateHmacKeyRequest const& request) { - google::storage::v2::CreateHmacKeyResponse response; - auto status = grpc_stub_->CreateHmacKey(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -Status DefaultStorageStub::DeleteHmacKey( - grpc::ClientContext& context, Options const&, - google::storage::v2::DeleteHmacKeyRequest const& request) { - google::protobuf::Empty response; - auto status = grpc_stub_->DeleteHmacKey(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return google::cloud::Status(); -} - -StatusOr DefaultStorageStub::GetHmacKey( - grpc::ClientContext& context, Options const&, - google::storage::v2::GetHmacKeyRequest const& request) { - google::storage::v2::HmacKeyMetadata response; - auto status = grpc_stub_->GetHmacKey(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -StatusOr -DefaultStorageStub::ListHmacKeys( - grpc::ClientContext& context, Options const&, - google::storage::v2::ListHmacKeysRequest const& request) { - google::storage::v2::ListHmacKeysResponse response; - auto status = grpc_stub_->ListHmacKeys(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -StatusOr -DefaultStorageStub::UpdateHmacKey( - grpc::ClientContext& context, Options const&, - google::storage::v2::UpdateHmacKeyRequest const& request) { - google::storage::v2::HmacKeyMetadata response; - auto status = grpc_stub_->UpdateHmacKey(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -Status DefaultStorageStub::DeleteNotificationConfig( - grpc::ClientContext& context, Options const&, - google::storage::v2::DeleteNotificationConfigRequest const& request) { - google::protobuf::Empty response; - auto status = - grpc_stub_->DeleteNotificationConfig(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return google::cloud::Status(); -} - -StatusOr -DefaultStorageStub::GetNotificationConfig( - grpc::ClientContext& context, Options const&, - google::storage::v2::GetNotificationConfigRequest const& request) { - google::storage::v2::NotificationConfig response; - auto status = grpc_stub_->GetNotificationConfig(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -StatusOr -DefaultStorageStub::CreateNotificationConfig( - grpc::ClientContext& context, Options const&, - google::storage::v2::CreateNotificationConfigRequest const& request) { - google::storage::v2::NotificationConfig response; - auto status = - grpc_stub_->CreateNotificationConfig(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -StatusOr -DefaultStorageStub::ListNotificationConfigs( - grpc::ClientContext& context, Options const&, - google::storage::v2::ListNotificationConfigsRequest const& request) { - google::storage::v2::ListNotificationConfigsResponse response; - auto status = - grpc_stub_->ListNotificationConfigs(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - future> DefaultStorageStub::AsyncComposeObject( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/storage/internal/storage_stub.h b/google/cloud/storage/internal/storage_stub.h index 0d63387280156..e91f6d5174872 100644 --- a/google/cloud/storage/internal/storage_stub.h +++ b/google/cloud/storage/internal/storage_stub.h @@ -141,49 +141,6 @@ class StorageStub { grpc::ClientContext& context, Options const& options, google::storage::v2::QueryWriteStatusRequest const& request) = 0; - virtual StatusOr GetServiceAccount( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetServiceAccountRequest const& request) = 0; - - virtual StatusOr CreateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateHmacKeyRequest const& request) = 0; - - virtual Status DeleteHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteHmacKeyRequest const& request) = 0; - - virtual StatusOr GetHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetHmacKeyRequest const& request) = 0; - - virtual StatusOr ListHmacKeys( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListHmacKeysRequest const& request) = 0; - - virtual StatusOr UpdateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::UpdateHmacKeyRequest const& request) = 0; - - virtual Status DeleteNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteNotificationConfigRequest const& request) = 0; - - virtual StatusOr - GetNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetNotificationConfigRequest const& request) = 0; - - virtual StatusOr - CreateNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateNotificationConfigRequest const& request) = 0; - - virtual StatusOr - ListNotificationConfigs( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListNotificationConfigsRequest const& request) = 0; - virtual future> AsyncComposeObject( google::cloud::CompletionQueue& cq, std::shared_ptr context, @@ -337,51 +294,6 @@ class DefaultStorageStub : public StorageStub { grpc::ClientContext& context, Options const& options, google::storage::v2::QueryWriteStatusRequest const& request) override; - StatusOr GetServiceAccount( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetServiceAccountRequest const& request) override; - - StatusOr CreateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateHmacKeyRequest const& request) override; - - Status DeleteHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteHmacKeyRequest const& request) override; - - StatusOr GetHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetHmacKeyRequest const& request) override; - - StatusOr ListHmacKeys( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListHmacKeysRequest const& request) override; - - StatusOr UpdateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::UpdateHmacKeyRequest const& request) override; - - Status DeleteNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteNotificationConfigRequest const& request) - override; - - StatusOr GetNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetNotificationConfigRequest const& request) - override; - - StatusOr CreateNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateNotificationConfigRequest const& request) - override; - - StatusOr - ListNotificationConfigs( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListNotificationConfigsRequest const& request) - override; - future> AsyncComposeObject( google::cloud::CompletionQueue& cq, std::shared_ptr context, diff --git a/google/cloud/storage/internal/storage_tracing_stub.cc b/google/cloud/storage/internal/storage_tracing_stub.cc index cc5ec0c1f408c..e15dc56b1b220 100644 --- a/google/cloud/storage/internal/storage_tracing_stub.cc +++ b/google/cloud/storage/internal/storage_tracing_stub.cc @@ -299,125 +299,6 @@ StorageTracingStub::QueryWriteStatus( child_->QueryWriteStatus(context, options, request)); } -StatusOr -StorageTracingStub::GetServiceAccount( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetServiceAccountRequest const& request) { - auto span = - internal::MakeSpanGrpc("google.storage.v2.Storage", "GetServiceAccount"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan( - context, *span, child_->GetServiceAccount(context, options, request)); -} - -StatusOr -StorageTracingStub::CreateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateHmacKeyRequest const& request) { - auto span = - internal::MakeSpanGrpc("google.storage.v2.Storage", "CreateHmacKey"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->CreateHmacKey(context, options, request)); -} - -Status StorageTracingStub::DeleteHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteHmacKeyRequest const& request) { - auto span = - internal::MakeSpanGrpc("google.storage.v2.Storage", "DeleteHmacKey"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->DeleteHmacKey(context, options, request)); -} - -StatusOr StorageTracingStub::GetHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetHmacKeyRequest const& request) { - auto span = internal::MakeSpanGrpc("google.storage.v2.Storage", "GetHmacKey"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->GetHmacKey(context, options, request)); -} - -StatusOr -StorageTracingStub::ListHmacKeys( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListHmacKeysRequest const& request) { - auto span = - internal::MakeSpanGrpc("google.storage.v2.Storage", "ListHmacKeys"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->ListHmacKeys(context, options, request)); -} - -StatusOr -StorageTracingStub::UpdateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::UpdateHmacKeyRequest const& request) { - auto span = - internal::MakeSpanGrpc("google.storage.v2.Storage", "UpdateHmacKey"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->UpdateHmacKey(context, options, request)); -} - -Status StorageTracingStub::DeleteNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteNotificationConfigRequest const& request) { - auto span = internal::MakeSpanGrpc("google.storage.v2.Storage", - "DeleteNotificationConfig"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan( - context, *span, - child_->DeleteNotificationConfig(context, options, request)); -} - -StatusOr -StorageTracingStub::GetNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetNotificationConfigRequest const& request) { - auto span = internal::MakeSpanGrpc("google.storage.v2.Storage", - "GetNotificationConfig"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan( - context, *span, child_->GetNotificationConfig(context, options, request)); -} - -StatusOr -StorageTracingStub::CreateNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateNotificationConfigRequest const& request) { - auto span = internal::MakeSpanGrpc("google.storage.v2.Storage", - "CreateNotificationConfig"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan( - context, *span, - child_->CreateNotificationConfig(context, options, request)); -} - -StatusOr -StorageTracingStub::ListNotificationConfigs( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListNotificationConfigsRequest const& request) { - auto span = internal::MakeSpanGrpc("google.storage.v2.Storage", - "ListNotificationConfigs"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan( - context, *span, - child_->ListNotificationConfigs(context, options, request)); -} - future> StorageTracingStub::AsyncComposeObject( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/storage/internal/storage_tracing_stub.h b/google/cloud/storage/internal/storage_tracing_stub.h index d9f5f5543df3a..fe7c29e39917a 100644 --- a/google/cloud/storage/internal/storage_tracing_stub.h +++ b/google/cloud/storage/internal/storage_tracing_stub.h @@ -137,51 +137,6 @@ class StorageTracingStub : public StorageStub { grpc::ClientContext& context, Options const& options, google::storage::v2::QueryWriteStatusRequest const& request) override; - StatusOr GetServiceAccount( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetServiceAccountRequest const& request) override; - - StatusOr CreateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateHmacKeyRequest const& request) override; - - Status DeleteHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteHmacKeyRequest const& request) override; - - StatusOr GetHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetHmacKeyRequest const& request) override; - - StatusOr ListHmacKeys( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListHmacKeysRequest const& request) override; - - StatusOr UpdateHmacKey( - grpc::ClientContext& context, Options const& options, - google::storage::v2::UpdateHmacKeyRequest const& request) override; - - Status DeleteNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::DeleteNotificationConfigRequest const& request) - override; - - StatusOr GetNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::GetNotificationConfigRequest const& request) - override; - - StatusOr CreateNotificationConfig( - grpc::ClientContext& context, Options const& options, - google::storage::v2::CreateNotificationConfigRequest const& request) - override; - - StatusOr - ListNotificationConfigs( - grpc::ClientContext& context, Options const& options, - google::storage::v2::ListNotificationConfigsRequest const& request) - override; - future> AsyncComposeObject( google::cloud::CompletionQueue& cq, std::shared_ptr context, diff --git a/google/cloud/storage/storage_client_grpc_unit_tests.bzl b/google/cloud/storage/storage_client_grpc_unit_tests.bzl index a6960d1561567..5b0c9049d9e68 100644 --- a/google/cloud/storage/storage_client_grpc_unit_tests.bzl +++ b/google/cloud/storage/storage_client_grpc_unit_tests.bzl @@ -62,7 +62,6 @@ storage_client_grpc_unit_tests = [ "internal/grpc/metrics_histograms_test.cc", "internal/grpc/metrics_meter_provider_test.cc", "internal/grpc/monitoring_project_test.cc", - "internal/grpc/notification_metadata_parser_test.cc", "internal/grpc/object_access_control_parser_test.cc", "internal/grpc/object_metadata_parser_test.cc", "internal/grpc/object_read_source_test.cc", diff --git a/google/cloud/storage/testing/mock_storage_stub.h b/google/cloud/storage/testing/mock_storage_stub.h index 342feeafd731c..b975e8a23dbae 100644 --- a/google/cloud/storage/testing/mock_storage_stub.h +++ b/google/cloud/storage/testing/mock_storage_stub.h @@ -65,25 +65,6 @@ class MockStorageStub : public storage_internal::StorageStub { (grpc::ClientContext&, Options const&, google::storage::v2::UpdateBucketRequest const&), (override)); - MOCK_METHOD(Status, DeleteNotificationConfig, - (grpc::ClientContext&, Options const&, - google::storage::v2::DeleteNotificationConfigRequest const&), - (override)); - MOCK_METHOD(StatusOr, - GetNotificationConfig, - (grpc::ClientContext&, Options const&, - google::storage::v2::GetNotificationConfigRequest const&), - (override)); - MOCK_METHOD(StatusOr, - CreateNotificationConfig, - (grpc::ClientContext&, Options const&, - google::storage::v2::CreateNotificationConfigRequest const&), - (override)); - MOCK_METHOD(StatusOr, - ListNotificationConfigs, - (grpc::ClientContext&, Options const&, - google::storage::v2::ListNotificationConfigsRequest const&), - (override)); MOCK_METHOD(StatusOr, ComposeObject, (grpc::ClientContext&, Options const&, google::storage::v2::ComposeObjectRequest const&), @@ -148,31 +129,6 @@ class MockStorageStub : public storage_internal::StorageStub { (grpc::ClientContext&, Options const&, google::storage::v2::QueryWriteStatusRequest const&), (override)); - MOCK_METHOD(StatusOr, GetServiceAccount, - (grpc::ClientContext&, Options const&, - google::storage::v2::GetServiceAccountRequest const&), - (override)); - MOCK_METHOD(StatusOr, - CreateHmacKey, - (grpc::ClientContext&, Options const&, - google::storage::v2::CreateHmacKeyRequest const&), - (override)); - MOCK_METHOD(Status, DeleteHmacKey, - (grpc::ClientContext&, Options const&, - google::storage::v2::DeleteHmacKeyRequest const&), - (override)); - MOCK_METHOD(StatusOr, GetHmacKey, - (grpc::ClientContext&, Options const&, - google::storage::v2::GetHmacKeyRequest const&), - (override)); - MOCK_METHOD(StatusOr, ListHmacKeys, - (grpc::ClientContext&, Options const&, - google::storage::v2::ListHmacKeysRequest const&), - (override)); - MOCK_METHOD(StatusOr, UpdateHmacKey, - (grpc::ClientContext&, Options const&, - google::storage::v2::UpdateHmacKeyRequest const&), - (override)); MOCK_METHOD(future>, AsyncComposeObject, (google::cloud::CompletionQueue&, std::shared_ptr,