<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for AncillaryServiceFeeType StructType
 * @package Dg
 * @subpackage Structs
 */
class DgAncillaryServiceFeeType extends AbstractStructBase
{
    /**
     * The Level
     * Meta informations extracted from the WSDL
     * - use: required
     * @var int
     */
    public $Level;
    /**
     * The Amount
     * Meta informations extracted from the WSDL
     * - use: required
     * @var float
     */
    public $Amount;
    /**
     * The Type
     * @var string
     */
    public $Type;
    /**
     * Constructor method for AncillaryServiceFeeType
     * @uses DgAncillaryServiceFeeType::setLevel()
     * @uses DgAncillaryServiceFeeType::setAmount()
     * @uses DgAncillaryServiceFeeType::setType()
     * @param int $level
     * @param float $amount
     * @param string $type
     */
    public function __construct($level = null, $amount = null, $type = null)
    {
        $this
            ->setLevel($level)
            ->setAmount($amount)
            ->setType($type);
    }
    /**
     * Get Level value
     * @return int
     */
    public function getLevel()
    {
        return $this->Level;
    }
    /**
     * Set Level value
     * @param int $level
     * @return \dgsoft\StructType\DgAncillaryServiceFeeType
     */
    public function setLevel($level = null)
    {
        // validation for constraint: int
        if (!is_null($level) && !is_numeric($level)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($level)), __LINE__);
        }
        $this->Level = $level;
        return $this;
    }
    /**
     * Get Amount value
     * @return float
     */
    public function getAmount()
    {
        return $this->Amount;
    }
    /**
     * Set Amount value
     * @param float $amount
     * @return \dgsoft\StructType\DgAncillaryServiceFeeType
     */
    public function setAmount($amount = null)
    {
        $this->Amount = $amount;
        return $this;
    }
    /**
     * Get Type value
     * @return string|null
     */
    public function getType()
    {
        return $this->Type;
    }
    /**
     * Set Type value
     * @param string $type
     * @return \dgsoft\StructType\DgAncillaryServiceFeeType
     */
    public function setType($type = null)
    {
        // validation for constraint: string
        if (!is_null($type) && !is_string($type)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($type)), __LINE__);
        }
        $this->Type = $type;
        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 \dgsoft\StructType\DgAncillaryServiceFeeType
     */
    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__;
    }
}
