<?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;

/**
 * Job configuration.
 * See the [Jobs](https://cloud.google.com/bigquery/docs/reference/v2/jobs)
 * API resource for more details on individual fields.
 *
 * Generated from protobuf message <code>google.cloud.audit.BigQueryAuditMetadata.JobConfig</code>
 */
class JobConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Job type.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.JobConfig.Type type = 1;</code>
     */
    protected $type = 0;
    /**
     * Labels provided for the job.
     *
     * Generated from protobuf field <code>map<string, string> labels = 6;</code>
     */
    private $labels;
    protected $config;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $type
     *           Job type.
     *     @type \Google\Cloud\Audit\BigQueryAuditMetadata\JobConfig\Query $query_config
     *           Query job information.
     *     @type \Google\Cloud\Audit\BigQueryAuditMetadata\JobConfig\Load $load_config
     *           Load job information.
     *     @type \Google\Cloud\Audit\BigQueryAuditMetadata\JobConfig\Extract $extract_config
     *           Extract job information.
     *     @type \Google\Cloud\Audit\BigQueryAuditMetadata\JobConfig\TableCopy $table_copy_config
     *           TableCopy job information.
     *     @type array|\Google\Protobuf\Internal\MapField $labels
     *           Labels provided for the job.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Audit\BigqueryAuditMetadata::initOnce();
        parent::__construct($data);
    }

    /**
     * Job type.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.JobConfig.Type type = 1;</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Job type.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.JobConfig.Type type = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Audit\BigQueryAuditMetadata\JobConfig\Type::class);
        $this->type = $var;

        return $this;
    }

    /**
     * Query job information.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.JobConfig.Query query_config = 2;</code>
     * @return \Google\Cloud\Audit\BigQueryAuditMetadata\JobConfig\Query|null
     */
    public function getQueryConfig()
    {
        return $this->readOneof(2);
    }

    public function hasQueryConfig()
    {
        return $this->hasOneof(2);
    }

    /**
     * Query job information.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.JobConfig.Query query_config = 2;</code>
     * @param \Google\Cloud\Audit\BigQueryAuditMetadata\JobConfig\Query $var
     * @return $this
     */
    public function setQueryConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Audit\BigQueryAuditMetadata\JobConfig\Query::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Load job information.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.JobConfig.Load load_config = 3;</code>
     * @return \Google\Cloud\Audit\BigQueryAuditMetadata\JobConfig\Load|null
     */
    public function getLoadConfig()
    {
        return $this->readOneof(3);
    }

    public function hasLoadConfig()
    {
        return $this->hasOneof(3);
    }

    /**
     * Load job information.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.JobConfig.Load load_config = 3;</code>
     * @param \Google\Cloud\Audit\BigQueryAuditMetadata\JobConfig\Load $var
     * @return $this
     */
    public function setLoadConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Audit\BigQueryAuditMetadata\JobConfig\Load::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Extract job information.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.JobConfig.Extract extract_config = 4;</code>
     * @return \Google\Cloud\Audit\BigQueryAuditMetadata\JobConfig\Extract|null
     */
    public function getExtractConfig()
    {
        return $this->readOneof(4);
    }

    public function hasExtractConfig()
    {
        return $this->hasOneof(4);
    }

    /**
     * Extract job information.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.JobConfig.Extract extract_config = 4;</code>
     * @param \Google\Cloud\Audit\BigQueryAuditMetadata\JobConfig\Extract $var
     * @return $this
     */
    public function setExtractConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Audit\BigQueryAuditMetadata\JobConfig\Extract::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * TableCopy job information.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.JobConfig.TableCopy table_copy_config = 5;</code>
     * @return \Google\Cloud\Audit\BigQueryAuditMetadata\JobConfig\TableCopy|null
     */
    public function getTableCopyConfig()
    {
        return $this->readOneof(5);
    }

    public function hasTableCopyConfig()
    {
        return $this->hasOneof(5);
    }

    /**
     * TableCopy job information.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.JobConfig.TableCopy table_copy_config = 5;</code>
     * @param \Google\Cloud\Audit\BigQueryAuditMetadata\JobConfig\TableCopy $var
     * @return $this
     */
    public function setTableCopyConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Audit\BigQueryAuditMetadata\JobConfig\TableCopy::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Labels provided for the job.
     *
     * Generated from protobuf field <code>map<string, string> labels = 6;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getLabels()
    {
        return $this->labels;
    }

    /**
     * Labels provided for the job.
     *
     * Generated from protobuf field <code>map<string, string> labels = 6;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setLabels($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->labels = $arr;

        return $this;
    }

    /**
     * @return string
     */
    public function getConfig()
    {
        return $this->whichOneof("config");
    }

}


