<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for CoveredTravelerTypeBeneficiary StructType
 * @package Dg
 * @subpackage Structs
 */
class DgCoveredTravelerTypeBeneficiary extends AbstractStructBase
{
    /**
     * The Name
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgCoveredTravelerTypeBeneficiaryName
     */
    public $Name;
    /**
     * The Address
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgAddressInfoType
     */
    public $Address;
    /**
     * The Relation
     * @var string
     */
    public $Relation;
    /**
     * The BenefitPercent
     * @var float
     */
    public $BenefitPercent;
    /**
     * The ID
     * @var string
     */
    public $ID;
    /**
     * Constructor method for CoveredTravelerTypeBeneficiary
     * @uses DgCoveredTravelerTypeBeneficiary::setName()
     * @uses DgCoveredTravelerTypeBeneficiary::setAddress()
     * @uses DgCoveredTravelerTypeBeneficiary::setRelation()
     * @uses DgCoveredTravelerTypeBeneficiary::setBenefitPercent()
     * @uses DgCoveredTravelerTypeBeneficiary::setID()
     * @param \dgsoft\StructType\DgCoveredTravelerTypeBeneficiaryName $name
     * @param \dgsoft\StructType\DgAddressInfoType $address
     * @param string $relation
     * @param float $benefitPercent
     * @param string $iD
     */
    public function __construct(\dgsoft\StructType\DgCoveredTravelerTypeBeneficiaryName $name = null, \dgsoft\StructType\DgAddressInfoType $address = null, $relation = null, $benefitPercent = null, $iD = null)
    {
        $this
            ->setName($name)
            ->setAddress($address)
            ->setRelation($relation)
            ->setBenefitPercent($benefitPercent)
            ->setID($iD);
    }
    /**
     * Get Name value
     * @return \dgsoft\StructType\DgCoveredTravelerTypeBeneficiaryName|null
     */
    public function getName()
    {
        return $this->Name;
    }
    /**
     * Set Name value
     * @param \dgsoft\StructType\DgCoveredTravelerTypeBeneficiaryName $name
     * @return \dgsoft\StructType\DgCoveredTravelerTypeBeneficiary
     */
    public function setName(\dgsoft\StructType\DgCoveredTravelerTypeBeneficiaryName $name = null)
    {
        $this->Name = $name;
        return $this;
    }
    /**
     * Get Address value
     * @return \dgsoft\StructType\DgAddressInfoType|null
     */
    public function getAddress()
    {
        return $this->Address;
    }
    /**
     * Set Address value
     * @param \dgsoft\StructType\DgAddressInfoType $address
     * @return \dgsoft\StructType\DgCoveredTravelerTypeBeneficiary
     */
    public function setAddress(\dgsoft\StructType\DgAddressInfoType $address = null)
    {
        $this->Address = $address;
        return $this;
    }
    /**
     * Get Relation value
     * @return string|null
     */
    public function getRelation()
    {
        return $this->Relation;
    }
    /**
     * Set Relation value
     * @param string $relation
     * @return \dgsoft\StructType\DgCoveredTravelerTypeBeneficiary
     */
    public function setRelation($relation = null)
    {
        // validation for constraint: string
        if (!is_null($relation) && !is_string($relation)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($relation)), __LINE__);
        }
        $this->Relation = $relation;
        return $this;
    }
    /**
     * Get BenefitPercent value
     * @return float|null
     */
    public function getBenefitPercent()
    {
        return $this->BenefitPercent;
    }
    /**
     * Set BenefitPercent value
     * @param float $benefitPercent
     * @return \dgsoft\StructType\DgCoveredTravelerTypeBeneficiary
     */
    public function setBenefitPercent($benefitPercent = null)
    {
        $this->BenefitPercent = $benefitPercent;
        return $this;
    }
    /**
     * Get ID value
     * @return string|null
     */
    public function getID()
    {
        return $this->ID;
    }
    /**
     * Set ID value
     * @param string $iD
     * @return \dgsoft\StructType\DgCoveredTravelerTypeBeneficiary
     */
    public function setID($iD = null)
    {
        // validation for constraint: string
        if (!is_null($iD) && !is_string($iD)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($iD)), __LINE__);
        }
        $this->ID = $iD;
        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\DgCoveredTravelerTypeBeneficiary
     */
    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__;
    }
}
