/*
 * 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
 *
 *      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.
 */

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/rpc/status.proto

#include "google/rpc/status.pb.h"

#include <algorithm>
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/extension_set.h"
#include "google/protobuf/wire_format_lite.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/generated_message_reflection.h"
#include "google/protobuf/reflection_ops.h"
#include "google/protobuf/wire_format.h"
#include "google/protobuf/generated_message_tctable_impl.h"
// @@protoc_insertion_point(includes)

// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::google::protobuf;
namespace _pbi = ::google::protobuf::internal;
namespace _fl = ::google::protobuf::internal::field_layout;
namespace google {
namespace rpc {

inline constexpr Status::Impl_::Impl_(
    ::_pbi::ConstantInitialized) noexcept
      : details_{},
        message_(
            &::google::protobuf::internal::fixed_address_empty_string,
            ::_pbi::ConstantInitialized()),
        code_{0},
        _cached_size_{0} {}

template <typename>
PROTOBUF_CONSTEXPR Status::Status(::_pbi::ConstantInitialized)
    : _impl_(::_pbi::ConstantInitialized()) {}
struct StatusDefaultTypeInternal {
  PROTOBUF_CONSTEXPR StatusDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  ~StatusDefaultTypeInternal() {}
  union {
    Status _instance;
  };
};

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StatusDefaultTypeInternal _Status_default_instance_;
}  // namespace rpc
}  // namespace google
static ::_pb::Metadata file_level_metadata_google_2frpc_2fstatus_2eproto[1];
static constexpr const ::_pb::EnumDescriptor**
    file_level_enum_descriptors_google_2frpc_2fstatus_2eproto = nullptr;
static constexpr const ::_pb::ServiceDescriptor**
    file_level_service_descriptors_google_2frpc_2fstatus_2eproto = nullptr;
const ::uint32_t TableStruct_google_2frpc_2fstatus_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
    protodesc_cold) = {
    ~0u,  // no _has_bits_
    PROTOBUF_FIELD_OFFSET(::google::rpc::Status, _internal_metadata_),
    ~0u,  // no _extensions_
    ~0u,  // no _oneof_case_
    ~0u,  // no _weak_field_map_
    ~0u,  // no _inlined_string_donated_
    ~0u,  // no _split_
    ~0u,  // no sizeof(Split)
    PROTOBUF_FIELD_OFFSET(::google::rpc::Status, _impl_.code_),
    PROTOBUF_FIELD_OFFSET(::google::rpc::Status, _impl_.message_),
    PROTOBUF_FIELD_OFFSET(::google::rpc::Status, _impl_.details_),
};

static const ::_pbi::MigrationSchema
    schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
        {0, -1, -1, sizeof(::google::rpc::Status)},
};

static const ::_pb::Message* const file_default_instances[] = {
    &::google::rpc::_Status_default_instance_._instance,
};
const char descriptor_table_protodef_google_2frpc_2fstatus_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
    "\n\027google/rpc/status.proto\022\ngoogle.rpc\032\031g"
    "oogle/protobuf/any.proto\"N\n\006Status\022\014\n\004co"
    "de\030\001 \001(\005\022\017\n\007message\030\002 \001(\t\022%\n\007details\030\003 \003"
    "(\0132\024.google.protobuf.AnyB^\n\016com.google.r"
    "pcB\013StatusProtoP\001Z7google.golang.org/gen"
    "proto/googleapis/rpc/status;status\242\002\003RPC"
    "b\006proto3"
};
static const ::_pbi::DescriptorTable* const descriptor_table_google_2frpc_2fstatus_2eproto_deps[1] =
    {
        &::descriptor_table_google_2fprotobuf_2fany_2eproto,
};
static ::absl::once_flag descriptor_table_google_2frpc_2fstatus_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_google_2frpc_2fstatus_2eproto = {
    false,
    false,
    248,
    descriptor_table_protodef_google_2frpc_2fstatus_2eproto,
    "google/rpc/status.proto",
    &descriptor_table_google_2frpc_2fstatus_2eproto_once,
    descriptor_table_google_2frpc_2fstatus_2eproto_deps,
    1,
    1,
    schemas,
    file_default_instances,
    TableStruct_google_2frpc_2fstatus_2eproto::offsets,
    file_level_metadata_google_2frpc_2fstatus_2eproto,
    file_level_enum_descriptors_google_2frpc_2fstatus_2eproto,
    file_level_service_descriptors_google_2frpc_2fstatus_2eproto,
};

// This function exists to be marked as weak.
// It can significantly speed up compilation by breaking up LLVM's SCC
// in the .pb.cc translation units. Large translation units see a
// reduction of more than 35% of walltime for optimized builds. Without
// the weak attribute all the messages in the file, including all the
// vtables and everything they use become part of the same SCC through
// a cycle like:
// GetMetadata -> descriptor table -> default instances ->
//   vtables -> GetMetadata
// By adding a weak function here we break the connection from the
// individual vtables back into the descriptor table.
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_google_2frpc_2fstatus_2eproto_getter() {
  return &descriptor_table_google_2frpc_2fstatus_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2frpc_2fstatus_2eproto(&descriptor_table_google_2frpc_2fstatus_2eproto);
namespace google {
namespace rpc {
// ===================================================================

class Status::_Internal {
 public:
};

void Status::clear_details() {
  PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
  _impl_.details_.Clear();
}
Status::Status(::google::protobuf::Arena* arena)
    : ::google::protobuf::Message(arena) {
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:google.rpc.Status)
}
inline PROTOBUF_NDEBUG_INLINE Status::Impl_::Impl_(
    ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena,
    const Impl_& from)
      : details_{visibility, arena, from.details_},
        message_(arena, from.message_),
        _cached_size_{0} {}

Status::Status(
    ::google::protobuf::Arena* arena,
    const Status& from)
    : ::google::protobuf::Message(arena) {
  Status* const _this = this;
  (void)_this;
  _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(
      from._internal_metadata_);
  new (&_impl_) Impl_(internal_visibility(), arena, from._impl_);
  _impl_.code_ = from._impl_.code_;

  // @@protoc_insertion_point(copy_constructor:google.rpc.Status)
}
inline PROTOBUF_NDEBUG_INLINE Status::Impl_::Impl_(
    ::google::protobuf::internal::InternalVisibility visibility,
    ::google::protobuf::Arena* arena)
      : details_{visibility, arena},
        message_(arena),
        _cached_size_{0} {}

inline void Status::SharedCtor(::_pb::Arena* arena) {
  new (&_impl_) Impl_(internal_visibility(), arena);
  _impl_.code_ = {};
}
Status::~Status() {
  // @@protoc_insertion_point(destructor:google.rpc.Status)
  _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>();
  SharedDtor();
}
inline void Status::SharedDtor() {
  ABSL_DCHECK(GetArena() == nullptr);
  _impl_.message_.Destroy();
  _impl_.~Impl_();
}

PROTOBUF_NOINLINE void Status::Clear() {
// @@protoc_insertion_point(message_clear_start:google.rpc.Status)
  PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _impl_.details_.Clear();
  _impl_.message_.ClearToEmpty();
  _impl_.code_ = 0;
  _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
}

const char* Status::_InternalParse(
    const char* ptr, ::_pbi::ParseContext* ctx) {
  ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header);
  return ptr;
}


PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::_pbi::TcParseTable<2, 3, 1, 33, 2> Status::_table_ = {
  {
    0,  // no _has_bits_
    0, // no _extensions_
    3, 24,  // max_field_number, fast_idx_mask
    offsetof(decltype(_table_), field_lookup_table),
    4294967288,  // skipmap
    offsetof(decltype(_table_), field_entries),
    3,  // num_field_entries
    1,  // num_aux_entries
    offsetof(decltype(_table_), aux_entries),
    &_Status_default_instance_._instance,
    ::_pbi::TcParser::GenericFallback,  // fallback
  }, {{
    {::_pbi::TcParser::MiniParse, {}},
    // int32 code = 1;
    {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Status, _impl_.code_), 63>(),
     {8, 63, 0, PROTOBUF_FIELD_OFFSET(Status, _impl_.code_)}},
    // string message = 2;
    {::_pbi::TcParser::FastUS1,
     {18, 63, 0, PROTOBUF_FIELD_OFFSET(Status, _impl_.message_)}},
    // repeated .google.protobuf.Any details = 3;
    {::_pbi::TcParser::FastMtR1,
     {26, 63, 0, PROTOBUF_FIELD_OFFSET(Status, _impl_.details_)}},
  }}, {{
    65535, 65535
  }}, {{
    // int32 code = 1;
    {PROTOBUF_FIELD_OFFSET(Status, _impl_.code_), 0, 0,
    (0 | ::_fl::kFcSingular | ::_fl::kInt32)},
    // string message = 2;
    {PROTOBUF_FIELD_OFFSET(Status, _impl_.message_), 0, 0,
    (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)},
    // repeated .google.protobuf.Any details = 3;
    {PROTOBUF_FIELD_OFFSET(Status, _impl_.details_), 0, 0,
    (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)},
  }}, {{
    {::_pbi::TcParser::GetTable<::google::protobuf::Any>()},
  }}, {{
    "\21\0\7\0\0\0\0\0"
    "google.rpc.Status"
    "message"
  }},
};

::uint8_t* Status::_InternalSerialize(
    ::uint8_t* target,
    ::google::protobuf::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:google.rpc.Status)
  ::uint32_t cached_has_bits = 0;
  (void)cached_has_bits;

  // int32 code = 1;
  if (this->_internal_code() != 0) {
    target = ::google::protobuf::internal::WireFormatLite::
        WriteInt32ToArrayWithField<1>(
            stream, this->_internal_code(), target);
  }

  // string message = 2;
  if (!this->_internal_message().empty()) {
    const std::string& _s = this->_internal_message();
    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
        _s.data(), static_cast<int>(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.rpc.Status.message");
    target = stream->WriteStringMaybeAliased(2, _s, target);
  }

  // repeated .google.protobuf.Any details = 3;
  for (unsigned i = 0,
      n = static_cast<unsigned>(this->_internal_details_size()); i < n; i++) {
    const auto& repfield = this->_internal_details().Get(i);
    target = ::google::protobuf::internal::WireFormatLite::
        InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target =
        ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
            _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:google.rpc.Status)
  return target;
}

::size_t Status::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:google.rpc.Status)
  ::size_t total_size = 0;

  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated .google.protobuf.Any details = 3;
  total_size += 1UL * this->_internal_details_size();
  for (const auto& msg : this->_internal_details()) {
    total_size +=
      ::google::protobuf::internal::WireFormatLite::MessageSize(msg);
  }
  // string message = 2;
  if (!this->_internal_message().empty()) {
    total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(
                                    this->_internal_message());
  }

  // int32 code = 1;
  if (this->_internal_code() != 0) {
    total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
        this->_internal_code());
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

const ::google::protobuf::Message::ClassData Status::_class_data_ = {
    Status::MergeImpl,
    nullptr,  // OnDemandRegisterArenaDtor
};
const ::google::protobuf::Message::ClassData* Status::GetClassData() const {
  return &_class_data_;
}

void Status::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) {
  auto* const _this = static_cast<Status*>(&to_msg);
  auto& from = static_cast<const Status&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:google.rpc.Status)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  _this->_internal_mutable_details()->MergeFrom(
      from._internal_details());
  if (!from._internal_message().empty()) {
    _this->_internal_set_message(from._internal_message());
  }
  if (from._internal_code() != 0) {
    _this->_internal_set_code(from._internal_code());
  }
  _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_);
}

void Status::CopyFrom(const Status& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:google.rpc.Status)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

PROTOBUF_NOINLINE bool Status::IsInitialized() const {
  return true;
}

::_pbi::CachedSize* Status::AccessCachedSize() const {
  return &_impl_._cached_size_;
}
void Status::InternalSwap(Status* PROTOBUF_RESTRICT other) {
  using std::swap;
  auto* arena = GetArena();
  ABSL_DCHECK_EQ(arena, other->GetArena());
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.details_.InternalSwap(&other->_impl_.details_);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.message_, &other->_impl_.message_, arena);
        swap(_impl_.code_, other->_impl_.code_);
}

::google::protobuf::Metadata Status::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_google_2frpc_2fstatus_2eproto_getter, &descriptor_table_google_2frpc_2fstatus_2eproto_once,
      file_level_metadata_google_2frpc_2fstatus_2eproto[0]);
}
// @@protoc_insertion_point(namespace_scope)
}  // namespace rpc
}  // namespace google
namespace google {
namespace protobuf {
}  // namespace protobuf
}  // namespace google
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
