<?php

/*
 * This file was automatically generated.
 */
namespace Syde\Vendor\Worldline\OnlinePayments\Sdk\Domain;

use UnexpectedValueException;
/**
 * @package OnlinePayments\Sdk\Domain
 */
class LoanRecipient extends DataObject
{
    /**
     * @var string|null
     */
    public ?string $accountNumber = null;
    /**
     * @var string|null
     */
    public ?string $dateOfBirth = null;
    /**
     * @var string|null
     */
    public ?string $partialPan = null;
    /**
     * @var string|null
     */
    public ?string $surname = null;
    /**
     * @var string|null
     */
    public ?string $zip = null;
    /**
     * @return string|null
     */
    public function getAccountNumber() : ?string
    {
        return $this->accountNumber;
    }
    /**
     * @param string|null $value
     */
    public function setAccountNumber(?string $value) : void
    {
        $this->accountNumber = $value;
    }
    /**
     * @return string|null
     */
    public function getDateOfBirth() : ?string
    {
        return $this->dateOfBirth;
    }
    /**
     * @param string|null $value
     */
    public function setDateOfBirth(?string $value) : void
    {
        $this->dateOfBirth = $value;
    }
    /**
     * @return string|null
     */
    public function getPartialPan() : ?string
    {
        return $this->partialPan;
    }
    /**
     * @param string|null $value
     */
    public function setPartialPan(?string $value) : void
    {
        $this->partialPan = $value;
    }
    /**
     * @return string|null
     */
    public function getSurname() : ?string
    {
        return $this->surname;
    }
    /**
     * @param string|null $value
     */
    public function setSurname(?string $value) : void
    {
        $this->surname = $value;
    }
    /**
     * @return string|null
     */
    public function getZip() : ?string
    {
        return $this->zip;
    }
    /**
     * @param string|null $value
     */
    public function setZip(?string $value) : void
    {
        $this->zip = $value;
    }
    /**
     * @return object
     */
    public function toObject() : object
    {
        $object = parent::toObject();
        if (!\is_null($this->accountNumber)) {
            $object->accountNumber = $this->accountNumber;
        }
        if (!\is_null($this->dateOfBirth)) {
            $object->dateOfBirth = $this->dateOfBirth;
        }
        if (!\is_null($this->partialPan)) {
            $object->partialPan = $this->partialPan;
        }
        if (!\is_null($this->surname)) {
            $object->surname = $this->surname;
        }
        if (!\is_null($this->zip)) {
            $object->zip = $this->zip;
        }
        return $object;
    }
    /**
     * @param object $object
     * @return $this
     * @throws UnexpectedValueException
     */
    public function fromObject(object $object) : LoanRecipient
    {
        parent::fromObject($object);
        if (\property_exists($object, 'accountNumber')) {
            $this->accountNumber = $object->accountNumber;
        }
        if (\property_exists($object, 'dateOfBirth')) {
            $this->dateOfBirth = $object->dateOfBirth;
        }
        if (\property_exists($object, 'partialPan')) {
            $this->partialPan = $object->partialPan;
        }
        if (\property_exists($object, 'surname')) {
            $this->surname = $object->surname;
        }
        if (\property_exists($object, 'zip')) {
            $this->zip = $object->zip;
        }
        return $this;
    }
}
