<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for SubscribeForGlobalMonitorsResponse StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:SubscribeForGlobalMonitorsResponse
 * @subpackage Structs
 */
class SubscribeForGlobalMonitorsResponse extends AbstractStructBase
{
    /**
     * The ResultMetadata
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\StructType\ResultMetadata
     */
    public $ResultMetadata;
    /**
     * The SubscriptionId
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $SubscriptionId;
    /**
     * Constructor method for SubscribeForGlobalMonitorsResponse
     * @uses SubscribeForGlobalMonitorsResponse::setResultMetadata()
     * @uses SubscribeForGlobalMonitorsResponse::setSubscriptionId()
     * @param \patest\StructType\ResultMetadata $resultMetadata
     * @param string $subscriptionId
     */
    public function __construct(\patest\StructType\ResultMetadata $resultMetadata = null, $subscriptionId = null)
    {
        $this
            ->setResultMetadata($resultMetadata)
            ->setSubscriptionId($subscriptionId);
    }
    /**
     * Get ResultMetadata 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 \patest\StructType\ResultMetadata|null
     */
    public function getResultMetadata()
    {
        return isset($this->ResultMetadata) ? $this->ResultMetadata : null;
    }
    /**
     * Set ResultMetadata 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 \patest\StructType\ResultMetadata $resultMetadata
     * @return \patest\StructType\SubscribeForGlobalMonitorsResponse
     */
    public function setResultMetadata(\patest\StructType\ResultMetadata $resultMetadata = null)
    {
        if (is_null($resultMetadata) || (is_array($resultMetadata) && empty($resultMetadata))) {
            unset($this->ResultMetadata);
        } else {
            $this->ResultMetadata = $resultMetadata;
        }
        return $this;
    }
    /**
     * Get SubscriptionId 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 string|null
     */
    public function getSubscriptionId()
    {
        return isset($this->SubscriptionId) ? $this->SubscriptionId : null;
    }
    /**
     * Set SubscriptionId 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 string $subscriptionId
     * @return \patest\StructType\SubscribeForGlobalMonitorsResponse
     */
    public function setSubscriptionId($subscriptionId = null)
    {
        // validation for constraint: string
        if (!is_null($subscriptionId) && !is_string($subscriptionId)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($subscriptionId, true), gettype($subscriptionId)), __LINE__);
        }
        if (is_null($subscriptionId) || (is_array($subscriptionId) && empty($subscriptionId))) {
            unset($this->SubscriptionId);
        } else {
            $this->SubscriptionId = $subscriptionId;
        }
        return $this;
    }
}
