<?php

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

use UnexpectedValueException;
/**
 * @package OnlinePayments\Sdk\Domain
 */
class PaymentProductFieldDisplayElement extends DataObject
{
    /**
     * @var string|null
     */
    public ?string $id = null;
    /**
     * @var string|null
     */
    public ?string $label = null;
    /**
     * @var string|null
     */
    public ?string $type = null;
    /**
     * @var string|null
     */
    public ?string $value = 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 getLabel() : ?string
    {
        return $this->label;
    }
    /**
     * @param string|null $value
     */
    public function setLabel(?string $value) : void
    {
        $this->label = $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 string|null
     */
    public function getValue() : ?string
    {
        return $this->value;
    }
    /**
     * @param string|null $value
     */
    public function setValue(?string $value) : void
    {
        $this->value = $value;
    }
    /**
     * @return object
     */
    public function toObject() : object
    {
        $object = parent::toObject();
        if (!\is_null($this->id)) {
            $object->id = $this->id;
        }
        if (!\is_null($this->label)) {
            $object->label = $this->label;
        }
        if (!\is_null($this->type)) {
            $object->type = $this->type;
        }
        if (!\is_null($this->value)) {
            $object->value = $this->value;
        }
        return $object;
    }
    /**
     * @param object $object
     * @return $this
     * @throws UnexpectedValueException
     */
    public function fromObject(object $object) : PaymentProductFieldDisplayElement
    {
        parent::fromObject($object);
        if (\property_exists($object, 'id')) {
            $this->id = $object->id;
        }
        if (\property_exists($object, 'label')) {
            $this->label = $object->label;
        }
        if (\property_exists($object, 'type')) {
            $this->type = $object->type;
        }
        if (\property_exists($object, 'value')) {
            $this->value = $object->value;
        }
        return $this;
    }
}
