<?php

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

use UnexpectedValueException;
/**
 * @package OnlinePayments\Sdk\Domain
 */
class RedirectionData extends DataObject
{
    /**
     * @var string|null
     */
    public ?string $returnUrl = null;
    /**
     * @return string|null
     */
    public function getReturnUrl() : ?string
    {
        return $this->returnUrl;
    }
    /**
     * @param string|null $value
     */
    public function setReturnUrl(?string $value) : void
    {
        $this->returnUrl = $value;
    }
    /**
     * @return object
     */
    public function toObject() : object
    {
        $object = parent::toObject();
        if (!\is_null($this->returnUrl)) {
            $object->returnUrl = $this->returnUrl;
        }
        return $object;
    }
    /**
     * @param object $object
     * @return $this
     * @throws UnexpectedValueException
     */
    public function fromObject(object $object) : RedirectionData
    {
        parent::fromObject($object);
        if (\property_exists($object, 'returnUrl')) {
            $this->returnUrl = $object->returnUrl;
        }
        return $this;
    }
}
