. */ declare(strict_types=1); namespace FireflyIII\Services\Spectre\Object; use Carbon\Carbon; /** * Class Login */ class Login extends SpectreObject { /** @var Carbon */ private $consentGivenAt; /** @var array */ private $consentTypes; /** @var string */ private $countryCode; /** @var Carbon */ private $createdAt; /** @var int */ private $customerId; /** @var bool */ private $dailyRefresh; /** @var Holder */ private $holderInfo; /** @var int */ private $id; /** @var Attempt */ private $lastAttempt; /** @var Carbon */ private $lastSuccessAt; /** @var Carbon */ private $nextRefreshPossibleAt; /** @var string */ private $providerCode; /** @var int */ private $providerId; /** @var string */ private $providerName; /** @var bool */ private $showConsentConfirmation; /** @var string */ private $status; /** @var bool */ private $storeCredentials; /** @var Carbon */ private $updatedAt; /** * Login constructor. * * @param array $data */ public function __construct(array $data) { $this->consentGivenAt = new Carbon($data['consent_given_at']); $this->consentTypes = $data['consent_types']; $this->countryCode = $data['country_code']; $this->createdAt = new Carbon($data['created_at']); $this->updatedAt = new Carbon($data['updated_at']); $this->customerId = $data['customer_id']; $this->dailyRefresh = $data['daily_refresh']; $this->holderInfo = new Holder($data['holder_info']); $this->id = $data['id']; $this->lastAttempt = new Attempt($data['last_attempt']); $this->lastSuccessAt = new Carbon($data['last_success_at']); $this->nextRefreshPossibleAt = new Carbon($data['next_refresh_possible_at']); $this->providerCode = $data['provider_code']; $this->providerId = $data['provider_id']; $this->providerName = $data['provider_name']; $this->showConsentConfirmation = $data['show_consent_confirmation']; $this->status = $data['status']; $this->storeCredentials = $data['store_credentials']; } /** * @return Attempt */ public function getLastAttempt(): Attempt { return $this->lastAttempt; } }