<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for PeriodSelectionWithDateType StructType
 * @subpackage Structs
 */
class PeriodSelectionWithDateType extends DateTimeRangeSelection
{
    /**
     * The DateTypeSelection
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var string
     */
    public $DateTypeSelection;
    /**
     * Constructor method for PeriodSelectionWithDateType
     * @uses PeriodSelectionWithDateType::setDateTypeSelection()
     * @param string $dateTypeSelection
     */
    public function __construct($dateTypeSelection = null)
    {
        $this
            ->setDateTypeSelection($dateTypeSelection);
    }
    /**
     * Get DateTypeSelection value
     * @return string
     */
    public function getDateTypeSelection()
    {
        return $this->DateTypeSelection;
    }
    /**
     * Set DateTypeSelection value
     * @uses \EnumType\EnumDateTypeSelection::valueIsValid()
     * @uses \EnumType\EnumDateTypeSelection::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $dateTypeSelection
     * @return \StructType\PeriodSelectionWithDateType
     */
    public function setDateTypeSelection($dateTypeSelection = null)
    {
        // validation for constraint: enumeration
        if (!\EnumType\EnumDateTypeSelection::valueIsValid($dateTypeSelection)) {
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \EnumType\EnumDateTypeSelection', is_array($dateTypeSelection) ? implode(', ', $dateTypeSelection) : var_export($dateTypeSelection, true), implode(', ', \EnumType\EnumDateTypeSelection::getValidValues())), __LINE__);
        }
        $this->DateTypeSelection = $dateTypeSelection;
        return $this;
    }
}
