<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for OTA_VehRateRuleRQRentalInfoSpecialEquipPref StructType
 * @package Dg
 * @subpackage Structs
 */
class DgOTA_VehRateRuleRQRentalInfoSpecialEquipPref extends AbstractStructBase
{
    /**
     * The Action
     * @var string
     */
    public $Action;
    /**
     * Constructor method for OTA_VehRateRuleRQRentalInfoSpecialEquipPref
     * @uses DgOTA_VehRateRuleRQRentalInfoSpecialEquipPref::setAction()
     * @param string $action
     */
    public function __construct($action = null)
    {
        $this
            ->setAction($action);
    }
    /**
     * Get Action value
     * @return string|null
     */
    public function getAction()
    {
        return $this->Action;
    }
    /**
     * Set Action value
     * @uses \dgsoft\EnumType\DgActionType::valueIsValid()
     * @uses \dgsoft\EnumType\DgActionType::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $action
     * @return \dgsoft\StructType\DgOTA_VehRateRuleRQRentalInfoSpecialEquipPref
     */
    public function setAction($action = null)
    {
        // validation for constraint: enumeration
        if (!\dgsoft\EnumType\DgActionType::valueIsValid($action)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $action, implode(', ', \dgsoft\EnumType\DgActionType::getValidValues())), __LINE__);
        }
        $this->Action = $action;
        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_VehRateRuleRQRentalInfoSpecialEquipPref
     */
    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__;
    }
}
