code: 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'])
          );
      }
docs: Deserialize JSON string to Rate
  
  @param string $json Serialized rate.
  @return Rate Deserialized rate.