<?php

namespace ServicePyramid\Structs;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for SyncGoodsData Structs
 * @subpackage Structs
 */
class SyncGoodsData extends AbstractStructBase
{
    /**
     * The userName
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string
     */
    public $userName;
    /**
     * The password
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string
     */
    public $password;
    /**
     * The goods
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ServicePyramid\Arrays\ArrayOfSyncGoods
     */
    public $goods;
    /**
     * Constructor method for SyncGoodsData
     * @uses SyncGoodsData::setUserName()
     * @uses SyncGoodsData::setPassword()
     * @uses SyncGoodsData::setGoods()
     * @param string $userName
     * @param string $password
     * @param \ServicePyramid\Arrays\ArrayOfSyncGoods $goods
     */
    public function __construct($userName = null, $password = null, \ServicePyramid\Arrays\ArrayOfSyncGoods $goods = null)
    {
        $this
            ->setUserName($userName)
            ->setPassword($password)
            ->setGoods($goods);
    }
    /**
     * Get userName value
     * @return string|null
     */
    public function getUserName()
    {
        return $this->userName;
    }
    /**
     * Set userName value
     * @param string $userName
     * @return \ServicePyramid\Structs\SyncGoodsData
     */
    public function setUserName($userName = null)
    {
        // validation for constraint: string
        if (!is_null($userName) && !is_string($userName)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($userName)), __LINE__);
        }
        $this->userName = $userName;
        return $this;
    }
    /**
     * Get password value
     * @return string|null
     */
    public function getPassword()
    {
        return $this->password;
    }
    /**
     * Set password value
     * @param string $password
     * @return \ServicePyramid\Structs\SyncGoodsData
     */
    public function setPassword($password = null)
    {
        // validation for constraint: string
        if (!is_null($password) && !is_string($password)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($password)), __LINE__);
        }
        $this->password = $password;
        return $this;
    }
    /**
     * Get goods value
     * @return \ServicePyramid\Arrays\ArrayOfSyncGoods|null
     */
    public function getGoods()
    {
        return $this->goods;
    }
    /**
     * Set goods value
     * @param \ServicePyramid\Arrays\ArrayOfSyncGoods $goods
     * @return \ServicePyramid\Structs\SyncGoodsData
     */
    public function setGoods(\ServicePyramid\Arrays\ArrayOfSyncGoods $goods = null)
    {
        $this->goods = $goods;
        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 \ServicePyramid\Structs\SyncGoodsData
     */
    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__;
    }
}
