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

namespace Google\Cloud\Container\V1\DatabaseEncryption;

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

/**
 * OperationError records errors seen from CloudKMS keys
 * encountered during updates to DatabaseEncryption configuration.
 *
 * Generated from protobuf message <code>google.container.v1.DatabaseEncryption.OperationError</code>
 */
class OperationError extends \Google\Protobuf\Internal\Message
{
    /**
     * CloudKMS key resource that had the error.
     *
     * Generated from protobuf field <code>string key_name = 1;</code>
     */
    protected $key_name = '';
    /**
     * Description of the error seen during the operation.
     *
     * Generated from protobuf field <code>string error_message = 2;</code>
     */
    protected $error_message = '';
    /**
     * Time when the CloudKMS error was seen.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp timestamp = 3;</code>
     */
    protected $timestamp = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $key_name
     *           CloudKMS key resource that had the error.
     *     @type string $error_message
     *           Description of the error seen during the operation.
     *     @type \Google\Protobuf\Timestamp $timestamp
     *           Time when the CloudKMS error was seen.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Container\V1\ClusterService::initOnce();
        parent::__construct($data);
    }

    /**
     * CloudKMS key resource that had the error.
     *
     * Generated from protobuf field <code>string key_name = 1;</code>
     * @return string
     */
    public function getKeyName()
    {
        return $this->key_name;
    }

    /**
     * CloudKMS key resource that had the error.
     *
     * Generated from protobuf field <code>string key_name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setKeyName($var)
    {
        GPBUtil::checkString($var, True);
        $this->key_name = $var;

        return $this;
    }

    /**
     * Description of the error seen during the operation.
     *
     * Generated from protobuf field <code>string error_message = 2;</code>
     * @return string
     */
    public function getErrorMessage()
    {
        return $this->error_message;
    }

    /**
     * Description of the error seen during the operation.
     *
     * Generated from protobuf field <code>string error_message = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setErrorMessage($var)
    {
        GPBUtil::checkString($var, True);
        $this->error_message = $var;

        return $this;
    }

    /**
     * Time when the CloudKMS error was seen.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp timestamp = 3;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getTimestamp()
    {
        return $this->timestamp;
    }

    public function hasTimestamp()
    {
        return isset($this->timestamp);
    }

    public function clearTimestamp()
    {
        unset($this->timestamp);
    }

    /**
     * Time when the CloudKMS error was seen.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp timestamp = 3;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setTimestamp($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->timestamp = $var;

        return $this;
    }

}


