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

namespace Google\Cloud\Audit\BigQueryAuditMetadata;

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

/**
 * Table creation event.
 *
 * Generated from protobuf message <code>google.cloud.audit.BigQueryAuditMetadata.TableCreation</code>
 */
class TableCreation extends \Google\Protobuf\Internal\Message
{
    /**
     * Table metadata.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.Table table = 1;</code>
     */
    protected $table = null;
    /**
     * Describes how the table was created.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.TableCreation.Reason reason = 3;</code>
     */
    protected $reason = 0;
    /**
     * The URI of the job that created a table.
     * Present if the reason is JOB or QUERY.
     * Format: `projects/<project_id>/jobs/<job_id>`.
     *
     * Generated from protobuf field <code>string job_name = 4;</code>
     */
    protected $job_name = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Audit\BigQueryAuditMetadata\Table $table
     *           Table metadata.
     *     @type int $reason
     *           Describes how the table was created.
     *     @type string $job_name
     *           The URI of the job that created a table.
     *           Present if the reason is JOB or QUERY.
     *           Format: `projects/<project_id>/jobs/<job_id>`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Audit\BigqueryAuditMetadata::initOnce();
        parent::__construct($data);
    }

    /**
     * Table metadata.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.Table table = 1;</code>
     * @return \Google\Cloud\Audit\BigQueryAuditMetadata\Table|null
     */
    public function getTable()
    {
        return $this->table;
    }

    public function hasTable()
    {
        return isset($this->table);
    }

    public function clearTable()
    {
        unset($this->table);
    }

    /**
     * Table metadata.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.Table table = 1;</code>
     * @param \Google\Cloud\Audit\BigQueryAuditMetadata\Table $var
     * @return $this
     */
    public function setTable($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Audit\BigQueryAuditMetadata\Table::class);
        $this->table = $var;

        return $this;
    }

    /**
     * Describes how the table was created.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.TableCreation.Reason reason = 3;</code>
     * @return int
     */
    public function getReason()
    {
        return $this->reason;
    }

    /**
     * Describes how the table was created.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.TableCreation.Reason reason = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setReason($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Audit\BigQueryAuditMetadata\TableCreation\Reason::class);
        $this->reason = $var;

        return $this;
    }

    /**
     * The URI of the job that created a table.
     * Present if the reason is JOB or QUERY.
     * Format: `projects/<project_id>/jobs/<job_id>`.
     *
     * Generated from protobuf field <code>string job_name = 4;</code>
     * @return string
     */
    public function getJobName()
    {
        return $this->job_name;
    }

    /**
     * The URI of the job that created a table.
     * Present if the reason is JOB or QUERY.
     * Format: `projects/<project_id>/jobs/<job_id>`.
     *
     * Generated from protobuf field <code>string job_name = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setJobName($var)
    {
        GPBUtil::checkString($var, True);
        $this->job_name = $var;

        return $this;
    }

}


