EasyPost\Object::__toJSON PHP Method

__toJSON() public method

convert object to JSON
public __toJSON ( ) : string
return string
    public function __toJSON()
    {
        if (defined('JSON_PRETTY_PRINT')) {
            return json_encode($this->__toArray(true), JSON_PRETTY_PRINT);
        }
        return json_encode($this->__toArray(true));
    }