status.pb.cc 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. /*
  2. * Copyright 2018 Google
  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/stubs/common.h>
  21. #include <google/protobuf/stubs/port.h>
  22. #include <google/protobuf/stubs/once.h>
  23. #include <google/protobuf/io/coded_stream.h>
  24. #include <google/protobuf/wire_format_lite_inl.h>
  25. #include <google/protobuf/descriptor.h>
  26. #include <google/protobuf/generated_message_reflection.h>
  27. #include <google/protobuf/reflection_ops.h>
  28. #include <google/protobuf/wire_format.h>
  29. // This is a temporary google only hack
  30. #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  31. #include "third_party/protobuf/version.h"
  32. #endif
  33. // @@protoc_insertion_point(includes)
  34. namespace google {
  35. namespace rpc {
  36. class StatusDefaultTypeInternal {
  37. public:
  38. ::google::protobuf::internal::ExplicitlyConstructed<Status>
  39. _instance;
  40. } _Status_default_instance_;
  41. } // namespace rpc
  42. } // namespace google
  43. namespace protobuf_google_2frpc_2fstatus_2eproto {
  44. void InitDefaultsStatusImpl() {
  45. GOOGLE_PROTOBUF_VERIFY_VERSION;
  46. #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  47. ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
  48. #else
  49. ::google::protobuf::internal::InitProtobufDefaults();
  50. #endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  51. protobuf_google_2fprotobuf_2fany_2eproto::InitDefaultsAny();
  52. {
  53. void* ptr = &::google::rpc::_Status_default_instance_;
  54. new (ptr) ::google::rpc::Status();
  55. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  56. }
  57. ::google::rpc::Status::InitAsDefaultInstance();
  58. }
  59. void InitDefaultsStatus() {
  60. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  61. ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsStatusImpl);
  62. }
  63. ::google::protobuf::Metadata file_level_metadata[1];
  64. const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  65. ~0u, // no _has_bits_
  66. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::rpc::Status, _internal_metadata_),
  67. ~0u, // no _extensions_
  68. ~0u, // no _oneof_case_
  69. ~0u, // no _weak_field_map_
  70. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::rpc::Status, code_),
  71. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::rpc::Status, message_),
  72. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::rpc::Status, details_),
  73. };
  74. static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  75. { 0, -1, sizeof(::google::rpc::Status)},
  76. };
  77. static ::google::protobuf::Message const * const file_default_instances[] = {
  78. reinterpret_cast<const ::google::protobuf::Message*>(&::google::rpc::_Status_default_instance_),
  79. };
  80. void protobuf_AssignDescriptors() {
  81. AddDescriptors();
  82. ::google::protobuf::MessageFactory* factory = NULL;
  83. AssignDescriptors(
  84. "google/rpc/status.proto", schemas, file_default_instances, TableStruct::offsets, factory,
  85. file_level_metadata, NULL, NULL);
  86. }
  87. void protobuf_AssignDescriptorsOnce() {
  88. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  89. ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
  90. }
  91. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  92. void protobuf_RegisterTypes(const ::std::string&) {
  93. protobuf_AssignDescriptorsOnce();
  94. ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
  95. }
  96. void AddDescriptorsImpl() {
  97. InitDefaults();
  98. static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  99. "\n\027google/rpc/status.proto\022\ngoogle.rpc\032\031g"
  100. "oogle/protobuf/any.proto\"N\n\006Status\022\014\n\004co"
  101. "de\030\001 \001(\005\022\017\n\007message\030\002 \001(\t\022%\n\007details\030\003 \003"
  102. "(\0132\024.google.protobuf.AnyB^\n\016com.google.r"
  103. "pcB\013StatusProtoP\001Z7google.golang.org/gen"
  104. "proto/googleapis/rpc/status;status\242\002\003RPC"
  105. "b\006proto3"
  106. };
  107. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  108. descriptor, 248);
  109. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  110. "google/rpc/status.proto", &protobuf_RegisterTypes);
  111. ::protobuf_google_2fprotobuf_2fany_2eproto::AddDescriptors();
  112. }
  113. void AddDescriptors() {
  114. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  115. ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
  116. }
  117. // Force AddDescriptors() to be called at dynamic initialization time.
  118. struct StaticDescriptorInitializer {
  119. StaticDescriptorInitializer() {
  120. AddDescriptors();
  121. }
  122. } static_descriptor_initializer;
  123. } // namespace protobuf_google_2frpc_2fstatus_2eproto
  124. namespace google {
  125. namespace rpc {
  126. // ===================================================================
  127. void Status::InitAsDefaultInstance() {
  128. }
  129. void Status::clear_details() {
  130. details_.Clear();
  131. }
  132. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  133. const int Status::kCodeFieldNumber;
  134. const int Status::kMessageFieldNumber;
  135. const int Status::kDetailsFieldNumber;
  136. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  137. Status::Status()
  138. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  139. if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
  140. ::protobuf_google_2frpc_2fstatus_2eproto::InitDefaultsStatus();
  141. }
  142. SharedCtor();
  143. // @@protoc_insertion_point(constructor:google.rpc.Status)
  144. }
  145. Status::Status(const Status& from)
  146. : ::google::protobuf::Message(),
  147. _internal_metadata_(NULL),
  148. details_(from.details_),
  149. _cached_size_(0) {
  150. _internal_metadata_.MergeFrom(from._internal_metadata_);
  151. message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  152. if (from.message().size() > 0) {
  153. message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.message_);
  154. }
  155. code_ = from.code_;
  156. // @@protoc_insertion_point(copy_constructor:google.rpc.Status)
  157. }
  158. void Status::SharedCtor() {
  159. message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  160. code_ = 0;
  161. _cached_size_ = 0;
  162. }
  163. Status::~Status() {
  164. // @@protoc_insertion_point(destructor:google.rpc.Status)
  165. SharedDtor();
  166. }
  167. void Status::SharedDtor() {
  168. message_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  169. }
  170. void Status::SetCachedSize(int size) const {
  171. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  172. _cached_size_ = size;
  173. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  174. }
  175. const ::google::protobuf::Descriptor* Status::descriptor() {
  176. ::protobuf_google_2frpc_2fstatus_2eproto::protobuf_AssignDescriptorsOnce();
  177. return ::protobuf_google_2frpc_2fstatus_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  178. }
  179. const Status& Status::default_instance() {
  180. ::protobuf_google_2frpc_2fstatus_2eproto::InitDefaultsStatus();
  181. return *internal_default_instance();
  182. }
  183. Status* Status::New(::google::protobuf::Arena* arena) const {
  184. Status* n = new Status;
  185. if (arena != NULL) {
  186. arena->Own(n);
  187. }
  188. return n;
  189. }
  190. void Status::Clear() {
  191. // @@protoc_insertion_point(message_clear_start:google.rpc.Status)
  192. ::google::protobuf::uint32 cached_has_bits = 0;
  193. // Prevent compiler warnings about cached_has_bits being unused
  194. (void) cached_has_bits;
  195. details_.Clear();
  196. message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  197. code_ = 0;
  198. _internal_metadata_.Clear();
  199. }
  200. bool Status::MergePartialFromCodedStream(
  201. ::google::protobuf::io::CodedInputStream* input) {
  202. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  203. ::google::protobuf::uint32 tag;
  204. // @@protoc_insertion_point(parse_start:google.rpc.Status)
  205. for (;;) {
  206. ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  207. tag = p.first;
  208. if (!p.second) goto handle_unusual;
  209. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  210. // int32 code = 1;
  211. case 1: {
  212. if (static_cast< ::google::protobuf::uint8>(tag) ==
  213. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  214. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  215. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  216. input, &code_)));
  217. } else {
  218. goto handle_unusual;
  219. }
  220. break;
  221. }
  222. // string message = 2;
  223. case 2: {
  224. if (static_cast< ::google::protobuf::uint8>(tag) ==
  225. static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
  226. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  227. input, this->mutable_message()));
  228. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  229. this->message().data(), static_cast<int>(this->message().length()),
  230. ::google::protobuf::internal::WireFormatLite::PARSE,
  231. "google.rpc.Status.message"));
  232. } else {
  233. goto handle_unusual;
  234. }
  235. break;
  236. }
  237. // repeated .google.protobuf.Any details = 3;
  238. case 3: {
  239. if (static_cast< ::google::protobuf::uint8>(tag) ==
  240. static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
  241. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_details()));
  242. } else {
  243. goto handle_unusual;
  244. }
  245. break;
  246. }
  247. default: {
  248. handle_unusual:
  249. if (tag == 0) {
  250. goto success;
  251. }
  252. DO_(::google::protobuf::internal::WireFormat::SkipField(
  253. input, tag, _internal_metadata_.mutable_unknown_fields()));
  254. break;
  255. }
  256. }
  257. }
  258. success:
  259. // @@protoc_insertion_point(parse_success:google.rpc.Status)
  260. return true;
  261. failure:
  262. // @@protoc_insertion_point(parse_failure:google.rpc.Status)
  263. return false;
  264. #undef DO_
  265. }
  266. void Status::SerializeWithCachedSizes(
  267. ::google::protobuf::io::CodedOutputStream* output) const {
  268. // @@protoc_insertion_point(serialize_start:google.rpc.Status)
  269. ::google::protobuf::uint32 cached_has_bits = 0;
  270. (void) cached_has_bits;
  271. // int32 code = 1;
  272. if (this->code() != 0) {
  273. ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->code(), output);
  274. }
  275. // string message = 2;
  276. if (this->message().size() > 0) {
  277. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  278. this->message().data(), static_cast<int>(this->message().length()),
  279. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  280. "google.rpc.Status.message");
  281. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  282. 2, this->message(), output);
  283. }
  284. // repeated .google.protobuf.Any details = 3;
  285. for (unsigned int i = 0,
  286. n = static_cast<unsigned int>(this->details_size()); i < n; i++) {
  287. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  288. 3, this->details(static_cast<int>(i)), output);
  289. }
  290. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  291. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  292. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  293. }
  294. // @@protoc_insertion_point(serialize_end:google.rpc.Status)
  295. }
  296. ::google::protobuf::uint8* Status::InternalSerializeWithCachedSizesToArray(
  297. bool deterministic, ::google::protobuf::uint8* target) const {
  298. (void)deterministic; // Unused
  299. // @@protoc_insertion_point(serialize_to_array_start:google.rpc.Status)
  300. ::google::protobuf::uint32 cached_has_bits = 0;
  301. (void) cached_has_bits;
  302. // int32 code = 1;
  303. if (this->code() != 0) {
  304. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->code(), target);
  305. }
  306. // string message = 2;
  307. if (this->message().size() > 0) {
  308. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  309. this->message().data(), static_cast<int>(this->message().length()),
  310. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  311. "google.rpc.Status.message");
  312. target =
  313. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  314. 2, this->message(), target);
  315. }
  316. // repeated .google.protobuf.Any details = 3;
  317. for (unsigned int i = 0,
  318. n = static_cast<unsigned int>(this->details_size()); i < n; i++) {
  319. target = ::google::protobuf::internal::WireFormatLite::
  320. InternalWriteMessageToArray(
  321. 3, this->details(static_cast<int>(i)), deterministic, target);
  322. }
  323. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  324. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  325. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  326. }
  327. // @@protoc_insertion_point(serialize_to_array_end:google.rpc.Status)
  328. return target;
  329. }
  330. size_t Status::ByteSizeLong() const {
  331. // @@protoc_insertion_point(message_byte_size_start:google.rpc.Status)
  332. size_t total_size = 0;
  333. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  334. total_size +=
  335. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  336. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  337. }
  338. // repeated .google.protobuf.Any details = 3;
  339. {
  340. unsigned int count = static_cast<unsigned int>(this->details_size());
  341. total_size += 1UL * count;
  342. for (unsigned int i = 0; i < count; i++) {
  343. total_size +=
  344. ::google::protobuf::internal::WireFormatLite::MessageSize(
  345. this->details(static_cast<int>(i)));
  346. }
  347. }
  348. // string message = 2;
  349. if (this->message().size() > 0) {
  350. total_size += 1 +
  351. ::google::protobuf::internal::WireFormatLite::StringSize(
  352. this->message());
  353. }
  354. // int32 code = 1;
  355. if (this->code() != 0) {
  356. total_size += 1 +
  357. ::google::protobuf::internal::WireFormatLite::Int32Size(
  358. this->code());
  359. }
  360. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  361. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  362. _cached_size_ = cached_size;
  363. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  364. return total_size;
  365. }
  366. void Status::MergeFrom(const ::google::protobuf::Message& from) {
  367. // @@protoc_insertion_point(generalized_merge_from_start:google.rpc.Status)
  368. GOOGLE_DCHECK_NE(&from, this);
  369. const Status* source =
  370. ::google::protobuf::internal::DynamicCastToGenerated<const Status>(
  371. &from);
  372. if (source == NULL) {
  373. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.rpc.Status)
  374. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  375. } else {
  376. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.rpc.Status)
  377. MergeFrom(*source);
  378. }
  379. }
  380. void Status::MergeFrom(const Status& from) {
  381. // @@protoc_insertion_point(class_specific_merge_from_start:google.rpc.Status)
  382. GOOGLE_DCHECK_NE(&from, this);
  383. _internal_metadata_.MergeFrom(from._internal_metadata_);
  384. ::google::protobuf::uint32 cached_has_bits = 0;
  385. (void) cached_has_bits;
  386. details_.MergeFrom(from.details_);
  387. if (from.message().size() > 0) {
  388. message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.message_);
  389. }
  390. if (from.code() != 0) {
  391. set_code(from.code());
  392. }
  393. }
  394. void Status::CopyFrom(const ::google::protobuf::Message& from) {
  395. // @@protoc_insertion_point(generalized_copy_from_start:google.rpc.Status)
  396. if (&from == this) return;
  397. Clear();
  398. MergeFrom(from);
  399. }
  400. void Status::CopyFrom(const Status& from) {
  401. // @@protoc_insertion_point(class_specific_copy_from_start:google.rpc.Status)
  402. if (&from == this) return;
  403. Clear();
  404. MergeFrom(from);
  405. }
  406. bool Status::IsInitialized() const {
  407. return true;
  408. }
  409. void Status::Swap(Status* other) {
  410. if (other == this) return;
  411. InternalSwap(other);
  412. }
  413. void Status::InternalSwap(Status* other) {
  414. using std::swap;
  415. details_.InternalSwap(&other->details_);
  416. message_.Swap(&other->message_);
  417. swap(code_, other->code_);
  418. _internal_metadata_.Swap(&other->_internal_metadata_);
  419. swap(_cached_size_, other->_cached_size_);
  420. }
  421. ::google::protobuf::Metadata Status::GetMetadata() const {
  422. protobuf_google_2frpc_2fstatus_2eproto::protobuf_AssignDescriptorsOnce();
  423. return ::protobuf_google_2frpc_2fstatus_2eproto::file_level_metadata[kIndexInFileMessages];
  424. }
  425. // @@protoc_insertion_point(namespace_scope)
  426. } // namespace rpc
  427. } // namespace google
  428. // @@protoc_insertion_point(global_scope)