status.pb.cc 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. /*
  2. * Copyright 2021 Google LLC
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. // Generated by the protocol buffer compiler. DO NOT EDIT!
  17. // source: google/rpc/status.proto
  18. #include "google/rpc/status.pb.h"
  19. #include <algorithm>
  20. #include <google/protobuf/io/coded_stream.h>
  21. #include <google/protobuf/extension_set.h>
  22. #include <google/protobuf/wire_format_lite.h>
  23. #include <google/protobuf/descriptor.h>
  24. #include <google/protobuf/generated_message_reflection.h>
  25. #include <google/protobuf/reflection_ops.h>
  26. #include <google/protobuf/wire_format.h>
  27. // @@protoc_insertion_point(includes)
  28. #include <google/protobuf/port_def.inc>
  29. extern PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fany_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Any_google_2fprotobuf_2fany_2eproto;
  30. namespace google {
  31. namespace rpc {
  32. class StatusDefaultTypeInternal {
  33. public:
  34. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Status> _instance;
  35. } _Status_default_instance_;
  36. } // namespace rpc
  37. } // namespace google
  38. static void InitDefaultsscc_info_Status_google_2frpc_2fstatus_2eproto() {
  39. GOOGLE_PROTOBUF_VERIFY_VERSION;
  40. {
  41. void* ptr = &::google::rpc::_Status_default_instance_;
  42. new (ptr) ::google::rpc::Status();
  43. ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  44. }
  45. ::google::rpc::Status::InitAsDefaultInstance();
  46. }
  47. ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Status_google_2frpc_2fstatus_2eproto =
  48. {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_Status_google_2frpc_2fstatus_2eproto}, {
  49. &scc_info_Any_google_2fprotobuf_2fany_2eproto.base,}};
  50. static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_google_2frpc_2fstatus_2eproto[1];
  51. static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_google_2frpc_2fstatus_2eproto = nullptr;
  52. static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_google_2frpc_2fstatus_2eproto = nullptr;
  53. const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_google_2frpc_2fstatus_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  54. ~0u, // no _has_bits_
  55. PROTOBUF_FIELD_OFFSET(::google::rpc::Status, _internal_metadata_),
  56. ~0u, // no _extensions_
  57. ~0u, // no _oneof_case_
  58. ~0u, // no _weak_field_map_
  59. PROTOBUF_FIELD_OFFSET(::google::rpc::Status, code_),
  60. PROTOBUF_FIELD_OFFSET(::google::rpc::Status, message_),
  61. PROTOBUF_FIELD_OFFSET(::google::rpc::Status, details_),
  62. };
  63. static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  64. { 0, -1, sizeof(::google::rpc::Status)},
  65. };
  66. static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
  67. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::google::rpc::_Status_default_instance_),
  68. };
  69. const char descriptor_table_protodef_google_2frpc_2fstatus_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  70. "\n\027google/rpc/status.proto\022\ngoogle.rpc\032\031g"
  71. "oogle/protobuf/any.proto\"N\n\006Status\022\014\n\004co"
  72. "de\030\001 \001(\005\022\017\n\007message\030\002 \001(\t\022%\n\007details\030\003 \003"
  73. "(\0132\024.google.protobuf.AnyB^\n\016com.google.r"
  74. "pcB\013StatusProtoP\001Z7google.golang.org/gen"
  75. "proto/googleapis/rpc/status;status\242\002\003RPC"
  76. "b\006proto3"
  77. ;
  78. static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_google_2frpc_2fstatus_2eproto_deps[1] = {
  79. &::descriptor_table_google_2fprotobuf_2fany_2eproto,
  80. };
  81. static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_google_2frpc_2fstatus_2eproto_sccs[1] = {
  82. &scc_info_Status_google_2frpc_2fstatus_2eproto.base,
  83. };
  84. static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2frpc_2fstatus_2eproto_once;
  85. static bool descriptor_table_google_2frpc_2fstatus_2eproto_initialized = false;
  86. const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2frpc_2fstatus_2eproto = {
  87. &descriptor_table_google_2frpc_2fstatus_2eproto_initialized, descriptor_table_protodef_google_2frpc_2fstatus_2eproto, "google/rpc/status.proto", 248,
  88. &descriptor_table_google_2frpc_2fstatus_2eproto_once, descriptor_table_google_2frpc_2fstatus_2eproto_sccs, descriptor_table_google_2frpc_2fstatus_2eproto_deps, 1, 1,
  89. schemas, file_default_instances, TableStruct_google_2frpc_2fstatus_2eproto::offsets,
  90. file_level_metadata_google_2frpc_2fstatus_2eproto, 1, file_level_enum_descriptors_google_2frpc_2fstatus_2eproto, file_level_service_descriptors_google_2frpc_2fstatus_2eproto,
  91. };
  92. // Force running AddDescriptors() at dynamic initialization time.
  93. static bool dynamic_init_dummy_google_2frpc_2fstatus_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_google_2frpc_2fstatus_2eproto), true);
  94. namespace google {
  95. namespace rpc {
  96. // ===================================================================
  97. void Status::InitAsDefaultInstance() {
  98. }
  99. class Status::_Internal {
  100. public:
  101. };
  102. void Status::clear_details() {
  103. details_.Clear();
  104. }
  105. Status::Status()
  106. : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  107. SharedCtor();
  108. // @@protoc_insertion_point(constructor:google.rpc.Status)
  109. }
  110. Status::Status(const Status& from)
  111. : ::PROTOBUF_NAMESPACE_ID::Message(),
  112. _internal_metadata_(nullptr),
  113. details_(from.details_) {
  114. _internal_metadata_.MergeFrom(from._internal_metadata_);
  115. message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  116. if (!from._internal_message().empty()) {
  117. message_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.message_);
  118. }
  119. code_ = from.code_;
  120. // @@protoc_insertion_point(copy_constructor:google.rpc.Status)
  121. }
  122. void Status::SharedCtor() {
  123. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Status_google_2frpc_2fstatus_2eproto.base);
  124. message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  125. code_ = 0;
  126. }
  127. Status::~Status() {
  128. // @@protoc_insertion_point(destructor:google.rpc.Status)
  129. SharedDtor();
  130. }
  131. void Status::SharedDtor() {
  132. message_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  133. }
  134. void Status::SetCachedSize(int size) const {
  135. _cached_size_.Set(size);
  136. }
  137. const Status& Status::default_instance() {
  138. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Status_google_2frpc_2fstatus_2eproto.base);
  139. return *internal_default_instance();
  140. }
  141. void Status::Clear() {
  142. // @@protoc_insertion_point(message_clear_start:google.rpc.Status)
  143. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  144. // Prevent compiler warnings about cached_has_bits being unused
  145. (void) cached_has_bits;
  146. details_.Clear();
  147. message_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  148. code_ = 0;
  149. _internal_metadata_.Clear();
  150. }
  151. const char* Status::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
  152. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  153. while (!ctx->Done(&ptr)) {
  154. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  155. ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
  156. CHK_(ptr);
  157. switch (tag >> 3) {
  158. // int32 code = 1;
  159. case 1:
  160. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
  161. code_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
  162. CHK_(ptr);
  163. } else goto handle_unusual;
  164. continue;
  165. // string message = 2;
  166. case 2:
  167. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
  168. auto str = _internal_mutable_message();
  169. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
  170. CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.rpc.Status.message"));
  171. CHK_(ptr);
  172. } else goto handle_unusual;
  173. continue;
  174. // repeated .google.protobuf.Any details = 3;
  175. case 3:
  176. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
  177. ptr -= 1;
  178. do {
  179. ptr += 1;
  180. ptr = ctx->ParseMessage(_internal_add_details(), ptr);
  181. CHK_(ptr);
  182. if (!ctx->DataAvailable(ptr)) break;
  183. } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
  184. } else goto handle_unusual;
  185. continue;
  186. default: {
  187. handle_unusual:
  188. if ((tag & 7) == 4 || tag == 0) {
  189. ctx->SetLastTag(tag);
  190. goto success;
  191. }
  192. ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
  193. CHK_(ptr != nullptr);
  194. continue;
  195. }
  196. } // switch
  197. } // while
  198. success:
  199. return ptr;
  200. failure:
  201. ptr = nullptr;
  202. goto success;
  203. #undef CHK_
  204. }
  205. ::PROTOBUF_NAMESPACE_ID::uint8* Status::_InternalSerialize(
  206. ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  207. // @@protoc_insertion_point(serialize_to_array_start:google.rpc.Status)
  208. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  209. (void) cached_has_bits;
  210. // int32 code = 1;
  211. if (this->code() != 0) {
  212. target = stream->EnsureSpace(target);
  213. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_code(), target);
  214. }
  215. // string message = 2;
  216. if (this->message().size() > 0) {
  217. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  218. this->_internal_message().data(), static_cast<int>(this->_internal_message().length()),
  219. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  220. "google.rpc.Status.message");
  221. target = stream->WriteStringMaybeAliased(
  222. 2, this->_internal_message(), target);
  223. }
  224. // repeated .google.protobuf.Any details = 3;
  225. for (unsigned int i = 0,
  226. n = static_cast<unsigned int>(this->_internal_details_size()); i < n; i++) {
  227. target = stream->EnsureSpace(target);
  228. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  229. InternalWriteMessage(3, this->_internal_details(i), target, stream);
  230. }
  231. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  232. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
  233. _internal_metadata_.unknown_fields(), target, stream);
  234. }
  235. // @@protoc_insertion_point(serialize_to_array_end:google.rpc.Status)
  236. return target;
  237. }
  238. size_t Status::ByteSizeLong() const {
  239. // @@protoc_insertion_point(message_byte_size_start:google.rpc.Status)
  240. size_t total_size = 0;
  241. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  242. // Prevent compiler warnings about cached_has_bits being unused
  243. (void) cached_has_bits;
  244. // repeated .google.protobuf.Any details = 3;
  245. total_size += 1UL * this->_internal_details_size();
  246. for (const auto& msg : this->details_) {
  247. total_size +=
  248. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  249. }
  250. // string message = 2;
  251. if (this->message().size() > 0) {
  252. total_size += 1 +
  253. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  254. this->_internal_message());
  255. }
  256. // int32 code = 1;
  257. if (this->code() != 0) {
  258. total_size += 1 +
  259. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
  260. this->_internal_code());
  261. }
  262. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  263. return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
  264. _internal_metadata_, total_size, &_cached_size_);
  265. }
  266. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  267. SetCachedSize(cached_size);
  268. return total_size;
  269. }
  270. void Status::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  271. // @@protoc_insertion_point(generalized_merge_from_start:google.rpc.Status)
  272. GOOGLE_DCHECK_NE(&from, this);
  273. const Status* source =
  274. ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Status>(
  275. &from);
  276. if (source == nullptr) {
  277. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.rpc.Status)
  278. ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  279. } else {
  280. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.rpc.Status)
  281. MergeFrom(*source);
  282. }
  283. }
  284. void Status::MergeFrom(const Status& from) {
  285. // @@protoc_insertion_point(class_specific_merge_from_start:google.rpc.Status)
  286. GOOGLE_DCHECK_NE(&from, this);
  287. _internal_metadata_.MergeFrom(from._internal_metadata_);
  288. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  289. (void) cached_has_bits;
  290. details_.MergeFrom(from.details_);
  291. if (from.message().size() > 0) {
  292. message_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.message_);
  293. }
  294. if (from.code() != 0) {
  295. _internal_set_code(from._internal_code());
  296. }
  297. }
  298. void Status::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  299. // @@protoc_insertion_point(generalized_copy_from_start:google.rpc.Status)
  300. if (&from == this) return;
  301. Clear();
  302. MergeFrom(from);
  303. }
  304. void Status::CopyFrom(const Status& from) {
  305. // @@protoc_insertion_point(class_specific_copy_from_start:google.rpc.Status)
  306. if (&from == this) return;
  307. Clear();
  308. MergeFrom(from);
  309. }
  310. bool Status::IsInitialized() const {
  311. return true;
  312. }
  313. void Status::InternalSwap(Status* other) {
  314. using std::swap;
  315. _internal_metadata_.Swap(&other->_internal_metadata_);
  316. details_.InternalSwap(&other->details_);
  317. message_.Swap(&other->message_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  318. GetArenaNoVirtual());
  319. swap(code_, other->code_);
  320. }
  321. ::PROTOBUF_NAMESPACE_ID::Metadata Status::GetMetadata() const {
  322. return GetMetadataStatic();
  323. }
  324. // @@protoc_insertion_point(namespace_scope)
  325. } // namespace rpc
  326. } // namespace google
  327. PROTOBUF_NAMESPACE_OPEN
  328. template<> PROTOBUF_NOINLINE ::google::rpc::Status* Arena::CreateMaybeMessage< ::google::rpc::Status >(Arena* arena) {
  329. return Arena::CreateInternal< ::google::rpc::Status >(arena);
  330. }
  331. PROTOBUF_NAMESPACE_CLOSE
  332. // @@protoc_insertion_point(global_scope)
  333. #include <google/protobuf/port_undef.inc>