<?php
/**
 * Objects of this class represent an error from the V12 server
 */

namespace billythekid\v12finance\models\responses;


use JsonSerializable;

/**
 * Class ResponseError
 *
 * @package billythekid\v12finance\models\responses
 */
class ResponseError implements JsonSerializable
{
  /**
   * Error code
   *
   * @var
   */
  private $code;
  /**
   * Description
   *
   * @var
   */
  private $description;
  /**
   * Reference
   *
   * @var
   */
  private $reference;

  /**
   * ApplicationStatusResponseError constructor.
   *
   * @param $code
   * @param $description
   * @param $reference
   */
  public function __construct($code, $description, $reference)
  {

    $this->code        = $code;
    $this->description = $description;
    $this->reference   = $reference;
  }

  /**
   * Gets the error code
   *
   * @return mixed
   */
  public function getCode()
  {
    return $this->code;
  }

  /**
   * Gets the description
   *
   * @return mixed
   */
  public function getDescription()
  {
    return $this->description;
  }

  /**
   * Gets the reference
   *
   * @return mixed
   */
  public function getReference()
  {
    return $this->reference;
  }

  /**
   * Specify data which should be serialized to JSON
   *
   * @link  http://php.net/manual/en/jsonserializable.jsonserialize.php
   * @return mixed data which can be serialized by <b>json_encode</b>,
   * which is a value of any type other than a resource.
   * @since 5.4.0
   */
  public function jsonSerialize()
  {
    return [
        'Code'        => $this->getCode(),
        'Description' => $this->getDescription(),
        'Reference'   => $this->getReference(),
    ];
  }
}
