| 1 |
<?php |
| 2 |
/** |
| 3 |
* Error |
| 4 |
* |
| 5 |
* PHP version 5 |
| 6 |
* |
| 7 |
* @category Class |
| 8 |
* @package OpenAPI\Client |
| 9 |
* @author OpenAPI Generator team |
| 10 |
* @link https://openapi-generator.tech |
| 11 |
*/ |
| 12 |
|
| 13 |
/** |
| 14 |
* MONEI API v1 |
| 15 |
* |
| 16 |
* The MONEI API is organized around [REST](https://en.wikipedia.org/wiki/Representational_State_Transfer). Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. |
| 17 |
* |
| 18 |
* The version of the OpenAPI document: 1.0.0 |
| 19 |
* |
| 20 |
* Generated by: https://openapi-generator.tech |
| 21 |
* OpenAPI Generator version: 4.3.1 |
| 22 |
*/ |
| 23 |
|
| 24 |
/** |
| 25 |
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| 26 |
* https://openapi-generator.tech |
| 27 |
* Do not edit the class manually. |
| 28 |
*/ |
| 29 |
|
| 30 |
namespace OpenAPI\Client\Model; |
| 31 |
|
| 32 |
use \ArrayAccess; |
| 33 |
use \OpenAPI\Client\ObjectSerializer; |
| 34 |
|
| 35 |
/** |
| 36 |
* Error Class Doc Comment |
| 37 |
* |
| 38 |
* @category Class |
| 39 |
* @package OpenAPI\Client |
| 40 |
* @author OpenAPI Generator team |
| 41 |
* @link https://openapi-generator.tech |
| 42 |
*/ |
| 43 |
class Error implements ModelInterface, ArrayAccess |
| 44 |
{ |
| 45 |
const DISCRIMINATOR = null; |
| 46 |
|
| 47 |
/** |
| 48 |
* The original name of the model. |
| 49 |
* |
| 50 |
* @var string |
| 51 |
*/ |
| 52 |
protected static $openAPIModelName = 'Error'; |
| 53 |
|
| 54 |
/** |
| 55 |
* Array of property to type mappings. Used for (de)serialization |
| 56 |
* |
| 57 |
* @var string[] |
| 58 |
*/ |
| 59 |
protected static $openAPITypes = [ |
| 60 |
'message' => 'string', |
| 61 |
'code' => 'int' |
| 62 |
]; |
| 63 |
|
| 64 |
/** |
| 65 |
* Array of property to format mappings. Used for (de)serialization |
| 66 |
* |
| 67 |
* @var string[] |
| 68 |
*/ |
| 69 |
protected static $openAPIFormats = [ |
| 70 |
'message' => null, |
| 71 |
'code' => 'int32' |
| 72 |
]; |
| 73 |
|
| 74 |
/** |
| 75 |
* Array of property to type mappings. Used for (de)serialization |
| 76 |
* |
| 77 |
* @return array |
| 78 |
*/ |
| 79 |
public static function openAPITypes() |
| 80 |
{ |
| 81 |
return self::$openAPITypes; |
| 82 |
} |
| 83 |
|
| 84 |
/** |
| 85 |
* Array of property to format mappings. Used for (de)serialization |
| 86 |
* |
| 87 |
* @return array |
| 88 |
*/ |
| 89 |
public static function openAPIFormats() |
| 90 |
{ |
| 91 |
return self::$openAPIFormats; |
| 92 |
} |
| 93 |
|
| 94 |
/** |
| 95 |
* Array of attributes where the key is the local name, |
| 96 |
* and the value is the original name |
| 97 |
* |
| 98 |
* @var string[] |
| 99 |
*/ |
| 100 |
protected static $attributeMap = [ |
| 101 |
'message' => 'message', |
| 102 |
'code' => 'code' |
| 103 |
]; |
| 104 |
|
| 105 |
/** |
| 106 |
* Array of attributes to setter functions (for deserialization of responses) |
| 107 |
* |
| 108 |
* @var string[] |
| 109 |
*/ |
| 110 |
protected static $setters = [ |
| 111 |
'message' => 'setMessage', |
| 112 |
'code' => 'setCode' |
| 113 |
]; |
| 114 |
|
| 115 |
/** |
| 116 |
* Array of attributes to getter functions (for serialization of requests) |
| 117 |
* |
| 118 |
* @var string[] |
| 119 |
*/ |
| 120 |
protected static $getters = [ |
| 121 |
'message' => 'getMessage', |
| 122 |
'code' => 'getCode' |
| 123 |
]; |
| 124 |
|
| 125 |
/** |
| 126 |
* Array of attributes where the key is the local name, |
| 127 |
* and the value is the original name |
| 128 |
* |
| 129 |
* @return array |
| 130 |
*/ |
| 131 |
public static function attributeMap() |
| 132 |
{ |
| 133 |
return self::$attributeMap; |
| 134 |
} |
| 135 |
|
| 136 |
/** |
| 137 |
* Array of attributes to setter functions (for deserialization of responses) |
| 138 |
* |
| 139 |
* @return array |
| 140 |
*/ |
| 141 |
public static function setters() |
| 142 |
{ |
| 143 |
return self::$setters; |
| 144 |
} |
| 145 |
|
| 146 |
/** |
| 147 |
* Array of attributes to getter functions (for serialization of requests) |
| 148 |
* |
| 149 |
* @return array |
| 150 |
*/ |
| 151 |
public static function getters() |
| 152 |
{ |
| 153 |
return self::$getters; |
| 154 |
} |
| 155 |
|
| 156 |
/** |
| 157 |
* The original name of the model. |
| 158 |
* |
| 159 |
* @return string |
| 160 |
*/ |
| 161 |
public function getModelName() |
| 162 |
{ |
| 163 |
return self::$openAPIModelName; |
| 164 |
} |
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
/** |
| 171 |
* Associative array for storing property values |
| 172 |
* |
| 173 |
* @var mixed[] |
| 174 |
*/ |
| 175 |
protected $container = []; |
| 176 |
|
| 177 |
/** |
| 178 |
* Constructor |
| 179 |
* |
| 180 |
* @param mixed[] $data Associated array of property values |
| 181 |
* initializing the model |
| 182 |
*/ |
| 183 |
public function __construct(array $data = null) |
| 184 |
{ |
| 185 |
$this->container['message'] = isset($data['message']) ? $data['message'] : null; |
| 186 |
$this->container['code'] = isset($data['code']) ? $data['code'] : null; |
| 187 |
} |
| 188 |
|
| 189 |
/** |
| 190 |
* Show all the invalid properties with reasons. |
| 191 |
* |
| 192 |
* @return array invalid properties with reasons |
| 193 |
*/ |
| 194 |
public function listInvalidProperties() |
| 195 |
{ |
| 196 |
$invalidProperties = []; |
| 197 |
|
| 198 |
if ($this->container['message'] === null) { |
| 199 |
$invalidProperties[] = "'message' can't be null"; |
| 200 |
} |
| 201 |
return $invalidProperties; |
| 202 |
} |
| 203 |
|
| 204 |
/** |
| 205 |
* Validate all the properties in the model |
| 206 |
* return true if all passed |
| 207 |
* |
| 208 |
* @return bool True if all properties are valid |
| 209 |
*/ |
| 210 |
public function valid() |
| 211 |
{ |
| 212 |
return count($this->listInvalidProperties()) === 0; |
| 213 |
} |
| 214 |
|
| 215 |
|
| 216 |
/** |
| 217 |
* Gets message |
| 218 |
* |
| 219 |
* @return string |
| 220 |
*/ |
| 221 |
public function getMessage() |
| 222 |
{ |
| 223 |
return $this->container['message']; |
| 224 |
} |
| 225 |
|
| 226 |
/** |
| 227 |
* Sets message |
| 228 |
* |
| 229 |
* @param string $message message |
| 230 |
* |
| 231 |
* @return $this |
| 232 |
*/ |
| 233 |
public function setMessage($message) |
| 234 |
{ |
| 235 |
$this->container['message'] = $message; |
| 236 |
|
| 237 |
return $this; |
| 238 |
} |
| 239 |
|
| 240 |
/** |
| 241 |
* Gets code |
| 242 |
* |
| 243 |
* @return int|null |
| 244 |
*/ |
| 245 |
public function getCode() |
| 246 |
{ |
| 247 |
return $this->container['code']; |
| 248 |
} |
| 249 |
|
| 250 |
/** |
| 251 |
* Sets code |
| 252 |
* |
| 253 |
* @param int|null $code code |
| 254 |
* |
| 255 |
* @return $this |
| 256 |
*/ |
| 257 |
public function setCode($code) |
| 258 |
{ |
| 259 |
$this->container['code'] = $code; |
| 260 |
|
| 261 |
return $this; |
| 262 |
} |
| 263 |
/** |
| 264 |
* Returns true if offset exists. False otherwise. |
| 265 |
* |
| 266 |
* @param integer $offset Offset |
| 267 |
* |
| 268 |
* @return boolean |
| 269 |
*/ |
| 270 |
public function offsetExists($offset) |
| 271 |
{ |
| 272 |
return isset($this->container[$offset]); |
| 273 |
} |
| 274 |
|
| 275 |
/** |
| 276 |
* Gets offset. |
| 277 |
* |
| 278 |
* @param integer $offset Offset |
| 279 |
* |
| 280 |
* @return mixed |
| 281 |
*/ |
| 282 |
public function offsetGet($offset) |
| 283 |
{ |
| 284 |
return isset($this->container[$offset]) ? $this->container[$offset] : null; |
| 285 |
} |
| 286 |
|
| 287 |
/** |
| 288 |
* Sets value based on offset. |
| 289 |
* |
| 290 |
* @param integer $offset Offset |
| 291 |
* @param mixed $value Value to be set |
| 292 |
* |
| 293 |
* @return void |
| 294 |
*/ |
| 295 |
public function offsetSet($offset, $value) |
| 296 |
{ |
| 297 |
if (is_null($offset)) { |
| 298 |
$this->container[] = $value; |
| 299 |
} else { |
| 300 |
$this->container[$offset] = $value; |
| 301 |
} |
| 302 |
} |
| 303 |
|
| 304 |
/** |
| 305 |
* Unsets offset. |
| 306 |
* |
| 307 |
* @param integer $offset Offset |
| 308 |
* |
| 309 |
* @return void |
| 310 |
*/ |
| 311 |
public function offsetUnset($offset) |
| 312 |
{ |
| 313 |
unset($this->container[$offset]); |
| 314 |
} |
| 315 |
|
| 316 |
/** |
| 317 |
* Gets the string presentation of the object |
| 318 |
* |
| 319 |
* @return string |
| 320 |
*/ |
| 321 |
public function __toString() |
| 322 |
{ |
| 323 |
return json_encode( |
| 324 |
ObjectSerializer::sanitizeForSerialization($this), |
| 325 |
JSON_PRETTY_PRINT |
| 326 |
); |
| 327 |
} |
| 328 |
|
| 329 |
/** |
| 330 |
* Gets a header-safe presentation of the object |
| 331 |
* |
| 332 |
* @return string |
| 333 |
*/ |
| 334 |
public function toHeaderValue() |
| 335 |
{ |
| 336 |
return json_encode(ObjectSerializer::sanitizeForSerialization($this)); |
| 337 |
} |
| 338 |
} |
| 339 |
|
| 340 |
|
| 341 |
|