<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for vpnGateways StructType
 * @subpackage Structs
 */
class VpnGateways extends AbstractStructBase
{
    /**
     * The vpnGateway
     * Meta informations extracted from the WSDL
     * - maxOccurs: 3
     * - minOccurs: 0
     * @var XVpnGroupMember[]
     */
    public $vpnGateway;
    /**
     * Constructor method for vpnGateways
     * @uses VpnGateways::setVpnGateway()
     * @param XVpnGroupMember[] $vpnGateway
     */
    public function __construct(array $vpnGateway = array())
    {
        $this
            ->setVpnGateway($vpnGateway);
    }
    /**
     * Get vpnGateway value
     * @return XVpnGroupMember[]|null
     */
    public function getVpnGateway()
    {
        return $this->vpnGateway;
    }
    /**
     * Set vpnGateway value
     * @throws \InvalidArgumentException
     * @param XVpnGroupMember[] $vpnGateway
     * @return VpnGateways
     */
    public function setVpnGateway(array $vpnGateway = array())
    {
        foreach ($vpnGateway as $vpnGatewaysVpnGatewayItem) {
            // validation for constraint: itemType
            if (!$vpnGatewaysVpnGatewayItem instanceof XVpnGroupMember) {
                throw new \InvalidArgumentException(sprintf('The vpnGateway property can only contain items of XVpnGroupMember, "%s" given', is_object($vpnGatewaysVpnGatewayItem) ? get_class($vpnGatewaysVpnGatewayItem) : gettype($vpnGatewaysVpnGatewayItem)), __LINE__);
            }
        }
        $this->vpnGateway = $vpnGateway;
        return $this;
    }
    /**
     * Add item to vpnGateway value
     * @throws \InvalidArgumentException
     * @param XVpnGroupMember $item
     * @return VpnGateways
     */
    public function addToVpnGateway(XVpnGroupMember $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof XVpnGroupMember) {
            throw new \InvalidArgumentException(sprintf('The vpnGateway property can only contain items of XVpnGroupMember, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->vpnGateway[] = $item;
        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 VpnGateways
     */
    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__;
    }
}
