// 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/chronicle/v1/data_access_control.proto

#include "google/cloud/chronicle/v1/data_access_control_client.h"
#include <memory>
#include <utility>

namespace google {
namespace cloud {
namespace chronicle_v1 {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

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

StatusOr<google::cloud::chronicle::v1::DataAccessLabel>
DataAccessControlServiceClient::CreateDataAccessLabel(
    std::string const& parent,
    google::cloud::chronicle::v1::DataAccessLabel const& data_access_label,
    std::string const& data_access_label_id, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::chronicle::v1::CreateDataAccessLabelRequest request;
  request.set_parent(parent);
  *request.mutable_data_access_label() = data_access_label;
  request.set_data_access_label_id(data_access_label_id);
  return connection_->CreateDataAccessLabel(request);
}

StatusOr<google::cloud::chronicle::v1::DataAccessLabel>
DataAccessControlServiceClient::CreateDataAccessLabel(
    google::cloud::chronicle::v1::CreateDataAccessLabelRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->CreateDataAccessLabel(request);
}

StatusOr<google::cloud::chronicle::v1::DataAccessLabel>
DataAccessControlServiceClient::GetDataAccessLabel(std::string const& name,
                                                   Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::chronicle::v1::GetDataAccessLabelRequest request;
  request.set_name(name);
  return connection_->GetDataAccessLabel(request);
}

StatusOr<google::cloud::chronicle::v1::DataAccessLabel>
DataAccessControlServiceClient::GetDataAccessLabel(
    google::cloud::chronicle::v1::GetDataAccessLabelRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->GetDataAccessLabel(request);
}

StreamRange<google::cloud::chronicle::v1::DataAccessLabel>
DataAccessControlServiceClient::ListDataAccessLabels(std::string const& parent,
                                                     Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::chronicle::v1::ListDataAccessLabelsRequest request;
  request.set_parent(parent);
  return connection_->ListDataAccessLabels(request);
}

StreamRange<google::cloud::chronicle::v1::DataAccessLabel>
DataAccessControlServiceClient::ListDataAccessLabels(
    google::cloud::chronicle::v1::ListDataAccessLabelsRequest request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->ListDataAccessLabels(std::move(request));
}

StatusOr<google::cloud::chronicle::v1::DataAccessLabel>
DataAccessControlServiceClient::UpdateDataAccessLabel(
    google::cloud::chronicle::v1::DataAccessLabel const& data_access_label,
    google::protobuf::FieldMask const& update_mask, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::chronicle::v1::UpdateDataAccessLabelRequest request;
  *request.mutable_data_access_label() = data_access_label;
  *request.mutable_update_mask() = update_mask;
  return connection_->UpdateDataAccessLabel(request);
}

StatusOr<google::cloud::chronicle::v1::DataAccessLabel>
DataAccessControlServiceClient::UpdateDataAccessLabel(
    google::cloud::chronicle::v1::UpdateDataAccessLabelRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->UpdateDataAccessLabel(request);
}

Status DataAccessControlServiceClient::DeleteDataAccessLabel(
    std::string const& name, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::chronicle::v1::DeleteDataAccessLabelRequest request;
  request.set_name(name);
  return connection_->DeleteDataAccessLabel(request);
}

Status DataAccessControlServiceClient::DeleteDataAccessLabel(
    google::cloud::chronicle::v1::DeleteDataAccessLabelRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->DeleteDataAccessLabel(request);
}

StatusOr<google::cloud::chronicle::v1::DataAccessScope>
DataAccessControlServiceClient::CreateDataAccessScope(
    std::string const& parent,
    google::cloud::chronicle::v1::DataAccessScope const& data_access_scope,
    std::string const& data_access_scope_id, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::chronicle::v1::CreateDataAccessScopeRequest request;
  request.set_parent(parent);
  *request.mutable_data_access_scope() = data_access_scope;
  request.set_data_access_scope_id(data_access_scope_id);
  return connection_->CreateDataAccessScope(request);
}

StatusOr<google::cloud::chronicle::v1::DataAccessScope>
DataAccessControlServiceClient::CreateDataAccessScope(
    google::cloud::chronicle::v1::CreateDataAccessScopeRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->CreateDataAccessScope(request);
}

StatusOr<google::cloud::chronicle::v1::DataAccessScope>
DataAccessControlServiceClient::GetDataAccessScope(std::string const& name,
                                                   Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::chronicle::v1::GetDataAccessScopeRequest request;
  request.set_name(name);
  return connection_->GetDataAccessScope(request);
}

StatusOr<google::cloud::chronicle::v1::DataAccessScope>
DataAccessControlServiceClient::GetDataAccessScope(
    google::cloud::chronicle::v1::GetDataAccessScopeRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->GetDataAccessScope(request);
}

StreamRange<google::cloud::chronicle::v1::DataAccessScope>
DataAccessControlServiceClient::ListDataAccessScopes(std::string const& parent,
                                                     Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::chronicle::v1::ListDataAccessScopesRequest request;
  request.set_parent(parent);
  return connection_->ListDataAccessScopes(request);
}

StreamRange<google::cloud::chronicle::v1::DataAccessScope>
DataAccessControlServiceClient::ListDataAccessScopes(
    google::cloud::chronicle::v1::ListDataAccessScopesRequest request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->ListDataAccessScopes(std::move(request));
}

StatusOr<google::cloud::chronicle::v1::DataAccessScope>
DataAccessControlServiceClient::UpdateDataAccessScope(
    google::cloud::chronicle::v1::DataAccessScope const& data_access_scope,
    google::protobuf::FieldMask const& update_mask, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::chronicle::v1::UpdateDataAccessScopeRequest request;
  *request.mutable_data_access_scope() = data_access_scope;
  *request.mutable_update_mask() = update_mask;
  return connection_->UpdateDataAccessScope(request);
}

StatusOr<google::cloud::chronicle::v1::DataAccessScope>
DataAccessControlServiceClient::UpdateDataAccessScope(
    google::cloud::chronicle::v1::UpdateDataAccessScopeRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->UpdateDataAccessScope(request);
}

Status DataAccessControlServiceClient::DeleteDataAccessScope(
    std::string const& name, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  google::cloud::chronicle::v1::DeleteDataAccessScopeRequest request;
  request.set_name(name);
  return connection_->DeleteDataAccessScope(request);
}

Status DataAccessControlServiceClient::DeleteDataAccessScope(
    google::cloud::chronicle::v1::DeleteDataAccessScopeRequest const& request,
    Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->DeleteDataAccessScope(request);
}

StreamRange<google::longrunning::Operation>
DataAccessControlServiceClient::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>
DataAccessControlServiceClient::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>
DataAccessControlServiceClient::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>
DataAccessControlServiceClient::GetOperation(
    google::longrunning::GetOperationRequest const& request, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->GetOperation(request);
}

Status DataAccessControlServiceClient::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 DataAccessControlServiceClient::DeleteOperation(
    google::longrunning::DeleteOperationRequest const& request, Options opts) {
  internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
  return connection_->DeleteOperation(request);
}

Status DataAccessControlServiceClient::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 DataAccessControlServiceClient::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 chronicle_v1
}  // namespace cloud
}  // namespace google
