protected function fromJson($json)
    {
        $data = json_decode($json, true);

        return new Rate(
            $data['sourceName'],
            (float) $data['value'],
            $data['currencyCode'],
            $data['rateType'],
            \DateTime::createFromFormat(\DateTime::ATOM, $data['date']),
            $data['baseCurrencyCode'],
            \DateTime::createFromFormat(\DateTime::ATOM, $data['createdAt']),
            \DateTime::createFromFormat(\DateTime::ATOM, $data['modifiedAt'])
        );
    }