<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for OTA_VehRateRuleRSRateRulesPickupReturnRulesLatestReturn
 * StructType
 * @package Dg
 * @subpackage Structs
 */
class DgOTA_VehRateRuleRSRateRulesPickupReturnRulesLatestReturn extends AbstractStructBase
{
    /**
     * The DayOfWeek
     * @var string
     */
    public $DayOfWeek;
    /**
     * The Time
     * @var string
     */
    public $Time;
    /**
     * Constructor method for OTA_VehRateRuleRSRateRulesPickupReturnRulesLatestReturn
     * @uses DgOTA_VehRateRuleRSRateRulesPickupReturnRulesLatestReturn::setDayOfWeek()
     * @uses DgOTA_VehRateRuleRSRateRulesPickupReturnRulesLatestReturn::setTime()
     * @param string $dayOfWeek
     * @param string $time
     */
    public function __construct($dayOfWeek = null, $time = null)
    {
        $this
            ->setDayOfWeek($dayOfWeek)
            ->setTime($time);
    }
    /**
     * Get DayOfWeek value
     * @return string|null
     */
    public function getDayOfWeek()
    {
        return $this->DayOfWeek;
    }
    /**
     * Set DayOfWeek value
     * @uses \dgsoft\EnumType\DgDayOfWeekType::valueIsValid()
     * @uses \dgsoft\EnumType\DgDayOfWeekType::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $dayOfWeek
     * @return \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesPickupReturnRulesLatestReturn
     */
    public function setDayOfWeek($dayOfWeek = null)
    {
        // validation for constraint: enumeration
        if (!\dgsoft\EnumType\DgDayOfWeekType::valueIsValid($dayOfWeek)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $dayOfWeek, implode(', ', \dgsoft\EnumType\DgDayOfWeekType::getValidValues())), __LINE__);
        }
        $this->DayOfWeek = $dayOfWeek;
        return $this;
    }
    /**
     * Get Time value
     * @return string|null
     */
    public function getTime()
    {
        return $this->Time;
    }
    /**
     * Set Time value
     * @param string $time
     * @return \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesPickupReturnRulesLatestReturn
     */
    public function setTime($time = null)
    {
        // validation for constraint: string
        if (!is_null($time) && !is_string($time)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($time)), __LINE__);
        }
        $this->Time = $time;
        return $this;
    }
    /**
     * Method called when an object has been exported with var_export() functions
     * It allows to return an object instantiated with the values
     * @see AbstractStructBase::__set_state()
     * @uses AbstractStructBase::__set_state()
     * @param array $array the exported values
     * @return \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesPickupReturnRulesLatestReturn
     */
    public static function __set_state(array $array)
    {
        return parent::__set_state($array);
    }
    /**
     * Method returning the class name
     * @return string __CLASS__
     */
    public function __toString()
    {
        return __CLASS__;
    }
}
