<?php

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

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