| 1 |
<?php |
| 2 |
/** |
| 3 |
* ApiException |
| 4 |
* PHP version 7.4 |
| 5 |
* |
| 6 |
* @category Class |
| 7 |
* @package Plausible\Analytics\WP\Client |
| 8 |
* @author OpenAPI Generator team |
| 9 |
* @link https://openapi-generator.tech |
| 10 |
*/ |
| 11 |
|
| 12 |
/** |
| 13 |
* Plausible Plugins API |
| 14 |
* |
| 15 |
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) |
| 16 |
* |
| 17 |
* The version of the OpenAPI document: 1.0-rc |
| 18 |
* Generated by: https://openapi-generator.tech |
| 19 |
* OpenAPI Generator version: 7.0.1 |
| 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 Plausible\Analytics\WP\Client; |
| 29 |
|
| 30 |
use \Exception; |
| 31 |
|
| 32 |
/** |
| 33 |
* ApiException Class Doc Comment |
| 34 |
* |
| 35 |
* @category Class |
| 36 |
* @package Plausible\Analytics\WP\Client |
| 37 |
* @author OpenAPI Generator team |
| 38 |
* @link https://openapi-generator.tech |
| 39 |
*/ |
| 40 |
class ApiException extends Exception { |
| 41 |
/** |
| 42 |
* The HTTP body of the server response either as Json or string. |
| 43 |
* |
| 44 |
* @var \stdClass|string|null |
| 45 |
*/ |
| 46 |
protected $responseBody; |
| 47 |
|
| 48 |
/** |
| 49 |
* The HTTP header of the server response. |
| 50 |
* |
| 51 |
* @var string[]|null |
| 52 |
*/ |
| 53 |
protected $responseHeaders; |
| 54 |
|
| 55 |
/** |
| 56 |
* The deserialized response object |
| 57 |
* |
| 58 |
* @var \stdClass|string|null |
| 59 |
*/ |
| 60 |
protected $responseObject; |
| 61 |
|
| 62 |
/** |
| 63 |
* Constructor |
| 64 |
* |
| 65 |
* @param string $message Error message |
| 66 |
* @param int $code HTTP status code |
| 67 |
* @param string[]|null $responseHeaders HTTP response header |
| 68 |
* @param \stdClass|string|null $responseBody HTTP decoded body of the server response either as \stdClass or string |
| 69 |
*/ |
| 70 |
public function __construct( $message = "", $code = 0, $responseHeaders = [], $responseBody = null ) { |
| 71 |
parent::__construct( $message, $code ); |
| 72 |
$this->responseHeaders = $responseHeaders; |
| 73 |
$this->responseBody = $responseBody; |
| 74 |
} |
| 75 |
|
| 76 |
/** |
| 77 |
* Gets the HTTP response header |
| 78 |
* |
| 79 |
* @return string[]|null HTTP response header |
| 80 |
*/ |
| 81 |
public function getResponseHeaders() { |
| 82 |
return $this->responseHeaders; |
| 83 |
} |
| 84 |
|
| 85 |
/** |
| 86 |
* Gets the HTTP body of the server response either as Json or string |
| 87 |
* |
| 88 |
* @return \stdClass|string|null HTTP body of the server response either as \stdClass or string |
| 89 |
*/ |
| 90 |
public function getResponseBody() { |
| 91 |
return $this->responseBody; |
| 92 |
} |
| 93 |
|
| 94 |
/** |
| 95 |
* Sets the deserialized response object (during deserialization) |
| 96 |
* |
| 97 |
* @param mixed $obj Deserialized response object |
| 98 |
* |
| 99 |
* @return void |
| 100 |
*/ |
| 101 |
public function setResponseObject( $obj ) { |
| 102 |
$this->responseObject = $obj; |
| 103 |
} |
| 104 |
|
| 105 |
/** |
| 106 |
* Gets the deserialized response object (during deserialization) |
| 107 |
* |
| 108 |
* @return mixed the deserialized response object |
| 109 |
*/ |
| 110 |
public function getResponseObject() { |
| 111 |
return $this->responseObject; |
| 112 |
} |
| 113 |
} |
| 114 |
|