<?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 CopyLogEntries long running operations.
 *
 * Generated from protobuf message <code>google.logging.v2.CopyLogEntriesMetadata</code>
 */
class CopyLogEntriesMetadata extends \Google\Protobuf\Internal\Message
{
    /**
     * The create 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;
    /**
     * Identifies whether the user has requested cancellation of the operation.
     *
     * Generated from protobuf field <code>bool cancellation_requested = 4;</code>
     */
    private $cancellation_requested = false;
    /**
     * CopyLogEntries RPC request.
     *
     * Generated from protobuf field <code>.google.logging.v2.CopyLogEntriesRequest request = 5;</code>
     */
    private $request = null;
    /**
     * Estimated progress of the operation (0 - 100%).
     *
     * Generated from protobuf field <code>int32 progress = 6;</code>
     */
    private $progress = 0;
    /**
     * The IAM identity of a service account that must be granted access to the
     * destination.
     * If the service account is not granted permission to the destination within
     * an hour, the operation will be cancelled.
     * For example: `"serviceAccount:foo&#64;bar.com"`
     *
     * Generated from protobuf field <code>string writer_identity = 7;</code>
     */
    private $writer_identity = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Timestamp $start_time
     *           The create time of an operation.
     *     @type \Google\Protobuf\Timestamp $end_time
     *           The end time of an operation.
     *     @type int $state
     *           State of an operation.
     *     @type bool $cancellation_requested
     *           Identifies whether the user has requested cancellation of the operation.
     *     @type \Google\Cloud\Logging\V2\CopyLogEntriesRequest $request
     *           CopyLogEntries RPC request.
     *     @type int $progress
     *           Estimated progress of the operation (0 - 100%).
     *     @type string $writer_identity
     *           The IAM identity of a service account that must be granted access to the
     *           destination.
     *           If the service account is not granted permission to the destination within
     *           an hour, the operation will be cancelled.
     *           For example: `"serviceAccount:foo&#64;bar.com"`
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce();
        parent::__construct($data);
    }

    /**
     * The create 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 create 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;
    }

    /**
     * Identifies whether the user has requested cancellation of the operation.
     *
     * Generated from protobuf field <code>bool cancellation_requested = 4;</code>
     * @return bool
     */
    public function getCancellationRequested()
    {
        return $this->cancellation_requested;
    }

    /**
     * Identifies whether the user has requested cancellation of the operation.
     *
     * Generated from protobuf field <code>bool cancellation_requested = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setCancellationRequested($var)
    {
        GPBUtil::checkBool($var);
        $this->cancellation_requested = $var;

        return $this;
    }

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

    public function hasRequest()
    {
        return isset($this->request);
    }

    public function clearRequest()
    {
        unset($this->request);
    }

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

        return $this;
    }

    /**
     * Estimated progress of the operation (0 - 100%).
     *
     * Generated from protobuf field <code>int32 progress = 6;</code>
     * @return int
     */
    public function getProgress()
    {
        return $this->progress;
    }

    /**
     * Estimated progress of the operation (0 - 100%).
     *
     * Generated from protobuf field <code>int32 progress = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setProgress($var)
    {
        GPBUtil::checkInt32($var);
        $this->progress = $var;

        return $this;
    }

    /**
     * The IAM identity of a service account that must be granted access to the
     * destination.
     * If the service account is not granted permission to the destination within
     * an hour, the operation will be cancelled.
     * For example: `"serviceAccount:foo&#64;bar.com"`
     *
     * Generated from protobuf field <code>string writer_identity = 7;</code>
     * @return string
     */
    public function getWriterIdentity()
    {
        return $this->writer_identity;
    }

    /**
     * The IAM identity of a service account that must be granted access to the
     * destination.
     * If the service account is not granted permission to the destination within
     * an hour, the operation will be cancelled.
     * For example: `"serviceAccount:foo&#64;bar.com"`
     *
     * Generated from protobuf field <code>string writer_identity = 7;</code>
     * @param string $var
     * @return $this
     */
    public function setWriterIdentity($var)
    {
        GPBUtil::checkString($var, True);
        $this->writer_identity = $var;

        return $this;
    }

}

