<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Security.DeliveryCompanyParameters StructType
 * @subpackage Structs
 */
class Security_DeliveryCompanyParameters extends Security_CompanyParameterBase
{
    /**
     * The AllowUnionAvailableDeliveryMethods
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var bool
     */
    public $AllowUnionAvailableDeliveryMethods;
    /**
     * Constructor method for Security.DeliveryCompanyParameters
     * @uses Security_DeliveryCompanyParameters::setAllowUnionAvailableDeliveryMethods()
     * @param bool $allowUnionAvailableDeliveryMethods
     */
    public function __construct($allowUnionAvailableDeliveryMethods = null)
    {
        $this
            ->setAllowUnionAvailableDeliveryMethods($allowUnionAvailableDeliveryMethods);
    }
    /**
     * Get AllowUnionAvailableDeliveryMethods value
     * An additional test has been added (isset) before returning the property value as
     * this property may have been unset before, due to the fact that this property is
     * removable from the request (nillable=true+minOccurs=0)
     * @return bool|null
     */
    public function getAllowUnionAvailableDeliveryMethods()
    {
        return isset($this->AllowUnionAvailableDeliveryMethods) ? $this->AllowUnionAvailableDeliveryMethods : null;
    }
    /**
     * Set AllowUnionAvailableDeliveryMethods value
     * This property is removable from request (nillable=true+minOccurs=0), therefore
     * if the value assigned to this property is null, it is removed from this object
     * @param bool $allowUnionAvailableDeliveryMethods
     * @return \patest\StructType\Security_DeliveryCompanyParameters
     */
    public function setAllowUnionAvailableDeliveryMethods($allowUnionAvailableDeliveryMethods = null)
    {
        // validation for constraint: boolean
        if (!is_null($allowUnionAvailableDeliveryMethods) && !is_bool($allowUnionAvailableDeliveryMethods)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($allowUnionAvailableDeliveryMethods, true), gettype($allowUnionAvailableDeliveryMethods)), __LINE__);
        }
        if (is_null($allowUnionAvailableDeliveryMethods) || (is_array($allowUnionAvailableDeliveryMethods) && empty($allowUnionAvailableDeliveryMethods))) {
            unset($this->AllowUnionAvailableDeliveryMethods);
        } else {
            $this->AllowUnionAvailableDeliveryMethods = $allowUnionAvailableDeliveryMethods;
        }
        return $this;
    }
}
