TargetModel.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php
  2. // This file is auto-generated, don't edit it. Thanks.
  3. namespace AlibabaCloud\OpenApiUtil\Tests\Models;
  4. use AlibabaCloud\Tea\Model;
  5. use GuzzleHttp\Psr7\Stream;
  6. class TargetModel extends Model {
  7. protected $_name = [
  8. 'test' => 'Test',
  9. 'empty' => 'empty',
  10. 'body' => 'body',
  11. 'list' => 'list',
  12. ];
  13. public function validate() {}
  14. public function toMap() {
  15. $res = [];
  16. if (null !== $this->test) {
  17. $res['Test'] = $this->test;
  18. }
  19. if (null !== $this->empty) {
  20. $res['empty'] = $this->empty;
  21. }
  22. if (null !== $this->body) {
  23. $res['body'] = $this->body;
  24. }
  25. if (null !== $this->list) {
  26. $res['list'] = $this->list;
  27. }
  28. if (null !== $this->urlList) {
  29. $res['urlList'] = [];
  30. if(null !== $this->urlList && is_array($this->urlList)){
  31. $n = 0;
  32. foreach($this->urlList as $item){
  33. $res['urlList'][$n++] = null !== $item ? $item->toMap() : $item;
  34. }
  35. }
  36. }
  37. return $res;
  38. }
  39. /**
  40. * @param array $map
  41. * @return TargetModel
  42. */
  43. public static function fromMap($map = []) {
  44. $model = new self();
  45. if(isset($map['Test'])){
  46. $model->test = $map['Test'];
  47. }
  48. if(isset($map['empty'])){
  49. $model->empty = $map['empty'];
  50. }
  51. if(isset($map['body'])){
  52. $model->body = $map['body'];
  53. }
  54. if(isset($map['list'])){
  55. if(!empty($map['list'])){
  56. $model->list = $map['list'];
  57. }
  58. }
  59. if(isset($map['urlList'])){
  60. if(!empty($map['urlList'])){
  61. $model->urlList = [];
  62. $n = 0;
  63. foreach($map['urlList'] as $item) {
  64. $model->urlList[$n++] = null !== $item ? urlList::fromMap($item) : $item;
  65. }
  66. }
  67. }
  68. return $model;
  69. }
  70. /**
  71. * @var string
  72. */
  73. public $test;
  74. /**
  75. * @var float
  76. */
  77. public $empty;
  78. /**
  79. * @var Stream
  80. */
  81. public $body;
  82. /**
  83. * @var string[]
  84. */
  85. public $list;
  86. public $urlList;
  87. }
  88. class urlList extends Model {
  89. protected $_name = [
  90. 'url' => 'url',
  91. ];
  92. public function validate() {}
  93. public function toMap() {
  94. $res = [];
  95. if (null !== $this->url) {
  96. $res['url'] = $this->url;
  97. }
  98. return $res;
  99. }
  100. /**
  101. * @param array $map
  102. * @return urlList
  103. */
  104. public static function fromMap($map = []) {
  105. $model = new self();
  106. if(isset($map['url'])){
  107. $model->url = $map['url'];
  108. }
  109. return $model;
  110. }
  111. /**
  112. * @var string
  113. */
  114. public $url;
  115. }