http.pb.cc 58 KB

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