1: | <?php |
2: | /** |
3: | * ApiException |
4: | * PHP version 7.4 |
5: | * |
6: | * @category Class |
7: | * @package Ally\PetStore |
8: | * @author OpenAPI Generator team |
9: | * @link https://openapi-generator.tech |
10: | */ |
11: | |
12: | /** |
13: | * OpenAPI Petstore |
14: | * |
15: | * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. |
16: | * |
17: | * The version of the OpenAPI document: 1.0.0 |
18: | * Generated by: https://openapi-generator.tech |
19: | * OpenAPI Generator version: 6.1.0-SNAPSHOT |
20: | */ |
21: | |
22: | /** |
23: | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
24: | * https://openapi-generator.tech |
25: | * Do not edit the class manually. |
26: | */ |
27: | |
28: | namespace Ally\PetStore; |
29: | |
30: | use \Exception; |
31: | |
32: | /** |
33: | * ApiException Class Doc Comment |
34: | * |
35: | * @category Class |
36: | * @package Ally\PetStore |
37: | * @author OpenAPI Generator team |
38: | * @link https://openapi-generator.tech |
39: | */ |
40: | class ApiException extends Exception |
41: | { |
42: | /** |
43: | * The HTTP body of the server response either as Json or string. |
44: | * |
45: | * @var \stdClass|string|null |
46: | */ |
47: | protected $responseBody; |
48: | |
49: | /** |
50: | * The HTTP header of the server response. |
51: | * |
52: | * @var string[]|null |
53: | */ |
54: | protected $responseHeaders; |
55: | |
56: | /** |
57: | * The deserialized response object |
58: | * |
59: | * @var \stdClass|string|null |
60: | */ |
61: | protected $responseObject; |
62: | |
63: | /** |
64: | * Constructor |
65: | * |
66: | * @param string $message Error message |
67: | * @param int $code HTTP status code |
68: | * @param string[]|null $responseHeaders HTTP response header |
69: | * @param \stdClass|string|null $responseBody HTTP decoded body of the server response either as \stdClass or string |
70: | */ |
71: | public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) |
72: | { |
73: | parent::__construct($message, $code); |
74: | $this->responseHeaders = $responseHeaders; |
75: | $this->responseBody = $responseBody; |
76: | } |
77: | |
78: | /** |
79: | * Gets the HTTP response header |
80: | * |
81: | * @return string[]|null HTTP response header |
82: | */ |
83: | public function getResponseHeaders() |
84: | { |
85: | return $this->responseHeaders; |
86: | } |
87: | |
88: | /** |
89: | * Gets the HTTP body of the server response either as Json or string |
90: | * |
91: | * @return \stdClass|string|null HTTP body of the server response either as \stdClass or string |
92: | */ |
93: | public function getResponseBody() |
94: | { |
95: | return $this->responseBody; |
96: | } |
97: | |
98: | /** |
99: | * Sets the deserialized response object (during deserialization) |
100: | * |
101: | * @param mixed $obj Deserialized response object |
102: | * |
103: | * @return void |
104: | */ |
105: | public function setResponseObject($obj) |
106: | { |
107: | $this->responseObject = $obj; |
108: | } |
109: | |
110: | /** |
111: | * Gets the deserialized response object (during deserialization) |
112: | * |
113: | * @return mixed the deserialized response object |
114: | */ |
115: | public function getResponseObject() |
116: | { |
117: | return $this->responseObject; |
118: | } |
119: | } |
120: |