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

namespace Google\Cloud\Logging\V2;

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

/**
 * Additional information used to correlate multiple log entries. Used when a
 * single LogEntry would exceed the Google Cloud Logging size limit and is
 * split across multiple log entries.
 *
 * Generated from protobuf message <code>google.logging.v2.LogSplit</code>
 */
class LogSplit extends \Google\Protobuf\Internal\Message
{
    /**
     * A globally unique identifier for all log entries in a sequence of split log
     * entries. All log entries with the same |LogSplit.uid| are assumed to be
     * part of the same sequence of split log entries.
     *
     * Generated from protobuf field <code>string uid = 1;</code>
     */
    private $uid = '';
    /**
     * The index of this LogEntry in the sequence of split log entries. Log
     * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log
     * entries.
     *
     * Generated from protobuf field <code>int32 index = 2;</code>
     */
    private $index = 0;
    /**
     * The total number of log entries that the original LogEntry was split into.
     *
     * Generated from protobuf field <code>int32 total_splits = 3;</code>
     */
    private $total_splits = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $uid
     *           A globally unique identifier for all log entries in a sequence of split log
     *           entries. All log entries with the same |LogSplit.uid| are assumed to be
     *           part of the same sequence of split log entries.
     *     @type int $index
     *           The index of this LogEntry in the sequence of split log entries. Log
     *           entries are given |index| values 0, 1, ..., n-1 for a sequence of n log
     *           entries.
     *     @type int $total_splits
     *           The total number of log entries that the original LogEntry was split into.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Logging\V2\LogEntry::initOnce();
        parent::__construct($data);
    }

    /**
     * A globally unique identifier for all log entries in a sequence of split log
     * entries. All log entries with the same |LogSplit.uid| are assumed to be
     * part of the same sequence of split log entries.
     *
     * Generated from protobuf field <code>string uid = 1;</code>
     * @return string
     */
    public function getUid()
    {
        return $this->uid;
    }

    /**
     * A globally unique identifier for all log entries in a sequence of split log
     * entries. All log entries with the same |LogSplit.uid| are assumed to be
     * part of the same sequence of split log entries.
     *
     * Generated from protobuf field <code>string uid = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setUid($var)
    {
        GPBUtil::checkString($var, True);
        $this->uid = $var;

        return $this;
    }

    /**
     * The index of this LogEntry in the sequence of split log entries. Log
     * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log
     * entries.
     *
     * Generated from protobuf field <code>int32 index = 2;</code>
     * @return int
     */
    public function getIndex()
    {
        return $this->index;
    }

    /**
     * The index of this LogEntry in the sequence of split log entries. Log
     * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log
     * entries.
     *
     * Generated from protobuf field <code>int32 index = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setIndex($var)
    {
        GPBUtil::checkInt32($var);
        $this->index = $var;

        return $this;
    }

    /**
     * The total number of log entries that the original LogEntry was split into.
     *
     * Generated from protobuf field <code>int32 total_splits = 3;</code>
     * @return int
     */
    public function getTotalSplits()
    {
        return $this->total_splits;
    }

    /**
     * The total number of log entries that the original LogEntry was split into.
     *
     * Generated from protobuf field <code>int32 total_splits = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setTotalSplits($var)
    {
        GPBUtil::checkInt32($var);
        $this->total_splits = $var;

        return $this;
    }

}

