<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: keyapis/audit/v1/keyapis_audit_events_v1.proto

namespace Keyapis\Audit\V1;

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

/**
 * Событие
 *
 * Generated from protobuf message <code>keyapis.audit.v1.AuditEvent</code>
 */
class AuditEvent extends \Google\Protobuf\Internal\Message
{
    /**
     * Время возникновения сигнала.
     * В секундах от 01.01.1970 года в UTC.
     * Присутствует всегда
     *
     * Generated from protobuf field <code>int64 time = 1;</code>
     */
    protected $time = 0;
    /**
     * Тип события
     *
     * Generated from protobuf field <code>string kind = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $kind = '';
    /**
     * Данные до события.
     * Представляет собой сериализованный json
     *
     * Generated from protobuf field <code>string previous_data = 3;</code>
     */
    protected $previous_data = '';
    /**
     * Данные после события.
     * Представляет собой сериализованный json
     *
     * Generated from protobuf field <code>string current_data = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $current_data = '';
    /**
     * Наименование сервиса
     *
     * Generated from protobuf field <code>string service_name = 5;</code>
     */
    protected $service_name = '';
    /**
     * Идентификатор пользователя
     *
     * Generated from protobuf field <code>int32 user_id = 6;</code>
     */
    protected $user_id = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $time
     *           Время возникновения сигнала.
     *           В секундах от 01.01.1970 года в UTC.
     *           Присутствует всегда
     *     @type string $kind
     *           Тип события
     *     @type string $previous_data
     *           Данные до события.
     *           Представляет собой сериализованный json
     *     @type string $current_data
     *           Данные после события.
     *           Представляет собой сериализованный json
     *     @type string $service_name
     *           Наименование сервиса
     *     @type int $user_id
     *           Идентификатор пользователя
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Audit\V1\KeyapisAuditEventsV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Время возникновения сигнала.
     * В секундах от 01.01.1970 года в UTC.
     * Присутствует всегда
     *
     * Generated from protobuf field <code>int64 time = 1;</code>
     * @return int|string
     */
    public function getTime()
    {
        return $this->time;
    }

    /**
     * Время возникновения сигнала.
     * В секундах от 01.01.1970 года в UTC.
     * Присутствует всегда
     *
     * Generated from protobuf field <code>int64 time = 1;</code>
     * @param int|string $var
     * @return $this
     */
    public function setTime($var)
    {
        GPBUtil::checkInt64($var);
        $this->time = $var;

        return $this;
    }

    /**
     * Тип события
     *
     * Generated from protobuf field <code>string kind = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getKind()
    {
        return $this->kind;
    }

    /**
     * Тип события
     *
     * Generated from protobuf field <code>string kind = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setKind($var)
    {
        GPBUtil::checkString($var, True);
        $this->kind = $var;

        return $this;
    }

    /**
     * Данные до события.
     * Представляет собой сериализованный json
     *
     * Generated from protobuf field <code>string previous_data = 3;</code>
     * @return string
     */
    public function getPreviousData()
    {
        return $this->previous_data;
    }

    /**
     * Данные до события.
     * Представляет собой сериализованный json
     *
     * Generated from protobuf field <code>string previous_data = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setPreviousData($var)
    {
        GPBUtil::checkString($var, True);
        $this->previous_data = $var;

        return $this;
    }

    /**
     * Данные после события.
     * Представляет собой сериализованный json
     *
     * Generated from protobuf field <code>string current_data = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getCurrentData()
    {
        return $this->current_data;
    }

    /**
     * Данные после события.
     * Представляет собой сериализованный json
     *
     * Generated from protobuf field <code>string current_data = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setCurrentData($var)
    {
        GPBUtil::checkString($var, True);
        $this->current_data = $var;

        return $this;
    }

    /**
     * Наименование сервиса
     *
     * Generated from protobuf field <code>string service_name = 5;</code>
     * @return string
     */
    public function getServiceName()
    {
        return $this->service_name;
    }

    /**
     * Наименование сервиса
     *
     * Generated from protobuf field <code>string service_name = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setServiceName($var)
    {
        GPBUtil::checkString($var, True);
        $this->service_name = $var;

        return $this;
    }

    /**
     * Идентификатор пользователя
     *
     * Generated from protobuf field <code>int32 user_id = 6;</code>
     * @return int
     */
    public function getUserId()
    {
        return $this->user_id;
    }

    /**
     * Идентификатор пользователя
     *
     * Generated from protobuf field <code>int32 user_id = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setUserId($var)
    {
        GPBUtil::checkInt32($var);
        $this->user_id = $var;

        return $this;
    }

}

