http.pb.cc 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268
  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/api/http.proto
  18. #include "google/api/http.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_2fapi_2fhttp_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_CustomHttpPattern_google_2fapi_2fhttp_2eproto;
  30. extern PROTOBUF_INTERNAL_EXPORT_google_2fapi_2fhttp_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_HttpRule_google_2fapi_2fhttp_2eproto;
  31. namespace google {
  32. namespace api {
  33. class HttpDefaultTypeInternal {
  34. public:
  35. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Http> _instance;
  36. } _Http_default_instance_;
  37. class HttpRuleDefaultTypeInternal {
  38. public:
  39. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<HttpRule> _instance;
  40. ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr get_;
  41. ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr put_;
  42. ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr post_;
  43. ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr delete__;
  44. ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr patch_;
  45. const ::google::api::CustomHttpPattern* custom_;
  46. } _HttpRule_default_instance_;
  47. class CustomHttpPatternDefaultTypeInternal {
  48. public:
  49. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<CustomHttpPattern> _instance;
  50. } _CustomHttpPattern_default_instance_;
  51. } // namespace api
  52. } // namespace google
  53. static void InitDefaultsscc_info_CustomHttpPattern_google_2fapi_2fhttp_2eproto() {
  54. GOOGLE_PROTOBUF_VERIFY_VERSION;
  55. {
  56. void* ptr = &::google::api::_CustomHttpPattern_default_instance_;
  57. new (ptr) ::google::api::CustomHttpPattern();
  58. ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  59. }
  60. ::google::api::CustomHttpPattern::InitAsDefaultInstance();
  61. }
  62. ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_CustomHttpPattern_google_2fapi_2fhttp_2eproto =
  63. {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_CustomHttpPattern_google_2fapi_2fhttp_2eproto}, {}};
  64. static void InitDefaultsscc_info_Http_google_2fapi_2fhttp_2eproto() {
  65. GOOGLE_PROTOBUF_VERIFY_VERSION;
  66. {
  67. void* ptr = &::google::api::_Http_default_instance_;
  68. new (ptr) ::google::api::Http();
  69. ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  70. }
  71. ::google::api::Http::InitAsDefaultInstance();
  72. }
  73. ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Http_google_2fapi_2fhttp_2eproto =
  74. {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_Http_google_2fapi_2fhttp_2eproto}, {
  75. &scc_info_HttpRule_google_2fapi_2fhttp_2eproto.base,}};
  76. static void InitDefaultsscc_info_HttpRule_google_2fapi_2fhttp_2eproto() {
  77. GOOGLE_PROTOBUF_VERIFY_VERSION;
  78. {
  79. void* ptr = &::google::api::_HttpRule_default_instance_;
  80. new (ptr) ::google::api::HttpRule();
  81. ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  82. }
  83. ::google::api::HttpRule::InitAsDefaultInstance();
  84. }
  85. ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_HttpRule_google_2fapi_2fhttp_2eproto =
  86. {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_HttpRule_google_2fapi_2fhttp_2eproto}, {
  87. &scc_info_CustomHttpPattern_google_2fapi_2fhttp_2eproto.base,}};
  88. static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_google_2fapi_2fhttp_2eproto[3];
  89. static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_google_2fapi_2fhttp_2eproto = nullptr;
  90. static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_google_2fapi_2fhttp_2eproto = nullptr;
  91. const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_google_2fapi_2fhttp_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  92. ~0u, // no _has_bits_
  93. PROTOBUF_FIELD_OFFSET(::google::api::Http, _internal_metadata_),
  94. ~0u, // no _extensions_
  95. ~0u, // no _oneof_case_
  96. ~0u, // no _weak_field_map_
  97. PROTOBUF_FIELD_OFFSET(::google::api::Http, rules_),
  98. PROTOBUF_FIELD_OFFSET(::google::api::Http, fully_decode_reserved_expansion_),
  99. ~0u, // no _has_bits_
  100. PROTOBUF_FIELD_OFFSET(::google::api::HttpRule, _internal_metadata_),
  101. ~0u, // no _extensions_
  102. PROTOBUF_FIELD_OFFSET(::google::api::HttpRule, _oneof_case_[0]),
  103. ~0u, // no _weak_field_map_
  104. PROTOBUF_FIELD_OFFSET(::google::api::HttpRule, selector_),
  105. offsetof(::google::api::HttpRuleDefaultTypeInternal, get_),
  106. offsetof(::google::api::HttpRuleDefaultTypeInternal, put_),
  107. offsetof(::google::api::HttpRuleDefaultTypeInternal, post_),
  108. offsetof(::google::api::HttpRuleDefaultTypeInternal, delete__),
  109. offsetof(::google::api::HttpRuleDefaultTypeInternal, patch_),
  110. offsetof(::google::api::HttpRuleDefaultTypeInternal, custom_),
  111. PROTOBUF_FIELD_OFFSET(::google::api::HttpRule, body_),
  112. PROTOBUF_FIELD_OFFSET(::google::api::HttpRule, additional_bindings_),
  113. PROTOBUF_FIELD_OFFSET(::google::api::HttpRule, pattern_),
  114. ~0u, // no _has_bits_
  115. PROTOBUF_FIELD_OFFSET(::google::api::CustomHttpPattern, _internal_metadata_),
  116. ~0u, // no _extensions_
  117. ~0u, // no _oneof_case_
  118. ~0u, // no _weak_field_map_
  119. PROTOBUF_FIELD_OFFSET(::google::api::CustomHttpPattern, kind_),
  120. PROTOBUF_FIELD_OFFSET(::google::api::CustomHttpPattern, path_),
  121. };
  122. static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  123. { 0, -1, sizeof(::google::api::Http)},
  124. { 7, -1, sizeof(::google::api::HttpRule)},
  125. { 22, -1, sizeof(::google::api::CustomHttpPattern)},
  126. };
  127. static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
  128. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::google::api::_Http_default_instance_),
  129. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::google::api::_HttpRule_default_instance_),
  130. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::google::api::_CustomHttpPattern_default_instance_),
  131. };
  132. const char descriptor_table_protodef_google_2fapi_2fhttp_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  133. "\n\025google/api/http.proto\022\ngoogle.api\"T\n\004H"
  134. "ttp\022#\n\005rules\030\001 \003(\0132\024.google.api.HttpRule"
  135. "\022\'\n\037fully_decode_reserved_expansion\030\002 \001("
  136. "\010\"\352\001\n\010HttpRule\022\020\n\010selector\030\001 \001(\t\022\r\n\003get\030"
  137. "\002 \001(\tH\000\022\r\n\003put\030\003 \001(\tH\000\022\016\n\004post\030\004 \001(\tH\000\022\020"
  138. "\n\006delete\030\005 \001(\tH\000\022\017\n\005patch\030\006 \001(\tH\000\022/\n\006cus"
  139. "tom\030\010 \001(\0132\035.google.api.CustomHttpPattern"
  140. "H\000\022\014\n\004body\030\007 \001(\t\0221\n\023additional_bindings\030"
  141. "\013 \003(\0132\024.google.api.HttpRuleB\t\n\007pattern\"/"
  142. "\n\021CustomHttpPattern\022\014\n\004kind\030\001 \001(\t\022\014\n\004pat"
  143. "h\030\002 \001(\tBj\n\016com.google.apiB\tHttpProtoP\001ZA"
  144. "google.golang.org/genproto/googleapis/ap"
  145. "i/annotations;annotations\370\001\001\242\002\004GAPIb\006pro"
  146. "to3"
  147. ;
  148. static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_google_2fapi_2fhttp_2eproto_deps[1] = {
  149. };
  150. static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_google_2fapi_2fhttp_2eproto_sccs[3] = {
  151. &scc_info_CustomHttpPattern_google_2fapi_2fhttp_2eproto.base,
  152. &scc_info_Http_google_2fapi_2fhttp_2eproto.base,
  153. &scc_info_HttpRule_google_2fapi_2fhttp_2eproto.base,
  154. };
  155. static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fapi_2fhttp_2eproto_once;
  156. static bool descriptor_table_google_2fapi_2fhttp_2eproto_initialized = false;
  157. const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fapi_2fhttp_2eproto = {
  158. &descriptor_table_google_2fapi_2fhttp_2eproto_initialized, descriptor_table_protodef_google_2fapi_2fhttp_2eproto, "google/api/http.proto", 523,
  159. &descriptor_table_google_2fapi_2fhttp_2eproto_once, descriptor_table_google_2fapi_2fhttp_2eproto_sccs, descriptor_table_google_2fapi_2fhttp_2eproto_deps, 3, 0,
  160. schemas, file_default_instances, TableStruct_google_2fapi_2fhttp_2eproto::offsets,
  161. file_level_metadata_google_2fapi_2fhttp_2eproto, 3, file_level_enum_descriptors_google_2fapi_2fhttp_2eproto, file_level_service_descriptors_google_2fapi_2fhttp_2eproto,
  162. };
  163. // Force running AddDescriptors() at dynamic initialization time.
  164. static bool dynamic_init_dummy_google_2fapi_2fhttp_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_google_2fapi_2fhttp_2eproto), true);
  165. namespace google {
  166. namespace api {
  167. // ===================================================================
  168. void Http::InitAsDefaultInstance() {
  169. }
  170. class Http::_Internal {
  171. public:
  172. };
  173. Http::Http()
  174. : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  175. SharedCtor();
  176. // @@protoc_insertion_point(constructor:google.api.Http)
  177. }
  178. Http::Http(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  179. : ::PROTOBUF_NAMESPACE_ID::Message(),
  180. _internal_metadata_(arena),
  181. rules_(arena) {
  182. SharedCtor();
  183. RegisterArenaDtor(arena);
  184. // @@protoc_insertion_point(arena_constructor:google.api.Http)
  185. }
  186. Http::Http(const Http& from)
  187. : ::PROTOBUF_NAMESPACE_ID::Message(),
  188. _internal_metadata_(nullptr),
  189. rules_(from.rules_) {
  190. _internal_metadata_.MergeFrom(from._internal_metadata_);
  191. fully_decode_reserved_expansion_ = from.fully_decode_reserved_expansion_;
  192. // @@protoc_insertion_point(copy_constructor:google.api.Http)
  193. }
  194. void Http::SharedCtor() {
  195. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Http_google_2fapi_2fhttp_2eproto.base);
  196. fully_decode_reserved_expansion_ = false;
  197. }
  198. Http::~Http() {
  199. // @@protoc_insertion_point(destructor:google.api.Http)
  200. SharedDtor();
  201. }
  202. void Http::SharedDtor() {
  203. GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
  204. }
  205. void Http::ArenaDtor(void* object) {
  206. Http* _this = reinterpret_cast< Http* >(object);
  207. (void)_this;
  208. }
  209. void Http::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
  210. }
  211. void Http::SetCachedSize(int size) const {
  212. _cached_size_.Set(size);
  213. }
  214. const Http& Http::default_instance() {
  215. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Http_google_2fapi_2fhttp_2eproto.base);
  216. return *internal_default_instance();
  217. }
  218. void Http::Clear() {
  219. // @@protoc_insertion_point(message_clear_start:google.api.Http)
  220. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  221. // Prevent compiler warnings about cached_has_bits being unused
  222. (void) cached_has_bits;
  223. rules_.Clear();
  224. fully_decode_reserved_expansion_ = false;
  225. _internal_metadata_.Clear();
  226. }
  227. const char* Http::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
  228. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  229. ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
  230. while (!ctx->Done(&ptr)) {
  231. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  232. ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
  233. CHK_(ptr);
  234. switch (tag >> 3) {
  235. // repeated .google.api.HttpRule rules = 1;
  236. case 1:
  237. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
  238. ptr -= 1;
  239. do {
  240. ptr += 1;
  241. ptr = ctx->ParseMessage(_internal_add_rules(), ptr);
  242. CHK_(ptr);
  243. if (!ctx->DataAvailable(ptr)) break;
  244. } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
  245. } else goto handle_unusual;
  246. continue;
  247. // bool fully_decode_reserved_expansion = 2;
  248. case 2:
  249. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
  250. fully_decode_reserved_expansion_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
  251. CHK_(ptr);
  252. } else goto handle_unusual;
  253. continue;
  254. default: {
  255. handle_unusual:
  256. if ((tag & 7) == 4 || tag == 0) {
  257. ctx->SetLastTag(tag);
  258. goto success;
  259. }
  260. ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
  261. CHK_(ptr != nullptr);
  262. continue;
  263. }
  264. } // switch
  265. } // while
  266. success:
  267. return ptr;
  268. failure:
  269. ptr = nullptr;
  270. goto success;
  271. #undef CHK_
  272. }
  273. ::PROTOBUF_NAMESPACE_ID::uint8* Http::_InternalSerialize(
  274. ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  275. // @@protoc_insertion_point(serialize_to_array_start:google.api.Http)
  276. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  277. (void) cached_has_bits;
  278. // repeated .google.api.HttpRule rules = 1;
  279. for (unsigned int i = 0,
  280. n = static_cast<unsigned int>(this->_internal_rules_size()); i < n; i++) {
  281. target = stream->EnsureSpace(target);
  282. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  283. InternalWriteMessage(1, this->_internal_rules(i), target, stream);
  284. }
  285. // bool fully_decode_reserved_expansion = 2;
  286. if (this->fully_decode_reserved_expansion() != 0) {
  287. target = stream->EnsureSpace(target);
  288. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_fully_decode_reserved_expansion(), target);
  289. }
  290. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  291. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
  292. _internal_metadata_.unknown_fields(), target, stream);
  293. }
  294. // @@protoc_insertion_point(serialize_to_array_end:google.api.Http)
  295. return target;
  296. }
  297. size_t Http::ByteSizeLong() const {
  298. // @@protoc_insertion_point(message_byte_size_start:google.api.Http)
  299. size_t total_size = 0;
  300. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  301. // Prevent compiler warnings about cached_has_bits being unused
  302. (void) cached_has_bits;
  303. // repeated .google.api.HttpRule rules = 1;
  304. total_size += 1UL * this->_internal_rules_size();
  305. for (const auto& msg : this->rules_) {
  306. total_size +=
  307. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  308. }
  309. // bool fully_decode_reserved_expansion = 2;
  310. if (this->fully_decode_reserved_expansion() != 0) {
  311. total_size += 1 + 1;
  312. }
  313. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  314. return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
  315. _internal_metadata_, total_size, &_cached_size_);
  316. }
  317. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  318. SetCachedSize(cached_size);
  319. return total_size;
  320. }
  321. void Http::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  322. // @@protoc_insertion_point(generalized_merge_from_start:google.api.Http)
  323. GOOGLE_DCHECK_NE(&from, this);
  324. const Http* source =
  325. ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Http>(
  326. &from);
  327. if (source == nullptr) {
  328. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.api.Http)
  329. ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  330. } else {
  331. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.api.Http)
  332. MergeFrom(*source);
  333. }
  334. }
  335. void Http::MergeFrom(const Http& from) {
  336. // @@protoc_insertion_point(class_specific_merge_from_start:google.api.Http)
  337. GOOGLE_DCHECK_NE(&from, this);
  338. _internal_metadata_.MergeFrom(from._internal_metadata_);
  339. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  340. (void) cached_has_bits;
  341. rules_.MergeFrom(from.rules_);
  342. if (from.fully_decode_reserved_expansion() != 0) {
  343. _internal_set_fully_decode_reserved_expansion(from._internal_fully_decode_reserved_expansion());
  344. }
  345. }
  346. void Http::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  347. // @@protoc_insertion_point(generalized_copy_from_start:google.api.Http)
  348. if (&from == this) return;
  349. Clear();
  350. MergeFrom(from);
  351. }
  352. void Http::CopyFrom(const Http& from) {
  353. // @@protoc_insertion_point(class_specific_copy_from_start:google.api.Http)
  354. if (&from == this) return;
  355. Clear();
  356. MergeFrom(from);
  357. }
  358. bool Http::IsInitialized() const {
  359. return true;
  360. }
  361. void Http::InternalSwap(Http* other) {
  362. using std::swap;
  363. _internal_metadata_.Swap(&other->_internal_metadata_);
  364. rules_.InternalSwap(&other->rules_);
  365. swap(fully_decode_reserved_expansion_, other->fully_decode_reserved_expansion_);
  366. }
  367. ::PROTOBUF_NAMESPACE_ID::Metadata Http::GetMetadata() const {
  368. return GetMetadataStatic();
  369. }
  370. // ===================================================================
  371. void HttpRule::InitAsDefaultInstance() {
  372. ::google::api::_HttpRule_default_instance_.get_.UnsafeSetDefault(
  373. &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  374. ::google::api::_HttpRule_default_instance_.put_.UnsafeSetDefault(
  375. &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  376. ::google::api::_HttpRule_default_instance_.post_.UnsafeSetDefault(
  377. &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  378. ::google::api::_HttpRule_default_instance_.delete__.UnsafeSetDefault(
  379. &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  380. ::google::api::_HttpRule_default_instance_.patch_.UnsafeSetDefault(
  381. &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  382. ::google::api::_HttpRule_default_instance_.custom_ = const_cast< ::google::api::CustomHttpPattern*>(
  383. ::google::api::CustomHttpPattern::internal_default_instance());
  384. }
  385. class HttpRule::_Internal {
  386. public:
  387. static const ::google::api::CustomHttpPattern& custom(const HttpRule* msg);
  388. };
  389. const ::google::api::CustomHttpPattern&
  390. HttpRule::_Internal::custom(const HttpRule* msg) {
  391. return *msg->pattern_.custom_;
  392. }
  393. void HttpRule::set_allocated_custom(::google::api::CustomHttpPattern* custom) {
  394. ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
  395. clear_pattern();
  396. if (custom) {
  397. ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
  398. ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(custom);
  399. if (message_arena != submessage_arena) {
  400. custom = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
  401. message_arena, custom, submessage_arena);
  402. }
  403. set_has_custom();
  404. pattern_.custom_ = custom;
  405. }
  406. // @@protoc_insertion_point(field_set_allocated:google.api.HttpRule.custom)
  407. }
  408. HttpRule::HttpRule()
  409. : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  410. SharedCtor();
  411. // @@protoc_insertion_point(constructor:google.api.HttpRule)
  412. }
  413. HttpRule::HttpRule(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  414. : ::PROTOBUF_NAMESPACE_ID::Message(),
  415. _internal_metadata_(arena),
  416. additional_bindings_(arena) {
  417. SharedCtor();
  418. RegisterArenaDtor(arena);
  419. // @@protoc_insertion_point(arena_constructor:google.api.HttpRule)
  420. }
  421. HttpRule::HttpRule(const HttpRule& from)
  422. : ::PROTOBUF_NAMESPACE_ID::Message(),
  423. _internal_metadata_(nullptr),
  424. additional_bindings_(from.additional_bindings_) {
  425. _internal_metadata_.MergeFrom(from._internal_metadata_);
  426. selector_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  427. if (!from._internal_selector().empty()) {
  428. selector_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_selector(),
  429. GetArenaNoVirtual());
  430. }
  431. body_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  432. if (!from._internal_body().empty()) {
  433. body_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_body(),
  434. GetArenaNoVirtual());
  435. }
  436. clear_has_pattern();
  437. switch (from.pattern_case()) {
  438. case kGet: {
  439. _internal_set_get(from._internal_get());
  440. break;
  441. }
  442. case kPut: {
  443. _internal_set_put(from._internal_put());
  444. break;
  445. }
  446. case kPost: {
  447. _internal_set_post(from._internal_post());
  448. break;
  449. }
  450. case kDelete: {
  451. _internal_set_delete_(from._internal_delete_());
  452. break;
  453. }
  454. case kPatch: {
  455. _internal_set_patch(from._internal_patch());
  456. break;
  457. }
  458. case kCustom: {
  459. _internal_mutable_custom()->::google::api::CustomHttpPattern::MergeFrom(from._internal_custom());
  460. break;
  461. }
  462. case PATTERN_NOT_SET: {
  463. break;
  464. }
  465. }
  466. // @@protoc_insertion_point(copy_constructor:google.api.HttpRule)
  467. }
  468. void HttpRule::SharedCtor() {
  469. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_HttpRule_google_2fapi_2fhttp_2eproto.base);
  470. selector_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  471. body_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  472. clear_has_pattern();
  473. }
  474. HttpRule::~HttpRule() {
  475. // @@protoc_insertion_point(destructor:google.api.HttpRule)
  476. SharedDtor();
  477. }
  478. void HttpRule::SharedDtor() {
  479. GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
  480. selector_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  481. body_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  482. if (has_pattern()) {
  483. clear_pattern();
  484. }
  485. }
  486. void HttpRule::ArenaDtor(void* object) {
  487. HttpRule* _this = reinterpret_cast< HttpRule* >(object);
  488. (void)_this;
  489. }
  490. void HttpRule::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
  491. }
  492. void HttpRule::SetCachedSize(int size) const {
  493. _cached_size_.Set(size);
  494. }
  495. const HttpRule& HttpRule::default_instance() {
  496. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_HttpRule_google_2fapi_2fhttp_2eproto.base);
  497. return *internal_default_instance();
  498. }
  499. void HttpRule::clear_pattern() {
  500. // @@protoc_insertion_point(one_of_clear_start:google.api.HttpRule)
  501. switch (pattern_case()) {
  502. case kGet: {
  503. pattern_.get_.Destroy(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  504. GetArenaNoVirtual());
  505. break;
  506. }
  507. case kPut: {
  508. pattern_.put_.Destroy(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  509. GetArenaNoVirtual());
  510. break;
  511. }
  512. case kPost: {
  513. pattern_.post_.Destroy(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  514. GetArenaNoVirtual());
  515. break;
  516. }
  517. case kDelete: {
  518. pattern_.delete__.Destroy(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  519. GetArenaNoVirtual());
  520. break;
  521. }
  522. case kPatch: {
  523. pattern_.patch_.Destroy(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  524. GetArenaNoVirtual());
  525. break;
  526. }
  527. case kCustom: {
  528. if (GetArenaNoVirtual() == nullptr) {
  529. delete pattern_.custom_;
  530. }
  531. break;
  532. }
  533. case PATTERN_NOT_SET: {
  534. break;
  535. }
  536. }
  537. _oneof_case_[0] = PATTERN_NOT_SET;
  538. }
  539. void HttpRule::Clear() {
  540. // @@protoc_insertion_point(message_clear_start:google.api.HttpRule)
  541. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  542. // Prevent compiler warnings about cached_has_bits being unused
  543. (void) cached_has_bits;
  544. additional_bindings_.Clear();
  545. selector_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
  546. body_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
  547. clear_pattern();
  548. _internal_metadata_.Clear();
  549. }
  550. const char* HttpRule::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
  551. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  552. ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
  553. while (!ctx->Done(&ptr)) {
  554. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  555. ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
  556. CHK_(ptr);
  557. switch (tag >> 3) {
  558. // string selector = 1;
  559. case 1:
  560. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
  561. auto str = _internal_mutable_selector();
  562. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
  563. CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.api.HttpRule.selector"));
  564. CHK_(ptr);
  565. } else goto handle_unusual;
  566. continue;
  567. // string get = 2;
  568. case 2:
  569. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
  570. auto str = _internal_mutable_get();
  571. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
  572. CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.api.HttpRule.get"));
  573. CHK_(ptr);
  574. } else goto handle_unusual;
  575. continue;
  576. // string put = 3;
  577. case 3:
  578. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
  579. auto str = _internal_mutable_put();
  580. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
  581. CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.api.HttpRule.put"));
  582. CHK_(ptr);
  583. } else goto handle_unusual;
  584. continue;
  585. // string post = 4;
  586. case 4:
  587. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
  588. auto str = _internal_mutable_post();
  589. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
  590. CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.api.HttpRule.post"));
  591. CHK_(ptr);
  592. } else goto handle_unusual;
  593. continue;
  594. // string delete = 5;
  595. case 5:
  596. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
  597. auto str = _internal_mutable_delete_();
  598. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
  599. CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.api.HttpRule.delete"));
  600. CHK_(ptr);
  601. } else goto handle_unusual;
  602. continue;
  603. // string patch = 6;
  604. case 6:
  605. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
  606. auto str = _internal_mutable_patch();
  607. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
  608. CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.api.HttpRule.patch"));
  609. CHK_(ptr);
  610. } else goto handle_unusual;
  611. continue;
  612. // string body = 7;
  613. case 7:
  614. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) {
  615. auto str = _internal_mutable_body();
  616. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
  617. CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.api.HttpRule.body"));
  618. CHK_(ptr);
  619. } else goto handle_unusual;
  620. continue;
  621. // .google.api.CustomHttpPattern custom = 8;
  622. case 8:
  623. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) {
  624. ptr = ctx->ParseMessage(_internal_mutable_custom(), ptr);
  625. CHK_(ptr);
  626. } else goto handle_unusual;
  627. continue;
  628. // repeated .google.api.HttpRule additional_bindings = 11;
  629. case 11:
  630. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 90)) {
  631. ptr -= 1;
  632. do {
  633. ptr += 1;
  634. ptr = ctx->ParseMessage(_internal_add_additional_bindings(), ptr);
  635. CHK_(ptr);
  636. if (!ctx->DataAvailable(ptr)) break;
  637. } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<90>(ptr));
  638. } else goto handle_unusual;
  639. continue;
  640. default: {
  641. handle_unusual:
  642. if ((tag & 7) == 4 || tag == 0) {
  643. ctx->SetLastTag(tag);
  644. goto success;
  645. }
  646. ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
  647. CHK_(ptr != nullptr);
  648. continue;
  649. }
  650. } // switch
  651. } // while
  652. success:
  653. return ptr;
  654. failure:
  655. ptr = nullptr;
  656. goto success;
  657. #undef CHK_
  658. }
  659. ::PROTOBUF_NAMESPACE_ID::uint8* HttpRule::_InternalSerialize(
  660. ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  661. // @@protoc_insertion_point(serialize_to_array_start:google.api.HttpRule)
  662. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  663. (void) cached_has_bits;
  664. // string selector = 1;
  665. if (this->selector().size() > 0) {
  666. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  667. this->_internal_selector().data(), static_cast<int>(this->_internal_selector().length()),
  668. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  669. "google.api.HttpRule.selector");
  670. target = stream->WriteStringMaybeAliased(
  671. 1, this->_internal_selector(), target);
  672. }
  673. // string get = 2;
  674. if (_internal_has_get()) {
  675. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  676. this->_internal_get().data(), static_cast<int>(this->_internal_get().length()),
  677. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  678. "google.api.HttpRule.get");
  679. target = stream->WriteStringMaybeAliased(
  680. 2, this->_internal_get(), target);
  681. }
  682. // string put = 3;
  683. if (_internal_has_put()) {
  684. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  685. this->_internal_put().data(), static_cast<int>(this->_internal_put().length()),
  686. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  687. "google.api.HttpRule.put");
  688. target = stream->WriteStringMaybeAliased(
  689. 3, this->_internal_put(), target);
  690. }
  691. // string post = 4;
  692. if (_internal_has_post()) {
  693. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  694. this->_internal_post().data(), static_cast<int>(this->_internal_post().length()),
  695. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  696. "google.api.HttpRule.post");
  697. target = stream->WriteStringMaybeAliased(
  698. 4, this->_internal_post(), target);
  699. }
  700. // string delete = 5;
  701. if (_internal_has_delete_()) {
  702. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  703. this->_internal_delete_().data(), static_cast<int>(this->_internal_delete_().length()),
  704. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  705. "google.api.HttpRule.delete");
  706. target = stream->WriteStringMaybeAliased(
  707. 5, this->_internal_delete_(), target);
  708. }
  709. // string patch = 6;
  710. if (_internal_has_patch()) {
  711. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  712. this->_internal_patch().data(), static_cast<int>(this->_internal_patch().length()),
  713. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  714. "google.api.HttpRule.patch");
  715. target = stream->WriteStringMaybeAliased(
  716. 6, this->_internal_patch(), target);
  717. }
  718. // string body = 7;
  719. if (this->body().size() > 0) {
  720. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  721. this->_internal_body().data(), static_cast<int>(this->_internal_body().length()),
  722. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  723. "google.api.HttpRule.body");
  724. target = stream->WriteStringMaybeAliased(
  725. 7, this->_internal_body(), target);
  726. }
  727. // .google.api.CustomHttpPattern custom = 8;
  728. if (_internal_has_custom()) {
  729. target = stream->EnsureSpace(target);
  730. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  731. InternalWriteMessage(
  732. 8, _Internal::custom(this), target, stream);
  733. }
  734. // repeated .google.api.HttpRule additional_bindings = 11;
  735. for (unsigned int i = 0,
  736. n = static_cast<unsigned int>(this->_internal_additional_bindings_size()); i < n; i++) {
  737. target = stream->EnsureSpace(target);
  738. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  739. InternalWriteMessage(11, this->_internal_additional_bindings(i), target, stream);
  740. }
  741. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  742. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
  743. _internal_metadata_.unknown_fields(), target, stream);
  744. }
  745. // @@protoc_insertion_point(serialize_to_array_end:google.api.HttpRule)
  746. return target;
  747. }
  748. size_t HttpRule::ByteSizeLong() const {
  749. // @@protoc_insertion_point(message_byte_size_start:google.api.HttpRule)
  750. size_t total_size = 0;
  751. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  752. // Prevent compiler warnings about cached_has_bits being unused
  753. (void) cached_has_bits;
  754. // repeated .google.api.HttpRule additional_bindings = 11;
  755. total_size += 1UL * this->_internal_additional_bindings_size();
  756. for (const auto& msg : this->additional_bindings_) {
  757. total_size +=
  758. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  759. }
  760. // string selector = 1;
  761. if (this->selector().size() > 0) {
  762. total_size += 1 +
  763. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  764. this->_internal_selector());
  765. }
  766. // string body = 7;
  767. if (this->body().size() > 0) {
  768. total_size += 1 +
  769. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  770. this->_internal_body());
  771. }
  772. switch (pattern_case()) {
  773. // string get = 2;
  774. case kGet: {
  775. total_size += 1 +
  776. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  777. this->_internal_get());
  778. break;
  779. }
  780. // string put = 3;
  781. case kPut: {
  782. total_size += 1 +
  783. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  784. this->_internal_put());
  785. break;
  786. }
  787. // string post = 4;
  788. case kPost: {
  789. total_size += 1 +
  790. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  791. this->_internal_post());
  792. break;
  793. }
  794. // string delete = 5;
  795. case kDelete: {
  796. total_size += 1 +
  797. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  798. this->_internal_delete_());
  799. break;
  800. }
  801. // string patch = 6;
  802. case kPatch: {
  803. total_size += 1 +
  804. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  805. this->_internal_patch());
  806. break;
  807. }
  808. // .google.api.CustomHttpPattern custom = 8;
  809. case kCustom: {
  810. total_size += 1 +
  811. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  812. *pattern_.custom_);
  813. break;
  814. }
  815. case PATTERN_NOT_SET: {
  816. break;
  817. }
  818. }
  819. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  820. return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
  821. _internal_metadata_, total_size, &_cached_size_);
  822. }
  823. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  824. SetCachedSize(cached_size);
  825. return total_size;
  826. }
  827. void HttpRule::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  828. // @@protoc_insertion_point(generalized_merge_from_start:google.api.HttpRule)
  829. GOOGLE_DCHECK_NE(&from, this);
  830. const HttpRule* source =
  831. ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<HttpRule>(
  832. &from);
  833. if (source == nullptr) {
  834. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.api.HttpRule)
  835. ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  836. } else {
  837. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.api.HttpRule)
  838. MergeFrom(*source);
  839. }
  840. }
  841. void HttpRule::MergeFrom(const HttpRule& from) {
  842. // @@protoc_insertion_point(class_specific_merge_from_start:google.api.HttpRule)
  843. GOOGLE_DCHECK_NE(&from, this);
  844. _internal_metadata_.MergeFrom(from._internal_metadata_);
  845. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  846. (void) cached_has_bits;
  847. additional_bindings_.MergeFrom(from.additional_bindings_);
  848. if (from.selector().size() > 0) {
  849. _internal_set_selector(from._internal_selector());
  850. }
  851. if (from.body().size() > 0) {
  852. _internal_set_body(from._internal_body());
  853. }
  854. switch (from.pattern_case()) {
  855. case kGet: {
  856. _internal_set_get(from._internal_get());
  857. break;
  858. }
  859. case kPut: {
  860. _internal_set_put(from._internal_put());
  861. break;
  862. }
  863. case kPost: {
  864. _internal_set_post(from._internal_post());
  865. break;
  866. }
  867. case kDelete: {
  868. _internal_set_delete_(from._internal_delete_());
  869. break;
  870. }
  871. case kPatch: {
  872. _internal_set_patch(from._internal_patch());
  873. break;
  874. }
  875. case kCustom: {
  876. _internal_mutable_custom()->::google::api::CustomHttpPattern::MergeFrom(from._internal_custom());
  877. break;
  878. }
  879. case PATTERN_NOT_SET: {
  880. break;
  881. }
  882. }
  883. }
  884. void HttpRule::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  885. // @@protoc_insertion_point(generalized_copy_from_start:google.api.HttpRule)
  886. if (&from == this) return;
  887. Clear();
  888. MergeFrom(from);
  889. }
  890. void HttpRule::CopyFrom(const HttpRule& from) {
  891. // @@protoc_insertion_point(class_specific_copy_from_start:google.api.HttpRule)
  892. if (&from == this) return;
  893. Clear();
  894. MergeFrom(from);
  895. }
  896. bool HttpRule::IsInitialized() const {
  897. return true;
  898. }
  899. void HttpRule::InternalSwap(HttpRule* other) {
  900. using std::swap;
  901. _internal_metadata_.Swap(&other->_internal_metadata_);
  902. additional_bindings_.InternalSwap(&other->additional_bindings_);
  903. selector_.Swap(&other->selector_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  904. GetArenaNoVirtual());
  905. body_.Swap(&other->body_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  906. GetArenaNoVirtual());
  907. swap(pattern_, other->pattern_);
  908. swap(_oneof_case_[0], other->_oneof_case_[0]);
  909. }
  910. ::PROTOBUF_NAMESPACE_ID::Metadata HttpRule::GetMetadata() const {
  911. return GetMetadataStatic();
  912. }
  913. // ===================================================================
  914. void CustomHttpPattern::InitAsDefaultInstance() {
  915. }
  916. class CustomHttpPattern::_Internal {
  917. public:
  918. };
  919. CustomHttpPattern::CustomHttpPattern()
  920. : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  921. SharedCtor();
  922. // @@protoc_insertion_point(constructor:google.api.CustomHttpPattern)
  923. }
  924. CustomHttpPattern::CustomHttpPattern(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  925. : ::PROTOBUF_NAMESPACE_ID::Message(),
  926. _internal_metadata_(arena) {
  927. SharedCtor();
  928. RegisterArenaDtor(arena);
  929. // @@protoc_insertion_point(arena_constructor:google.api.CustomHttpPattern)
  930. }
  931. CustomHttpPattern::CustomHttpPattern(const CustomHttpPattern& from)
  932. : ::PROTOBUF_NAMESPACE_ID::Message(),
  933. _internal_metadata_(nullptr) {
  934. _internal_metadata_.MergeFrom(from._internal_metadata_);
  935. kind_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  936. if (!from._internal_kind().empty()) {
  937. kind_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_kind(),
  938. GetArenaNoVirtual());
  939. }
  940. path_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  941. if (!from._internal_path().empty()) {
  942. path_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_path(),
  943. GetArenaNoVirtual());
  944. }
  945. // @@protoc_insertion_point(copy_constructor:google.api.CustomHttpPattern)
  946. }
  947. void CustomHttpPattern::SharedCtor() {
  948. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_CustomHttpPattern_google_2fapi_2fhttp_2eproto.base);
  949. kind_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  950. path_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  951. }
  952. CustomHttpPattern::~CustomHttpPattern() {
  953. // @@protoc_insertion_point(destructor:google.api.CustomHttpPattern)
  954. SharedDtor();
  955. }
  956. void CustomHttpPattern::SharedDtor() {
  957. GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
  958. kind_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  959. path_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  960. }
  961. void CustomHttpPattern::ArenaDtor(void* object) {
  962. CustomHttpPattern* _this = reinterpret_cast< CustomHttpPattern* >(object);
  963. (void)_this;
  964. }
  965. void CustomHttpPattern::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
  966. }
  967. void CustomHttpPattern::SetCachedSize(int size) const {
  968. _cached_size_.Set(size);
  969. }
  970. const CustomHttpPattern& CustomHttpPattern::default_instance() {
  971. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_CustomHttpPattern_google_2fapi_2fhttp_2eproto.base);
  972. return *internal_default_instance();
  973. }
  974. void CustomHttpPattern::Clear() {
  975. // @@protoc_insertion_point(message_clear_start:google.api.CustomHttpPattern)
  976. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  977. // Prevent compiler warnings about cached_has_bits being unused
  978. (void) cached_has_bits;
  979. kind_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
  980. path_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
  981. _internal_metadata_.Clear();
  982. }
  983. const char* CustomHttpPattern::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
  984. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  985. ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
  986. while (!ctx->Done(&ptr)) {
  987. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  988. ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
  989. CHK_(ptr);
  990. switch (tag >> 3) {
  991. // string kind = 1;
  992. case 1:
  993. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
  994. auto str = _internal_mutable_kind();
  995. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
  996. CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.api.CustomHttpPattern.kind"));
  997. CHK_(ptr);
  998. } else goto handle_unusual;
  999. continue;
  1000. // string path = 2;
  1001. case 2:
  1002. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
  1003. auto str = _internal_mutable_path();
  1004. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
  1005. CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.api.CustomHttpPattern.path"));
  1006. CHK_(ptr);
  1007. } else goto handle_unusual;
  1008. continue;
  1009. default: {
  1010. handle_unusual:
  1011. if ((tag & 7) == 4 || tag == 0) {
  1012. ctx->SetLastTag(tag);
  1013. goto success;
  1014. }
  1015. ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
  1016. CHK_(ptr != nullptr);
  1017. continue;
  1018. }
  1019. } // switch
  1020. } // while
  1021. success:
  1022. return ptr;
  1023. failure:
  1024. ptr = nullptr;
  1025. goto success;
  1026. #undef CHK_
  1027. }
  1028. ::PROTOBUF_NAMESPACE_ID::uint8* CustomHttpPattern::_InternalSerialize(
  1029. ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  1030. // @@protoc_insertion_point(serialize_to_array_start:google.api.CustomHttpPattern)
  1031. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1032. (void) cached_has_bits;
  1033. // string kind = 1;
  1034. if (this->kind().size() > 0) {
  1035. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  1036. this->_internal_kind().data(), static_cast<int>(this->_internal_kind().length()),
  1037. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  1038. "google.api.CustomHttpPattern.kind");
  1039. target = stream->WriteStringMaybeAliased(
  1040. 1, this->_internal_kind(), target);
  1041. }
  1042. // string path = 2;
  1043. if (this->path().size() > 0) {
  1044. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  1045. this->_internal_path().data(), static_cast<int>(this->_internal_path().length()),
  1046. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  1047. "google.api.CustomHttpPattern.path");
  1048. target = stream->WriteStringMaybeAliased(
  1049. 2, this->_internal_path(), target);
  1050. }
  1051. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  1052. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
  1053. _internal_metadata_.unknown_fields(), target, stream);
  1054. }
  1055. // @@protoc_insertion_point(serialize_to_array_end:google.api.CustomHttpPattern)
  1056. return target;
  1057. }
  1058. size_t CustomHttpPattern::ByteSizeLong() const {
  1059. // @@protoc_insertion_point(message_byte_size_start:google.api.CustomHttpPattern)
  1060. size_t total_size = 0;
  1061. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1062. // Prevent compiler warnings about cached_has_bits being unused
  1063. (void) cached_has_bits;
  1064. // string kind = 1;
  1065. if (this->kind().size() > 0) {
  1066. total_size += 1 +
  1067. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  1068. this->_internal_kind());
  1069. }
  1070. // string path = 2;
  1071. if (this->path().size() > 0) {
  1072. total_size += 1 +
  1073. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  1074. this->_internal_path());
  1075. }
  1076. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  1077. return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
  1078. _internal_metadata_, total_size, &_cached_size_);
  1079. }
  1080. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  1081. SetCachedSize(cached_size);
  1082. return total_size;
  1083. }
  1084. void CustomHttpPattern::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  1085. // @@protoc_insertion_point(generalized_merge_from_start:google.api.CustomHttpPattern)
  1086. GOOGLE_DCHECK_NE(&from, this);
  1087. const CustomHttpPattern* source =
  1088. ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<CustomHttpPattern>(
  1089. &from);
  1090. if (source == nullptr) {
  1091. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.api.CustomHttpPattern)
  1092. ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  1093. } else {
  1094. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.api.CustomHttpPattern)
  1095. MergeFrom(*source);
  1096. }
  1097. }
  1098. void CustomHttpPattern::MergeFrom(const CustomHttpPattern& from) {
  1099. // @@protoc_insertion_point(class_specific_merge_from_start:google.api.CustomHttpPattern)
  1100. GOOGLE_DCHECK_NE(&from, this);
  1101. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1102. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1103. (void) cached_has_bits;
  1104. if (from.kind().size() > 0) {
  1105. _internal_set_kind(from._internal_kind());
  1106. }
  1107. if (from.path().size() > 0) {
  1108. _internal_set_path(from._internal_path());
  1109. }
  1110. }
  1111. void CustomHttpPattern::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  1112. // @@protoc_insertion_point(generalized_copy_from_start:google.api.CustomHttpPattern)
  1113. if (&from == this) return;
  1114. Clear();
  1115. MergeFrom(from);
  1116. }
  1117. void CustomHttpPattern::CopyFrom(const CustomHttpPattern& from) {
  1118. // @@protoc_insertion_point(class_specific_copy_from_start:google.api.CustomHttpPattern)
  1119. if (&from == this) return;
  1120. Clear();
  1121. MergeFrom(from);
  1122. }
  1123. bool CustomHttpPattern::IsInitialized() const {
  1124. return true;
  1125. }
  1126. void CustomHttpPattern::InternalSwap(CustomHttpPattern* other) {
  1127. using std::swap;
  1128. _internal_metadata_.Swap(&other->_internal_metadata_);
  1129. kind_.Swap(&other->kind_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  1130. GetArenaNoVirtual());
  1131. path_.Swap(&other->path_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  1132. GetArenaNoVirtual());
  1133. }
  1134. ::PROTOBUF_NAMESPACE_ID::Metadata CustomHttpPattern::GetMetadata() const {
  1135. return GetMetadataStatic();
  1136. }
  1137. // @@protoc_insertion_point(namespace_scope)
  1138. } // namespace api
  1139. } // namespace google
  1140. PROTOBUF_NAMESPACE_OPEN
  1141. template<> PROTOBUF_NOINLINE ::google::api::Http* Arena::CreateMaybeMessage< ::google::api::Http >(Arena* arena) {
  1142. return Arena::CreateMessageInternal< ::google::api::Http >(arena);
  1143. }
  1144. template<> PROTOBUF_NOINLINE ::google::api::HttpRule* Arena::CreateMaybeMessage< ::google::api::HttpRule >(Arena* arena) {
  1145. return Arena::CreateMessageInternal< ::google::api::HttpRule >(arena);
  1146. }
  1147. template<> PROTOBUF_NOINLINE ::google::api::CustomHttpPattern* Arena::CreateMaybeMessage< ::google::api::CustomHttpPattern >(Arena* arena) {
  1148. return Arena::CreateMessageInternal< ::google::api::CustomHttpPattern >(arena);
  1149. }
  1150. PROTOBUF_NAMESPACE_CLOSE
  1151. // @@protoc_insertion_point(global_scope)
  1152. #include <google/protobuf/port_undef.inc>