<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for EditBallotApplication-Response StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:EditBallotApplication-Response
 * @subpackage Structs
 */
class EditBallotApplication_Response extends AbstractStructBase
{
    /**
     * The HasWarning
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var bool
     */
    public $HasWarning;
    /**
     * The Warning
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Warning;
    /**
     * Constructor method for EditBallotApplication-Response
     * @uses EditBallotApplication_Response::setHasWarning()
     * @uses EditBallotApplication_Response::setWarning()
     * @param bool $hasWarning
     * @param string $warning
     */
    public function __construct($hasWarning = null, $warning = null)
    {
        $this
            ->setHasWarning($hasWarning)
            ->setWarning($warning);
    }
    /**
     * Get HasWarning value
     * @return bool|null
     */
    public function getHasWarning()
    {
        return $this->HasWarning;
    }
    /**
     * Set HasWarning value
     * @param bool $hasWarning
     * @return \patest\StructType\EditBallotApplication_Response
     */
    public function setHasWarning($hasWarning = null)
    {
        // validation for constraint: boolean
        if (!is_null($hasWarning) && !is_bool($hasWarning)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($hasWarning, true), gettype($hasWarning)), __LINE__);
        }
        $this->HasWarning = $hasWarning;
        return $this;
    }
    /**
     * Get Warning 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 string|null
     */
    public function getWarning()
    {
        return isset($this->Warning) ? $this->Warning : null;
    }
    /**
     * Set Warning 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 string $warning
     * @return \patest\StructType\EditBallotApplication_Response
     */
    public function setWarning($warning = null)
    {
        // validation for constraint: string
        if (!is_null($warning) && !is_string($warning)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($warning, true), gettype($warning)), __LINE__);
        }
        if (is_null($warning) || (is_array($warning) && empty($warning))) {
            unset($this->Warning);
        } else {
            $this->Warning = $warning;
        }
        return $this;
    }
}
