<?php

namespace Struct;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for KeyValueOfCustomerintbMZLxG6p Struct
 * @subpackage Structs
 * @date 2019-10-21
 */
class KeyValueOfCustomerintbMZLxG6p extends AbstractStructBase
{
    /**
     * The Key
     * Meta information extracted from the WSDL
     * - nillable: true
     * @var \Struct\Customer
     */
    public $Key;
    /**
     * The Value
     * @var int
     */
    public $Value;
    /**
     * Constructor method for KeyValueOfCustomerintbMZLxG6p
     * @uses KeyValueOfCustomerintbMZLxG6p::setKey()
     * @uses KeyValueOfCustomerintbMZLxG6p::setValue()
     * @param \Struct\Customer $key
     * @param int $value
     */
    public function __construct(\Struct\Customer $key = null, $value = null)
    {
        $this
            ->setKey($key)
            ->setValue($value);
    }
    /**
     * Get Key value
     * @return \Struct\Customer|null
     */
    public function getKey()
    {
        return $this->Key;
    }
    /**
     * Set Key value
     * @param \Struct\Customer $key
     * @return \Struct\KeyValueOfCustomerintbMZLxG6p
     */
    public function setKey(\Struct\Customer $key = null)
    {
        $this->Key = $key;
        return $this;
    }
    /**
     * Get Value value
     * @return int|null
     */
    public function getValue()
    {
        return $this->Value;
    }
    /**
     * Set Value value
     * @param int $value
     * @return \Struct\KeyValueOfCustomerintbMZLxG6p
     */
    public function setValue($value = null)
    {
        // validation for constraint: int
        if (!is_null($value) && !(is_int($value) || ctype_digit($value))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($value, true), gettype($value)), __LINE__);
        }
        $this->Value = $value;
        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 \Struct\KeyValueOfCustomerintbMZLxG6p
     */
    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__;
    }
}
