AppService.php 52 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861
  1. <?php
  2. namespace OpenSearch\Generated\App;
  3. /**
  4. * Autogenerated by Thrift Compiler (0.10.0)
  5. *
  6. * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  7. * @generated
  8. */
  9. use Thrift\Base\TBase;
  10. use Thrift\Type\TType;
  11. use Thrift\Type\TMessageType;
  12. use Thrift\Exception\TException;
  13. use Thrift\Exception\TProtocolException;
  14. use Thrift\Protocol\TProtocol;
  15. use Thrift\Protocol\TBinaryProtocolAccelerated;
  16. use Thrift\Exception\TApplicationException;
  17. interface AppServiceIf {
  18. /**
  19. * @param string $app
  20. * @return \OpenSearch\Generated\Common\OpenSearchResult
  21. * @throws \OpenSearch\Generated\Common\OpenSearchException
  22. * @throws \OpenSearch\Generated\Common\OpenSearchClientException
  23. */
  24. public function save($app);
  25. /**
  26. * @param string $identity
  27. * @return \OpenSearch\Generated\Common\OpenSearchResult
  28. * @throws \OpenSearch\Generated\Common\OpenSearchException
  29. * @throws \OpenSearch\Generated\Common\OpenSearchClientException
  30. */
  31. public function getById($identity);
  32. /**
  33. * @param \OpenSearch\Generated\Common\Pageable $pageable
  34. * @return \OpenSearch\Generated\Common\OpenSearchResult
  35. * @throws \OpenSearch\Generated\Common\OpenSearchException
  36. * @throws \OpenSearch\Generated\Common\OpenSearchClientException
  37. */
  38. public function listAll(\OpenSearch\Generated\Common\Pageable $pageable);
  39. /**
  40. * @param string $identity
  41. * @return \OpenSearch\Generated\Common\OpenSearchResult
  42. * @throws \OpenSearch\Generated\Common\OpenSearchException
  43. * @throws \OpenSearch\Generated\Common\OpenSearchClientException
  44. */
  45. public function removeById($identity);
  46. /**
  47. * @param string $identity
  48. * @param string $app
  49. * @return \OpenSearch\Generated\Common\OpenSearchResult
  50. * @throws \OpenSearch\Generated\Common\OpenSearchException
  51. * @throws \OpenSearch\Generated\Common\OpenSearchClientException
  52. */
  53. public function updateById($identity, $app);
  54. /**
  55. * @param string $identity
  56. * @return \OpenSearch\Generated\Common\OpenSearchResult
  57. * @throws \OpenSearch\Generated\Common\OpenSearchException
  58. * @throws \OpenSearch\Generated\Common\OpenSearchClientException
  59. */
  60. public function reindexById($identity);
  61. }
  62. class AppServiceClient implements \OpenSearch\Generated\App\AppServiceIf {
  63. protected $input_ = null;
  64. protected $output_ = null;
  65. protected $seqid_ = 0;
  66. public function __construct($input, $output=null) {
  67. $this->input_ = $input;
  68. $this->output_ = $output ? $output : $input;
  69. }
  70. public function save($app)
  71. {
  72. $this->send_save($app);
  73. return $this->recv_save();
  74. }
  75. public function send_save($app)
  76. {
  77. $args = new \OpenSearch\Generated\App\AppService_save_args();
  78. $args->app = $app;
  79. $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
  80. if ($bin_accel)
  81. {
  82. thrift_protocol_write_binary($this->output_, 'save', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  83. }
  84. else
  85. {
  86. $this->output_->writeMessageBegin('save', TMessageType::CALL, $this->seqid_);
  87. $args->write($this->output_);
  88. $this->output_->writeMessageEnd();
  89. $this->output_->getTransport()->flush();
  90. }
  91. }
  92. public function recv_save()
  93. {
  94. $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
  95. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\OpenSearch\Generated\App\AppService_save_result', $this->input_->isStrictRead());
  96. else
  97. {
  98. $rseqid = 0;
  99. $fname = null;
  100. $mtype = 0;
  101. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  102. if ($mtype == TMessageType::EXCEPTION) {
  103. $x = new TApplicationException();
  104. $x->read($this->input_);
  105. $this->input_->readMessageEnd();
  106. throw $x;
  107. }
  108. $result = new \OpenSearch\Generated\App\AppService_save_result();
  109. $result->read($this->input_);
  110. $this->input_->readMessageEnd();
  111. }
  112. if ($result->success !== null) {
  113. return $result->success;
  114. }
  115. if ($result->error !== null) {
  116. throw $result->error;
  117. }
  118. if ($result->e !== null) {
  119. throw $result->e;
  120. }
  121. throw new \Exception("save failed: unknown result");
  122. }
  123. public function getById($identity)
  124. {
  125. $this->send_getById($identity);
  126. return $this->recv_getById();
  127. }
  128. public function send_getById($identity)
  129. {
  130. $args = new \OpenSearch\Generated\App\AppService_getById_args();
  131. $args->identity = $identity;
  132. $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
  133. if ($bin_accel)
  134. {
  135. thrift_protocol_write_binary($this->output_, 'getById', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  136. }
  137. else
  138. {
  139. $this->output_->writeMessageBegin('getById', TMessageType::CALL, $this->seqid_);
  140. $args->write($this->output_);
  141. $this->output_->writeMessageEnd();
  142. $this->output_->getTransport()->flush();
  143. }
  144. }
  145. public function recv_getById()
  146. {
  147. $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
  148. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\OpenSearch\Generated\App\AppService_getById_result', $this->input_->isStrictRead());
  149. else
  150. {
  151. $rseqid = 0;
  152. $fname = null;
  153. $mtype = 0;
  154. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  155. if ($mtype == TMessageType::EXCEPTION) {
  156. $x = new TApplicationException();
  157. $x->read($this->input_);
  158. $this->input_->readMessageEnd();
  159. throw $x;
  160. }
  161. $result = new \OpenSearch\Generated\App\AppService_getById_result();
  162. $result->read($this->input_);
  163. $this->input_->readMessageEnd();
  164. }
  165. if ($result->success !== null) {
  166. return $result->success;
  167. }
  168. if ($result->error !== null) {
  169. throw $result->error;
  170. }
  171. if ($result->e !== null) {
  172. throw $result->e;
  173. }
  174. throw new \Exception("getById failed: unknown result");
  175. }
  176. public function listAll(\OpenSearch\Generated\Common\Pageable $pageable)
  177. {
  178. $this->send_listAll($pageable);
  179. return $this->recv_listAll();
  180. }
  181. public function send_listAll(\OpenSearch\Generated\Common\Pageable $pageable)
  182. {
  183. $args = new \OpenSearch\Generated\App\AppService_listAll_args();
  184. $args->pageable = $pageable;
  185. $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
  186. if ($bin_accel)
  187. {
  188. thrift_protocol_write_binary($this->output_, 'listAll', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  189. }
  190. else
  191. {
  192. $this->output_->writeMessageBegin('listAll', TMessageType::CALL, $this->seqid_);
  193. $args->write($this->output_);
  194. $this->output_->writeMessageEnd();
  195. $this->output_->getTransport()->flush();
  196. }
  197. }
  198. public function recv_listAll()
  199. {
  200. $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
  201. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\OpenSearch\Generated\App\AppService_listAll_result', $this->input_->isStrictRead());
  202. else
  203. {
  204. $rseqid = 0;
  205. $fname = null;
  206. $mtype = 0;
  207. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  208. if ($mtype == TMessageType::EXCEPTION) {
  209. $x = new TApplicationException();
  210. $x->read($this->input_);
  211. $this->input_->readMessageEnd();
  212. throw $x;
  213. }
  214. $result = new \OpenSearch\Generated\App\AppService_listAll_result();
  215. $result->read($this->input_);
  216. $this->input_->readMessageEnd();
  217. }
  218. if ($result->success !== null) {
  219. return $result->success;
  220. }
  221. if ($result->error !== null) {
  222. throw $result->error;
  223. }
  224. if ($result->e !== null) {
  225. throw $result->e;
  226. }
  227. throw new \Exception("listAll failed: unknown result");
  228. }
  229. public function removeById($identity)
  230. {
  231. $this->send_removeById($identity);
  232. return $this->recv_removeById();
  233. }
  234. public function send_removeById($identity)
  235. {
  236. $args = new \OpenSearch\Generated\App\AppService_removeById_args();
  237. $args->identity = $identity;
  238. $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
  239. if ($bin_accel)
  240. {
  241. thrift_protocol_write_binary($this->output_, 'removeById', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  242. }
  243. else
  244. {
  245. $this->output_->writeMessageBegin('removeById', TMessageType::CALL, $this->seqid_);
  246. $args->write($this->output_);
  247. $this->output_->writeMessageEnd();
  248. $this->output_->getTransport()->flush();
  249. }
  250. }
  251. public function recv_removeById()
  252. {
  253. $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
  254. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\OpenSearch\Generated\App\AppService_removeById_result', $this->input_->isStrictRead());
  255. else
  256. {
  257. $rseqid = 0;
  258. $fname = null;
  259. $mtype = 0;
  260. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  261. if ($mtype == TMessageType::EXCEPTION) {
  262. $x = new TApplicationException();
  263. $x->read($this->input_);
  264. $this->input_->readMessageEnd();
  265. throw $x;
  266. }
  267. $result = new \OpenSearch\Generated\App\AppService_removeById_result();
  268. $result->read($this->input_);
  269. $this->input_->readMessageEnd();
  270. }
  271. if ($result->success !== null) {
  272. return $result->success;
  273. }
  274. if ($result->error !== null) {
  275. throw $result->error;
  276. }
  277. if ($result->e !== null) {
  278. throw $result->e;
  279. }
  280. throw new \Exception("removeById failed: unknown result");
  281. }
  282. public function updateById($identity, $app)
  283. {
  284. $this->send_updateById($identity, $app);
  285. return $this->recv_updateById();
  286. }
  287. public function send_updateById($identity, $app)
  288. {
  289. $args = new \OpenSearch\Generated\App\AppService_updateById_args();
  290. $args->identity = $identity;
  291. $args->app = $app;
  292. $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
  293. if ($bin_accel)
  294. {
  295. thrift_protocol_write_binary($this->output_, 'updateById', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  296. }
  297. else
  298. {
  299. $this->output_->writeMessageBegin('updateById', TMessageType::CALL, $this->seqid_);
  300. $args->write($this->output_);
  301. $this->output_->writeMessageEnd();
  302. $this->output_->getTransport()->flush();
  303. }
  304. }
  305. public function recv_updateById()
  306. {
  307. $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
  308. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\OpenSearch\Generated\App\AppService_updateById_result', $this->input_->isStrictRead());
  309. else
  310. {
  311. $rseqid = 0;
  312. $fname = null;
  313. $mtype = 0;
  314. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  315. if ($mtype == TMessageType::EXCEPTION) {
  316. $x = new TApplicationException();
  317. $x->read($this->input_);
  318. $this->input_->readMessageEnd();
  319. throw $x;
  320. }
  321. $result = new \OpenSearch\Generated\App\AppService_updateById_result();
  322. $result->read($this->input_);
  323. $this->input_->readMessageEnd();
  324. }
  325. if ($result->success !== null) {
  326. return $result->success;
  327. }
  328. if ($result->error !== null) {
  329. throw $result->error;
  330. }
  331. if ($result->e !== null) {
  332. throw $result->e;
  333. }
  334. throw new \Exception("updateById failed: unknown result");
  335. }
  336. public function reindexById($identity)
  337. {
  338. $this->send_reindexById($identity);
  339. return $this->recv_reindexById();
  340. }
  341. public function send_reindexById($identity)
  342. {
  343. $args = new \OpenSearch\Generated\App\AppService_reindexById_args();
  344. $args->identity = $identity;
  345. $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
  346. if ($bin_accel)
  347. {
  348. thrift_protocol_write_binary($this->output_, 'reindexById', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
  349. }
  350. else
  351. {
  352. $this->output_->writeMessageBegin('reindexById', TMessageType::CALL, $this->seqid_);
  353. $args->write($this->output_);
  354. $this->output_->writeMessageEnd();
  355. $this->output_->getTransport()->flush();
  356. }
  357. }
  358. public function recv_reindexById()
  359. {
  360. $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
  361. if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\OpenSearch\Generated\App\AppService_reindexById_result', $this->input_->isStrictRead());
  362. else
  363. {
  364. $rseqid = 0;
  365. $fname = null;
  366. $mtype = 0;
  367. $this->input_->readMessageBegin($fname, $mtype, $rseqid);
  368. if ($mtype == TMessageType::EXCEPTION) {
  369. $x = new TApplicationException();
  370. $x->read($this->input_);
  371. $this->input_->readMessageEnd();
  372. throw $x;
  373. }
  374. $result = new \OpenSearch\Generated\App\AppService_reindexById_result();
  375. $result->read($this->input_);
  376. $this->input_->readMessageEnd();
  377. }
  378. if ($result->success !== null) {
  379. return $result->success;
  380. }
  381. if ($result->error !== null) {
  382. throw $result->error;
  383. }
  384. if ($result->e !== null) {
  385. throw $result->e;
  386. }
  387. throw new \Exception("reindexById failed: unknown result");
  388. }
  389. }
  390. // HELPER FUNCTIONS AND STRUCTURES
  391. class AppService_save_args {
  392. static $_TSPEC;
  393. /**
  394. * @var string
  395. */
  396. public $app = null;
  397. public function __construct($vals=null) {
  398. if (!isset(self::$_TSPEC)) {
  399. self::$_TSPEC = array(
  400. 1 => array(
  401. 'var' => 'app',
  402. 'type' => TType::STRING,
  403. ),
  404. );
  405. }
  406. if (is_array($vals)) {
  407. if (isset($vals['app'])) {
  408. $this->app = $vals['app'];
  409. }
  410. }
  411. }
  412. public function getName() {
  413. return 'AppService_save_args';
  414. }
  415. public function read($input)
  416. {
  417. $xfer = 0;
  418. $fname = null;
  419. $ftype = 0;
  420. $fid = 0;
  421. $xfer += $input->readStructBegin($fname);
  422. while (true)
  423. {
  424. $xfer += $input->readFieldBegin($fname, $ftype, $fid);
  425. if ($ftype == TType::STOP) {
  426. break;
  427. }
  428. switch ($fid)
  429. {
  430. case 1:
  431. if ($ftype == TType::STRING) {
  432. $xfer += $input->readString($this->app);
  433. } else {
  434. $xfer += $input->skip($ftype);
  435. }
  436. break;
  437. default:
  438. $xfer += $input->skip($ftype);
  439. break;
  440. }
  441. $xfer += $input->readFieldEnd();
  442. }
  443. $xfer += $input->readStructEnd();
  444. return $xfer;
  445. }
  446. public function write($output) {
  447. $xfer = 0;
  448. $xfer += $output->writeStructBegin('AppService_save_args');
  449. if ($this->app !== null) {
  450. $xfer += $output->writeFieldBegin('app', TType::STRING, 1);
  451. $xfer += $output->writeString($this->app);
  452. $xfer += $output->writeFieldEnd();
  453. }
  454. $xfer += $output->writeFieldStop();
  455. $xfer += $output->writeStructEnd();
  456. return $xfer;
  457. }
  458. }
  459. class AppService_save_result {
  460. static $_TSPEC;
  461. /**
  462. * @var \OpenSearch\Generated\Common\OpenSearchResult
  463. */
  464. public $success = null;
  465. /**
  466. * @var \OpenSearch\Generated\Common\OpenSearchException
  467. */
  468. public $error = null;
  469. /**
  470. * @var \OpenSearch\Generated\Common\OpenSearchClientException
  471. */
  472. public $e = null;
  473. public function __construct($vals=null) {
  474. if (!isset(self::$_TSPEC)) {
  475. self::$_TSPEC = array(
  476. 0 => array(
  477. 'var' => 'success',
  478. 'type' => TType::STRUCT,
  479. 'class' => '\OpenSearch\Generated\Common\OpenSearchResult',
  480. ),
  481. 1 => array(
  482. 'var' => 'error',
  483. 'type' => TType::STRUCT,
  484. 'class' => '\OpenSearch\Generated\Common\OpenSearchException',
  485. ),
  486. 2 => array(
  487. 'var' => 'e',
  488. 'type' => TType::STRUCT,
  489. 'class' => '\OpenSearch\Generated\Common\OpenSearchClientException',
  490. ),
  491. );
  492. }
  493. if (is_array($vals)) {
  494. if (isset($vals['success'])) {
  495. $this->success = $vals['success'];
  496. }
  497. if (isset($vals['error'])) {
  498. $this->error = $vals['error'];
  499. }
  500. if (isset($vals['e'])) {
  501. $this->e = $vals['e'];
  502. }
  503. }
  504. }
  505. public function getName() {
  506. return 'AppService_save_result';
  507. }
  508. public function read($input)
  509. {
  510. $xfer = 0;
  511. $fname = null;
  512. $ftype = 0;
  513. $fid = 0;
  514. $xfer += $input->readStructBegin($fname);
  515. while (true)
  516. {
  517. $xfer += $input->readFieldBegin($fname, $ftype, $fid);
  518. if ($ftype == TType::STOP) {
  519. break;
  520. }
  521. switch ($fid)
  522. {
  523. case 0:
  524. if ($ftype == TType::STRUCT) {
  525. $this->success = new \OpenSearch\Generated\Common\OpenSearchResult();
  526. $xfer += $this->success->read($input);
  527. } else {
  528. $xfer += $input->skip($ftype);
  529. }
  530. break;
  531. case 1:
  532. if ($ftype == TType::STRUCT) {
  533. $this->error = new \OpenSearch\Generated\Common\OpenSearchException();
  534. $xfer += $this->error->read($input);
  535. } else {
  536. $xfer += $input->skip($ftype);
  537. }
  538. break;
  539. case 2:
  540. if ($ftype == TType::STRUCT) {
  541. $this->e = new \OpenSearch\Generated\Common\OpenSearchClientException();
  542. $xfer += $this->e->read($input);
  543. } else {
  544. $xfer += $input->skip($ftype);
  545. }
  546. break;
  547. default:
  548. $xfer += $input->skip($ftype);
  549. break;
  550. }
  551. $xfer += $input->readFieldEnd();
  552. }
  553. $xfer += $input->readStructEnd();
  554. return $xfer;
  555. }
  556. public function write($output) {
  557. $xfer = 0;
  558. $xfer += $output->writeStructBegin('AppService_save_result');
  559. if ($this->success !== null) {
  560. if (!is_object($this->success)) {
  561. throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
  562. }
  563. $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
  564. $xfer += $this->success->write($output);
  565. $xfer += $output->writeFieldEnd();
  566. }
  567. if ($this->error !== null) {
  568. $xfer += $output->writeFieldBegin('error', TType::STRUCT, 1);
  569. $xfer += $this->error->write($output);
  570. $xfer += $output->writeFieldEnd();
  571. }
  572. if ($this->e !== null) {
  573. $xfer += $output->writeFieldBegin('e', TType::STRUCT, 2);
  574. $xfer += $this->e->write($output);
  575. $xfer += $output->writeFieldEnd();
  576. }
  577. $xfer += $output->writeFieldStop();
  578. $xfer += $output->writeStructEnd();
  579. return $xfer;
  580. }
  581. }
  582. class AppService_getById_args {
  583. static $_TSPEC;
  584. /**
  585. * @var string
  586. */
  587. public $identity = null;
  588. public function __construct($vals=null) {
  589. if (!isset(self::$_TSPEC)) {
  590. self::$_TSPEC = array(
  591. 1 => array(
  592. 'var' => 'identity',
  593. 'type' => TType::STRING,
  594. ),
  595. );
  596. }
  597. if (is_array($vals)) {
  598. if (isset($vals['identity'])) {
  599. $this->identity = $vals['identity'];
  600. }
  601. }
  602. }
  603. public function getName() {
  604. return 'AppService_getById_args';
  605. }
  606. public function read($input)
  607. {
  608. $xfer = 0;
  609. $fname = null;
  610. $ftype = 0;
  611. $fid = 0;
  612. $xfer += $input->readStructBegin($fname);
  613. while (true)
  614. {
  615. $xfer += $input->readFieldBegin($fname, $ftype, $fid);
  616. if ($ftype == TType::STOP) {
  617. break;
  618. }
  619. switch ($fid)
  620. {
  621. case 1:
  622. if ($ftype == TType::STRING) {
  623. $xfer += $input->readString($this->identity);
  624. } else {
  625. $xfer += $input->skip($ftype);
  626. }
  627. break;
  628. default:
  629. $xfer += $input->skip($ftype);
  630. break;
  631. }
  632. $xfer += $input->readFieldEnd();
  633. }
  634. $xfer += $input->readStructEnd();
  635. return $xfer;
  636. }
  637. public function write($output) {
  638. $xfer = 0;
  639. $xfer += $output->writeStructBegin('AppService_getById_args');
  640. if ($this->identity !== null) {
  641. $xfer += $output->writeFieldBegin('identity', TType::STRING, 1);
  642. $xfer += $output->writeString($this->identity);
  643. $xfer += $output->writeFieldEnd();
  644. }
  645. $xfer += $output->writeFieldStop();
  646. $xfer += $output->writeStructEnd();
  647. return $xfer;
  648. }
  649. }
  650. class AppService_getById_result {
  651. static $_TSPEC;
  652. /**
  653. * @var \OpenSearch\Generated\Common\OpenSearchResult
  654. */
  655. public $success = null;
  656. /**
  657. * @var \OpenSearch\Generated\Common\OpenSearchException
  658. */
  659. public $error = null;
  660. /**
  661. * @var \OpenSearch\Generated\Common\OpenSearchClientException
  662. */
  663. public $e = null;
  664. public function __construct($vals=null) {
  665. if (!isset(self::$_TSPEC)) {
  666. self::$_TSPEC = array(
  667. 0 => array(
  668. 'var' => 'success',
  669. 'type' => TType::STRUCT,
  670. 'class' => '\OpenSearch\Generated\Common\OpenSearchResult',
  671. ),
  672. 1 => array(
  673. 'var' => 'error',
  674. 'type' => TType::STRUCT,
  675. 'class' => '\OpenSearch\Generated\Common\OpenSearchException',
  676. ),
  677. 2 => array(
  678. 'var' => 'e',
  679. 'type' => TType::STRUCT,
  680. 'class' => '\OpenSearch\Generated\Common\OpenSearchClientException',
  681. ),
  682. );
  683. }
  684. if (is_array($vals)) {
  685. if (isset($vals['success'])) {
  686. $this->success = $vals['success'];
  687. }
  688. if (isset($vals['error'])) {
  689. $this->error = $vals['error'];
  690. }
  691. if (isset($vals['e'])) {
  692. $this->e = $vals['e'];
  693. }
  694. }
  695. }
  696. public function getName() {
  697. return 'AppService_getById_result';
  698. }
  699. public function read($input)
  700. {
  701. $xfer = 0;
  702. $fname = null;
  703. $ftype = 0;
  704. $fid = 0;
  705. $xfer += $input->readStructBegin($fname);
  706. while (true)
  707. {
  708. $xfer += $input->readFieldBegin($fname, $ftype, $fid);
  709. if ($ftype == TType::STOP) {
  710. break;
  711. }
  712. switch ($fid)
  713. {
  714. case 0:
  715. if ($ftype == TType::STRUCT) {
  716. $this->success = new \OpenSearch\Generated\Common\OpenSearchResult();
  717. $xfer += $this->success->read($input);
  718. } else {
  719. $xfer += $input->skip($ftype);
  720. }
  721. break;
  722. case 1:
  723. if ($ftype == TType::STRUCT) {
  724. $this->error = new \OpenSearch\Generated\Common\OpenSearchException();
  725. $xfer += $this->error->read($input);
  726. } else {
  727. $xfer += $input->skip($ftype);
  728. }
  729. break;
  730. case 2:
  731. if ($ftype == TType::STRUCT) {
  732. $this->e = new \OpenSearch\Generated\Common\OpenSearchClientException();
  733. $xfer += $this->e->read($input);
  734. } else {
  735. $xfer += $input->skip($ftype);
  736. }
  737. break;
  738. default:
  739. $xfer += $input->skip($ftype);
  740. break;
  741. }
  742. $xfer += $input->readFieldEnd();
  743. }
  744. $xfer += $input->readStructEnd();
  745. return $xfer;
  746. }
  747. public function write($output) {
  748. $xfer = 0;
  749. $xfer += $output->writeStructBegin('AppService_getById_result');
  750. if ($this->success !== null) {
  751. if (!is_object($this->success)) {
  752. throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
  753. }
  754. $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
  755. $xfer += $this->success->write($output);
  756. $xfer += $output->writeFieldEnd();
  757. }
  758. if ($this->error !== null) {
  759. $xfer += $output->writeFieldBegin('error', TType::STRUCT, 1);
  760. $xfer += $this->error->write($output);
  761. $xfer += $output->writeFieldEnd();
  762. }
  763. if ($this->e !== null) {
  764. $xfer += $output->writeFieldBegin('e', TType::STRUCT, 2);
  765. $xfer += $this->e->write($output);
  766. $xfer += $output->writeFieldEnd();
  767. }
  768. $xfer += $output->writeFieldStop();
  769. $xfer += $output->writeStructEnd();
  770. return $xfer;
  771. }
  772. }
  773. class AppService_listAll_args {
  774. static $_TSPEC;
  775. /**
  776. * @var \OpenSearch\Generated\Common\Pageable
  777. */
  778. public $pageable = null;
  779. public function __construct($vals=null) {
  780. if (!isset(self::$_TSPEC)) {
  781. self::$_TSPEC = array(
  782. 1 => array(
  783. 'var' => 'pageable',
  784. 'type' => TType::STRUCT,
  785. 'class' => '\OpenSearch\Generated\Common\Pageable',
  786. ),
  787. );
  788. }
  789. if (is_array($vals)) {
  790. if (isset($vals['pageable'])) {
  791. $this->pageable = $vals['pageable'];
  792. }
  793. }
  794. }
  795. public function getName() {
  796. return 'AppService_listAll_args';
  797. }
  798. public function read($input)
  799. {
  800. $xfer = 0;
  801. $fname = null;
  802. $ftype = 0;
  803. $fid = 0;
  804. $xfer += $input->readStructBegin($fname);
  805. while (true)
  806. {
  807. $xfer += $input->readFieldBegin($fname, $ftype, $fid);
  808. if ($ftype == TType::STOP) {
  809. break;
  810. }
  811. switch ($fid)
  812. {
  813. case 1:
  814. if ($ftype == TType::STRUCT) {
  815. $this->pageable = new \OpenSearch\Generated\Common\Pageable();
  816. $xfer += $this->pageable->read($input);
  817. } else {
  818. $xfer += $input->skip($ftype);
  819. }
  820. break;
  821. default:
  822. $xfer += $input->skip($ftype);
  823. break;
  824. }
  825. $xfer += $input->readFieldEnd();
  826. }
  827. $xfer += $input->readStructEnd();
  828. return $xfer;
  829. }
  830. public function write($output) {
  831. $xfer = 0;
  832. $xfer += $output->writeStructBegin('AppService_listAll_args');
  833. if ($this->pageable !== null) {
  834. if (!is_object($this->pageable)) {
  835. throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
  836. }
  837. $xfer += $output->writeFieldBegin('pageable', TType::STRUCT, 1);
  838. $xfer += $this->pageable->write($output);
  839. $xfer += $output->writeFieldEnd();
  840. }
  841. $xfer += $output->writeFieldStop();
  842. $xfer += $output->writeStructEnd();
  843. return $xfer;
  844. }
  845. }
  846. class AppService_listAll_result {
  847. static $_TSPEC;
  848. /**
  849. * @var \OpenSearch\Generated\Common\OpenSearchResult
  850. */
  851. public $success = null;
  852. /**
  853. * @var \OpenSearch\Generated\Common\OpenSearchException
  854. */
  855. public $error = null;
  856. /**
  857. * @var \OpenSearch\Generated\Common\OpenSearchClientException
  858. */
  859. public $e = null;
  860. public function __construct($vals=null) {
  861. if (!isset(self::$_TSPEC)) {
  862. self::$_TSPEC = array(
  863. 0 => array(
  864. 'var' => 'success',
  865. 'type' => TType::STRUCT,
  866. 'class' => '\OpenSearch\Generated\Common\OpenSearchResult',
  867. ),
  868. 1 => array(
  869. 'var' => 'error',
  870. 'type' => TType::STRUCT,
  871. 'class' => '\OpenSearch\Generated\Common\OpenSearchException',
  872. ),
  873. 2 => array(
  874. 'var' => 'e',
  875. 'type' => TType::STRUCT,
  876. 'class' => '\OpenSearch\Generated\Common\OpenSearchClientException',
  877. ),
  878. );
  879. }
  880. if (is_array($vals)) {
  881. if (isset($vals['success'])) {
  882. $this->success = $vals['success'];
  883. }
  884. if (isset($vals['error'])) {
  885. $this->error = $vals['error'];
  886. }
  887. if (isset($vals['e'])) {
  888. $this->e = $vals['e'];
  889. }
  890. }
  891. }
  892. public function getName() {
  893. return 'AppService_listAll_result';
  894. }
  895. public function read($input)
  896. {
  897. $xfer = 0;
  898. $fname = null;
  899. $ftype = 0;
  900. $fid = 0;
  901. $xfer += $input->readStructBegin($fname);
  902. while (true)
  903. {
  904. $xfer += $input->readFieldBegin($fname, $ftype, $fid);
  905. if ($ftype == TType::STOP) {
  906. break;
  907. }
  908. switch ($fid)
  909. {
  910. case 0:
  911. if ($ftype == TType::STRUCT) {
  912. $this->success = new \OpenSearch\Generated\Common\OpenSearchResult();
  913. $xfer += $this->success->read($input);
  914. } else {
  915. $xfer += $input->skip($ftype);
  916. }
  917. break;
  918. case 1:
  919. if ($ftype == TType::STRUCT) {
  920. $this->error = new \OpenSearch\Generated\Common\OpenSearchException();
  921. $xfer += $this->error->read($input);
  922. } else {
  923. $xfer += $input->skip($ftype);
  924. }
  925. break;
  926. case 2:
  927. if ($ftype == TType::STRUCT) {
  928. $this->e = new \OpenSearch\Generated\Common\OpenSearchClientException();
  929. $xfer += $this->e->read($input);
  930. } else {
  931. $xfer += $input->skip($ftype);
  932. }
  933. break;
  934. default:
  935. $xfer += $input->skip($ftype);
  936. break;
  937. }
  938. $xfer += $input->readFieldEnd();
  939. }
  940. $xfer += $input->readStructEnd();
  941. return $xfer;
  942. }
  943. public function write($output) {
  944. $xfer = 0;
  945. $xfer += $output->writeStructBegin('AppService_listAll_result');
  946. if ($this->success !== null) {
  947. if (!is_object($this->success)) {
  948. throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
  949. }
  950. $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
  951. $xfer += $this->success->write($output);
  952. $xfer += $output->writeFieldEnd();
  953. }
  954. if ($this->error !== null) {
  955. $xfer += $output->writeFieldBegin('error', TType::STRUCT, 1);
  956. $xfer += $this->error->write($output);
  957. $xfer += $output->writeFieldEnd();
  958. }
  959. if ($this->e !== null) {
  960. $xfer += $output->writeFieldBegin('e', TType::STRUCT, 2);
  961. $xfer += $this->e->write($output);
  962. $xfer += $output->writeFieldEnd();
  963. }
  964. $xfer += $output->writeFieldStop();
  965. $xfer += $output->writeStructEnd();
  966. return $xfer;
  967. }
  968. }
  969. class AppService_removeById_args {
  970. static $_TSPEC;
  971. /**
  972. * @var string
  973. */
  974. public $identity = null;
  975. public function __construct($vals=null) {
  976. if (!isset(self::$_TSPEC)) {
  977. self::$_TSPEC = array(
  978. 1 => array(
  979. 'var' => 'identity',
  980. 'type' => TType::STRING,
  981. ),
  982. );
  983. }
  984. if (is_array($vals)) {
  985. if (isset($vals['identity'])) {
  986. $this->identity = $vals['identity'];
  987. }
  988. }
  989. }
  990. public function getName() {
  991. return 'AppService_removeById_args';
  992. }
  993. public function read($input)
  994. {
  995. $xfer = 0;
  996. $fname = null;
  997. $ftype = 0;
  998. $fid = 0;
  999. $xfer += $input->readStructBegin($fname);
  1000. while (true)
  1001. {
  1002. $xfer += $input->readFieldBegin($fname, $ftype, $fid);
  1003. if ($ftype == TType::STOP) {
  1004. break;
  1005. }
  1006. switch ($fid)
  1007. {
  1008. case 1:
  1009. if ($ftype == TType::STRING) {
  1010. $xfer += $input->readString($this->identity);
  1011. } else {
  1012. $xfer += $input->skip($ftype);
  1013. }
  1014. break;
  1015. default:
  1016. $xfer += $input->skip($ftype);
  1017. break;
  1018. }
  1019. $xfer += $input->readFieldEnd();
  1020. }
  1021. $xfer += $input->readStructEnd();
  1022. return $xfer;
  1023. }
  1024. public function write($output) {
  1025. $xfer = 0;
  1026. $xfer += $output->writeStructBegin('AppService_removeById_args');
  1027. if ($this->identity !== null) {
  1028. $xfer += $output->writeFieldBegin('identity', TType::STRING, 1);
  1029. $xfer += $output->writeString($this->identity);
  1030. $xfer += $output->writeFieldEnd();
  1031. }
  1032. $xfer += $output->writeFieldStop();
  1033. $xfer += $output->writeStructEnd();
  1034. return $xfer;
  1035. }
  1036. }
  1037. class AppService_removeById_result {
  1038. static $_TSPEC;
  1039. /**
  1040. * @var \OpenSearch\Generated\Common\OpenSearchResult
  1041. */
  1042. public $success = null;
  1043. /**
  1044. * @var \OpenSearch\Generated\Common\OpenSearchException
  1045. */
  1046. public $error = null;
  1047. /**
  1048. * @var \OpenSearch\Generated\Common\OpenSearchClientException
  1049. */
  1050. public $e = null;
  1051. public function __construct($vals=null) {
  1052. if (!isset(self::$_TSPEC)) {
  1053. self::$_TSPEC = array(
  1054. 0 => array(
  1055. 'var' => 'success',
  1056. 'type' => TType::STRUCT,
  1057. 'class' => '\OpenSearch\Generated\Common\OpenSearchResult',
  1058. ),
  1059. 1 => array(
  1060. 'var' => 'error',
  1061. 'type' => TType::STRUCT,
  1062. 'class' => '\OpenSearch\Generated\Common\OpenSearchException',
  1063. ),
  1064. 2 => array(
  1065. 'var' => 'e',
  1066. 'type' => TType::STRUCT,
  1067. 'class' => '\OpenSearch\Generated\Common\OpenSearchClientException',
  1068. ),
  1069. );
  1070. }
  1071. if (is_array($vals)) {
  1072. if (isset($vals['success'])) {
  1073. $this->success = $vals['success'];
  1074. }
  1075. if (isset($vals['error'])) {
  1076. $this->error = $vals['error'];
  1077. }
  1078. if (isset($vals['e'])) {
  1079. $this->e = $vals['e'];
  1080. }
  1081. }
  1082. }
  1083. public function getName() {
  1084. return 'AppService_removeById_result';
  1085. }
  1086. public function read($input)
  1087. {
  1088. $xfer = 0;
  1089. $fname = null;
  1090. $ftype = 0;
  1091. $fid = 0;
  1092. $xfer += $input->readStructBegin($fname);
  1093. while (true)
  1094. {
  1095. $xfer += $input->readFieldBegin($fname, $ftype, $fid);
  1096. if ($ftype == TType::STOP) {
  1097. break;
  1098. }
  1099. switch ($fid)
  1100. {
  1101. case 0:
  1102. if ($ftype == TType::STRUCT) {
  1103. $this->success = new \OpenSearch\Generated\Common\OpenSearchResult();
  1104. $xfer += $this->success->read($input);
  1105. } else {
  1106. $xfer += $input->skip($ftype);
  1107. }
  1108. break;
  1109. case 1:
  1110. if ($ftype == TType::STRUCT) {
  1111. $this->error = new \OpenSearch\Generated\Common\OpenSearchException();
  1112. $xfer += $this->error->read($input);
  1113. } else {
  1114. $xfer += $input->skip($ftype);
  1115. }
  1116. break;
  1117. case 2:
  1118. if ($ftype == TType::STRUCT) {
  1119. $this->e = new \OpenSearch\Generated\Common\OpenSearchClientException();
  1120. $xfer += $this->e->read($input);
  1121. } else {
  1122. $xfer += $input->skip($ftype);
  1123. }
  1124. break;
  1125. default:
  1126. $xfer += $input->skip($ftype);
  1127. break;
  1128. }
  1129. $xfer += $input->readFieldEnd();
  1130. }
  1131. $xfer += $input->readStructEnd();
  1132. return $xfer;
  1133. }
  1134. public function write($output) {
  1135. $xfer = 0;
  1136. $xfer += $output->writeStructBegin('AppService_removeById_result');
  1137. if ($this->success !== null) {
  1138. if (!is_object($this->success)) {
  1139. throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
  1140. }
  1141. $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
  1142. $xfer += $this->success->write($output);
  1143. $xfer += $output->writeFieldEnd();
  1144. }
  1145. if ($this->error !== null) {
  1146. $xfer += $output->writeFieldBegin('error', TType::STRUCT, 1);
  1147. $xfer += $this->error->write($output);
  1148. $xfer += $output->writeFieldEnd();
  1149. }
  1150. if ($this->e !== null) {
  1151. $xfer += $output->writeFieldBegin('e', TType::STRUCT, 2);
  1152. $xfer += $this->e->write($output);
  1153. $xfer += $output->writeFieldEnd();
  1154. }
  1155. $xfer += $output->writeFieldStop();
  1156. $xfer += $output->writeStructEnd();
  1157. return $xfer;
  1158. }
  1159. }
  1160. class AppService_updateById_args {
  1161. static $_TSPEC;
  1162. /**
  1163. * @var string
  1164. */
  1165. public $identity = null;
  1166. /**
  1167. * @var string
  1168. */
  1169. public $app = null;
  1170. public function __construct($vals=null) {
  1171. if (!isset(self::$_TSPEC)) {
  1172. self::$_TSPEC = array(
  1173. 1 => array(
  1174. 'var' => 'identity',
  1175. 'type' => TType::STRING,
  1176. ),
  1177. 2 => array(
  1178. 'var' => 'app',
  1179. 'type' => TType::STRING,
  1180. ),
  1181. );
  1182. }
  1183. if (is_array($vals)) {
  1184. if (isset($vals['identity'])) {
  1185. $this->identity = $vals['identity'];
  1186. }
  1187. if (isset($vals['app'])) {
  1188. $this->app = $vals['app'];
  1189. }
  1190. }
  1191. }
  1192. public function getName() {
  1193. return 'AppService_updateById_args';
  1194. }
  1195. public function read($input)
  1196. {
  1197. $xfer = 0;
  1198. $fname = null;
  1199. $ftype = 0;
  1200. $fid = 0;
  1201. $xfer += $input->readStructBegin($fname);
  1202. while (true)
  1203. {
  1204. $xfer += $input->readFieldBegin($fname, $ftype, $fid);
  1205. if ($ftype == TType::STOP) {
  1206. break;
  1207. }
  1208. switch ($fid)
  1209. {
  1210. case 1:
  1211. if ($ftype == TType::STRING) {
  1212. $xfer += $input->readString($this->identity);
  1213. } else {
  1214. $xfer += $input->skip($ftype);
  1215. }
  1216. break;
  1217. case 2:
  1218. if ($ftype == TType::STRING) {
  1219. $xfer += $input->readString($this->app);
  1220. } else {
  1221. $xfer += $input->skip($ftype);
  1222. }
  1223. break;
  1224. default:
  1225. $xfer += $input->skip($ftype);
  1226. break;
  1227. }
  1228. $xfer += $input->readFieldEnd();
  1229. }
  1230. $xfer += $input->readStructEnd();
  1231. return $xfer;
  1232. }
  1233. public function write($output) {
  1234. $xfer = 0;
  1235. $xfer += $output->writeStructBegin('AppService_updateById_args');
  1236. if ($this->identity !== null) {
  1237. $xfer += $output->writeFieldBegin('identity', TType::STRING, 1);
  1238. $xfer += $output->writeString($this->identity);
  1239. $xfer += $output->writeFieldEnd();
  1240. }
  1241. if ($this->app !== null) {
  1242. $xfer += $output->writeFieldBegin('app', TType::STRING, 2);
  1243. $xfer += $output->writeString($this->app);
  1244. $xfer += $output->writeFieldEnd();
  1245. }
  1246. $xfer += $output->writeFieldStop();
  1247. $xfer += $output->writeStructEnd();
  1248. return $xfer;
  1249. }
  1250. }
  1251. class AppService_updateById_result {
  1252. static $_TSPEC;
  1253. /**
  1254. * @var \OpenSearch\Generated\Common\OpenSearchResult
  1255. */
  1256. public $success = null;
  1257. /**
  1258. * @var \OpenSearch\Generated\Common\OpenSearchException
  1259. */
  1260. public $error = null;
  1261. /**
  1262. * @var \OpenSearch\Generated\Common\OpenSearchClientException
  1263. */
  1264. public $e = null;
  1265. public function __construct($vals=null) {
  1266. if (!isset(self::$_TSPEC)) {
  1267. self::$_TSPEC = array(
  1268. 0 => array(
  1269. 'var' => 'success',
  1270. 'type' => TType::STRUCT,
  1271. 'class' => '\OpenSearch\Generated\Common\OpenSearchResult',
  1272. ),
  1273. 1 => array(
  1274. 'var' => 'error',
  1275. 'type' => TType::STRUCT,
  1276. 'class' => '\OpenSearch\Generated\Common\OpenSearchException',
  1277. ),
  1278. 2 => array(
  1279. 'var' => 'e',
  1280. 'type' => TType::STRUCT,
  1281. 'class' => '\OpenSearch\Generated\Common\OpenSearchClientException',
  1282. ),
  1283. );
  1284. }
  1285. if (is_array($vals)) {
  1286. if (isset($vals['success'])) {
  1287. $this->success = $vals['success'];
  1288. }
  1289. if (isset($vals['error'])) {
  1290. $this->error = $vals['error'];
  1291. }
  1292. if (isset($vals['e'])) {
  1293. $this->e = $vals['e'];
  1294. }
  1295. }
  1296. }
  1297. public function getName() {
  1298. return 'AppService_updateById_result';
  1299. }
  1300. public function read($input)
  1301. {
  1302. $xfer = 0;
  1303. $fname = null;
  1304. $ftype = 0;
  1305. $fid = 0;
  1306. $xfer += $input->readStructBegin($fname);
  1307. while (true)
  1308. {
  1309. $xfer += $input->readFieldBegin($fname, $ftype, $fid);
  1310. if ($ftype == TType::STOP) {
  1311. break;
  1312. }
  1313. switch ($fid)
  1314. {
  1315. case 0:
  1316. if ($ftype == TType::STRUCT) {
  1317. $this->success = new \OpenSearch\Generated\Common\OpenSearchResult();
  1318. $xfer += $this->success->read($input);
  1319. } else {
  1320. $xfer += $input->skip($ftype);
  1321. }
  1322. break;
  1323. case 1:
  1324. if ($ftype == TType::STRUCT) {
  1325. $this->error = new \OpenSearch\Generated\Common\OpenSearchException();
  1326. $xfer += $this->error->read($input);
  1327. } else {
  1328. $xfer += $input->skip($ftype);
  1329. }
  1330. break;
  1331. case 2:
  1332. if ($ftype == TType::STRUCT) {
  1333. $this->e = new \OpenSearch\Generated\Common\OpenSearchClientException();
  1334. $xfer += $this->e->read($input);
  1335. } else {
  1336. $xfer += $input->skip($ftype);
  1337. }
  1338. break;
  1339. default:
  1340. $xfer += $input->skip($ftype);
  1341. break;
  1342. }
  1343. $xfer += $input->readFieldEnd();
  1344. }
  1345. $xfer += $input->readStructEnd();
  1346. return $xfer;
  1347. }
  1348. public function write($output) {
  1349. $xfer = 0;
  1350. $xfer += $output->writeStructBegin('AppService_updateById_result');
  1351. if ($this->success !== null) {
  1352. if (!is_object($this->success)) {
  1353. throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
  1354. }
  1355. $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
  1356. $xfer += $this->success->write($output);
  1357. $xfer += $output->writeFieldEnd();
  1358. }
  1359. if ($this->error !== null) {
  1360. $xfer += $output->writeFieldBegin('error', TType::STRUCT, 1);
  1361. $xfer += $this->error->write($output);
  1362. $xfer += $output->writeFieldEnd();
  1363. }
  1364. if ($this->e !== null) {
  1365. $xfer += $output->writeFieldBegin('e', TType::STRUCT, 2);
  1366. $xfer += $this->e->write($output);
  1367. $xfer += $output->writeFieldEnd();
  1368. }
  1369. $xfer += $output->writeFieldStop();
  1370. $xfer += $output->writeStructEnd();
  1371. return $xfer;
  1372. }
  1373. }
  1374. class AppService_reindexById_args {
  1375. static $_TSPEC;
  1376. /**
  1377. * @var string
  1378. */
  1379. public $identity = null;
  1380. public function __construct($vals=null) {
  1381. if (!isset(self::$_TSPEC)) {
  1382. self::$_TSPEC = array(
  1383. 1 => array(
  1384. 'var' => 'identity',
  1385. 'type' => TType::STRING,
  1386. ),
  1387. );
  1388. }
  1389. if (is_array($vals)) {
  1390. if (isset($vals['identity'])) {
  1391. $this->identity = $vals['identity'];
  1392. }
  1393. }
  1394. }
  1395. public function getName() {
  1396. return 'AppService_reindexById_args';
  1397. }
  1398. public function read($input)
  1399. {
  1400. $xfer = 0;
  1401. $fname = null;
  1402. $ftype = 0;
  1403. $fid = 0;
  1404. $xfer += $input->readStructBegin($fname);
  1405. while (true)
  1406. {
  1407. $xfer += $input->readFieldBegin($fname, $ftype, $fid);
  1408. if ($ftype == TType::STOP) {
  1409. break;
  1410. }
  1411. switch ($fid)
  1412. {
  1413. case 1:
  1414. if ($ftype == TType::STRING) {
  1415. $xfer += $input->readString($this->identity);
  1416. } else {
  1417. $xfer += $input->skip($ftype);
  1418. }
  1419. break;
  1420. default:
  1421. $xfer += $input->skip($ftype);
  1422. break;
  1423. }
  1424. $xfer += $input->readFieldEnd();
  1425. }
  1426. $xfer += $input->readStructEnd();
  1427. return $xfer;
  1428. }
  1429. public function write($output) {
  1430. $xfer = 0;
  1431. $xfer += $output->writeStructBegin('AppService_reindexById_args');
  1432. if ($this->identity !== null) {
  1433. $xfer += $output->writeFieldBegin('identity', TType::STRING, 1);
  1434. $xfer += $output->writeString($this->identity);
  1435. $xfer += $output->writeFieldEnd();
  1436. }
  1437. $xfer += $output->writeFieldStop();
  1438. $xfer += $output->writeStructEnd();
  1439. return $xfer;
  1440. }
  1441. }
  1442. class AppService_reindexById_result {
  1443. static $_TSPEC;
  1444. /**
  1445. * @var \OpenSearch\Generated\Common\OpenSearchResult
  1446. */
  1447. public $success = null;
  1448. /**
  1449. * @var \OpenSearch\Generated\Common\OpenSearchException
  1450. */
  1451. public $error = null;
  1452. /**
  1453. * @var \OpenSearch\Generated\Common\OpenSearchClientException
  1454. */
  1455. public $e = null;
  1456. public function __construct($vals=null) {
  1457. if (!isset(self::$_TSPEC)) {
  1458. self::$_TSPEC = array(
  1459. 0 => array(
  1460. 'var' => 'success',
  1461. 'type' => TType::STRUCT,
  1462. 'class' => '\OpenSearch\Generated\Common\OpenSearchResult',
  1463. ),
  1464. 1 => array(
  1465. 'var' => 'error',
  1466. 'type' => TType::STRUCT,
  1467. 'class' => '\OpenSearch\Generated\Common\OpenSearchException',
  1468. ),
  1469. 2 => array(
  1470. 'var' => 'e',
  1471. 'type' => TType::STRUCT,
  1472. 'class' => '\OpenSearch\Generated\Common\OpenSearchClientException',
  1473. ),
  1474. );
  1475. }
  1476. if (is_array($vals)) {
  1477. if (isset($vals['success'])) {
  1478. $this->success = $vals['success'];
  1479. }
  1480. if (isset($vals['error'])) {
  1481. $this->error = $vals['error'];
  1482. }
  1483. if (isset($vals['e'])) {
  1484. $this->e = $vals['e'];
  1485. }
  1486. }
  1487. }
  1488. public function getName() {
  1489. return 'AppService_reindexById_result';
  1490. }
  1491. public function read($input)
  1492. {
  1493. $xfer = 0;
  1494. $fname = null;
  1495. $ftype = 0;
  1496. $fid = 0;
  1497. $xfer += $input->readStructBegin($fname);
  1498. while (true)
  1499. {
  1500. $xfer += $input->readFieldBegin($fname, $ftype, $fid);
  1501. if ($ftype == TType::STOP) {
  1502. break;
  1503. }
  1504. switch ($fid)
  1505. {
  1506. case 0:
  1507. if ($ftype == TType::STRUCT) {
  1508. $this->success = new \OpenSearch\Generated\Common\OpenSearchResult();
  1509. $xfer += $this->success->read($input);
  1510. } else {
  1511. $xfer += $input->skip($ftype);
  1512. }
  1513. break;
  1514. case 1:
  1515. if ($ftype == TType::STRUCT) {
  1516. $this->error = new \OpenSearch\Generated\Common\OpenSearchException();
  1517. $xfer += $this->error->read($input);
  1518. } else {
  1519. $xfer += $input->skip($ftype);
  1520. }
  1521. break;
  1522. case 2:
  1523. if ($ftype == TType::STRUCT) {
  1524. $this->e = new \OpenSearch\Generated\Common\OpenSearchClientException();
  1525. $xfer += $this->e->read($input);
  1526. } else {
  1527. $xfer += $input->skip($ftype);
  1528. }
  1529. break;
  1530. default:
  1531. $xfer += $input->skip($ftype);
  1532. break;
  1533. }
  1534. $xfer += $input->readFieldEnd();
  1535. }
  1536. $xfer += $input->readStructEnd();
  1537. return $xfer;
  1538. }
  1539. public function write($output) {
  1540. $xfer = 0;
  1541. $xfer += $output->writeStructBegin('AppService_reindexById_result');
  1542. if ($this->success !== null) {
  1543. if (!is_object($this->success)) {
  1544. throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
  1545. }
  1546. $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
  1547. $xfer += $this->success->write($output);
  1548. $xfer += $output->writeFieldEnd();
  1549. }
  1550. if ($this->error !== null) {
  1551. $xfer += $output->writeFieldBegin('error', TType::STRUCT, 1);
  1552. $xfer += $this->error->write($output);
  1553. $xfer += $output->writeFieldEnd();
  1554. }
  1555. if ($this->e !== null) {
  1556. $xfer += $output->writeFieldBegin('e', TType::STRUCT, 2);
  1557. $xfer += $this->e->write($output);
  1558. $xfer += $output->writeFieldEnd();
  1559. }
  1560. $xfer += $output->writeFieldStop();
  1561. $xfer += $output->writeStructEnd();
  1562. return $xfer;
  1563. }
  1564. }
  1565. class AppServiceProcessor {
  1566. protected $handler_ = null;
  1567. public function __construct($handler) {
  1568. $this->handler_ = $handler;
  1569. }
  1570. public function process($input, $output) {
  1571. $rseqid = 0;
  1572. $fname = null;
  1573. $mtype = 0;
  1574. $input->readMessageBegin($fname, $mtype, $rseqid);
  1575. $methodname = 'process_'.$fname;
  1576. if (!method_exists($this, $methodname)) {
  1577. $input->skip(TType::STRUCT);
  1578. $input->readMessageEnd();
  1579. $x = new TApplicationException('Function '.$fname.' not implemented.', TApplicationException::UNKNOWN_METHOD);
  1580. $output->writeMessageBegin($fname, TMessageType::EXCEPTION, $rseqid);
  1581. $x->write($output);
  1582. $output->writeMessageEnd();
  1583. $output->getTransport()->flush();
  1584. return;
  1585. }
  1586. $this->$methodname($rseqid, $input, $output);
  1587. return true;
  1588. }
  1589. protected function process_save($seqid, $input, $output) {
  1590. $args = new \OpenSearch\Generated\App\AppService_save_args();
  1591. $args->read($input);
  1592. $input->readMessageEnd();
  1593. $result = new \OpenSearch\Generated\App\AppService_save_result();
  1594. try {
  1595. $result->success = $this->handler_->save($args->app);
  1596. } catch (\OpenSearch\Generated\Common\OpenSearchException $error) {
  1597. $result->error = $error;
  1598. } catch (\OpenSearch\Generated\Common\OpenSearchClientException $e) {
  1599. $result->e = $e;
  1600. }
  1601. $bin_accel = ($output instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
  1602. if ($bin_accel)
  1603. {
  1604. thrift_protocol_write_binary($output, 'save', TMessageType::REPLY, $result, $seqid, $output->isStrictWrite());
  1605. }
  1606. else
  1607. {
  1608. $output->writeMessageBegin('save', TMessageType::REPLY, $seqid);
  1609. $result->write($output);
  1610. $output->writeMessageEnd();
  1611. $output->getTransport()->flush();
  1612. }
  1613. }
  1614. protected function process_getById($seqid, $input, $output) {
  1615. $args = new \OpenSearch\Generated\App\AppService_getById_args();
  1616. $args->read($input);
  1617. $input->readMessageEnd();
  1618. $result = new \OpenSearch\Generated\App\AppService_getById_result();
  1619. try {
  1620. $result->success = $this->handler_->getById($args->identity);
  1621. } catch (\OpenSearch\Generated\Common\OpenSearchException $error) {
  1622. $result->error = $error;
  1623. } catch (\OpenSearch\Generated\Common\OpenSearchClientException $e) {
  1624. $result->e = $e;
  1625. }
  1626. $bin_accel = ($output instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
  1627. if ($bin_accel)
  1628. {
  1629. thrift_protocol_write_binary($output, 'getById', TMessageType::REPLY, $result, $seqid, $output->isStrictWrite());
  1630. }
  1631. else
  1632. {
  1633. $output->writeMessageBegin('getById', TMessageType::REPLY, $seqid);
  1634. $result->write($output);
  1635. $output->writeMessageEnd();
  1636. $output->getTransport()->flush();
  1637. }
  1638. }
  1639. protected function process_listAll($seqid, $input, $output) {
  1640. $args = new \OpenSearch\Generated\App\AppService_listAll_args();
  1641. $args->read($input);
  1642. $input->readMessageEnd();
  1643. $result = new \OpenSearch\Generated\App\AppService_listAll_result();
  1644. try {
  1645. $result->success = $this->handler_->listAll($args->pageable);
  1646. } catch (\OpenSearch\Generated\Common\OpenSearchException $error) {
  1647. $result->error = $error;
  1648. } catch (\OpenSearch\Generated\Common\OpenSearchClientException $e) {
  1649. $result->e = $e;
  1650. }
  1651. $bin_accel = ($output instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
  1652. if ($bin_accel)
  1653. {
  1654. thrift_protocol_write_binary($output, 'listAll', TMessageType::REPLY, $result, $seqid, $output->isStrictWrite());
  1655. }
  1656. else
  1657. {
  1658. $output->writeMessageBegin('listAll', TMessageType::REPLY, $seqid);
  1659. $result->write($output);
  1660. $output->writeMessageEnd();
  1661. $output->getTransport()->flush();
  1662. }
  1663. }
  1664. protected function process_removeById($seqid, $input, $output) {
  1665. $args = new \OpenSearch\Generated\App\AppService_removeById_args();
  1666. $args->read($input);
  1667. $input->readMessageEnd();
  1668. $result = new \OpenSearch\Generated\App\AppService_removeById_result();
  1669. try {
  1670. $result->success = $this->handler_->removeById($args->identity);
  1671. } catch (\OpenSearch\Generated\Common\OpenSearchException $error) {
  1672. $result->error = $error;
  1673. } catch (\OpenSearch\Generated\Common\OpenSearchClientException $e) {
  1674. $result->e = $e;
  1675. }
  1676. $bin_accel = ($output instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
  1677. if ($bin_accel)
  1678. {
  1679. thrift_protocol_write_binary($output, 'removeById', TMessageType::REPLY, $result, $seqid, $output->isStrictWrite());
  1680. }
  1681. else
  1682. {
  1683. $output->writeMessageBegin('removeById', TMessageType::REPLY, $seqid);
  1684. $result->write($output);
  1685. $output->writeMessageEnd();
  1686. $output->getTransport()->flush();
  1687. }
  1688. }
  1689. protected function process_updateById($seqid, $input, $output) {
  1690. $args = new \OpenSearch\Generated\App\AppService_updateById_args();
  1691. $args->read($input);
  1692. $input->readMessageEnd();
  1693. $result = new \OpenSearch\Generated\App\AppService_updateById_result();
  1694. try {
  1695. $result->success = $this->handler_->updateById($args->identity, $args->app);
  1696. } catch (\OpenSearch\Generated\Common\OpenSearchException $error) {
  1697. $result->error = $error;
  1698. } catch (\OpenSearch\Generated\Common\OpenSearchClientException $e) {
  1699. $result->e = $e;
  1700. }
  1701. $bin_accel = ($output instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
  1702. if ($bin_accel)
  1703. {
  1704. thrift_protocol_write_binary($output, 'updateById', TMessageType::REPLY, $result, $seqid, $output->isStrictWrite());
  1705. }
  1706. else
  1707. {
  1708. $output->writeMessageBegin('updateById', TMessageType::REPLY, $seqid);
  1709. $result->write($output);
  1710. $output->writeMessageEnd();
  1711. $output->getTransport()->flush();
  1712. }
  1713. }
  1714. protected function process_reindexById($seqid, $input, $output) {
  1715. $args = new \OpenSearch\Generated\App\AppService_reindexById_args();
  1716. $args->read($input);
  1717. $input->readMessageEnd();
  1718. $result = new \OpenSearch\Generated\App\AppService_reindexById_result();
  1719. try {
  1720. $result->success = $this->handler_->reindexById($args->identity);
  1721. } catch (\OpenSearch\Generated\Common\OpenSearchException $error) {
  1722. $result->error = $error;
  1723. } catch (\OpenSearch\Generated\Common\OpenSearchClientException $e) {
  1724. $result->e = $e;
  1725. }
  1726. $bin_accel = ($output instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
  1727. if ($bin_accel)
  1728. {
  1729. thrift_protocol_write_binary($output, 'reindexById', TMessageType::REPLY, $result, $seqid, $output->isStrictWrite());
  1730. }
  1731. else
  1732. {
  1733. $output->writeMessageBegin('reindexById', TMessageType::REPLY, $seqid);
  1734. $result->write($output);
  1735. $output->writeMessageEnd();
  1736. $output->getTransport()->flush();
  1737. }
  1738. }
  1739. }