GetActualStorageInfoResponse.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <?php
  2. /*
  3. * Copyright (c) 2008-2016 vip.com, All Rights Reserved.
  4. *
  5. * Powered by com.vip.osp.osp-idlc-2.5.11.
  6. *
  7. */
  8. namespace vipapis\delivery;
  9. class GetActualStorageInfoResponse {
  10. static $_TSPEC;
  11. public $storage_no = null;
  12. public $storage_time = null;
  13. public $total = null;
  14. public $actual_storage_list = null;
  15. public function __construct($vals=null){
  16. if (!isset(self::$_TSPEC)){
  17. self::$_TSPEC = array(
  18. 1 => array(
  19. 'var' => 'storage_no'
  20. ),
  21. 2 => array(
  22. 'var' => 'storage_time'
  23. ),
  24. 3 => array(
  25. 'var' => 'total'
  26. ),
  27. 4 => array(
  28. 'var' => 'actual_storage_list'
  29. ),
  30. );
  31. }
  32. if (is_array($vals)){
  33. if (isset($vals['storage_no'])){
  34. $this->storage_no = $vals['storage_no'];
  35. }
  36. if (isset($vals['storage_time'])){
  37. $this->storage_time = $vals['storage_time'];
  38. }
  39. if (isset($vals['total'])){
  40. $this->total = $vals['total'];
  41. }
  42. if (isset($vals['actual_storage_list'])){
  43. $this->actual_storage_list = $vals['actual_storage_list'];
  44. }
  45. }
  46. }
  47. public function getName(){
  48. return 'GetActualStorageInfoResponse';
  49. }
  50. public function read($input){
  51. $input->readStructBegin();
  52. while(true){
  53. $schemeField = $input->readFieldBegin();
  54. if ($schemeField == null) break;
  55. $needSkip = true;
  56. if ("storage_no" == $schemeField){
  57. $needSkip = false;
  58. $input->readString($this->storage_no);
  59. }
  60. if ("storage_time" == $schemeField){
  61. $needSkip = false;
  62. $input->readString($this->storage_time);
  63. }
  64. if ("total" == $schemeField){
  65. $needSkip = false;
  66. $input->readI32($this->total);
  67. }
  68. if ("actual_storage_list" == $schemeField){
  69. $needSkip = false;
  70. $this->actual_storage_list = array();
  71. $_size0 = 0;
  72. $input->readListBegin();
  73. while(true){
  74. try{
  75. $elem0 = null;
  76. $elem0 = new \vipapis\delivery\ActualStorageInfo();
  77. $elem0->read($input);
  78. $this->actual_storage_list[$_size0++] = $elem0;
  79. }
  80. catch(\Exception $e){
  81. break;
  82. }
  83. }
  84. $input->readListEnd();
  85. }
  86. if($needSkip){
  87. \Osp\Protocol\ProtocolUtil::skip($input);
  88. }
  89. $input->readFieldEnd();
  90. }
  91. $input->readStructEnd();
  92. }
  93. public function write($output){
  94. $xfer = 0;
  95. $xfer += $output->writeStructBegin();
  96. if($this->storage_no !== null) {
  97. $xfer += $output->writeFieldBegin('storage_no');
  98. $xfer += $output->writeString($this->storage_no);
  99. $xfer += $output->writeFieldEnd();
  100. }
  101. if($this->storage_time !== null) {
  102. $xfer += $output->writeFieldBegin('storage_time');
  103. $xfer += $output->writeString($this->storage_time);
  104. $xfer += $output->writeFieldEnd();
  105. }
  106. if($this->total !== null) {
  107. $xfer += $output->writeFieldBegin('total');
  108. $xfer += $output->writeI32($this->total);
  109. $xfer += $output->writeFieldEnd();
  110. }
  111. if($this->actual_storage_list !== null) {
  112. $xfer += $output->writeFieldBegin('actual_storage_list');
  113. if (!is_array($this->actual_storage_list)){
  114. throw new \Osp\Exception\OspException('Bad type in structure.', \Osp\Exception\OspException::INVALID_DATA);
  115. }
  116. $output->writeListBegin();
  117. foreach ($this->actual_storage_list as $iter0){
  118. if (!is_object($iter0)) {
  119. throw new \Osp\Exception\OspException('Bad type in structure.', \Osp\Exception\OspException::INVALID_DATA);
  120. }
  121. $xfer += $iter0->write($output);
  122. }
  123. $output->writeListEnd();
  124. $xfer += $output->writeFieldEnd();
  125. }
  126. $xfer += $output->writeFieldStop();
  127. $xfer += $output->writeStructEnd();
  128. return $xfer;
  129. }
  130. }
  131. ?>