// 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 // // http://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_PUBSUB_INTERNAL_SUBSCRIBER_METADATA_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_SUBSCRIBER_METADATA_H #include "google/cloud/pubsub/internal/subscriber_stub.h" #include "google/cloud/pubsub/version.h" #include "google/cloud/tracing_options.h" #include namespace google { namespace cloud { namespace pubsub_internal { inline namespace GOOGLE_CLOUD_CPP_PUBSUB_NS { class SubscriberMetadata : public SubscriberStub { public: explicit SubscriberMetadata(std::shared_ptr child); StatusOr CreateSubscription( grpc::ClientContext& context, google::pubsub::v1::Subscription const& request) override; StatusOr GetSubscription( grpc::ClientContext& context, google::pubsub::v1::GetSubscriptionRequest const& request) override; StatusOr UpdateSubscription( grpc::ClientContext& context, google::pubsub::v1::UpdateSubscriptionRequest const& request) override; StatusOr ListSubscriptions( grpc::ClientContext& context, google::pubsub::v1::ListSubscriptionsRequest const& request) override; Status DeleteSubscription( grpc::ClientContext& context, google::pubsub::v1::DeleteSubscriptionRequest const& request) override; Status ModifyPushConfig( grpc::ClientContext& context, google::pubsub::v1::ModifyPushConfigRequest const& request) override; std::unique_ptr AsyncStreamingPull( google::cloud::CompletionQueue& cq, std::unique_ptr context, google::pubsub::v1::StreamingPullRequest const& request) override; StatusOr CreateSnapshot( grpc::ClientContext& context, google::pubsub::v1::CreateSnapshotRequest const& request) override; StatusOr GetSnapshot( grpc::ClientContext& context, google::pubsub::v1::GetSnapshotRequest const& request) override; StatusOr ListSnapshots( grpc::ClientContext& context, google::pubsub::v1::ListSnapshotsRequest const& request) override; StatusOr UpdateSnapshot( grpc::ClientContext& context, google::pubsub::v1::UpdateSnapshotRequest const& request) override; Status DeleteSnapshot( grpc::ClientContext& context, google::pubsub::v1::DeleteSnapshotRequest const& request) override; StatusOr Seek( grpc::ClientContext& context, google::pubsub::v1::SeekRequest const& request) override; private: void SetMetadata(grpc::ClientContext& context, std::string const& request_params); std::shared_ptr child_; std::string x_goog_api_client_; }; } // namespace GOOGLE_CLOUD_CPP_PUBSUB_NS } // namespace pubsub_internal } // namespace cloud } // namespace google #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_INTERNAL_SUBSCRIBER_METADATA_H