DescribeUPhoneJobResponse.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /**
  3. * Copyright 2022 UCloud Technology Co., Ltd.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. namespace UCloud\UPhone\Apis;
  18. use UCloud\Core\Response\Response;
  19. use UCloud\UPhone\Models\Job;
  20. use UCloud\UPhone\Models\Task;
  21. class DescribeUPhoneJobResponse extends Response
  22. {
  23. /**
  24. * Jobs: Job信息,详情见数据结构Job(如果Status为等待中,此字段为空)
  25. *
  26. * @return Job[]|null
  27. */
  28. public function getJobs()
  29. {
  30. $items = $this->get("Jobs");
  31. if ($items == null) {
  32. return [];
  33. }
  34. $result = [];
  35. foreach ($items as $i => $item) {
  36. array_push($result, new Job($item));
  37. }
  38. return $result;
  39. }
  40. /**
  41. * Jobs: Job信息,详情见数据结构Job(如果Status为等待中,此字段为空)
  42. *
  43. * @param Job[] $jobs
  44. */
  45. public function setJobs(array $jobs)
  46. {
  47. $result = [];
  48. foreach ($jobs as $i => $item) {
  49. array_push($result, $item->getAll());
  50. }
  51. return $result;
  52. }
  53. /**
  54. * TotalCount: Job总数
  55. *
  56. * @return integer|null
  57. */
  58. public function getTotalCount()
  59. {
  60. return $this->get("TotalCount");
  61. }
  62. /**
  63. * TotalCount: Job总数
  64. *
  65. * @param int $totalCount
  66. */
  67. public function setTotalCount($totalCount)
  68. {
  69. $this->set("TotalCount", $totalCount);
  70. }
  71. }