|
| 1 | +// Copyright 2023 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/devtools/cloudtrace/v1/trace.proto |
| 18 | + |
| 19 | +#include "google/cloud/trace/v1/internal/trace_auth_decorator.h" |
| 20 | +#include <google/devtools/cloudtrace/v1/trace.grpc.pb.h> |
| 21 | +#include <memory> |
| 22 | + |
| 23 | +namespace google { |
| 24 | +namespace cloud { |
| 25 | +namespace trace_v1_internal { |
| 26 | +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN |
| 27 | + |
| 28 | +TraceServiceAuth::TraceServiceAuth( |
| 29 | + std::shared_ptr<google::cloud::internal::GrpcAuthenticationStrategy> auth, |
| 30 | + std::shared_ptr<TraceServiceStub> child) |
| 31 | + : auth_(std::move(auth)), child_(std::move(child)) {} |
| 32 | + |
| 33 | +StatusOr<google::devtools::cloudtrace::v1::ListTracesResponse> |
| 34 | +TraceServiceAuth::ListTraces( |
| 35 | + grpc::ClientContext& context, |
| 36 | + google::devtools::cloudtrace::v1::ListTracesRequest const& request) { |
| 37 | + auto status = auth_->ConfigureContext(context); |
| 38 | + if (!status.ok()) return status; |
| 39 | + return child_->ListTraces(context, request); |
| 40 | +} |
| 41 | + |
| 42 | +StatusOr<google::devtools::cloudtrace::v1::Trace> TraceServiceAuth::GetTrace( |
| 43 | + grpc::ClientContext& context, |
| 44 | + google::devtools::cloudtrace::v1::GetTraceRequest const& request) { |
| 45 | + auto status = auth_->ConfigureContext(context); |
| 46 | + if (!status.ok()) return status; |
| 47 | + return child_->GetTrace(context, request); |
| 48 | +} |
| 49 | + |
| 50 | +Status TraceServiceAuth::PatchTraces( |
| 51 | + grpc::ClientContext& context, |
| 52 | + google::devtools::cloudtrace::v1::PatchTracesRequest const& request) { |
| 53 | + auto status = auth_->ConfigureContext(context); |
| 54 | + if (!status.ok()) return status; |
| 55 | + return child_->PatchTraces(context, request); |
| 56 | +} |
| 57 | + |
| 58 | +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END |
| 59 | +} // namespace trace_v1_internal |
| 60 | +} // namespace cloud |
| 61 | +} // namespace google |
0 commit comments