http.pb.cc 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704
  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/api/http.proto
  18. #include "google/api/http.pb.h"
  19. #include <algorithm>
  20. #include <google/protobuf/stubs/common.h>
  21. #include <google/protobuf/io/coded_stream.h>
  22. #include <google/protobuf/extension_set.h>
  23. #include <google/protobuf/wire_format_lite.h>
  24. #include <google/protobuf/descriptor.h>
  25. #include <google/protobuf/generated_message_reflection.h>
  26. #include <google/protobuf/reflection_ops.h>
  27. #include <google/protobuf/wire_format.h>
  28. // @@protoc_insertion_point(includes)
  29. #include <google/protobuf/port_def.inc>
  30. extern PROTOBUF_INTERNAL_EXPORT_google_2fapi_2fhttp_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_CustomHttpPattern_google_2fapi_2fhttp_2eproto;
  31. extern PROTOBUF_INTERNAL_EXPORT_google_2fapi_2fhttp_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_HttpRule_google_2fapi_2fhttp_2eproto;
  32. namespace google {
  33. namespace api {
  34. class HttpDefaultTypeInternal {
  35. public:
  36. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Http> _instance;
  37. } _Http_default_instance_;
  38. class HttpRuleDefaultTypeInternal {
  39. public:
  40. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<HttpRule> _instance;
  41. ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr get_;
  42. ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr put_;
  43. ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr post_;
  44. ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr delete__;
  45. ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr patch_;
  46. const ::google::api::CustomHttpPattern* custom_;
  47. } _HttpRule_default_instance_;
  48. class CustomHttpPatternDefaultTypeInternal {
  49. public:
  50. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<CustomHttpPattern> _instance;
  51. } _CustomHttpPattern_default_instance_;
  52. } // namespace api
  53. } // namespace google
  54. static void InitDefaultsscc_info_CustomHttpPattern_google_2fapi_2fhttp_2eproto() {
  55. GOOGLE_PROTOBUF_VERIFY_VERSION;
  56. {
  57. void* ptr = &::google::api::_CustomHttpPattern_default_instance_;
  58. new (ptr) ::google::api::CustomHttpPattern();
  59. ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  60. }
  61. ::google::api::CustomHttpPattern::InitAsDefaultInstance();
  62. }
  63. ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_CustomHttpPattern_google_2fapi_2fhttp_2eproto =
  64. {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_CustomHttpPattern_google_2fapi_2fhttp_2eproto}, {}};
  65. static void InitDefaultsscc_info_Http_google_2fapi_2fhttp_2eproto() {
  66. GOOGLE_PROTOBUF_VERIFY_VERSION;
  67. {
  68. void* ptr = &::google::api::_Http_default_instance_;
  69. new (ptr) ::google::api::Http();
  70. ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  71. }
  72. ::google::api::Http::InitAsDefaultInstance();
  73. }
  74. ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Http_google_2fapi_2fhttp_2eproto =
  75. {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_Http_google_2fapi_2fhttp_2eproto}, {
  76. &scc_info_HttpRule_google_2fapi_2fhttp_2eproto.base,}};
  77. static void InitDefaultsscc_info_HttpRule_google_2fapi_2fhttp_2eproto() {
  78. GOOGLE_PROTOBUF_VERIFY_VERSION;
  79. {
  80. void* ptr = &::google::api::_HttpRule_default_instance_;
  81. new (ptr) ::google::api::HttpRule();
  82. ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  83. }
  84. ::google::api::HttpRule::InitAsDefaultInstance();
  85. }
  86. ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_HttpRule_google_2fapi_2fhttp_2eproto =
  87. {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_HttpRule_google_2fapi_2fhttp_2eproto}, {
  88. &scc_info_CustomHttpPattern_google_2fapi_2fhttp_2eproto.base,}};
  89. static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_google_2fapi_2fhttp_2eproto[3];
  90. static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_google_2fapi_2fhttp_2eproto = nullptr;
  91. static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_google_2fapi_2fhttp_2eproto = nullptr;
  92. const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_google_2fapi_2fhttp_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  93. ~0u, // no _has_bits_
  94. PROTOBUF_FIELD_OFFSET(::google::api::Http, _internal_metadata_),
  95. ~0u, // no _extensions_
  96. ~0u, // no _oneof_case_
  97. ~0u, // no _weak_field_map_
  98. PROTOBUF_FIELD_OFFSET(::google::api::Http, rules_),
  99. PROTOBUF_FIELD_OFFSET(::google::api::Http, fully_decode_reserved_expansion_),
  100. ~0u, // no _has_bits_
  101. PROTOBUF_FIELD_OFFSET(::google::api::HttpRule, _internal_metadata_),
  102. ~0u, // no _extensions_
  103. PROTOBUF_FIELD_OFFSET(::google::api::HttpRule, _oneof_case_[0]),
  104. ~0u, // no _weak_field_map_
  105. PROTOBUF_FIELD_OFFSET(::google::api::HttpRule, selector_),
  106. offsetof(::google::api::HttpRuleDefaultTypeInternal, get_),
  107. offsetof(::google::api::HttpRuleDefaultTypeInternal, put_),
  108. offsetof(::google::api::HttpRuleDefaultTypeInternal, post_),
  109. offsetof(::google::api::HttpRuleDefaultTypeInternal, delete__),
  110. offsetof(::google::api::HttpRuleDefaultTypeInternal, patch_),
  111. offsetof(::google::api::HttpRuleDefaultTypeInternal, custom_),
  112. PROTOBUF_FIELD_OFFSET(::google::api::HttpRule, body_),
  113. PROTOBUF_FIELD_OFFSET(::google::api::HttpRule, additional_bindings_),
  114. PROTOBUF_FIELD_OFFSET(::google::api::HttpRule, pattern_),
  115. ~0u, // no _has_bits_
  116. PROTOBUF_FIELD_OFFSET(::google::api::CustomHttpPattern, _internal_metadata_),
  117. ~0u, // no _extensions_
  118. ~0u, // no _oneof_case_
  119. ~0u, // no _weak_field_map_
  120. PROTOBUF_FIELD_OFFSET(::google::api::CustomHttpPattern, kind_),
  121. PROTOBUF_FIELD_OFFSET(::google::api::CustomHttpPattern, path_),
  122. };
  123. static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  124. { 0, -1, sizeof(::google::api::Http)},
  125. { 7, -1, sizeof(::google::api::HttpRule)},
  126. { 22, -1, sizeof(::google::api::CustomHttpPattern)},
  127. };
  128. static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
  129. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::google::api::_Http_default_instance_),
  130. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::google::api::_HttpRule_default_instance_),
  131. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::google::api::_CustomHttpPattern_default_instance_),
  132. };
  133. const char descriptor_table_protodef_google_2fapi_2fhttp_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  134. "\n\025google/api/http.proto\022\ngoogle.api\"T\n\004H"
  135. "ttp\022#\n\005rules\030\001 \003(\0132\024.google.api.HttpRule"
  136. "\022\'\n\037fully_decode_reserved_expansion\030\002 \001("
  137. "\010\"\352\001\n\010HttpRule\022\020\n\010selector\030\001 \001(\t\022\r\n\003get\030"
  138. "\002 \001(\tH\000\022\r\n\003put\030\003 \001(\tH\000\022\016\n\004post\030\004 \001(\tH\000\022\020"
  139. "\n\006delete\030\005 \001(\tH\000\022\017\n\005patch\030\006 \001(\tH\000\022/\n\006cus"
  140. "tom\030\010 \001(\0132\035.google.api.CustomHttpPattern"
  141. "H\000\022\014\n\004body\030\007 \001(\t\0221\n\023additional_bindings\030"
  142. "\013 \003(\0132\024.google.api.HttpRuleB\t\n\007pattern\"/"
  143. "\n\021CustomHttpPattern\022\014\n\004kind\030\001 \001(\t\022\014\n\004pat"
  144. "h\030\002 \001(\tBj\n\016com.google.apiB\tHttpProtoP\001ZA"
  145. "google.golang.org/genproto/googleapis/ap"
  146. "i/annotations;annotations\370\001\001\242\002\004GAPIb\006pro"
  147. "to3"
  148. ;
  149. static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_google_2fapi_2fhttp_2eproto_deps[1] = {
  150. };
  151. static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_google_2fapi_2fhttp_2eproto_sccs[3] = {
  152. &scc_info_CustomHttpPattern_google_2fapi_2fhttp_2eproto.base,
  153. &scc_info_Http_google_2fapi_2fhttp_2eproto.base,
  154. &scc_info_HttpRule_google_2fapi_2fhttp_2eproto.base,
  155. };
  156. static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fapi_2fhttp_2eproto_once;
  157. static bool descriptor_table_google_2fapi_2fhttp_2eproto_initialized = false;
  158. const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fapi_2fhttp_2eproto = {
  159. &descriptor_table_google_2fapi_2fhttp_2eproto_initialized, descriptor_table_protodef_google_2fapi_2fhttp_2eproto, "google/api/http.proto", 523,
  160. &descriptor_table_google_2fapi_2fhttp_2eproto_once, descriptor_table_google_2fapi_2fhttp_2eproto_sccs, descriptor_table_google_2fapi_2fhttp_2eproto_deps, 3, 0,
  161. schemas, file_default_instances, TableStruct_google_2fapi_2fhttp_2eproto::offsets,
  162. file_level_metadata_google_2fapi_2fhttp_2eproto, 3, file_level_enum_descriptors_google_2fapi_2fhttp_2eproto, file_level_service_descriptors_google_2fapi_2fhttp_2eproto,
  163. };
  164. // Force running AddDescriptors() at dynamic initialization time.
  165. static bool dynamic_init_dummy_google_2fapi_2fhttp_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_google_2fapi_2fhttp_2eproto), true);
  166. namespace google {
  167. namespace api {
  168. // ===================================================================
  169. void Http::InitAsDefaultInstance() {
  170. }
  171. class Http::_Internal {
  172. public:
  173. };
  174. Http::Http()
  175. : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  176. SharedCtor();
  177. // @@protoc_insertion_point(constructor:google.api.Http)
  178. }
  179. Http::Http(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  180. : ::PROTOBUF_NAMESPACE_ID::Message(),
  181. _internal_metadata_(arena),
  182. rules_(arena) {
  183. SharedCtor();
  184. RegisterArenaDtor(arena);
  185. // @@protoc_insertion_point(arena_constructor:google.api.Http)
  186. }
  187. Http::Http(const Http& from)
  188. : ::PROTOBUF_NAMESPACE_ID::Message(),
  189. _internal_metadata_(nullptr),
  190. rules_(from.rules_) {
  191. _internal_metadata_.MergeFrom(from._internal_metadata_);
  192. fully_decode_reserved_expansion_ = from.fully_decode_reserved_expansion_;
  193. // @@protoc_insertion_point(copy_constructor:google.api.Http)
  194. }
  195. void Http::SharedCtor() {
  196. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Http_google_2fapi_2fhttp_2eproto.base);
  197. fully_decode_reserved_expansion_ = false;
  198. }
  199. Http::~Http() {
  200. // @@protoc_insertion_point(destructor:google.api.Http)
  201. SharedDtor();
  202. }
  203. void Http::SharedDtor() {
  204. GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
  205. }
  206. void Http::ArenaDtor(void* object) {
  207. Http* _this = reinterpret_cast< Http* >(object);
  208. (void)_this;
  209. }
  210. void Http::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
  211. }
  212. void Http::SetCachedSize(int size) const {
  213. _cached_size_.Set(size);
  214. }
  215. const Http& Http::default_instance() {
  216. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Http_google_2fapi_2fhttp_2eproto.base);
  217. return *internal_default_instance();
  218. }
  219. void Http::Clear() {
  220. // @@protoc_insertion_point(message_clear_start:google.api.Http)
  221. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  222. // Prevent compiler warnings about cached_has_bits being unused
  223. (void) cached_has_bits;
  224. rules_.Clear();
  225. fully_decode_reserved_expansion_ = false;
  226. _internal_metadata_.Clear();
  227. }
  228. #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  229. const char* Http::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
  230. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  231. ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
  232. while (!ctx->Done(&ptr)) {
  233. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  234. ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
  235. CHK_(ptr);
  236. switch (tag >> 3) {
  237. // repeated .google.api.HttpRule rules = 1;
  238. case 1:
  239. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
  240. ptr -= 1;
  241. do {
  242. ptr += 1;
  243. ptr = ctx->ParseMessage(add_rules(), ptr);
  244. CHK_(ptr);
  245. if (!ctx->DataAvailable(ptr)) break;
  246. } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 10);
  247. } else goto handle_unusual;
  248. continue;
  249. // bool fully_decode_reserved_expansion = 2;
  250. case 2:
  251. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
  252. fully_decode_reserved_expansion_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
  253. CHK_(ptr);
  254. } else goto handle_unusual;
  255. continue;
  256. default: {
  257. handle_unusual:
  258. if ((tag & 7) == 4 || tag == 0) {
  259. ctx->SetLastTag(tag);
  260. goto success;
  261. }
  262. ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
  263. CHK_(ptr != nullptr);
  264. continue;
  265. }
  266. } // switch
  267. } // while
  268. success:
  269. return ptr;
  270. failure:
  271. ptr = nullptr;
  272. goto success;
  273. #undef CHK_
  274. }
  275. #else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  276. bool Http::MergePartialFromCodedStream(
  277. ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
  278. #define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
  279. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  280. // @@protoc_insertion_point(parse_start:google.api.Http)
  281. for (;;) {
  282. ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  283. tag = p.first;
  284. if (!p.second) goto handle_unusual;
  285. switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  286. // repeated .google.api.HttpRule rules = 1;
  287. case 1: {
  288. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
  289. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
  290. input, add_rules()));
  291. } else {
  292. goto handle_unusual;
  293. }
  294. break;
  295. }
  296. // bool fully_decode_reserved_expansion = 2;
  297. case 2: {
  298. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
  299. DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
  300. bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
  301. input, &fully_decode_reserved_expansion_)));
  302. } else {
  303. goto handle_unusual;
  304. }
  305. break;
  306. }
  307. default: {
  308. handle_unusual:
  309. if (tag == 0) {
  310. goto success;
  311. }
  312. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
  313. input, tag, _internal_metadata_.mutable_unknown_fields()));
  314. break;
  315. }
  316. }
  317. }
  318. success:
  319. // @@protoc_insertion_point(parse_success:google.api.Http)
  320. return true;
  321. failure:
  322. // @@protoc_insertion_point(parse_failure:google.api.Http)
  323. return false;
  324. #undef DO_
  325. }
  326. #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  327. void Http::SerializeWithCachedSizes(
  328. ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
  329. // @@protoc_insertion_point(serialize_start:google.api.Http)
  330. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  331. (void) cached_has_bits;
  332. // repeated .google.api.HttpRule rules = 1;
  333. for (unsigned int i = 0,
  334. n = static_cast<unsigned int>(this->rules_size()); i < n; i++) {
  335. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
  336. 1,
  337. this->rules(static_cast<int>(i)),
  338. output);
  339. }
  340. // bool fully_decode_reserved_expansion = 2;
  341. if (this->fully_decode_reserved_expansion() != 0) {
  342. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(2, this->fully_decode_reserved_expansion(), output);
  343. }
  344. if (_internal_metadata_.have_unknown_fields()) {
  345. ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
  346. _internal_metadata_.unknown_fields(), output);
  347. }
  348. // @@protoc_insertion_point(serialize_end:google.api.Http)
  349. }
  350. ::PROTOBUF_NAMESPACE_ID::uint8* Http::InternalSerializeWithCachedSizesToArray(
  351. ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
  352. // @@protoc_insertion_point(serialize_to_array_start:google.api.Http)
  353. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  354. (void) cached_has_bits;
  355. // repeated .google.api.HttpRule rules = 1;
  356. for (unsigned int i = 0,
  357. n = static_cast<unsigned int>(this->rules_size()); i < n; i++) {
  358. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  359. InternalWriteMessageToArray(
  360. 1, this->rules(static_cast<int>(i)), target);
  361. }
  362. // bool fully_decode_reserved_expansion = 2;
  363. if (this->fully_decode_reserved_expansion() != 0) {
  364. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->fully_decode_reserved_expansion(), target);
  365. }
  366. if (_internal_metadata_.have_unknown_fields()) {
  367. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
  368. _internal_metadata_.unknown_fields(), target);
  369. }
  370. // @@protoc_insertion_point(serialize_to_array_end:google.api.Http)
  371. return target;
  372. }
  373. size_t Http::ByteSizeLong() const {
  374. // @@protoc_insertion_point(message_byte_size_start:google.api.Http)
  375. size_t total_size = 0;
  376. if (_internal_metadata_.have_unknown_fields()) {
  377. total_size +=
  378. ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
  379. _internal_metadata_.unknown_fields());
  380. }
  381. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  382. // Prevent compiler warnings about cached_has_bits being unused
  383. (void) cached_has_bits;
  384. // repeated .google.api.HttpRule rules = 1;
  385. {
  386. unsigned int count = static_cast<unsigned int>(this->rules_size());
  387. total_size += 1UL * count;
  388. for (unsigned int i = 0; i < count; i++) {
  389. total_size +=
  390. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  391. this->rules(static_cast<int>(i)));
  392. }
  393. }
  394. // bool fully_decode_reserved_expansion = 2;
  395. if (this->fully_decode_reserved_expansion() != 0) {
  396. total_size += 1 + 1;
  397. }
  398. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  399. SetCachedSize(cached_size);
  400. return total_size;
  401. }
  402. void Http::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  403. // @@protoc_insertion_point(generalized_merge_from_start:google.api.Http)
  404. GOOGLE_DCHECK_NE(&from, this);
  405. const Http* source =
  406. ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Http>(
  407. &from);
  408. if (source == nullptr) {
  409. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.api.Http)
  410. ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  411. } else {
  412. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.api.Http)
  413. MergeFrom(*source);
  414. }
  415. }
  416. void Http::MergeFrom(const Http& from) {
  417. // @@protoc_insertion_point(class_specific_merge_from_start:google.api.Http)
  418. GOOGLE_DCHECK_NE(&from, this);
  419. _internal_metadata_.MergeFrom(from._internal_metadata_);
  420. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  421. (void) cached_has_bits;
  422. rules_.MergeFrom(from.rules_);
  423. if (from.fully_decode_reserved_expansion() != 0) {
  424. set_fully_decode_reserved_expansion(from.fully_decode_reserved_expansion());
  425. }
  426. }
  427. void Http::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  428. // @@protoc_insertion_point(generalized_copy_from_start:google.api.Http)
  429. if (&from == this) return;
  430. Clear();
  431. MergeFrom(from);
  432. }
  433. void Http::CopyFrom(const Http& from) {
  434. // @@protoc_insertion_point(class_specific_copy_from_start:google.api.Http)
  435. if (&from == this) return;
  436. Clear();
  437. MergeFrom(from);
  438. }
  439. bool Http::IsInitialized() const {
  440. return true;
  441. }
  442. void Http::InternalSwap(Http* other) {
  443. using std::swap;
  444. _internal_metadata_.Swap(&other->_internal_metadata_);
  445. CastToBase(&rules_)->InternalSwap(CastToBase(&other->rules_));
  446. swap(fully_decode_reserved_expansion_, other->fully_decode_reserved_expansion_);
  447. }
  448. ::PROTOBUF_NAMESPACE_ID::Metadata Http::GetMetadata() const {
  449. return GetMetadataStatic();
  450. }
  451. // ===================================================================
  452. void HttpRule::InitAsDefaultInstance() {
  453. ::google::api::_HttpRule_default_instance_.get_.UnsafeSetDefault(
  454. &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  455. ::google::api::_HttpRule_default_instance_.put_.UnsafeSetDefault(
  456. &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  457. ::google::api::_HttpRule_default_instance_.post_.UnsafeSetDefault(
  458. &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  459. ::google::api::_HttpRule_default_instance_.delete__.UnsafeSetDefault(
  460. &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  461. ::google::api::_HttpRule_default_instance_.patch_.UnsafeSetDefault(
  462. &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  463. ::google::api::_HttpRule_default_instance_.custom_ = const_cast< ::google::api::CustomHttpPattern*>(
  464. ::google::api::CustomHttpPattern::internal_default_instance());
  465. }
  466. class HttpRule::_Internal {
  467. public:
  468. static const ::google::api::CustomHttpPattern& custom(const HttpRule* msg);
  469. };
  470. const ::google::api::CustomHttpPattern&
  471. HttpRule::_Internal::custom(const HttpRule* msg) {
  472. return *msg->pattern_.custom_;
  473. }
  474. void HttpRule::set_allocated_custom(::google::api::CustomHttpPattern* custom) {
  475. ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
  476. clear_pattern();
  477. if (custom) {
  478. ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
  479. ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(custom);
  480. if (message_arena != submessage_arena) {
  481. custom = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
  482. message_arena, custom, submessage_arena);
  483. }
  484. set_has_custom();
  485. pattern_.custom_ = custom;
  486. }
  487. // @@protoc_insertion_point(field_set_allocated:google.api.HttpRule.custom)
  488. }
  489. HttpRule::HttpRule()
  490. : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  491. SharedCtor();
  492. // @@protoc_insertion_point(constructor:google.api.HttpRule)
  493. }
  494. HttpRule::HttpRule(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  495. : ::PROTOBUF_NAMESPACE_ID::Message(),
  496. _internal_metadata_(arena),
  497. additional_bindings_(arena) {
  498. SharedCtor();
  499. RegisterArenaDtor(arena);
  500. // @@protoc_insertion_point(arena_constructor:google.api.HttpRule)
  501. }
  502. HttpRule::HttpRule(const HttpRule& from)
  503. : ::PROTOBUF_NAMESPACE_ID::Message(),
  504. _internal_metadata_(nullptr),
  505. additional_bindings_(from.additional_bindings_) {
  506. _internal_metadata_.MergeFrom(from._internal_metadata_);
  507. selector_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  508. if (!from.selector().empty()) {
  509. selector_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.selector(),
  510. GetArenaNoVirtual());
  511. }
  512. body_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  513. if (!from.body().empty()) {
  514. body_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.body(),
  515. GetArenaNoVirtual());
  516. }
  517. clear_has_pattern();
  518. switch (from.pattern_case()) {
  519. case kGet: {
  520. set_get(from.get());
  521. break;
  522. }
  523. case kPut: {
  524. set_put(from.put());
  525. break;
  526. }
  527. case kPost: {
  528. set_post(from.post());
  529. break;
  530. }
  531. case kDelete: {
  532. set_delete_(from.delete_());
  533. break;
  534. }
  535. case kPatch: {
  536. set_patch(from.patch());
  537. break;
  538. }
  539. case kCustom: {
  540. mutable_custom()->::google::api::CustomHttpPattern::MergeFrom(from.custom());
  541. break;
  542. }
  543. case PATTERN_NOT_SET: {
  544. break;
  545. }
  546. }
  547. // @@protoc_insertion_point(copy_constructor:google.api.HttpRule)
  548. }
  549. void HttpRule::SharedCtor() {
  550. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_HttpRule_google_2fapi_2fhttp_2eproto.base);
  551. selector_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  552. body_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  553. clear_has_pattern();
  554. }
  555. HttpRule::~HttpRule() {
  556. // @@protoc_insertion_point(destructor:google.api.HttpRule)
  557. SharedDtor();
  558. }
  559. void HttpRule::SharedDtor() {
  560. GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
  561. selector_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  562. body_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  563. if (has_pattern()) {
  564. clear_pattern();
  565. }
  566. }
  567. void HttpRule::ArenaDtor(void* object) {
  568. HttpRule* _this = reinterpret_cast< HttpRule* >(object);
  569. (void)_this;
  570. }
  571. void HttpRule::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
  572. }
  573. void HttpRule::SetCachedSize(int size) const {
  574. _cached_size_.Set(size);
  575. }
  576. const HttpRule& HttpRule::default_instance() {
  577. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_HttpRule_google_2fapi_2fhttp_2eproto.base);
  578. return *internal_default_instance();
  579. }
  580. void HttpRule::clear_pattern() {
  581. // @@protoc_insertion_point(one_of_clear_start:google.api.HttpRule)
  582. switch (pattern_case()) {
  583. case kGet: {
  584. pattern_.get_.Destroy(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  585. GetArenaNoVirtual());
  586. break;
  587. }
  588. case kPut: {
  589. pattern_.put_.Destroy(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  590. GetArenaNoVirtual());
  591. break;
  592. }
  593. case kPost: {
  594. pattern_.post_.Destroy(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  595. GetArenaNoVirtual());
  596. break;
  597. }
  598. case kDelete: {
  599. pattern_.delete__.Destroy(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  600. GetArenaNoVirtual());
  601. break;
  602. }
  603. case kPatch: {
  604. pattern_.patch_.Destroy(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  605. GetArenaNoVirtual());
  606. break;
  607. }
  608. case kCustom: {
  609. if (GetArenaNoVirtual() == nullptr) {
  610. delete pattern_.custom_;
  611. }
  612. break;
  613. }
  614. case PATTERN_NOT_SET: {
  615. break;
  616. }
  617. }
  618. _oneof_case_[0] = PATTERN_NOT_SET;
  619. }
  620. void HttpRule::Clear() {
  621. // @@protoc_insertion_point(message_clear_start:google.api.HttpRule)
  622. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  623. // Prevent compiler warnings about cached_has_bits being unused
  624. (void) cached_has_bits;
  625. additional_bindings_.Clear();
  626. selector_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
  627. body_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
  628. clear_pattern();
  629. _internal_metadata_.Clear();
  630. }
  631. #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  632. const char* HttpRule::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
  633. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  634. ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
  635. while (!ctx->Done(&ptr)) {
  636. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  637. ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
  638. CHK_(ptr);
  639. switch (tag >> 3) {
  640. // string selector = 1;
  641. case 1:
  642. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
  643. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_selector(), ptr, ctx, "google.api.HttpRule.selector");
  644. CHK_(ptr);
  645. } else goto handle_unusual;
  646. continue;
  647. // string get = 2;
  648. case 2:
  649. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
  650. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_get(), ptr, ctx, "google.api.HttpRule.get");
  651. CHK_(ptr);
  652. } else goto handle_unusual;
  653. continue;
  654. // string put = 3;
  655. case 3:
  656. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
  657. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_put(), ptr, ctx, "google.api.HttpRule.put");
  658. CHK_(ptr);
  659. } else goto handle_unusual;
  660. continue;
  661. // string post = 4;
  662. case 4:
  663. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
  664. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_post(), ptr, ctx, "google.api.HttpRule.post");
  665. CHK_(ptr);
  666. } else goto handle_unusual;
  667. continue;
  668. // string delete = 5;
  669. case 5:
  670. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
  671. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_delete_(), ptr, ctx, "google.api.HttpRule.delete");
  672. CHK_(ptr);
  673. } else goto handle_unusual;
  674. continue;
  675. // string patch = 6;
  676. case 6:
  677. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
  678. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_patch(), ptr, ctx, "google.api.HttpRule.patch");
  679. CHK_(ptr);
  680. } else goto handle_unusual;
  681. continue;
  682. // string body = 7;
  683. case 7:
  684. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) {
  685. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_body(), ptr, ctx, "google.api.HttpRule.body");
  686. CHK_(ptr);
  687. } else goto handle_unusual;
  688. continue;
  689. // .google.api.CustomHttpPattern custom = 8;
  690. case 8:
  691. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) {
  692. ptr = ctx->ParseMessage(mutable_custom(), ptr);
  693. CHK_(ptr);
  694. } else goto handle_unusual;
  695. continue;
  696. // repeated .google.api.HttpRule additional_bindings = 11;
  697. case 11:
  698. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 90)) {
  699. ptr -= 1;
  700. do {
  701. ptr += 1;
  702. ptr = ctx->ParseMessage(add_additional_bindings(), ptr);
  703. CHK_(ptr);
  704. if (!ctx->DataAvailable(ptr)) break;
  705. } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 90);
  706. } else goto handle_unusual;
  707. continue;
  708. default: {
  709. handle_unusual:
  710. if ((tag & 7) == 4 || tag == 0) {
  711. ctx->SetLastTag(tag);
  712. goto success;
  713. }
  714. ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
  715. CHK_(ptr != nullptr);
  716. continue;
  717. }
  718. } // switch
  719. } // while
  720. success:
  721. return ptr;
  722. failure:
  723. ptr = nullptr;
  724. goto success;
  725. #undef CHK_
  726. }
  727. #else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  728. bool HttpRule::MergePartialFromCodedStream(
  729. ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
  730. #define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
  731. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  732. // @@protoc_insertion_point(parse_start:google.api.HttpRule)
  733. for (;;) {
  734. ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  735. tag = p.first;
  736. if (!p.second) goto handle_unusual;
  737. switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  738. // string selector = 1;
  739. case 1: {
  740. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
  741. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
  742. input, this->mutable_selector()));
  743. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  744. this->selector().data(), static_cast<int>(this->selector().length()),
  745. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
  746. "google.api.HttpRule.selector"));
  747. } else {
  748. goto handle_unusual;
  749. }
  750. break;
  751. }
  752. // string get = 2;
  753. case 2: {
  754. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
  755. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
  756. input, this->mutable_get()));
  757. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  758. this->get().data(), static_cast<int>(this->get().length()),
  759. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
  760. "google.api.HttpRule.get"));
  761. } else {
  762. goto handle_unusual;
  763. }
  764. break;
  765. }
  766. // string put = 3;
  767. case 3: {
  768. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) {
  769. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
  770. input, this->mutable_put()));
  771. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  772. this->put().data(), static_cast<int>(this->put().length()),
  773. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
  774. "google.api.HttpRule.put"));
  775. } else {
  776. goto handle_unusual;
  777. }
  778. break;
  779. }
  780. // string post = 4;
  781. case 4: {
  782. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) {
  783. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
  784. input, this->mutable_post()));
  785. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  786. this->post().data(), static_cast<int>(this->post().length()),
  787. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
  788. "google.api.HttpRule.post"));
  789. } else {
  790. goto handle_unusual;
  791. }
  792. break;
  793. }
  794. // string delete = 5;
  795. case 5: {
  796. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) {
  797. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
  798. input, this->mutable_delete_()));
  799. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  800. this->delete_().data(), static_cast<int>(this->delete_().length()),
  801. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
  802. "google.api.HttpRule.delete"));
  803. } else {
  804. goto handle_unusual;
  805. }
  806. break;
  807. }
  808. // string patch = 6;
  809. case 6: {
  810. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) {
  811. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
  812. input, this->mutable_patch()));
  813. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  814. this->patch().data(), static_cast<int>(this->patch().length()),
  815. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
  816. "google.api.HttpRule.patch"));
  817. } else {
  818. goto handle_unusual;
  819. }
  820. break;
  821. }
  822. // string body = 7;
  823. case 7: {
  824. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (58 & 0xFF)) {
  825. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
  826. input, this->mutable_body()));
  827. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  828. this->body().data(), static_cast<int>(this->body().length()),
  829. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
  830. "google.api.HttpRule.body"));
  831. } else {
  832. goto handle_unusual;
  833. }
  834. break;
  835. }
  836. // .google.api.CustomHttpPattern custom = 8;
  837. case 8: {
  838. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (66 & 0xFF)) {
  839. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
  840. input, mutable_custom()));
  841. } else {
  842. goto handle_unusual;
  843. }
  844. break;
  845. }
  846. // repeated .google.api.HttpRule additional_bindings = 11;
  847. case 11: {
  848. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (90 & 0xFF)) {
  849. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
  850. input, add_additional_bindings()));
  851. } else {
  852. goto handle_unusual;
  853. }
  854. break;
  855. }
  856. default: {
  857. handle_unusual:
  858. if (tag == 0) {
  859. goto success;
  860. }
  861. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
  862. input, tag, _internal_metadata_.mutable_unknown_fields()));
  863. break;
  864. }
  865. }
  866. }
  867. success:
  868. // @@protoc_insertion_point(parse_success:google.api.HttpRule)
  869. return true;
  870. failure:
  871. // @@protoc_insertion_point(parse_failure:google.api.HttpRule)
  872. return false;
  873. #undef DO_
  874. }
  875. #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  876. void HttpRule::SerializeWithCachedSizes(
  877. ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
  878. // @@protoc_insertion_point(serialize_start:google.api.HttpRule)
  879. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  880. (void) cached_has_bits;
  881. // string selector = 1;
  882. if (this->selector().size() > 0) {
  883. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  884. this->selector().data(), static_cast<int>(this->selector().length()),
  885. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  886. "google.api.HttpRule.selector");
  887. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
  888. 1, this->selector(), output);
  889. }
  890. // string get = 2;
  891. if (has_get()) {
  892. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  893. this->get().data(), static_cast<int>(this->get().length()),
  894. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  895. "google.api.HttpRule.get");
  896. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
  897. 2, this->get(), output);
  898. }
  899. // string put = 3;
  900. if (has_put()) {
  901. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  902. this->put().data(), static_cast<int>(this->put().length()),
  903. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  904. "google.api.HttpRule.put");
  905. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
  906. 3, this->put(), output);
  907. }
  908. // string post = 4;
  909. if (has_post()) {
  910. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  911. this->post().data(), static_cast<int>(this->post().length()),
  912. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  913. "google.api.HttpRule.post");
  914. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
  915. 4, this->post(), output);
  916. }
  917. // string delete = 5;
  918. if (has_delete_()) {
  919. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  920. this->delete_().data(), static_cast<int>(this->delete_().length()),
  921. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  922. "google.api.HttpRule.delete");
  923. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
  924. 5, this->delete_(), output);
  925. }
  926. // string patch = 6;
  927. if (has_patch()) {
  928. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  929. this->patch().data(), static_cast<int>(this->patch().length()),
  930. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  931. "google.api.HttpRule.patch");
  932. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
  933. 6, this->patch(), output);
  934. }
  935. // string body = 7;
  936. if (this->body().size() > 0) {
  937. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  938. this->body().data(), static_cast<int>(this->body().length()),
  939. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  940. "google.api.HttpRule.body");
  941. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
  942. 7, this->body(), output);
  943. }
  944. // .google.api.CustomHttpPattern custom = 8;
  945. if (has_custom()) {
  946. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
  947. 8, _Internal::custom(this), output);
  948. }
  949. // repeated .google.api.HttpRule additional_bindings = 11;
  950. for (unsigned int i = 0,
  951. n = static_cast<unsigned int>(this->additional_bindings_size()); i < n; i++) {
  952. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
  953. 11,
  954. this->additional_bindings(static_cast<int>(i)),
  955. output);
  956. }
  957. if (_internal_metadata_.have_unknown_fields()) {
  958. ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
  959. _internal_metadata_.unknown_fields(), output);
  960. }
  961. // @@protoc_insertion_point(serialize_end:google.api.HttpRule)
  962. }
  963. ::PROTOBUF_NAMESPACE_ID::uint8* HttpRule::InternalSerializeWithCachedSizesToArray(
  964. ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
  965. // @@protoc_insertion_point(serialize_to_array_start:google.api.HttpRule)
  966. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  967. (void) cached_has_bits;
  968. // string selector = 1;
  969. if (this->selector().size() > 0) {
  970. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  971. this->selector().data(), static_cast<int>(this->selector().length()),
  972. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  973. "google.api.HttpRule.selector");
  974. target =
  975. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
  976. 1, this->selector(), target);
  977. }
  978. // string get = 2;
  979. if (has_get()) {
  980. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  981. this->get().data(), static_cast<int>(this->get().length()),
  982. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  983. "google.api.HttpRule.get");
  984. target =
  985. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
  986. 2, this->get(), target);
  987. }
  988. // string put = 3;
  989. if (has_put()) {
  990. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  991. this->put().data(), static_cast<int>(this->put().length()),
  992. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  993. "google.api.HttpRule.put");
  994. target =
  995. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
  996. 3, this->put(), target);
  997. }
  998. // string post = 4;
  999. if (has_post()) {
  1000. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  1001. this->post().data(), static_cast<int>(this->post().length()),
  1002. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  1003. "google.api.HttpRule.post");
  1004. target =
  1005. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
  1006. 4, this->post(), target);
  1007. }
  1008. // string delete = 5;
  1009. if (has_delete_()) {
  1010. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  1011. this->delete_().data(), static_cast<int>(this->delete_().length()),
  1012. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  1013. "google.api.HttpRule.delete");
  1014. target =
  1015. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
  1016. 5, this->delete_(), target);
  1017. }
  1018. // string patch = 6;
  1019. if (has_patch()) {
  1020. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  1021. this->patch().data(), static_cast<int>(this->patch().length()),
  1022. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  1023. "google.api.HttpRule.patch");
  1024. target =
  1025. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
  1026. 6, this->patch(), target);
  1027. }
  1028. // string body = 7;
  1029. if (this->body().size() > 0) {
  1030. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  1031. this->body().data(), static_cast<int>(this->body().length()),
  1032. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  1033. "google.api.HttpRule.body");
  1034. target =
  1035. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
  1036. 7, this->body(), target);
  1037. }
  1038. // .google.api.CustomHttpPattern custom = 8;
  1039. if (has_custom()) {
  1040. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  1041. InternalWriteMessageToArray(
  1042. 8, _Internal::custom(this), target);
  1043. }
  1044. // repeated .google.api.HttpRule additional_bindings = 11;
  1045. for (unsigned int i = 0,
  1046. n = static_cast<unsigned int>(this->additional_bindings_size()); i < n; i++) {
  1047. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  1048. InternalWriteMessageToArray(
  1049. 11, this->additional_bindings(static_cast<int>(i)), target);
  1050. }
  1051. if (_internal_metadata_.have_unknown_fields()) {
  1052. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
  1053. _internal_metadata_.unknown_fields(), target);
  1054. }
  1055. // @@protoc_insertion_point(serialize_to_array_end:google.api.HttpRule)
  1056. return target;
  1057. }
  1058. size_t HttpRule::ByteSizeLong() const {
  1059. // @@protoc_insertion_point(message_byte_size_start:google.api.HttpRule)
  1060. size_t total_size = 0;
  1061. if (_internal_metadata_.have_unknown_fields()) {
  1062. total_size +=
  1063. ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
  1064. _internal_metadata_.unknown_fields());
  1065. }
  1066. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1067. // Prevent compiler warnings about cached_has_bits being unused
  1068. (void) cached_has_bits;
  1069. // repeated .google.api.HttpRule additional_bindings = 11;
  1070. {
  1071. unsigned int count = static_cast<unsigned int>(this->additional_bindings_size());
  1072. total_size += 1UL * count;
  1073. for (unsigned int i = 0; i < count; i++) {
  1074. total_size +=
  1075. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  1076. this->additional_bindings(static_cast<int>(i)));
  1077. }
  1078. }
  1079. // string selector = 1;
  1080. if (this->selector().size() > 0) {
  1081. total_size += 1 +
  1082. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  1083. this->selector());
  1084. }
  1085. // string body = 7;
  1086. if (this->body().size() > 0) {
  1087. total_size += 1 +
  1088. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  1089. this->body());
  1090. }
  1091. switch (pattern_case()) {
  1092. // string get = 2;
  1093. case kGet: {
  1094. total_size += 1 +
  1095. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  1096. this->get());
  1097. break;
  1098. }
  1099. // string put = 3;
  1100. case kPut: {
  1101. total_size += 1 +
  1102. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  1103. this->put());
  1104. break;
  1105. }
  1106. // string post = 4;
  1107. case kPost: {
  1108. total_size += 1 +
  1109. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  1110. this->post());
  1111. break;
  1112. }
  1113. // string delete = 5;
  1114. case kDelete: {
  1115. total_size += 1 +
  1116. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  1117. this->delete_());
  1118. break;
  1119. }
  1120. // string patch = 6;
  1121. case kPatch: {
  1122. total_size += 1 +
  1123. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  1124. this->patch());
  1125. break;
  1126. }
  1127. // .google.api.CustomHttpPattern custom = 8;
  1128. case kCustom: {
  1129. total_size += 1 +
  1130. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  1131. *pattern_.custom_);
  1132. break;
  1133. }
  1134. case PATTERN_NOT_SET: {
  1135. break;
  1136. }
  1137. }
  1138. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  1139. SetCachedSize(cached_size);
  1140. return total_size;
  1141. }
  1142. void HttpRule::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  1143. // @@protoc_insertion_point(generalized_merge_from_start:google.api.HttpRule)
  1144. GOOGLE_DCHECK_NE(&from, this);
  1145. const HttpRule* source =
  1146. ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<HttpRule>(
  1147. &from);
  1148. if (source == nullptr) {
  1149. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.api.HttpRule)
  1150. ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  1151. } else {
  1152. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.api.HttpRule)
  1153. MergeFrom(*source);
  1154. }
  1155. }
  1156. void HttpRule::MergeFrom(const HttpRule& from) {
  1157. // @@protoc_insertion_point(class_specific_merge_from_start:google.api.HttpRule)
  1158. GOOGLE_DCHECK_NE(&from, this);
  1159. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1160. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1161. (void) cached_has_bits;
  1162. additional_bindings_.MergeFrom(from.additional_bindings_);
  1163. if (from.selector().size() > 0) {
  1164. set_selector(from.selector());
  1165. }
  1166. if (from.body().size() > 0) {
  1167. set_body(from.body());
  1168. }
  1169. switch (from.pattern_case()) {
  1170. case kGet: {
  1171. set_get(from.get());
  1172. break;
  1173. }
  1174. case kPut: {
  1175. set_put(from.put());
  1176. break;
  1177. }
  1178. case kPost: {
  1179. set_post(from.post());
  1180. break;
  1181. }
  1182. case kDelete: {
  1183. set_delete_(from.delete_());
  1184. break;
  1185. }
  1186. case kPatch: {
  1187. set_patch(from.patch());
  1188. break;
  1189. }
  1190. case kCustom: {
  1191. mutable_custom()->::google::api::CustomHttpPattern::MergeFrom(from.custom());
  1192. break;
  1193. }
  1194. case PATTERN_NOT_SET: {
  1195. break;
  1196. }
  1197. }
  1198. }
  1199. void HttpRule::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  1200. // @@protoc_insertion_point(generalized_copy_from_start:google.api.HttpRule)
  1201. if (&from == this) return;
  1202. Clear();
  1203. MergeFrom(from);
  1204. }
  1205. void HttpRule::CopyFrom(const HttpRule& from) {
  1206. // @@protoc_insertion_point(class_specific_copy_from_start:google.api.HttpRule)
  1207. if (&from == this) return;
  1208. Clear();
  1209. MergeFrom(from);
  1210. }
  1211. bool HttpRule::IsInitialized() const {
  1212. return true;
  1213. }
  1214. void HttpRule::InternalSwap(HttpRule* other) {
  1215. using std::swap;
  1216. _internal_metadata_.Swap(&other->_internal_metadata_);
  1217. CastToBase(&additional_bindings_)->InternalSwap(CastToBase(&other->additional_bindings_));
  1218. selector_.Swap(&other->selector_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  1219. GetArenaNoVirtual());
  1220. body_.Swap(&other->body_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  1221. GetArenaNoVirtual());
  1222. swap(pattern_, other->pattern_);
  1223. swap(_oneof_case_[0], other->_oneof_case_[0]);
  1224. }
  1225. ::PROTOBUF_NAMESPACE_ID::Metadata HttpRule::GetMetadata() const {
  1226. return GetMetadataStatic();
  1227. }
  1228. // ===================================================================
  1229. void CustomHttpPattern::InitAsDefaultInstance() {
  1230. }
  1231. class CustomHttpPattern::_Internal {
  1232. public:
  1233. };
  1234. CustomHttpPattern::CustomHttpPattern()
  1235. : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  1236. SharedCtor();
  1237. // @@protoc_insertion_point(constructor:google.api.CustomHttpPattern)
  1238. }
  1239. CustomHttpPattern::CustomHttpPattern(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  1240. : ::PROTOBUF_NAMESPACE_ID::Message(),
  1241. _internal_metadata_(arena) {
  1242. SharedCtor();
  1243. RegisterArenaDtor(arena);
  1244. // @@protoc_insertion_point(arena_constructor:google.api.CustomHttpPattern)
  1245. }
  1246. CustomHttpPattern::CustomHttpPattern(const CustomHttpPattern& from)
  1247. : ::PROTOBUF_NAMESPACE_ID::Message(),
  1248. _internal_metadata_(nullptr) {
  1249. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1250. kind_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  1251. if (!from.kind().empty()) {
  1252. kind_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.kind(),
  1253. GetArenaNoVirtual());
  1254. }
  1255. path_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  1256. if (!from.path().empty()) {
  1257. path_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.path(),
  1258. GetArenaNoVirtual());
  1259. }
  1260. // @@protoc_insertion_point(copy_constructor:google.api.CustomHttpPattern)
  1261. }
  1262. void CustomHttpPattern::SharedCtor() {
  1263. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_CustomHttpPattern_google_2fapi_2fhttp_2eproto.base);
  1264. kind_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  1265. path_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  1266. }
  1267. CustomHttpPattern::~CustomHttpPattern() {
  1268. // @@protoc_insertion_point(destructor:google.api.CustomHttpPattern)
  1269. SharedDtor();
  1270. }
  1271. void CustomHttpPattern::SharedDtor() {
  1272. GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
  1273. kind_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  1274. path_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  1275. }
  1276. void CustomHttpPattern::ArenaDtor(void* object) {
  1277. CustomHttpPattern* _this = reinterpret_cast< CustomHttpPattern* >(object);
  1278. (void)_this;
  1279. }
  1280. void CustomHttpPattern::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
  1281. }
  1282. void CustomHttpPattern::SetCachedSize(int size) const {
  1283. _cached_size_.Set(size);
  1284. }
  1285. const CustomHttpPattern& CustomHttpPattern::default_instance() {
  1286. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_CustomHttpPattern_google_2fapi_2fhttp_2eproto.base);
  1287. return *internal_default_instance();
  1288. }
  1289. void CustomHttpPattern::Clear() {
  1290. // @@protoc_insertion_point(message_clear_start:google.api.CustomHttpPattern)
  1291. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1292. // Prevent compiler warnings about cached_has_bits being unused
  1293. (void) cached_has_bits;
  1294. kind_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
  1295. path_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
  1296. _internal_metadata_.Clear();
  1297. }
  1298. #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  1299. const char* CustomHttpPattern::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
  1300. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  1301. ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
  1302. while (!ctx->Done(&ptr)) {
  1303. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  1304. ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
  1305. CHK_(ptr);
  1306. switch (tag >> 3) {
  1307. // string kind = 1;
  1308. case 1:
  1309. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
  1310. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_kind(), ptr, ctx, "google.api.CustomHttpPattern.kind");
  1311. CHK_(ptr);
  1312. } else goto handle_unusual;
  1313. continue;
  1314. // string path = 2;
  1315. case 2:
  1316. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
  1317. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_path(), ptr, ctx, "google.api.CustomHttpPattern.path");
  1318. CHK_(ptr);
  1319. } else goto handle_unusual;
  1320. continue;
  1321. default: {
  1322. handle_unusual:
  1323. if ((tag & 7) == 4 || tag == 0) {
  1324. ctx->SetLastTag(tag);
  1325. goto success;
  1326. }
  1327. ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
  1328. CHK_(ptr != nullptr);
  1329. continue;
  1330. }
  1331. } // switch
  1332. } // while
  1333. success:
  1334. return ptr;
  1335. failure:
  1336. ptr = nullptr;
  1337. goto success;
  1338. #undef CHK_
  1339. }
  1340. #else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  1341. bool CustomHttpPattern::MergePartialFromCodedStream(
  1342. ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
  1343. #define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
  1344. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  1345. // @@protoc_insertion_point(parse_start:google.api.CustomHttpPattern)
  1346. for (;;) {
  1347. ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  1348. tag = p.first;
  1349. if (!p.second) goto handle_unusual;
  1350. switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  1351. // string kind = 1;
  1352. case 1: {
  1353. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
  1354. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
  1355. input, this->mutable_kind()));
  1356. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  1357. this->kind().data(), static_cast<int>(this->kind().length()),
  1358. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
  1359. "google.api.CustomHttpPattern.kind"));
  1360. } else {
  1361. goto handle_unusual;
  1362. }
  1363. break;
  1364. }
  1365. // string path = 2;
  1366. case 2: {
  1367. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
  1368. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
  1369. input, this->mutable_path()));
  1370. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  1371. this->path().data(), static_cast<int>(this->path().length()),
  1372. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
  1373. "google.api.CustomHttpPattern.path"));
  1374. } else {
  1375. goto handle_unusual;
  1376. }
  1377. break;
  1378. }
  1379. default: {
  1380. handle_unusual:
  1381. if (tag == 0) {
  1382. goto success;
  1383. }
  1384. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
  1385. input, tag, _internal_metadata_.mutable_unknown_fields()));
  1386. break;
  1387. }
  1388. }
  1389. }
  1390. success:
  1391. // @@protoc_insertion_point(parse_success:google.api.CustomHttpPattern)
  1392. return true;
  1393. failure:
  1394. // @@protoc_insertion_point(parse_failure:google.api.CustomHttpPattern)
  1395. return false;
  1396. #undef DO_
  1397. }
  1398. #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  1399. void CustomHttpPattern::SerializeWithCachedSizes(
  1400. ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
  1401. // @@protoc_insertion_point(serialize_start:google.api.CustomHttpPattern)
  1402. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1403. (void) cached_has_bits;
  1404. // string kind = 1;
  1405. if (this->kind().size() > 0) {
  1406. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  1407. this->kind().data(), static_cast<int>(this->kind().length()),
  1408. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  1409. "google.api.CustomHttpPattern.kind");
  1410. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
  1411. 1, this->kind(), output);
  1412. }
  1413. // string path = 2;
  1414. if (this->path().size() > 0) {
  1415. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  1416. this->path().data(), static_cast<int>(this->path().length()),
  1417. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  1418. "google.api.CustomHttpPattern.path");
  1419. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
  1420. 2, this->path(), output);
  1421. }
  1422. if (_internal_metadata_.have_unknown_fields()) {
  1423. ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
  1424. _internal_metadata_.unknown_fields(), output);
  1425. }
  1426. // @@protoc_insertion_point(serialize_end:google.api.CustomHttpPattern)
  1427. }
  1428. ::PROTOBUF_NAMESPACE_ID::uint8* CustomHttpPattern::InternalSerializeWithCachedSizesToArray(
  1429. ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
  1430. // @@protoc_insertion_point(serialize_to_array_start:google.api.CustomHttpPattern)
  1431. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1432. (void) cached_has_bits;
  1433. // string kind = 1;
  1434. if (this->kind().size() > 0) {
  1435. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  1436. this->kind().data(), static_cast<int>(this->kind().length()),
  1437. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  1438. "google.api.CustomHttpPattern.kind");
  1439. target =
  1440. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
  1441. 1, this->kind(), target);
  1442. }
  1443. // string path = 2;
  1444. if (this->path().size() > 0) {
  1445. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  1446. this->path().data(), static_cast<int>(this->path().length()),
  1447. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  1448. "google.api.CustomHttpPattern.path");
  1449. target =
  1450. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
  1451. 2, this->path(), target);
  1452. }
  1453. if (_internal_metadata_.have_unknown_fields()) {
  1454. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
  1455. _internal_metadata_.unknown_fields(), target);
  1456. }
  1457. // @@protoc_insertion_point(serialize_to_array_end:google.api.CustomHttpPattern)
  1458. return target;
  1459. }
  1460. size_t CustomHttpPattern::ByteSizeLong() const {
  1461. // @@protoc_insertion_point(message_byte_size_start:google.api.CustomHttpPattern)
  1462. size_t total_size = 0;
  1463. if (_internal_metadata_.have_unknown_fields()) {
  1464. total_size +=
  1465. ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
  1466. _internal_metadata_.unknown_fields());
  1467. }
  1468. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1469. // Prevent compiler warnings about cached_has_bits being unused
  1470. (void) cached_has_bits;
  1471. // string kind = 1;
  1472. if (this->kind().size() > 0) {
  1473. total_size += 1 +
  1474. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  1475. this->kind());
  1476. }
  1477. // string path = 2;
  1478. if (this->path().size() > 0) {
  1479. total_size += 1 +
  1480. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  1481. this->path());
  1482. }
  1483. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  1484. SetCachedSize(cached_size);
  1485. return total_size;
  1486. }
  1487. void CustomHttpPattern::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  1488. // @@protoc_insertion_point(generalized_merge_from_start:google.api.CustomHttpPattern)
  1489. GOOGLE_DCHECK_NE(&from, this);
  1490. const CustomHttpPattern* source =
  1491. ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<CustomHttpPattern>(
  1492. &from);
  1493. if (source == nullptr) {
  1494. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.api.CustomHttpPattern)
  1495. ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  1496. } else {
  1497. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.api.CustomHttpPattern)
  1498. MergeFrom(*source);
  1499. }
  1500. }
  1501. void CustomHttpPattern::MergeFrom(const CustomHttpPattern& from) {
  1502. // @@protoc_insertion_point(class_specific_merge_from_start:google.api.CustomHttpPattern)
  1503. GOOGLE_DCHECK_NE(&from, this);
  1504. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1505. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1506. (void) cached_has_bits;
  1507. if (from.kind().size() > 0) {
  1508. set_kind(from.kind());
  1509. }
  1510. if (from.path().size() > 0) {
  1511. set_path(from.path());
  1512. }
  1513. }
  1514. void CustomHttpPattern::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  1515. // @@protoc_insertion_point(generalized_copy_from_start:google.api.CustomHttpPattern)
  1516. if (&from == this) return;
  1517. Clear();
  1518. MergeFrom(from);
  1519. }
  1520. void CustomHttpPattern::CopyFrom(const CustomHttpPattern& from) {
  1521. // @@protoc_insertion_point(class_specific_copy_from_start:google.api.CustomHttpPattern)
  1522. if (&from == this) return;
  1523. Clear();
  1524. MergeFrom(from);
  1525. }
  1526. bool CustomHttpPattern::IsInitialized() const {
  1527. return true;
  1528. }
  1529. void CustomHttpPattern::InternalSwap(CustomHttpPattern* other) {
  1530. using std::swap;
  1531. _internal_metadata_.Swap(&other->_internal_metadata_);
  1532. kind_.Swap(&other->kind_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  1533. GetArenaNoVirtual());
  1534. path_.Swap(&other->path_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  1535. GetArenaNoVirtual());
  1536. }
  1537. ::PROTOBUF_NAMESPACE_ID::Metadata CustomHttpPattern::GetMetadata() const {
  1538. return GetMetadataStatic();
  1539. }
  1540. // @@protoc_insertion_point(namespace_scope)
  1541. } // namespace api
  1542. } // namespace google
  1543. PROTOBUF_NAMESPACE_OPEN
  1544. template<> PROTOBUF_NOINLINE ::google::api::Http* Arena::CreateMaybeMessage< ::google::api::Http >(Arena* arena) {
  1545. return Arena::CreateMessageInternal< ::google::api::Http >(arena);
  1546. }
  1547. template<> PROTOBUF_NOINLINE ::google::api::HttpRule* Arena::CreateMaybeMessage< ::google::api::HttpRule >(Arena* arena) {
  1548. return Arena::CreateMessageInternal< ::google::api::HttpRule >(arena);
  1549. }
  1550. template<> PROTOBUF_NOINLINE ::google::api::CustomHttpPattern* Arena::CreateMaybeMessage< ::google::api::CustomHttpPattern >(Arena* arena) {
  1551. return Arena::CreateMessageInternal< ::google::api::CustomHttpPattern >(arena);
  1552. }
  1553. PROTOBUF_NAMESPACE_CLOSE
  1554. // @@protoc_insertion_point(global_scope)
  1555. #include <google/protobuf/port_undef.inc>