BatchGetLogsResponse.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /**
  3. * Copyright (C) Alibaba Cloud Computing
  4. * All rights reserved
  5. */
  6. require_once realpath(dirname(__FILE__) . '/Response.php');
  7. require_once realpath ( dirname ( __FILE__ ) . '/../sls.proto.php' );
  8. require_once realpath ( dirname ( __FILE__ ) . '/../protocolbuffers.inc.php' );
  9. /**
  10. * The response of the GetLog API from log service.
  11. *
  12. * @author log service dev
  13. */
  14. class Aliyun_Log_Models_BatchGetLogsResponse extends Aliyun_Log_Models_Response {
  15. /**
  16. * @var array compressed Loggroup array
  17. */
  18. private $logPackageList;
  19. private $nextCursor;
  20. /**
  21. * Aliyun_Log_Models_BatchGetLogsResponse constructor
  22. *
  23. * @param array $resp
  24. * GetLogs HTTP response body
  25. * @param array $header
  26. * GetLogs HTTP response header
  27. */
  28. public function __construct($resp, $header) {
  29. parent::__construct ( $header );
  30. $this->logPackageList = $resp->getLogGroupListArray();
  31. $this->nextCursor = (isset($header['x-log-cursor']))?$header['x-log-cursor']:null;
  32. }
  33. public function getLogPackageList(){
  34. return $this->logPackageList;
  35. }
  36. public function getNextCursor(){
  37. return $this->nextCursor;
  38. }
  39. public function getCount() {
  40. return count($this->logPackageList);
  41. }
  42. public function getLogPackage($index){
  43. if($index<$this->getCount()){
  44. return $this->logPackageList[$index];
  45. }
  46. else{
  47. throw new OutOfBoundsException('Index must less than size of logPackageList');
  48. }
  49. }
  50. public function getLogGroupList(){
  51. return $this->logPackageList;
  52. }
  53. public function getLogGroup($index){
  54. if($index<$this->getCount()){
  55. return $this->logPackageList[$index];
  56. }
  57. else{
  58. throw new OutOfBoundsException('Index must less than size of logPackageList');
  59. }
  60. }
  61. }