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

namespace Google\Cloud\Dataproc\V1;

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

/**
 * A Dataproc job for running Apache Flink applications on YARN.
 *
 * Generated from protobuf message <code>google.cloud.dataproc.v1.FlinkJob</code>
 */
class FlinkJob extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. The arguments to pass to the driver. Do not include arguments,
     * such as `--conf`, that can be set as job properties, since a collision
     * might occur that causes an incorrect job submission.
     *
     * Generated from protobuf field <code>repeated string args = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $args;
    /**
     * Optional. HCFS URIs of jar files to add to the CLASSPATHs of the
     * Flink driver and tasks.
     *
     * Generated from protobuf field <code>repeated string jar_file_uris = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $jar_file_uris;
    /**
     * Optional. HCFS URI of the savepoint, which contains the last saved progress
     * for starting the current job.
     *
     * Generated from protobuf field <code>string savepoint_uri = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $savepoint_uri = '';
    /**
     * Optional. A mapping of property names to values, used to configure Flink.
     * Properties that conflict with values set by the Dataproc API might be
     * overwritten. Can include properties set in
     * `/etc/flink/conf/flink-defaults.conf` and classes in user code.
     *
     * Generated from protobuf field <code>map<string, string> properties = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $properties;
    /**
     * Optional. The runtime log config for job execution.
     *
     * Generated from protobuf field <code>.google.cloud.dataproc.v1.LoggingConfig logging_config = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $logging_config = null;
    protected $driver;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $main_jar_file_uri
     *           The HCFS URI of the jar file that contains the main class.
     *     @type string $main_class
     *           The name of the driver's main class. The jar file that contains the class
     *           must be in the default CLASSPATH or specified in
     *           [jarFileUris][google.cloud.dataproc.v1.FlinkJob.jar_file_uris].
     *     @type string[] $args
     *           Optional. The arguments to pass to the driver. Do not include arguments,
     *           such as `--conf`, that can be set as job properties, since a collision
     *           might occur that causes an incorrect job submission.
     *     @type string[] $jar_file_uris
     *           Optional. HCFS URIs of jar files to add to the CLASSPATHs of the
     *           Flink driver and tasks.
     *     @type string $savepoint_uri
     *           Optional. HCFS URI of the savepoint, which contains the last saved progress
     *           for starting the current job.
     *     @type array|\Google\Protobuf\Internal\MapField $properties
     *           Optional. A mapping of property names to values, used to configure Flink.
     *           Properties that conflict with values set by the Dataproc API might be
     *           overwritten. Can include properties set in
     *           `/etc/flink/conf/flink-defaults.conf` and classes in user code.
     *     @type \Google\Cloud\Dataproc\V1\LoggingConfig $logging_config
     *           Optional. The runtime log config for job execution.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dataproc\V1\Jobs::initOnce();
        parent::__construct($data);
    }

    /**
     * The HCFS URI of the jar file that contains the main class.
     *
     * Generated from protobuf field <code>string main_jar_file_uri = 1;</code>
     * @return string
     */
    public function getMainJarFileUri()
    {
        return $this->readOneof(1);
    }

    public function hasMainJarFileUri()
    {
        return $this->hasOneof(1);
    }

    /**
     * The HCFS URI of the jar file that contains the main class.
     *
     * Generated from protobuf field <code>string main_jar_file_uri = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setMainJarFileUri($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * The name of the driver's main class. The jar file that contains the class
     * must be in the default CLASSPATH or specified in
     * [jarFileUris][google.cloud.dataproc.v1.FlinkJob.jar_file_uris].
     *
     * Generated from protobuf field <code>string main_class = 2;</code>
     * @return string
     */
    public function getMainClass()
    {
        return $this->readOneof(2);
    }

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

    /**
     * The name of the driver's main class. The jar file that contains the class
     * must be in the default CLASSPATH or specified in
     * [jarFileUris][google.cloud.dataproc.v1.FlinkJob.jar_file_uris].
     *
     * Generated from protobuf field <code>string main_class = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setMainClass($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Optional. The arguments to pass to the driver. Do not include arguments,
     * such as `--conf`, that can be set as job properties, since a collision
     * might occur that causes an incorrect job submission.
     *
     * Generated from protobuf field <code>repeated string args = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return RepeatedField<string>
     */
    public function getArgs()
    {
        return $this->args;
    }

    /**
     * Optional. The arguments to pass to the driver. Do not include arguments,
     * such as `--conf`, that can be set as job properties, since a collision
     * might occur that causes an incorrect job submission.
     *
     * Generated from protobuf field <code>repeated string args = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string[] $var
     * @return $this
     */
    public function setArgs($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->args = $arr;

        return $this;
    }

    /**
     * Optional. HCFS URIs of jar files to add to the CLASSPATHs of the
     * Flink driver and tasks.
     *
     * Generated from protobuf field <code>repeated string jar_file_uris = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return RepeatedField<string>
     */
    public function getJarFileUris()
    {
        return $this->jar_file_uris;
    }

    /**
     * Optional. HCFS URIs of jar files to add to the CLASSPATHs of the
     * Flink driver and tasks.
     *
     * Generated from protobuf field <code>repeated string jar_file_uris = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string[] $var
     * @return $this
     */
    public function setJarFileUris($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->jar_file_uris = $arr;

        return $this;
    }

    /**
     * Optional. HCFS URI of the savepoint, which contains the last saved progress
     * for starting the current job.
     *
     * Generated from protobuf field <code>string savepoint_uri = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getSavepointUri()
    {
        return $this->savepoint_uri;
    }

    /**
     * Optional. HCFS URI of the savepoint, which contains the last saved progress
     * for starting the current job.
     *
     * Generated from protobuf field <code>string savepoint_uri = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setSavepointUri($var)
    {
        GPBUtil::checkString($var, True);
        $this->savepoint_uri = $var;

        return $this;
    }

    /**
     * Optional. A mapping of property names to values, used to configure Flink.
     * Properties that conflict with values set by the Dataproc API might be
     * overwritten. Can include properties set in
     * `/etc/flink/conf/flink-defaults.conf` and classes in user code.
     *
     * Generated from protobuf field <code>map<string, string> properties = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getProperties()
    {
        return $this->properties;
    }

    /**
     * Optional. A mapping of property names to values, used to configure Flink.
     * Properties that conflict with values set by the Dataproc API might be
     * overwritten. Can include properties set in
     * `/etc/flink/conf/flink-defaults.conf` and classes in user code.
     *
     * Generated from protobuf field <code>map<string, string> properties = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setProperties($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->properties = $arr;

        return $this;
    }

    /**
     * Optional. The runtime log config for job execution.
     *
     * Generated from protobuf field <code>.google.cloud.dataproc.v1.LoggingConfig logging_config = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Dataproc\V1\LoggingConfig|null
     */
    public function getLoggingConfig()
    {
        return $this->logging_config;
    }

    public function hasLoggingConfig()
    {
        return isset($this->logging_config);
    }

    public function clearLoggingConfig()
    {
        unset($this->logging_config);
    }

    /**
     * Optional. The runtime log config for job execution.
     *
     * Generated from protobuf field <code>.google.cloud.dataproc.v1.LoggingConfig logging_config = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Dataproc\V1\LoggingConfig $var
     * @return $this
     */
    public function setLoggingConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\LoggingConfig::class);
        $this->logging_config = $var;

        return $this;
    }

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

}

