<?php

namespace CustomerManagement\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for CreateImageSensorAutoUploadRule StructType
 * @subpackage Structs
 */
class CreateImageSensorAutoUploadRule extends AbstractStructBase
{
    /**
     * The customerId
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var int
     */
    public $customerId;
    /**
     * The rules
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \CustomerManagement\ArrayType\ArrayOfImageSensorAutoUploadRule
     */
    public $rules;
    /**
     * Constructor method for CreateImageSensorAutoUploadRule
     * @uses CreateImageSensorAutoUploadRule::setCustomerId()
     * @uses CreateImageSensorAutoUploadRule::setRules()
     * @param int $customerId
     * @param \CustomerManagement\ArrayType\ArrayOfImageSensorAutoUploadRule $rules
     */
    public function __construct($customerId = null, \CustomerManagement\ArrayType\ArrayOfImageSensorAutoUploadRule $rules = null)
    {
        $this
            ->setCustomerId($customerId)
            ->setRules($rules);
    }
    /**
     * Get customerId value
     * @return int
     */
    public function getCustomerId()
    {
        return $this->customerId;
    }
    /**
     * Set customerId value
     * @param int $customerId
     * @return \CustomerManagement\StructType\CreateImageSensorAutoUploadRule
     */
    public function setCustomerId($customerId = null)
    {
        // validation for constraint: int
        if (!is_null($customerId) && !(is_int($customerId) || ctype_digit($customerId))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($customerId, true), gettype($customerId)), __LINE__);
        }
        $this->customerId = $customerId;
        return $this;
    }
    /**
     * Get rules value
     * @return \CustomerManagement\ArrayType\ArrayOfImageSensorAutoUploadRule|null
     */
    public function getRules()
    {
        return $this->rules;
    }
    /**
     * Set rules value
     * @param \CustomerManagement\ArrayType\ArrayOfImageSensorAutoUploadRule $rules
     * @return \CustomerManagement\StructType\CreateImageSensorAutoUploadRule
     */
    public function setRules(\CustomerManagement\ArrayType\ArrayOfImageSensorAutoUploadRule $rules = null)
    {
        $this->rules = $rules;
        return $this;
    }
}
