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

namespace Google\Cloud\Logging\V2;

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

/**
 * Describes a view over log entries in a bucket.
 *
 * Generated from protobuf message <code>google.logging.v2.LogView</code>
 */
class LogView extends \Google\Protobuf\Internal\Message
{
    /**
     * The resource name of the view.
     * For example:
     *   `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    private $name = '';
    /**
     * Describes this view.
     *
     * Generated from protobuf field <code>string description = 3;</code>
     */
    private $description = '';
    /**
     * Output only. The creation timestamp of the view.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $create_time = null;
    /**
     * Output only. The last update timestamp of the view.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $update_time = null;
    /**
     * Filter that restricts which log entries in a bucket are visible in this
     * view.
     * Filters are restricted to be a logical AND of ==/!= of any of the
     * following:
     *   - originating project/folder/organization/billing account.
     *   - resource type
     *   - log id
     * For example:
     *   SOURCE("projects/myproject") AND resource.type = "gce_instance"
     *                                AND LOG_ID("stdout")
     *
     * Generated from protobuf field <code>string filter = 7;</code>
     */
    private $filter = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           The resource name of the view.
     *           For example:
     *             `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
     *     @type string $description
     *           Describes this view.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The creation timestamp of the view.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. The last update timestamp of the view.
     *     @type string $filter
     *           Filter that restricts which log entries in a bucket are visible in this
     *           view.
     *           Filters are restricted to be a logical AND of ==/!= of any of the
     *           following:
     *             - originating project/folder/organization/billing account.
     *             - resource type
     *             - log id
     *           For example:
     *             SOURCE("projects/myproject") AND resource.type = "gce_instance"
     *                                          AND LOG_ID("stdout")
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce();
        parent::__construct($data);
    }

    /**
     * The resource name of the view.
     * For example:
     *   `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * The resource name of the view.
     * For example:
     *   `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Describes this view.
     *
     * Generated from protobuf field <code>string description = 3;</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Describes this view.
     *
     * Generated from protobuf field <code>string description = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * Output only. The creation timestamp of the view.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. The creation timestamp of the view.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Output only. The last update timestamp of the view.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    public function hasUpdateTime()
    {
        return isset($this->update_time);
    }

    public function clearUpdateTime()
    {
        unset($this->update_time);
    }

    /**
     * Output only. The last update timestamp of the view.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

    /**
     * Filter that restricts which log entries in a bucket are visible in this
     * view.
     * Filters are restricted to be a logical AND of ==/!= of any of the
     * following:
     *   - originating project/folder/organization/billing account.
     *   - resource type
     *   - log id
     * For example:
     *   SOURCE("projects/myproject") AND resource.type = "gce_instance"
     *                                AND LOG_ID("stdout")
     *
     * Generated from protobuf field <code>string filter = 7;</code>
     * @return string
     */
    public function getFilter()
    {
        return $this->filter;
    }

    /**
     * Filter that restricts which log entries in a bucket are visible in this
     * view.
     * Filters are restricted to be a logical AND of ==/!= of any of the
     * following:
     *   - originating project/folder/organization/billing account.
     *   - resource type
     *   - log id
     * For example:
     *   SOURCE("projects/myproject") AND resource.type = "gce_instance"
     *                                AND LOG_ID("stdout")
     *
     * Generated from protobuf field <code>string filter = 7;</code>
     * @param string $var
     * @return $this
     */
    public function setFilter($var)
    {
        GPBUtil::checkString($var, True);
        $this->filter = $var;

        return $this;
    }

}

