<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for UpdateSNMPCommunityStringReq StructType
 * @subpackage Structs
 */
class UpdateSNMPCommunityStringReq extends APIRequest
{
    /**
     * The communityName
     * Meta informations extracted from the WSDL
     * - minOccurs: 0
     * @var string
     */
    public $communityName;
    /**
     * The newValues
     * @var RSNMPCommunityString1
     */
    public $newValues;
    /**
     * Constructor method for UpdateSNMPCommunityStringReq
     * @uses UpdateSNMPCommunityStringReq::setCommunityName()
     * @uses UpdateSNMPCommunityStringReq::setNewValues()
     * @param string $communityName
     * @param RSNMPCommunityString1 $newValues
     */
    public function __construct($communityName = null, RSNMPCommunityString1 $newValues = null)
    {
        $this
            ->setCommunityName($communityName)
            ->setNewValues($newValues);
    }
    /**
     * Get communityName value
     * @return string|null
     */
    public function getCommunityName()
    {
        return $this->communityName;
    }
    /**
     * Set communityName value
     * @param string $communityName
     * @return UpdateSNMPCommunityStringReq
     */
    public function setCommunityName($communityName = null)
    {
        // validation for constraint: string
        if (!is_null($communityName) && !is_string($communityName)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($communityName)), __LINE__);
        }
        $this->communityName = $communityName;
        return $this;
    }
    /**
     * Get newValues value
     * @return RSNMPCommunityString1|null
     */
    public function getNewValues()
    {
        return $this->newValues;
    }
    /**
     * Set newValues value
     * @param RSNMPCommunityString1 $newValues
     * @return UpdateSNMPCommunityStringReq
     */
    public function setNewValues(RSNMPCommunityString1 $newValues = null)
    {
        $this->newValues = $newValues;
        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 UpdateSNMPCommunityStringReq
     */
    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__;
    }
}
