// Copyright 2025 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/cloud/configdelivery/v1/config_delivery.proto

#include "google/cloud/configdelivery/v1/internal/config_delivery_tracing_connection.h"
#include "google/cloud/internal/opentelemetry.h"
#include "google/cloud/internal/traced_stream_range.h"
#include <memory>
#include <utility>

namespace google {
namespace cloud {
namespace configdelivery_v1_internal {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

ConfigDeliveryTracingConnection::ConfigDeliveryTracingConnection(
    std::shared_ptr<configdelivery_v1::ConfigDeliveryConnection> child)
    : child_(std::move(child)) {}

StreamRange<google::cloud::configdelivery::v1::ResourceBundle>
ConfigDeliveryTracingConnection::ListResourceBundles(
    google::cloud::configdelivery::v1::ListResourceBundlesRequest request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::ListResourceBundles");
  internal::OTelScope scope(span);
  auto sr = child_->ListResourceBundles(std::move(request));
  return internal::MakeTracedStreamRange<
      google::cloud::configdelivery::v1::ResourceBundle>(std::move(span),
                                                         std::move(sr));
}

StatusOr<google::cloud::configdelivery::v1::ResourceBundle>
ConfigDeliveryTracingConnection::GetResourceBundle(
    google::cloud::configdelivery::v1::GetResourceBundleRequest const&
        request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::GetResourceBundle");
  auto scope = opentelemetry::trace::Scope(span);
  return internal::EndSpan(*span, child_->GetResourceBundle(request));
}

future<StatusOr<google::cloud::configdelivery::v1::ResourceBundle>>
ConfigDeliveryTracingConnection::CreateResourceBundle(
    google::cloud::configdelivery::v1::CreateResourceBundleRequest const&
        request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::CreateResourceBundle");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span),
                           child_->CreateResourceBundle(request));
}

StatusOr<google::longrunning::Operation>
ConfigDeliveryTracingConnection::CreateResourceBundle(
    NoAwaitTag,
    google::cloud::configdelivery::v1::CreateResourceBundleRequest const&
        request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::CreateResourceBundle");
  opentelemetry::trace::Scope scope(span);
  return internal::EndSpan(*span,
                           child_->CreateResourceBundle(NoAwaitTag{}, request));
}

future<StatusOr<google::cloud::configdelivery::v1::ResourceBundle>>
ConfigDeliveryTracingConnection::CreateResourceBundle(
    google::longrunning::Operation const& operation) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::CreateResourceBundle");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span),
                           child_->CreateResourceBundle(operation));
}

future<StatusOr<google::cloud::configdelivery::v1::ResourceBundle>>
ConfigDeliveryTracingConnection::UpdateResourceBundle(
    google::cloud::configdelivery::v1::UpdateResourceBundleRequest const&
        request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::UpdateResourceBundle");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span),
                           child_->UpdateResourceBundle(request));
}

StatusOr<google::longrunning::Operation>
ConfigDeliveryTracingConnection::UpdateResourceBundle(
    NoAwaitTag,
    google::cloud::configdelivery::v1::UpdateResourceBundleRequest const&
        request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::UpdateResourceBundle");
  opentelemetry::trace::Scope scope(span);
  return internal::EndSpan(*span,
                           child_->UpdateResourceBundle(NoAwaitTag{}, request));
}

future<StatusOr<google::cloud::configdelivery::v1::ResourceBundle>>
ConfigDeliveryTracingConnection::UpdateResourceBundle(
    google::longrunning::Operation const& operation) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::UpdateResourceBundle");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span),
                           child_->UpdateResourceBundle(operation));
}

future<StatusOr<google::cloud::configdelivery::v1::OperationMetadata>>
ConfigDeliveryTracingConnection::DeleteResourceBundle(
    google::cloud::configdelivery::v1::DeleteResourceBundleRequest const&
        request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::DeleteResourceBundle");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span),
                           child_->DeleteResourceBundle(request));
}

StatusOr<google::longrunning::Operation>
ConfigDeliveryTracingConnection::DeleteResourceBundle(
    NoAwaitTag,
    google::cloud::configdelivery::v1::DeleteResourceBundleRequest const&
        request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::DeleteResourceBundle");
  opentelemetry::trace::Scope scope(span);
  return internal::EndSpan(*span,
                           child_->DeleteResourceBundle(NoAwaitTag{}, request));
}

future<StatusOr<google::cloud::configdelivery::v1::OperationMetadata>>
ConfigDeliveryTracingConnection::DeleteResourceBundle(
    google::longrunning::Operation const& operation) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::DeleteResourceBundle");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span),
                           child_->DeleteResourceBundle(operation));
}

StreamRange<google::cloud::configdelivery::v1::FleetPackage>
ConfigDeliveryTracingConnection::ListFleetPackages(
    google::cloud::configdelivery::v1::ListFleetPackagesRequest request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::ListFleetPackages");
  internal::OTelScope scope(span);
  auto sr = child_->ListFleetPackages(std::move(request));
  return internal::MakeTracedStreamRange<
      google::cloud::configdelivery::v1::FleetPackage>(std::move(span),
                                                       std::move(sr));
}

StatusOr<google::cloud::configdelivery::v1::FleetPackage>
ConfigDeliveryTracingConnection::GetFleetPackage(
    google::cloud::configdelivery::v1::GetFleetPackageRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::GetFleetPackage");
  auto scope = opentelemetry::trace::Scope(span);
  return internal::EndSpan(*span, child_->GetFleetPackage(request));
}

future<StatusOr<google::cloud::configdelivery::v1::FleetPackage>>
ConfigDeliveryTracingConnection::CreateFleetPackage(
    google::cloud::configdelivery::v1::CreateFleetPackageRequest const&
        request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::CreateFleetPackage");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span),
                           child_->CreateFleetPackage(request));
}

StatusOr<google::longrunning::Operation>
ConfigDeliveryTracingConnection::CreateFleetPackage(
    NoAwaitTag,
    google::cloud::configdelivery::v1::CreateFleetPackageRequest const&
        request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::CreateFleetPackage");
  opentelemetry::trace::Scope scope(span);
  return internal::EndSpan(*span,
                           child_->CreateFleetPackage(NoAwaitTag{}, request));
}

future<StatusOr<google::cloud::configdelivery::v1::FleetPackage>>
ConfigDeliveryTracingConnection::CreateFleetPackage(
    google::longrunning::Operation const& operation) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::CreateFleetPackage");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span),
                           child_->CreateFleetPackage(operation));
}

future<StatusOr<google::cloud::configdelivery::v1::FleetPackage>>
ConfigDeliveryTracingConnection::UpdateFleetPackage(
    google::cloud::configdelivery::v1::UpdateFleetPackageRequest const&
        request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::UpdateFleetPackage");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span),
                           child_->UpdateFleetPackage(request));
}

StatusOr<google::longrunning::Operation>
ConfigDeliveryTracingConnection::UpdateFleetPackage(
    NoAwaitTag,
    google::cloud::configdelivery::v1::UpdateFleetPackageRequest const&
        request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::UpdateFleetPackage");
  opentelemetry::trace::Scope scope(span);
  return internal::EndSpan(*span,
                           child_->UpdateFleetPackage(NoAwaitTag{}, request));
}

future<StatusOr<google::cloud::configdelivery::v1::FleetPackage>>
ConfigDeliveryTracingConnection::UpdateFleetPackage(
    google::longrunning::Operation const& operation) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::UpdateFleetPackage");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span),
                           child_->UpdateFleetPackage(operation));
}

future<StatusOr<google::cloud::configdelivery::v1::OperationMetadata>>
ConfigDeliveryTracingConnection::DeleteFleetPackage(
    google::cloud::configdelivery::v1::DeleteFleetPackageRequest const&
        request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::DeleteFleetPackage");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span),
                           child_->DeleteFleetPackage(request));
}

StatusOr<google::longrunning::Operation>
ConfigDeliveryTracingConnection::DeleteFleetPackage(
    NoAwaitTag,
    google::cloud::configdelivery::v1::DeleteFleetPackageRequest const&
        request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::DeleteFleetPackage");
  opentelemetry::trace::Scope scope(span);
  return internal::EndSpan(*span,
                           child_->DeleteFleetPackage(NoAwaitTag{}, request));
}

future<StatusOr<google::cloud::configdelivery::v1::OperationMetadata>>
ConfigDeliveryTracingConnection::DeleteFleetPackage(
    google::longrunning::Operation const& operation) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::DeleteFleetPackage");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span),
                           child_->DeleteFleetPackage(operation));
}

StreamRange<google::cloud::configdelivery::v1::Release>
ConfigDeliveryTracingConnection::ListReleases(
    google::cloud::configdelivery::v1::ListReleasesRequest request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::ListReleases");
  internal::OTelScope scope(span);
  auto sr = child_->ListReleases(std::move(request));
  return internal::MakeTracedStreamRange<
      google::cloud::configdelivery::v1::Release>(std::move(span),
                                                  std::move(sr));
}

StatusOr<google::cloud::configdelivery::v1::Release>
ConfigDeliveryTracingConnection::GetRelease(
    google::cloud::configdelivery::v1::GetReleaseRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::GetRelease");
  auto scope = opentelemetry::trace::Scope(span);
  return internal::EndSpan(*span, child_->GetRelease(request));
}

future<StatusOr<google::cloud::configdelivery::v1::Release>>
ConfigDeliveryTracingConnection::CreateRelease(
    google::cloud::configdelivery::v1::CreateReleaseRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::CreateRelease");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span), child_->CreateRelease(request));
}

StatusOr<google::longrunning::Operation>
ConfigDeliveryTracingConnection::CreateRelease(
    NoAwaitTag,
    google::cloud::configdelivery::v1::CreateReleaseRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::CreateRelease");
  opentelemetry::trace::Scope scope(span);
  return internal::EndSpan(*span, child_->CreateRelease(NoAwaitTag{}, request));
}

future<StatusOr<google::cloud::configdelivery::v1::Release>>
ConfigDeliveryTracingConnection::CreateRelease(
    google::longrunning::Operation const& operation) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::CreateRelease");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span), child_->CreateRelease(operation));
}

future<StatusOr<google::cloud::configdelivery::v1::Release>>
ConfigDeliveryTracingConnection::UpdateRelease(
    google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::UpdateRelease");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span), child_->UpdateRelease(request));
}

StatusOr<google::longrunning::Operation>
ConfigDeliveryTracingConnection::UpdateRelease(
    NoAwaitTag,
    google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::UpdateRelease");
  opentelemetry::trace::Scope scope(span);
  return internal::EndSpan(*span, child_->UpdateRelease(NoAwaitTag{}, request));
}

future<StatusOr<google::cloud::configdelivery::v1::Release>>
ConfigDeliveryTracingConnection::UpdateRelease(
    google::longrunning::Operation const& operation) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::UpdateRelease");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span), child_->UpdateRelease(operation));
}

future<StatusOr<google::cloud::configdelivery::v1::OperationMetadata>>
ConfigDeliveryTracingConnection::DeleteRelease(
    google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::DeleteRelease");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span), child_->DeleteRelease(request));
}

StatusOr<google::longrunning::Operation>
ConfigDeliveryTracingConnection::DeleteRelease(
    NoAwaitTag,
    google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::DeleteRelease");
  opentelemetry::trace::Scope scope(span);
  return internal::EndSpan(*span, child_->DeleteRelease(NoAwaitTag{}, request));
}

future<StatusOr<google::cloud::configdelivery::v1::OperationMetadata>>
ConfigDeliveryTracingConnection::DeleteRelease(
    google::longrunning::Operation const& operation) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::DeleteRelease");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span), child_->DeleteRelease(operation));
}

StreamRange<google::cloud::configdelivery::v1::Variant>
ConfigDeliveryTracingConnection::ListVariants(
    google::cloud::configdelivery::v1::ListVariantsRequest request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::ListVariants");
  internal::OTelScope scope(span);
  auto sr = child_->ListVariants(std::move(request));
  return internal::MakeTracedStreamRange<
      google::cloud::configdelivery::v1::Variant>(std::move(span),
                                                  std::move(sr));
}

StatusOr<google::cloud::configdelivery::v1::Variant>
ConfigDeliveryTracingConnection::GetVariant(
    google::cloud::configdelivery::v1::GetVariantRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::GetVariant");
  auto scope = opentelemetry::trace::Scope(span);
  return internal::EndSpan(*span, child_->GetVariant(request));
}

future<StatusOr<google::cloud::configdelivery::v1::Variant>>
ConfigDeliveryTracingConnection::CreateVariant(
    google::cloud::configdelivery::v1::CreateVariantRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::CreateVariant");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span), child_->CreateVariant(request));
}

StatusOr<google::longrunning::Operation>
ConfigDeliveryTracingConnection::CreateVariant(
    NoAwaitTag,
    google::cloud::configdelivery::v1::CreateVariantRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::CreateVariant");
  opentelemetry::trace::Scope scope(span);
  return internal::EndSpan(*span, child_->CreateVariant(NoAwaitTag{}, request));
}

future<StatusOr<google::cloud::configdelivery::v1::Variant>>
ConfigDeliveryTracingConnection::CreateVariant(
    google::longrunning::Operation const& operation) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::CreateVariant");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span), child_->CreateVariant(operation));
}

future<StatusOr<google::cloud::configdelivery::v1::Variant>>
ConfigDeliveryTracingConnection::UpdateVariant(
    google::cloud::configdelivery::v1::UpdateVariantRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::UpdateVariant");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span), child_->UpdateVariant(request));
}

StatusOr<google::longrunning::Operation>
ConfigDeliveryTracingConnection::UpdateVariant(
    NoAwaitTag,
    google::cloud::configdelivery::v1::UpdateVariantRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::UpdateVariant");
  opentelemetry::trace::Scope scope(span);
  return internal::EndSpan(*span, child_->UpdateVariant(NoAwaitTag{}, request));
}

future<StatusOr<google::cloud::configdelivery::v1::Variant>>
ConfigDeliveryTracingConnection::UpdateVariant(
    google::longrunning::Operation const& operation) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::UpdateVariant");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span), child_->UpdateVariant(operation));
}

future<StatusOr<google::cloud::configdelivery::v1::OperationMetadata>>
ConfigDeliveryTracingConnection::DeleteVariant(
    google::cloud::configdelivery::v1::DeleteVariantRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::DeleteVariant");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span), child_->DeleteVariant(request));
}

StatusOr<google::longrunning::Operation>
ConfigDeliveryTracingConnection::DeleteVariant(
    NoAwaitTag,
    google::cloud::configdelivery::v1::DeleteVariantRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::DeleteVariant");
  opentelemetry::trace::Scope scope(span);
  return internal::EndSpan(*span, child_->DeleteVariant(NoAwaitTag{}, request));
}

future<StatusOr<google::cloud::configdelivery::v1::OperationMetadata>>
ConfigDeliveryTracingConnection::DeleteVariant(
    google::longrunning::Operation const& operation) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::DeleteVariant");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span), child_->DeleteVariant(operation));
}

StreamRange<google::cloud::configdelivery::v1::Rollout>
ConfigDeliveryTracingConnection::ListRollouts(
    google::cloud::configdelivery::v1::ListRolloutsRequest request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::ListRollouts");
  internal::OTelScope scope(span);
  auto sr = child_->ListRollouts(std::move(request));
  return internal::MakeTracedStreamRange<
      google::cloud::configdelivery::v1::Rollout>(std::move(span),
                                                  std::move(sr));
}

StatusOr<google::cloud::configdelivery::v1::Rollout>
ConfigDeliveryTracingConnection::GetRollout(
    google::cloud::configdelivery::v1::GetRolloutRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::GetRollout");
  auto scope = opentelemetry::trace::Scope(span);
  return internal::EndSpan(*span, child_->GetRollout(request));
}

future<StatusOr<google::cloud::configdelivery::v1::Rollout>>
ConfigDeliveryTracingConnection::SuspendRollout(
    google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::SuspendRollout");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span), child_->SuspendRollout(request));
}

StatusOr<google::longrunning::Operation>
ConfigDeliveryTracingConnection::SuspendRollout(
    NoAwaitTag,
    google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::SuspendRollout");
  opentelemetry::trace::Scope scope(span);
  return internal::EndSpan(*span,
                           child_->SuspendRollout(NoAwaitTag{}, request));
}

future<StatusOr<google::cloud::configdelivery::v1::Rollout>>
ConfigDeliveryTracingConnection::SuspendRollout(
    google::longrunning::Operation const& operation) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::SuspendRollout");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span), child_->SuspendRollout(operation));
}

future<StatusOr<google::cloud::configdelivery::v1::Rollout>>
ConfigDeliveryTracingConnection::ResumeRollout(
    google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::ResumeRollout");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span), child_->ResumeRollout(request));
}

StatusOr<google::longrunning::Operation>
ConfigDeliveryTracingConnection::ResumeRollout(
    NoAwaitTag,
    google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::ResumeRollout");
  opentelemetry::trace::Scope scope(span);
  return internal::EndSpan(*span, child_->ResumeRollout(NoAwaitTag{}, request));
}

future<StatusOr<google::cloud::configdelivery::v1::Rollout>>
ConfigDeliveryTracingConnection::ResumeRollout(
    google::longrunning::Operation const& operation) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::ResumeRollout");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span), child_->ResumeRollout(operation));
}

future<StatusOr<google::cloud::configdelivery::v1::Rollout>>
ConfigDeliveryTracingConnection::AbortRollout(
    google::cloud::configdelivery::v1::AbortRolloutRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::AbortRollout");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span), child_->AbortRollout(request));
}

StatusOr<google::longrunning::Operation>
ConfigDeliveryTracingConnection::AbortRollout(
    NoAwaitTag,
    google::cloud::configdelivery::v1::AbortRolloutRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::AbortRollout");
  opentelemetry::trace::Scope scope(span);
  return internal::EndSpan(*span, child_->AbortRollout(NoAwaitTag{}, request));
}

future<StatusOr<google::cloud::configdelivery::v1::Rollout>>
ConfigDeliveryTracingConnection::AbortRollout(
    google::longrunning::Operation const& operation) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::AbortRollout");
  internal::OTelScope scope(span);
  return internal::EndSpan(std::move(span), child_->AbortRollout(operation));
}

StreamRange<google::cloud::location::Location>
ConfigDeliveryTracingConnection::ListLocations(
    google::cloud::location::ListLocationsRequest request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::ListLocations");
  internal::OTelScope scope(span);
  auto sr = child_->ListLocations(std::move(request));
  return internal::MakeTracedStreamRange<google::cloud::location::Location>(
      std::move(span), std::move(sr));
}

StatusOr<google::cloud::location::Location>
ConfigDeliveryTracingConnection::GetLocation(
    google::cloud::location::GetLocationRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::GetLocation");
  auto scope = opentelemetry::trace::Scope(span);
  return internal::EndSpan(*span, child_->GetLocation(request));
}

StreamRange<google::longrunning::Operation>
ConfigDeliveryTracingConnection::ListOperations(
    google::longrunning::ListOperationsRequest request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::ListOperations");
  internal::OTelScope scope(span);
  auto sr = child_->ListOperations(std::move(request));
  return internal::MakeTracedStreamRange<google::longrunning::Operation>(
      std::move(span), std::move(sr));
}

StatusOr<google::longrunning::Operation>
ConfigDeliveryTracingConnection::GetOperation(
    google::longrunning::GetOperationRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::GetOperation");
  auto scope = opentelemetry::trace::Scope(span);
  return internal::EndSpan(*span, child_->GetOperation(request));
}

Status ConfigDeliveryTracingConnection::DeleteOperation(
    google::longrunning::DeleteOperationRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::DeleteOperation");
  auto scope = opentelemetry::trace::Scope(span);
  return internal::EndSpan(*span, child_->DeleteOperation(request));
}

Status ConfigDeliveryTracingConnection::CancelOperation(
    google::longrunning::CancelOperationRequest const& request) {
  auto span = internal::MakeSpan(
      "configdelivery_v1::ConfigDeliveryConnection::CancelOperation");
  auto scope = opentelemetry::trace::Scope(span);
  return internal::EndSpan(*span, child_->CancelOperation(request));
}

std::shared_ptr<configdelivery_v1::ConfigDeliveryConnection>
MakeConfigDeliveryTracingConnection(
    std::shared_ptr<configdelivery_v1::ConfigDeliveryConnection> conn) {
  if (internal::TracingEnabled(conn->options())) {
    conn = std::make_shared<ConfigDeliveryTracingConnection>(std::move(conn));
  }
  return conn;
}

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
}  // namespace configdelivery_v1_internal
}  // namespace cloud
}  // namespace google
