<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/lustre/v1/transfer.proto

namespace Google\Cloud\Lustre\V1;

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

/**
 * A summary of errors by error code, plus a count and sample error log
 * entries.
 *
 * Generated from protobuf message <code>google.cloud.lustre.v1.ErrorSummary</code>
 */
class ErrorSummary extends \Google\Protobuf\Internal\Message
{
    /**
     * Required.
     *
     * Generated from protobuf field <code>.google.rpc.Code error_code = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $error_code = 0;
    /**
     * Required. Count of this type of error.
     *
     * Generated from protobuf field <code>int64 error_count = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $error_count = 0;
    /**
     * Error samples.
     * At most 5 error log entries are recorded for a given
     * error code for a single transfer operation.
     *
     * Generated from protobuf field <code>repeated .google.cloud.lustre.v1.ErrorLogEntry error_log_entries = 3;</code>
     */
    private $error_log_entries;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $error_code
     *           Required.
     *     @type int|string $error_count
     *           Required. Count of this type of error.
     *     @type array<\Google\Cloud\Lustre\V1\ErrorLogEntry>|\Google\Protobuf\Internal\RepeatedField $error_log_entries
     *           Error samples.
     *           At most 5 error log entries are recorded for a given
     *           error code for a single transfer operation.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Lustre\V1\Transfer::initOnce();
        parent::__construct($data);
    }

    /**
     * Required.
     *
     * Generated from protobuf field <code>.google.rpc.Code error_code = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getErrorCode()
    {
        return $this->error_code;
    }

    /**
     * Required.
     *
     * Generated from protobuf field <code>.google.rpc.Code error_code = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setErrorCode($var)
    {
        GPBUtil::checkEnum($var, \Google\Rpc\Code::class);
        $this->error_code = $var;

        return $this;
    }

    /**
     * Required. Count of this type of error.
     *
     * Generated from protobuf field <code>int64 error_count = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int|string
     */
    public function getErrorCount()
    {
        return $this->error_count;
    }

    /**
     * Required. Count of this type of error.
     *
     * Generated from protobuf field <code>int64 error_count = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int|string $var
     * @return $this
     */
    public function setErrorCount($var)
    {
        GPBUtil::checkInt64($var);
        $this->error_count = $var;

        return $this;
    }

    /**
     * Error samples.
     * At most 5 error log entries are recorded for a given
     * error code for a single transfer operation.
     *
     * Generated from protobuf field <code>repeated .google.cloud.lustre.v1.ErrorLogEntry error_log_entries = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getErrorLogEntries()
    {
        return $this->error_log_entries;
    }

    /**
     * Error samples.
     * At most 5 error log entries are recorded for a given
     * error code for a single transfer operation.
     *
     * Generated from protobuf field <code>repeated .google.cloud.lustre.v1.ErrorLogEntry error_log_entries = 3;</code>
     * @param array<\Google\Cloud\Lustre\V1\ErrorLogEntry>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setErrorLogEntries($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Lustre\V1\ErrorLogEntry::class);
        $this->error_log_entries = $arr;

        return $this;
    }

}

