<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for StopMonitoringPermissions StructType
 * Meta informations extracted from the WSDL
 * - documentation: Participants permissions to use the service, Only returned if requested.
 * @subpackage Structs
 */
class StopMonitoringPermissions extends PermissionsStructure
{
    /**
     * The StopMonitoringPermission
     * Meta informations extracted from the WSDL
     * - documentation: Permission for a single participant or all participants to use an aspect of the service.
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\StopMonitoringServicePermissionStructure[]
     */
    public $StopMonitoringPermission;
    /**
     * Constructor method for StopMonitoringPermissions
     * @uses StopMonitoringPermissions::setStopMonitoringPermission()
     * @param \StructType\StopMonitoringServicePermissionStructure[] $stopMonitoringPermission
     */
    public function __construct(array $stopMonitoringPermission = array())
    {
        $this
            ->setStopMonitoringPermission($stopMonitoringPermission);
    }
    /**
     * Get StopMonitoringPermission value
     * @return \StructType\StopMonitoringServicePermissionStructure[]|null
     */
    public function getStopMonitoringPermission()
    {
        return $this->StopMonitoringPermission;
    }
    /**
     * Set StopMonitoringPermission value
     * @throws \InvalidArgumentException
     * @param \StructType\StopMonitoringServicePermissionStructure[] $stopMonitoringPermission
     * @return \StructType\StopMonitoringPermissions
     */
    public function setStopMonitoringPermission(array $stopMonitoringPermission = array())
    {
        foreach ($stopMonitoringPermission as $stopMonitoringPermissionsStopMonitoringPermissionItem) {
            // validation for constraint: itemType
            if (!$stopMonitoringPermissionsStopMonitoringPermissionItem instanceof \StructType\StopMonitoringServicePermissionStructure) {
                throw new \InvalidArgumentException(sprintf('The StopMonitoringPermission property can only contain items of \StructType\StopMonitoringServicePermissionStructure, "%s" given', is_object($stopMonitoringPermissionsStopMonitoringPermissionItem) ? get_class($stopMonitoringPermissionsStopMonitoringPermissionItem) : gettype($stopMonitoringPermissionsStopMonitoringPermissionItem)), __LINE__);
            }
        }
        $this->StopMonitoringPermission = $stopMonitoringPermission;
        return $this;
    }
    /**
     * Add item to StopMonitoringPermission value
     * @throws \InvalidArgumentException
     * @param \StructType\StopMonitoringServicePermissionStructure $item
     * @return \StructType\StopMonitoringPermissions
     */
    public function addToStopMonitoringPermission(\StructType\StopMonitoringServicePermissionStructure $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\StopMonitoringServicePermissionStructure) {
            throw new \InvalidArgumentException(sprintf('The StopMonitoringPermission property can only contain items of \StructType\StopMonitoringServicePermissionStructure, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->StopMonitoringPermission[] = $item;
        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 \StructType\StopMonitoringPermissions
     */
    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__;
    }
}
