<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/logging/v2/logging_config.proto

namespace Google\Cloud\Logging\V2;

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

/**
 * Metadata for long running Link operations.
 *
 * Generated from protobuf message <code>google.logging.v2.LinkMetadata</code>
 */
class LinkMetadata extends \Google\Protobuf\Internal\Message
{
    /**
     * The start time of an operation.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 1;</code>
     */
    private $start_time = null;
    /**
     * The end time of an operation.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 2;</code>
     */
    private $end_time = null;
    /**
     * State of an operation.
     *
     * Generated from protobuf field <code>.google.logging.v2.OperationState state = 3;</code>
     */
    private $state = 0;
    protected $request;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Timestamp $start_time
     *           The start time of an operation.
     *     @type \Google\Protobuf\Timestamp $end_time
     *           The end time of an operation.
     *     @type int $state
     *           State of an operation.
     *     @type \Google\Cloud\Logging\V2\CreateLinkRequest $create_link_request
     *           CreateLink RPC request.
     *     @type \Google\Cloud\Logging\V2\DeleteLinkRequest $delete_link_request
     *           DeleteLink RPC request.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce();
        parent::__construct($data);
    }

    /**
     * The start time of an operation.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 1;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getStartTime()
    {
        return $this->start_time;
    }

    public function hasStartTime()
    {
        return isset($this->start_time);
    }

    public function clearStartTime()
    {
        unset($this->start_time);
    }

    /**
     * The start time of an operation.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 1;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setStartTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->start_time = $var;

        return $this;
    }

    /**
     * The end time of an operation.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 2;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getEndTime()
    {
        return $this->end_time;
    }

    public function hasEndTime()
    {
        return isset($this->end_time);
    }

    public function clearEndTime()
    {
        unset($this->end_time);
    }

    /**
     * The end time of an operation.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 2;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setEndTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->end_time = $var;

        return $this;
    }

    /**
     * State of an operation.
     *
     * Generated from protobuf field <code>.google.logging.v2.OperationState state = 3;</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * State of an operation.
     *
     * Generated from protobuf field <code>.google.logging.v2.OperationState state = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Logging\V2\OperationState::class);
        $this->state = $var;

        return $this;
    }

    /**
     * CreateLink RPC request.
     *
     * Generated from protobuf field <code>.google.logging.v2.CreateLinkRequest create_link_request = 4;</code>
     * @return \Google\Cloud\Logging\V2\CreateLinkRequest|null
     */
    public function getCreateLinkRequest()
    {
        return $this->readOneof(4);
    }

    public function hasCreateLinkRequest()
    {
        return $this->hasOneof(4);
    }

    /**
     * CreateLink RPC request.
     *
     * Generated from protobuf field <code>.google.logging.v2.CreateLinkRequest create_link_request = 4;</code>
     * @param \Google\Cloud\Logging\V2\CreateLinkRequest $var
     * @return $this
     */
    public function setCreateLinkRequest($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\CreateLinkRequest::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * DeleteLink RPC request.
     *
     * Generated from protobuf field <code>.google.logging.v2.DeleteLinkRequest delete_link_request = 5;</code>
     * @return \Google\Cloud\Logging\V2\DeleteLinkRequest|null
     */
    public function getDeleteLinkRequest()
    {
        return $this->readOneof(5);
    }

    public function hasDeleteLinkRequest()
    {
        return $this->hasOneof(5);
    }

    /**
     * DeleteLink RPC request.
     *
     * Generated from protobuf field <code>.google.logging.v2.DeleteLinkRequest delete_link_request = 5;</code>
     * @param \Google\Cloud\Logging\V2\DeleteLinkRequest $var
     * @return $this
     */
    public function setDeleteLinkRequest($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\DeleteLinkRequest::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getRequest()
    {
        return $this->whichOneof("request");
    }

}

