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

namespace Google\Cloud\Dlp\V2;

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

/**
 * Details information about an error encountered during job execution or
 * the results of an unsuccessful activation of the JobTrigger.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.Error</code>
 */
class Error extends \Google\Protobuf\Internal\Message
{
    /**
     * Detailed error codes and messages.
     *
     * Generated from protobuf field <code>.google.rpc.Status details = 1;</code>
     */
    protected $details = null;
    /**
     * The times the error occurred. List includes the oldest timestamp and the
     * last 9 timestamps.
     *
     * Generated from protobuf field <code>repeated .google.protobuf.Timestamp timestamps = 2;</code>
     */
    private $timestamps;
    /**
     * Additional information about the error.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Error.ErrorExtraInfo extra_info = 4;</code>
     */
    protected $extra_info = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Rpc\Status $details
     *           Detailed error codes and messages.
     *     @type \Google\Protobuf\Timestamp[] $timestamps
     *           The times the error occurred. List includes the oldest timestamp and the
     *           last 9 timestamps.
     *     @type int $extra_info
     *           Additional information about the error.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * Detailed error codes and messages.
     *
     * Generated from protobuf field <code>.google.rpc.Status details = 1;</code>
     * @return \Google\Rpc\Status|null
     */
    public function getDetails()
    {
        return $this->details;
    }

    public function hasDetails()
    {
        return isset($this->details);
    }

    public function clearDetails()
    {
        unset($this->details);
    }

    /**
     * Detailed error codes and messages.
     *
     * Generated from protobuf field <code>.google.rpc.Status details = 1;</code>
     * @param \Google\Rpc\Status $var
     * @return $this
     */
    public function setDetails($var)
    {
        GPBUtil::checkMessage($var, \Google\Rpc\Status::class);
        $this->details = $var;

        return $this;
    }

    /**
     * The times the error occurred. List includes the oldest timestamp and the
     * last 9 timestamps.
     *
     * Generated from protobuf field <code>repeated .google.protobuf.Timestamp timestamps = 2;</code>
     * @return RepeatedField<\Google\Protobuf\Timestamp>
     */
    public function getTimestamps()
    {
        return $this->timestamps;
    }

    /**
     * The times the error occurred. List includes the oldest timestamp and the
     * last 9 timestamps.
     *
     * Generated from protobuf field <code>repeated .google.protobuf.Timestamp timestamps = 2;</code>
     * @param \Google\Protobuf\Timestamp[] $var
     * @return $this
     */
    public function setTimestamps($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Timestamp::class);
        $this->timestamps = $arr;

        return $this;
    }

    /**
     * Additional information about the error.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Error.ErrorExtraInfo extra_info = 4;</code>
     * @return int
     */
    public function getExtraInfo()
    {
        return $this->extra_info;
    }

    /**
     * Additional information about the error.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Error.ErrorExtraInfo extra_info = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setExtraInfo($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\Error\ErrorExtraInfo::class);
        $this->extra_info = $var;

        return $this;
    }

}

