<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/monitoring/v3/snooze.proto

namespace Google\Cloud\Monitoring\V3;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * A `Snooze` will prevent any alerts from being opened, and close any that
 * are already open. The `Snooze` will work on alerts that match the
 * criteria defined in the `Snooze`. The `Snooze` will be active from
 * `interval.start_time` through `interval.end_time`.
 *
 * Generated from protobuf message <code>google.monitoring.v3.Snooze</code>
 */
class Snooze extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Identifier. The name of the `Snooze`. The format is:
     *     projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID]
     * The ID of the `Snooze` will be generated by the system.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     */
    protected $name = '';
    /**
     * Required. This defines the criteria for applying the `Snooze`. See
     * `Criteria` for more information.
     *
     * Generated from protobuf field <code>.google.monitoring.v3.Snooze.Criteria criteria = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $criteria = null;
    /**
     * Required. The `Snooze` will be active from `interval.start_time` through
     * `interval.end_time`.
     * `interval.start_time` cannot be in the past. There is a 15 second clock
     * skew to account for the time it takes for a request to reach the API from
     * the UI.
     *
     * Generated from protobuf field <code>.google.monitoring.v3.TimeInterval interval = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $interval = null;
    /**
     * Required. A display name for the `Snooze`. This can be, at most, 512
     * unicode characters.
     *
     * Generated from protobuf field <code>string display_name = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $display_name = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Required. Identifier. The name of the `Snooze`. The format is:
     *               projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID]
     *           The ID of the `Snooze` will be generated by the system.
     *     @type \Google\Cloud\Monitoring\V3\Snooze\Criteria $criteria
     *           Required. This defines the criteria for applying the `Snooze`. See
     *           `Criteria` for more information.
     *     @type \Google\Cloud\Monitoring\V3\TimeInterval $interval
     *           Required. The `Snooze` will be active from `interval.start_time` through
     *           `interval.end_time`.
     *           `interval.start_time` cannot be in the past. There is a 15 second clock
     *           skew to account for the time it takes for a request to reach the API from
     *           the UI.
     *     @type string $display_name
     *           Required. A display name for the `Snooze`. This can be, at most, 512
     *           unicode characters.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Monitoring\V3\Snooze::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Identifier. The name of the `Snooze`. The format is:
     *     projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID]
     * The ID of the `Snooze` will be generated by the system.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Required. Identifier. The name of the `Snooze`. The format is:
     *     projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID]
     * The ID of the `Snooze` will be generated by the system.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Required. This defines the criteria for applying the `Snooze`. See
     * `Criteria` for more information.
     *
     * Generated from protobuf field <code>.google.monitoring.v3.Snooze.Criteria criteria = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Monitoring\V3\Snooze\Criteria|null
     */
    public function getCriteria()
    {
        return $this->criteria;
    }

    public function hasCriteria()
    {
        return isset($this->criteria);
    }

    public function clearCriteria()
    {
        unset($this->criteria);
    }

    /**
     * Required. This defines the criteria for applying the `Snooze`. See
     * `Criteria` for more information.
     *
     * Generated from protobuf field <code>.google.monitoring.v3.Snooze.Criteria criteria = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Monitoring\V3\Snooze\Criteria $var
     * @return $this
     */
    public function setCriteria($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Snooze\Criteria::class);
        $this->criteria = $var;

        return $this;
    }

    /**
     * Required. The `Snooze` will be active from `interval.start_time` through
     * `interval.end_time`.
     * `interval.start_time` cannot be in the past. There is a 15 second clock
     * skew to account for the time it takes for a request to reach the API from
     * the UI.
     *
     * Generated from protobuf field <code>.google.monitoring.v3.TimeInterval interval = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Monitoring\V3\TimeInterval|null
     */
    public function getInterval()
    {
        return $this->interval;
    }

    public function hasInterval()
    {
        return isset($this->interval);
    }

    public function clearInterval()
    {
        unset($this->interval);
    }

    /**
     * Required. The `Snooze` will be active from `interval.start_time` through
     * `interval.end_time`.
     * `interval.start_time` cannot be in the past. There is a 15 second clock
     * skew to account for the time it takes for a request to reach the API from
     * the UI.
     *
     * Generated from protobuf field <code>.google.monitoring.v3.TimeInterval interval = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Monitoring\V3\TimeInterval $var
     * @return $this
     */
    public function setInterval($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\TimeInterval::class);
        $this->interval = $var;

        return $this;
    }

    /**
     * Required. A display name for the `Snooze`. This can be, at most, 512
     * unicode characters.
     *
     * Generated from protobuf field <code>string display_name = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }

    /**
     * Required. A display name for the `Snooze`. This can be, at most, 512
     * unicode characters.
     *
     * Generated from protobuf field <code>string display_name = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setDisplayName($var)
    {
        GPBUtil::checkString($var, True);
        $this->display_name = $var;

        return $this;
    }

}

