<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for VehicleChargePurposeType StructType
 * @package Dg
 * @subpackage Structs
 */
class DgVehicleChargePurposeType extends DgVehicleChargeType
{
    /**
     * The Purpose
     * @var string
     */
    public $Purpose;
    /**
     * The RateConvertInd
     * @var bool
     */
    public $RateConvertInd;
    /**
     * Constructor method for VehicleChargePurposeType
     * @uses DgVehicleChargePurposeType::setPurpose()
     * @uses DgVehicleChargePurposeType::setRateConvertInd()
     * @param string $purpose
     * @param bool $rateConvertInd
     */
    public function __construct($purpose = null, $rateConvertInd = null)
    {
        $this
            ->setPurpose($purpose)
            ->setRateConvertInd($rateConvertInd);
    }
    /**
     * Get Purpose value
     * @return string|null
     */
    public function getPurpose()
    {
        return $this->Purpose;
    }
    /**
     * Set Purpose value
     * @param string $purpose
     * @return \dgsoft\StructType\DgVehicleChargePurposeType
     */
    public function setPurpose($purpose = null)
    {
        // validation for constraint: string
        if (!is_null($purpose) && !is_string($purpose)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($purpose)), __LINE__);
        }
        $this->Purpose = $purpose;
        return $this;
    }
    /**
     * Get RateConvertInd value
     * @return bool|null
     */
    public function getRateConvertInd()
    {
        return $this->RateConvertInd;
    }
    /**
     * Set RateConvertInd value
     * @param bool $rateConvertInd
     * @return \dgsoft\StructType\DgVehicleChargePurposeType
     */
    public function setRateConvertInd($rateConvertInd = null)
    {
        // validation for constraint: boolean
        if (!is_null($rateConvertInd) && !is_bool($rateConvertInd)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($rateConvertInd)), __LINE__);
        }
        $this->RateConvertInd = $rateConvertInd;
        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\DgVehicleChargePurposeType
     */
    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__;
    }
}
