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

namespace Google\Cloud\SecurityCenter\V2;

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

/**
 * Metadata taken from a [Cloud Logging
 * LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry)
 *
 * Generated from protobuf message <code>google.cloud.securitycenter.v2.CloudLoggingEntry</code>
 */
class CloudLoggingEntry extends \Google\Protobuf\Internal\Message
{
    /**
     * A unique identifier for the log entry.
     *
     * Generated from protobuf field <code>string insert_id = 1;</code>
     */
    protected $insert_id = '';
    /**
     * The type of the log (part of `log_name`. `log_name` is the resource name of
     * the log to which this log entry belongs). For example:
     * `cloudresourcemanager.googleapis.com/activity` Note that this field is not
     * URL-encoded, unlike in `LogEntry`.
     *
     * Generated from protobuf field <code>string log_id = 2;</code>
     */
    protected $log_id = '';
    /**
     * The organization, folder, or project of the monitored resource that
     * produced this log entry.
     *
     * Generated from protobuf field <code>string resource_container = 3;</code>
     */
    protected $resource_container = '';
    /**
     * The time the event described by the log entry occurred.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp timestamp = 4;</code>
     */
    protected $timestamp = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $insert_id
     *           A unique identifier for the log entry.
     *     @type string $log_id
     *           The type of the log (part of `log_name`. `log_name` is the resource name of
     *           the log to which this log entry belongs). For example:
     *           `cloudresourcemanager.googleapis.com/activity` Note that this field is not
     *           URL-encoded, unlike in `LogEntry`.
     *     @type string $resource_container
     *           The organization, folder, or project of the monitored resource that
     *           produced this log entry.
     *     @type \Google\Protobuf\Timestamp $timestamp
     *           The time the event described by the log entry occurred.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Securitycenter\V2\LogEntry::initOnce();
        parent::__construct($data);
    }

    /**
     * A unique identifier for the log entry.
     *
     * Generated from protobuf field <code>string insert_id = 1;</code>
     * @return string
     */
    public function getInsertId()
    {
        return $this->insert_id;
    }

    /**
     * A unique identifier for the log entry.
     *
     * Generated from protobuf field <code>string insert_id = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setInsertId($var)
    {
        GPBUtil::checkString($var, True);
        $this->insert_id = $var;

        return $this;
    }

    /**
     * The type of the log (part of `log_name`. `log_name` is the resource name of
     * the log to which this log entry belongs). For example:
     * `cloudresourcemanager.googleapis.com/activity` Note that this field is not
     * URL-encoded, unlike in `LogEntry`.
     *
     * Generated from protobuf field <code>string log_id = 2;</code>
     * @return string
     */
    public function getLogId()
    {
        return $this->log_id;
    }

    /**
     * The type of the log (part of `log_name`. `log_name` is the resource name of
     * the log to which this log entry belongs). For example:
     * `cloudresourcemanager.googleapis.com/activity` Note that this field is not
     * URL-encoded, unlike in `LogEntry`.
     *
     * Generated from protobuf field <code>string log_id = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setLogId($var)
    {
        GPBUtil::checkString($var, True);
        $this->log_id = $var;

        return $this;
    }

    /**
     * The organization, folder, or project of the monitored resource that
     * produced this log entry.
     *
     * Generated from protobuf field <code>string resource_container = 3;</code>
     * @return string
     */
    public function getResourceContainer()
    {
        return $this->resource_container;
    }

    /**
     * The organization, folder, or project of the monitored resource that
     * produced this log entry.
     *
     * Generated from protobuf field <code>string resource_container = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setResourceContainer($var)
    {
        GPBUtil::checkString($var, True);
        $this->resource_container = $var;

        return $this;
    }

    /**
     * The time the event described by the log entry occurred.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp timestamp = 4;</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);
    }

    /**
     * The time the event described by the log entry occurred.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp timestamp = 4;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setTimestamp($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->timestamp = $var;

        return $this;
    }

}

