// 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/managedkafka/schemaregistry/v1/schema_registry.proto

#include "google/cloud/managedkafka/schemaregistry/v1/managed_schema_registry_client.h"
#include <memory>
#include <utility>

namespace google {
namespace cloud {
namespace managedkafka_schemaregistry_v1 {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

ManagedSchemaRegistryClient::ManagedSchemaRegistryClient(
    std::shared_ptr<ManagedSchemaRegistryConnection> connection, Options opts)
    : connection_(std::move(connection)),
      options_(
          internal::MergeOptions(std::move(opts), connection_->options())) {}
ManagedSchemaRegistryClient::~ManagedSchemaRegistryClient() = default;

StatusOr<google::cloud::managedkafka::schemaregistry::v1::SchemaRegistry>
ManagedSchemaRegistryClient::GetSchemaRegistry(std::string const& name,
                                               Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::GetSchemaRegistryRequest
      request;
  request.set_name(name);
  return connection_->GetSchemaRegistry(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::SchemaRegistry>
ManagedSchemaRegistryClient::GetSchemaRegistry(
    google::cloud::managedkafka::schemaregistry::v1::
        GetSchemaRegistryRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->GetSchemaRegistry(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::
             ListSchemaRegistriesResponse>
ManagedSchemaRegistryClient::ListSchemaRegistries(std::string const& parent,
                                                  Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::ListSchemaRegistriesRequest
      request;
  request.set_parent(parent);
  return connection_->ListSchemaRegistries(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::
             ListSchemaRegistriesResponse>
ManagedSchemaRegistryClient::ListSchemaRegistries(
    google::cloud::managedkafka::schemaregistry::v1::
        ListSchemaRegistriesRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->ListSchemaRegistries(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::SchemaRegistry>
ManagedSchemaRegistryClient::CreateSchemaRegistry(
    std::string const& parent,
    google::cloud::managedkafka::schemaregistry::v1::SchemaRegistry const&
        schema_registry,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::CreateSchemaRegistryRequest
      request;
  request.set_parent(parent);
  *request.mutable_schema_registry() = schema_registry;
  return connection_->CreateSchemaRegistry(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::SchemaRegistry>
ManagedSchemaRegistryClient::CreateSchemaRegistry(
    google::cloud::managedkafka::schemaregistry::v1::
        CreateSchemaRegistryRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->CreateSchemaRegistry(request);
}

Status ManagedSchemaRegistryClient::DeleteSchemaRegistry(
    std::string const& name, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::DeleteSchemaRegistryRequest
      request;
  request.set_name(name);
  return connection_->DeleteSchemaRegistry(request);
}

Status ManagedSchemaRegistryClient::DeleteSchemaRegistry(
    google::cloud::managedkafka::schemaregistry::v1::
        DeleteSchemaRegistryRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->DeleteSchemaRegistry(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::Context>
ManagedSchemaRegistryClient::GetContext(std::string const& name, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::GetContextRequest request;
  request.set_name(name);
  return connection_->GetContext(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::Context>
ManagedSchemaRegistryClient::GetContext(
    google::cloud::managedkafka::schemaregistry::v1::GetContextRequest const&
        request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->GetContext(request);
}

StatusOr<google::api::HttpBody> ManagedSchemaRegistryClient::ListContexts(
    std::string const& parent, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::ListContextsRequest request;
  request.set_parent(parent);
  return connection_->ListContexts(request);
}

StatusOr<google::api::HttpBody> ManagedSchemaRegistryClient::ListContexts(
    google::cloud::managedkafka::schemaregistry::v1::ListContextsRequest const&
        request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->ListContexts(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::Schema>
ManagedSchemaRegistryClient::GetSchema(std::string const& name, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::GetSchemaRequest request;
  request.set_name(name);
  return connection_->GetSchema(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::Schema>
ManagedSchemaRegistryClient::GetSchema(
    google::cloud::managedkafka::schemaregistry::v1::GetSchemaRequest const&
        request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->GetSchema(request);
}

StatusOr<google::api::HttpBody> ManagedSchemaRegistryClient::GetRawSchema(
    std::string const& name, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::GetSchemaRequest request;
  request.set_name(name);
  return connection_->GetRawSchema(request);
}

StatusOr<google::api::HttpBody> ManagedSchemaRegistryClient::GetRawSchema(
    google::cloud::managedkafka::schemaregistry::v1::GetSchemaRequest const&
        request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->GetRawSchema(request);
}

StatusOr<google::api::HttpBody> ManagedSchemaRegistryClient::ListSchemaVersions(
    std::string const& parent, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::ListSchemaVersionsRequest
      request;
  request.set_parent(parent);
  return connection_->ListSchemaVersions(request);
}

StatusOr<google::api::HttpBody> ManagedSchemaRegistryClient::ListSchemaVersions(
    google::cloud::managedkafka::schemaregistry::v1::
        ListSchemaVersionsRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->ListSchemaVersions(request);
}

StatusOr<google::api::HttpBody> ManagedSchemaRegistryClient::ListSchemaTypes(
    std::string const& parent, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::ListSchemaTypesRequest
      request;
  request.set_parent(parent);
  return connection_->ListSchemaTypes(request);
}

StatusOr<google::api::HttpBody> ManagedSchemaRegistryClient::ListSchemaTypes(
    google::cloud::managedkafka::schemaregistry::v1::
        ListSchemaTypesRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->ListSchemaTypes(request);
}

StatusOr<google::api::HttpBody> ManagedSchemaRegistryClient::ListSubjects(
    std::string const& parent, std::string const& subject_prefix, bool deleted,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::ListSubjectsRequest request;
  request.set_parent(parent);
  request.set_subject_prefix(subject_prefix);
  request.set_deleted(deleted);
  return connection_->ListSubjects(request);
}

StatusOr<google::api::HttpBody> ManagedSchemaRegistryClient::ListSubjects(
    google::cloud::managedkafka::schemaregistry::v1::ListSubjectsRequest const&
        request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->ListSubjects(request);
}

StatusOr<google::api::HttpBody>
ManagedSchemaRegistryClient::ListSubjectsBySchemaId(std::string const& parent,
                                                    std::string const& subject,
                                                    bool deleted,
                                                    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::ListSubjectsBySchemaIdRequest
      request;
  request.set_parent(parent);
  request.set_subject(subject);
  request.set_deleted(deleted);
  return connection_->ListSubjectsBySchemaId(request);
}

StatusOr<google::api::HttpBody>
ManagedSchemaRegistryClient::ListSubjectsBySchemaId(
    google::cloud::managedkafka::schemaregistry::v1::
        ListSubjectsBySchemaIdRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->ListSubjectsBySchemaId(request);
}

StatusOr<google::api::HttpBody> ManagedSchemaRegistryClient::DeleteSubject(
    std::string const& name, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::DeleteSubjectRequest request;
  request.set_name(name);
  return connection_->DeleteSubject(request);
}

StatusOr<google::api::HttpBody> ManagedSchemaRegistryClient::DeleteSubject(
    google::cloud::managedkafka::schemaregistry::v1::DeleteSubjectRequest const&
        request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->DeleteSubject(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::SchemaVersion>
ManagedSchemaRegistryClient::LookupVersion(std::string const& parent,
                                           std::string const& schema,
                                           Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::LookupVersionRequest request;
  request.set_parent(parent);
  request.set_schema(schema);
  return connection_->LookupVersion(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::SchemaVersion>
ManagedSchemaRegistryClient::LookupVersion(
    google::cloud::managedkafka::schemaregistry::v1::LookupVersionRequest const&
        request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->LookupVersion(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::SchemaVersion>
ManagedSchemaRegistryClient::GetVersion(std::string const& name, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::GetVersionRequest request;
  request.set_name(name);
  return connection_->GetVersion(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::SchemaVersion>
ManagedSchemaRegistryClient::GetVersion(
    google::cloud::managedkafka::schemaregistry::v1::GetVersionRequest const&
        request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->GetVersion(request);
}

StatusOr<google::api::HttpBody>
ManagedSchemaRegistryClient::GetRawSchemaVersion(std::string const& name,
                                                 Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::GetVersionRequest request;
  request.set_name(name);
  return connection_->GetRawSchemaVersion(request);
}

StatusOr<google::api::HttpBody>
ManagedSchemaRegistryClient::GetRawSchemaVersion(
    google::cloud::managedkafka::schemaregistry::v1::GetVersionRequest const&
        request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->GetRawSchemaVersion(request);
}

StatusOr<google::api::HttpBody> ManagedSchemaRegistryClient::ListVersions(
    std::string const& parent, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::ListVersionsRequest request;
  request.set_parent(parent);
  return connection_->ListVersions(request);
}

StatusOr<google::api::HttpBody> ManagedSchemaRegistryClient::ListVersions(
    google::cloud::managedkafka::schemaregistry::v1::ListVersionsRequest const&
        request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->ListVersions(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::CreateVersionResponse>
ManagedSchemaRegistryClient::CreateVersion(
    std::string const& parent, std::int32_t version, std::int32_t id,
    google::cloud::managedkafka::schemaregistry::v1::Schema::SchemaType
        schema_type,
    std::string const& schema,
    std::vector<google::cloud::managedkafka::schemaregistry::v1::Schema::
                    SchemaReference> const& references,
    bool normalize, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::CreateVersionRequest request;
  request.set_parent(parent);
  request.set_version(version);
  request.set_id(id);
  request.set_schema_type(schema_type);
  request.set_schema(schema);
  *request.mutable_references() = {references.begin(), references.end()};
  request.set_normalize(normalize);
  return connection_->CreateVersion(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::CreateVersionResponse>
ManagedSchemaRegistryClient::CreateVersion(
    google::cloud::managedkafka::schemaregistry::v1::CreateVersionRequest const&
        request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->CreateVersion(request);
}

StatusOr<google::api::HttpBody> ManagedSchemaRegistryClient::DeleteVersion(
    std::string const& name, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::DeleteVersionRequest request;
  request.set_name(name);
  return connection_->DeleteVersion(request);
}

StatusOr<google::api::HttpBody> ManagedSchemaRegistryClient::DeleteVersion(
    google::cloud::managedkafka::schemaregistry::v1::DeleteVersionRequest const&
        request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->DeleteVersion(request);
}

StatusOr<google::api::HttpBody>
ManagedSchemaRegistryClient::ListReferencedSchemas(std::string const& parent,
                                                   Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::ListReferencedSchemasRequest
      request;
  request.set_parent(parent);
  return connection_->ListReferencedSchemas(request);
}

StatusOr<google::api::HttpBody>
ManagedSchemaRegistryClient::ListReferencedSchemas(
    google::cloud::managedkafka::schemaregistry::v1::
        ListReferencedSchemasRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->ListReferencedSchemas(request);
}

StatusOr<
    google::cloud::managedkafka::schemaregistry::v1::CheckCompatibilityResponse>
ManagedSchemaRegistryClient::CheckCompatibility(std::string const& name,
                                                std::string const& schema,
                                                Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::CheckCompatibilityRequest
      request;
  request.set_name(name);
  request.set_schema(schema);
  return connection_->CheckCompatibility(request);
}

StatusOr<
    google::cloud::managedkafka::schemaregistry::v1::CheckCompatibilityResponse>
ManagedSchemaRegistryClient::CheckCompatibility(
    google::cloud::managedkafka::schemaregistry::v1::
        CheckCompatibilityRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->CheckCompatibility(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::SchemaConfig>
ManagedSchemaRegistryClient::GetSchemaConfig(std::string const& name,
                                             Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::GetSchemaConfigRequest
      request;
  request.set_name(name);
  return connection_->GetSchemaConfig(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::SchemaConfig>
ManagedSchemaRegistryClient::GetSchemaConfig(
    google::cloud::managedkafka::schemaregistry::v1::
        GetSchemaConfigRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->GetSchemaConfig(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::SchemaConfig>
ManagedSchemaRegistryClient::UpdateSchemaConfig(
    std::string const& name,
    google::cloud::managedkafka::schemaregistry::v1::SchemaConfig::
        CompatibilityType compatibility,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::UpdateSchemaConfigRequest
      request;
  request.set_name(name);
  request.set_compatibility(compatibility);
  return connection_->UpdateSchemaConfig(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::SchemaConfig>
ManagedSchemaRegistryClient::UpdateSchemaConfig(
    google::cloud::managedkafka::schemaregistry::v1::
        UpdateSchemaConfigRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->UpdateSchemaConfig(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::SchemaConfig>
ManagedSchemaRegistryClient::DeleteSchemaConfig(std::string const& name,
                                                Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::DeleteSchemaConfigRequest
      request;
  request.set_name(name);
  return connection_->DeleteSchemaConfig(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::SchemaConfig>
ManagedSchemaRegistryClient::DeleteSchemaConfig(
    google::cloud::managedkafka::schemaregistry::v1::
        DeleteSchemaConfigRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->DeleteSchemaConfig(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::SchemaMode>
ManagedSchemaRegistryClient::GetSchemaMode(std::string const& name,
                                           Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::GetSchemaModeRequest request;
  request.set_name(name);
  return connection_->GetSchemaMode(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::SchemaMode>
ManagedSchemaRegistryClient::GetSchemaMode(
    google::cloud::managedkafka::schemaregistry::v1::GetSchemaModeRequest const&
        request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->GetSchemaMode(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::SchemaMode>
ManagedSchemaRegistryClient::UpdateSchemaMode(
    std::string const& name,
    google::cloud::managedkafka::schemaregistry::v1::SchemaMode::ModeType mode,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::UpdateSchemaModeRequest
      request;
  request.set_name(name);
  request.set_mode(mode);
  return connection_->UpdateSchemaMode(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::SchemaMode>
ManagedSchemaRegistryClient::UpdateSchemaMode(
    google::cloud::managedkafka::schemaregistry::v1::
        UpdateSchemaModeRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->UpdateSchemaMode(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::SchemaMode>
ManagedSchemaRegistryClient::DeleteSchemaMode(std::string const& name,
                                              Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::managedkafka::schemaregistry::v1::DeleteSchemaModeRequest
      request;
  request.set_name(name);
  return connection_->DeleteSchemaMode(request);
}

StatusOr<google::cloud::managedkafka::schemaregistry::v1::SchemaMode>
ManagedSchemaRegistryClient::DeleteSchemaMode(
    google::cloud::managedkafka::schemaregistry::v1::
        DeleteSchemaModeRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->DeleteSchemaMode(request);
}

StreamRange<google::cloud::location::Location>
ManagedSchemaRegistryClient::ListLocations(
    google::cloud::location::ListLocationsRequest request, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->ListLocations(std::move(request));
}

StatusOr<google::cloud::location::Location>
ManagedSchemaRegistryClient::GetLocation(
    google::cloud::location::GetLocationRequest const& request, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->GetLocation(request);
}

StreamRange<google::longrunning::Operation>
ManagedSchemaRegistryClient::ListOperations(std::string const& name,
                                            std::string const& filter,
                                            Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::longrunning::ListOperationsRequest request;
  request.set_name(name);
  request.set_filter(filter);
  return connection_->ListOperations(request);
}

StreamRange<google::longrunning::Operation>
ManagedSchemaRegistryClient::ListOperations(
    google::longrunning::ListOperationsRequest request, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->ListOperations(std::move(request));
}

StatusOr<google::longrunning::Operation>
ManagedSchemaRegistryClient::GetOperation(std::string const& name,
                                          Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::longrunning::GetOperationRequest request;
  request.set_name(name);
  return connection_->GetOperation(request);
}

StatusOr<google::longrunning::Operation>
ManagedSchemaRegistryClient::GetOperation(
    google::longrunning::GetOperationRequest const& request, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->GetOperation(request);
}

Status ManagedSchemaRegistryClient::DeleteOperation(std::string const& name,
                                                    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::longrunning::DeleteOperationRequest request;
  request.set_name(name);
  return connection_->DeleteOperation(request);
}

Status ManagedSchemaRegistryClient::DeleteOperation(
    google::longrunning::DeleteOperationRequest const& request, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->DeleteOperation(request);
}

Status ManagedSchemaRegistryClient::CancelOperation(std::string const& name,
                                                    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::longrunning::CancelOperationRequest request;
  request.set_name(name);
  return connection_->CancelOperation(request);
}

Status ManagedSchemaRegistryClient::CancelOperation(
    google::longrunning::CancelOperationRequest const& request, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->CancelOperation(request);
}

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
}  // namespace managedkafka_schemaregistry_v1
}  // namespace cloud
}  // namespace google
