<?php

namespace Pepitelabs\PWS\ServiceAvailabilityService;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Service ServiceAvailabilityService
 * Meta information extracted from the WSDL
 * - documentation: Service
 * - nillable: true
 * - type: tns:Service
 * @subpackage Structs
 */
class Service extends AbstractStructBase
{
    /**
     * The ID
     * Meta information extracted from the WSDL
     * - documentation: ID - string
     * - nillable: true
     * @var string
     */
    public $ID;
    /**
     * The Description
     * Meta information extracted from the WSDL
     * - documentation: Description - string
     * - nillable: true
     * @var string
     */
    public $Description;
    /**
     * The PackageType
     * Meta information extracted from the WSDL
     * - documentation: PackageType - string
     * - nillable: true
     * @var string
     */
    public $PackageType;
    /**
     * The PackageTypeDescription
     * Meta information extracted from the WSDL
     * - documentation: PackageTypeDescription - string
     * - nillable: true
     * @var string
     */
    public $PackageTypeDescription;
    /**
     * The Options
     * Meta information extracted from the WSDL
     * - documentation: Options - Option[]
     * - minOccurs: 0
     * - nillable: true
     * @var \Pepitelabs\PWS\ServiceAvailabilityService\ArrayOfOption
     */
    public $Options;
    /**
     * Constructor method for Service
     * @uses Service::setID()
     * @uses Service::setDescription()
     * @uses Service::setPackageType()
     * @uses Service::setPackageTypeDescription()
     * @uses Service::setOptions()
     * @param string $iD
     * @param string $description
     * @param string $packageType
     * @param string $packageTypeDescription
     * @param \Pepitelabs\PWS\ServiceAvailabilityService\ArrayOfOption $options
     */
    public function __construct($iD = null, $description = null, $packageType = null, $packageTypeDescription = null, \Pepitelabs\PWS\ServiceAvailabilityService\ArrayOfOption $options = null)
    {
        $this
            ->setID($iD)
            ->setDescription($description)
            ->setPackageType($packageType)
            ->setPackageTypeDescription($packageTypeDescription)
            ->setOptions($options);
    }
    /**
     * Get ID value
     * @return string|null
     */
    public function getID()
    {
        return $this->ID;
    }
    /**
     * Set ID value
     * @param string $iD
     * @return \Pepitelabs\PWS\ServiceAvailabilityService\Service
     */
    public function setID($iD = null)
    {
        // validation for constraint: string
        if (!is_null($iD) && !is_string($iD)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($iD, true), gettype($iD)), __LINE__);
        }
        $this->ID = $iD;
        return $this;
    }
    /**
     * Get Description value
     * @return string|null
     */
    public function getDescription()
    {
        return $this->Description;
    }
    /**
     * Set Description value
     * @param string $description
     * @return \Pepitelabs\PWS\ServiceAvailabilityService\Service
     */
    public function setDescription($description = null)
    {
        // validation for constraint: string
        if (!is_null($description) && !is_string($description)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($description, true), gettype($description)), __LINE__);
        }
        $this->Description = $description;
        return $this;
    }
    /**
     * Get PackageType value
     * @return string|null
     */
    public function getPackageType()
    {
        return $this->PackageType;
    }
    /**
     * Set PackageType value
     * @param string $packageType
     * @return \Pepitelabs\PWS\ServiceAvailabilityService\Service
     */
    public function setPackageType($packageType = null)
    {
        // validation for constraint: string
        if (!is_null($packageType) && !is_string($packageType)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($packageType, true), gettype($packageType)), __LINE__);
        }
        $this->PackageType = $packageType;
        return $this;
    }
    /**
     * Get PackageTypeDescription value
     * @return string|null
     */
    public function getPackageTypeDescription()
    {
        return $this->PackageTypeDescription;
    }
    /**
     * Set PackageTypeDescription value
     * @param string $packageTypeDescription
     * @return \Pepitelabs\PWS\ServiceAvailabilityService\Service
     */
    public function setPackageTypeDescription($packageTypeDescription = null)
    {
        // validation for constraint: string
        if (!is_null($packageTypeDescription) && !is_string($packageTypeDescription)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($packageTypeDescription, true), gettype($packageTypeDescription)), __LINE__);
        }
        $this->PackageTypeDescription = $packageTypeDescription;
        return $this;
    }
    /**
     * Get Options 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 \Pepitelabs\PWS\ServiceAvailabilityService\ArrayOfOption|null
     */
    public function getOptions()
    {
        return isset($this->Options) ? $this->Options : null;
    }
    /**
     * Set Options 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 \Pepitelabs\PWS\ServiceAvailabilityService\ArrayOfOption $options
     * @return \Pepitelabs\PWS\ServiceAvailabilityService\Service
     */
    public function setOptions(\Pepitelabs\PWS\ServiceAvailabilityService\ArrayOfOption $options = null)
    {
        if (is_null($options) || (is_array($options) && empty($options))) {
            unset($this->Options);
        } else {
            $this->Options = $options;
        }
        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 \Pepitelabs\PWS\ServiceAvailabilityService\Service
     */
    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__;
    }
}
