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

namespace Google\Cloud\Dataproc\V1;

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

/**
 * A configuration for running
 * [Apache Spark SQL](https://spark.apache.org/sql/) queries as a batch
 * workload.
 *
 * Generated from protobuf message <code>google.cloud.dataproc.v1.SparkSqlBatch</code>
 */
class SparkSqlBatch extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The HCFS URI of the script that contains Spark SQL queries to
     * execute.
     *
     * Generated from protobuf field <code>string query_file_uri = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $query_file_uri = '';
    /**
     * Optional. Mapping of query variable names to values (equivalent to the
     * Spark SQL command: `SET name="value";`).
     *
     * Generated from protobuf field <code>map<string, string> query_variables = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $query_variables;
    /**
     * Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH.
     *
     * Generated from protobuf field <code>repeated string jar_file_uris = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $jar_file_uris;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $query_file_uri
     *           Required. The HCFS URI of the script that contains Spark SQL queries to
     *           execute.
     *     @type array|\Google\Protobuf\Internal\MapField $query_variables
     *           Optional. Mapping of query variable names to values (equivalent to the
     *           Spark SQL command: `SET name="value";`).
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $jar_file_uris
     *           Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dataproc\V1\Batches::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The HCFS URI of the script that contains Spark SQL queries to
     * execute.
     *
     * Generated from protobuf field <code>string query_file_uri = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getQueryFileUri()
    {
        return $this->query_file_uri;
    }

    /**
     * Required. The HCFS URI of the script that contains Spark SQL queries to
     * execute.
     *
     * Generated from protobuf field <code>string query_file_uri = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setQueryFileUri($var)
    {
        GPBUtil::checkString($var, True);
        $this->query_file_uri = $var;

        return $this;
    }

    /**
     * Optional. Mapping of query variable names to values (equivalent to the
     * Spark SQL command: `SET name="value";`).
     *
     * Generated from protobuf field <code>map<string, string> query_variables = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getQueryVariables()
    {
        return $this->query_variables;
    }

    /**
     * Optional. Mapping of query variable names to values (equivalent to the
     * Spark SQL command: `SET name="value";`).
     *
     * Generated from protobuf field <code>map<string, string> query_variables = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setQueryVariables($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->query_variables = $arr;

        return $this;
    }

    /**
     * Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH.
     *
     * Generated from protobuf field <code>repeated string jar_file_uris = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getJarFileUris()
    {
        return $this->jar_file_uris;
    }

    /**
     * Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH.
     *
     * Generated from protobuf field <code>repeated string jar_file_uris = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setJarFileUris($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->jar_file_uris = $arr;

        return $this;
    }

}

