ApiException.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <?php
  2. /**
  3. * ApiException
  4. * PHP version 8.1
  5. *
  6. * @category Class
  7. * @package WikipaliApi
  8. * @author OpenAPI Generator team
  9. * @link https://openapi-generator.tech
  10. */
  11. /**
  12. * MINT API
  13. *
  14. * International Academy Of Pali Tipitaka(国际巴利三藏学院) 由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
  15. *
  16. * The version of the OpenAPI document: 2026.10.15
  17. * Generated by: https://openapi-generator.tech
  18. * Generator version: 7.25.0
  19. */
  20. /**
  21. * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
  22. * https://openapi-generator.tech
  23. * Do not edit the class manually.
  24. */
  25. namespace WikipaliApi;
  26. use \Exception;
  27. /**
  28. * ApiException Class Doc Comment
  29. *
  30. * @category Class
  31. * @package WikipaliApi
  32. * @author OpenAPI Generator team
  33. * @link https://openapi-generator.tech
  34. */
  35. class ApiException extends Exception
  36. {
  37. /**
  38. * The HTTP body of the server response either as Json or string.
  39. *
  40. * @var \stdClass|string|null
  41. */
  42. protected $responseBody;
  43. /**
  44. * The HTTP header of the server response.
  45. *
  46. * @var string[][]|null
  47. */
  48. protected $responseHeaders;
  49. /**
  50. * The deserialized response object
  51. *
  52. * @var \stdClass|string|null
  53. */
  54. protected $responseObject;
  55. /**
  56. * Constructor
  57. *
  58. * @param string $message Error message
  59. * @param int $code HTTP status code
  60. * @param string[][]|null $responseHeaders HTTP response header
  61. * @param \stdClass|string|null $responseBody HTTP decoded body of the server response either as \stdClass or string
  62. */
  63. public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null)
  64. {
  65. parent::__construct($message, $code);
  66. $this->responseHeaders = $responseHeaders;
  67. $this->responseBody = $responseBody;
  68. }
  69. /**
  70. * Gets the HTTP response header
  71. *
  72. * @return string[][]|null HTTP response header
  73. */
  74. public function getResponseHeaders()
  75. {
  76. return $this->responseHeaders;
  77. }
  78. /**
  79. * Gets the HTTP body of the server response either as Json or string
  80. *
  81. * @return \stdClass|string|null HTTP body of the server response either as \stdClass or string
  82. */
  83. public function getResponseBody()
  84. {
  85. return $this->responseBody;
  86. }
  87. /**
  88. * Sets the deserialized response object (during deserialization)
  89. *
  90. * @param mixed $obj Deserialized response object
  91. *
  92. * @return void
  93. */
  94. public function setResponseObject($obj)
  95. {
  96. $this->responseObject = $obj;
  97. }
  98. /**
  99. * Gets the deserialized response object (during deserialization)
  100. *
  101. * @return mixed the deserialized response object
  102. */
  103. public function getResponseObject()
  104. {
  105. return $this->responseObject;
  106. }
  107. }