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

namespace Google\Cloud\Monitoring\V3;

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

/**
 * The message definition for creating a `Snooze`. Users must provide the body
 * of the `Snooze` to be created but must omit the `Snooze` field, `name`.
 *
 * Generated from protobuf message <code>google.monitoring.v3.CreateSnoozeRequest</code>
 */
class CreateSnoozeRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The
     * [project](https://cloud.google.com/monitoring/api/v3#project_name) in which
     * a `Snooze` should be created. The format is:
     *     projects/[PROJECT_ID_OR_NUMBER]
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Required. The `Snooze` to create. Omit the `name` field, as it will be
     * filled in by the API.
     *
     * Generated from protobuf field <code>.google.monitoring.v3.Snooze snooze = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $snooze = null;

    /**
     * @param string                             $parent Required. The
     *                                                   [project](https://cloud.google.com/monitoring/api/v3#project_name) in which
     *                                                   a `Snooze` should be created. The format is:
     *
     *                                                   projects/[PROJECT_ID_OR_NUMBER]
     *                                                   Please see {@see SnoozeServiceClient::workspaceName()} for help formatting this field.
     * @param \Google\Cloud\Monitoring\V3\Snooze $snooze Required. The `Snooze` to create. Omit the `name` field, as it will be
     *                                                   filled in by the API.
     *
     * @return \Google\Cloud\Monitoring\V3\CreateSnoozeRequest
     *
     * @experimental
     */
    public static function build(string $parent, \Google\Cloud\Monitoring\V3\Snooze $snooze): self
    {
        return (new self())
            ->setParent($parent)
            ->setSnooze($snooze);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The
     *           [project](https://cloud.google.com/monitoring/api/v3#project_name) in which
     *           a `Snooze` should be created. The format is:
     *               projects/[PROJECT_ID_OR_NUMBER]
     *     @type \Google\Cloud\Monitoring\V3\Snooze $snooze
     *           Required. The `Snooze` to create. Omit the `name` field, as it will be
     *           filled in by the API.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The
     * [project](https://cloud.google.com/monitoring/api/v3#project_name) in which
     * a `Snooze` should be created. The format is:
     *     projects/[PROJECT_ID_OR_NUMBER]
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. The
     * [project](https://cloud.google.com/monitoring/api/v3#project_name) in which
     * a `Snooze` should be created. The format is:
     *     projects/[PROJECT_ID_OR_NUMBER]
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Required. The `Snooze` to create. Omit the `name` field, as it will be
     * filled in by the API.
     *
     * Generated from protobuf field <code>.google.monitoring.v3.Snooze snooze = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Monitoring\V3\Snooze|null
     */
    public function getSnooze()
    {
        return $this->snooze;
    }

    public function hasSnooze()
    {
        return isset($this->snooze);
    }

    public function clearSnooze()
    {
        unset($this->snooze);
    }

    /**
     * Required. The `Snooze` to create. Omit the `name` field, as it will be
     * filled in by the API.
     *
     * Generated from protobuf field <code>.google.monitoring.v3.Snooze snooze = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Monitoring\V3\Snooze $var
     * @return $this
     */
    public function setSnooze($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Snooze::class);
        $this->snooze = $var;

        return $this;
    }

}

