<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for FareRuleResponseInfoTypeRoutingInfo StructType
 * @package Dg
 * @subpackage Structs
 */
class DgFareRuleResponseInfoTypeRoutingInfo extends AbstractStructBase
{
    /**
     * The Direction
     * @var string
     */
    public $Direction;
    /**
     * The Text
     * @var string
     */
    public $Text;
    /**
     * Constructor method for FareRuleResponseInfoTypeRoutingInfo
     * @uses DgFareRuleResponseInfoTypeRoutingInfo::setDirection()
     * @uses DgFareRuleResponseInfoTypeRoutingInfo::setText()
     * @param string $direction
     * @param string $text
     */
    public function __construct($direction = null, $text = null)
    {
        $this
            ->setDirection($direction)
            ->setText($text);
    }
    /**
     * Get Direction value
     * @return string|null
     */
    public function getDirection()
    {
        return $this->Direction;
    }
    /**
     * Set Direction value
     * @param string $direction
     * @return \dgsoft\StructType\DgFareRuleResponseInfoTypeRoutingInfo
     */
    public function setDirection($direction = null)
    {
        // validation for constraint: string
        if (!is_null($direction) && !is_string($direction)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($direction)), __LINE__);
        }
        $this->Direction = $direction;
        return $this;
    }
    /**
     * Get Text value
     * @return string|null
     */
    public function getText()
    {
        return $this->Text;
    }
    /**
     * Set Text value
     * @param string $text
     * @return \dgsoft\StructType\DgFareRuleResponseInfoTypeRoutingInfo
     */
    public function setText($text = null)
    {
        // validation for constraint: string
        if (!is_null($text) && !is_string($text)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($text)), __LINE__);
        }
        $this->Text = $text;
        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\DgFareRuleResponseInfoTypeRoutingInfo
     */
    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__;
    }
}
