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

namespace Google\Cloud\Run\V2;

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

/**
 * Request message for creating a Job.
 *
 * Generated from protobuf message <code>google.cloud.run.v2.CreateJobRequest</code>
 */
class CreateJobRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The location and project in which this Job should be created.
     * Format: projects/{project}/locations/{location}, where {project} can be
     * project id or number.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';
    /**
     * Required. The Job instance to create.
     *
     * Generated from protobuf field <code>.google.cloud.run.v2.Job job = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $job = null;
    /**
     * Required. The unique identifier for the Job. The name of the job becomes
     * {parent}/jobs/{job_id}.
     *
     * Generated from protobuf field <code>string job_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $job_id = '';
    /**
     * Indicates that the request should be validated and default values
     * populated, without persisting the request or creating any resources.
     *
     * Generated from protobuf field <code>bool validate_only = 4;</code>
     */
    private $validate_only = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The location and project in which this Job should be created.
     *           Format: projects/{project}/locations/{location}, where {project} can be
     *           project id or number.
     *     @type \Google\Cloud\Run\V2\Job $job
     *           Required. The Job instance to create.
     *     @type string $job_id
     *           Required. The unique identifier for the Job. The name of the job becomes
     *           {parent}/jobs/{job_id}.
     *     @type bool $validate_only
     *           Indicates that the request should be validated and default values
     *           populated, without persisting the request or creating any resources.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The location and project in which this Job should be created.
     * Format: projects/{project}/locations/{location}, where {project} can be
     * project id or number.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. The location and project in which this Job should be created.
     * Format: projects/{project}/locations/{location}, where {project} can be
     * project id or number.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Required. The Job instance to create.
     *
     * Generated from protobuf field <code>.google.cloud.run.v2.Job job = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Run\V2\Job|null
     */
    public function getJob()
    {
        return $this->job;
    }

    public function hasJob()
    {
        return isset($this->job);
    }

    public function clearJob()
    {
        unset($this->job);
    }

    /**
     * Required. The Job instance to create.
     *
     * Generated from protobuf field <code>.google.cloud.run.v2.Job job = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Run\V2\Job $var
     * @return $this
     */
    public function setJob($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Job::class);
        $this->job = $var;

        return $this;
    }

    /**
     * Required. The unique identifier for the Job. The name of the job becomes
     * {parent}/jobs/{job_id}.
     *
     * Generated from protobuf field <code>string job_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getJobId()
    {
        return $this->job_id;
    }

    /**
     * Required. The unique identifier for the Job. The name of the job becomes
     * {parent}/jobs/{job_id}.
     *
     * Generated from protobuf field <code>string job_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setJobId($var)
    {
        GPBUtil::checkString($var, True);
        $this->job_id = $var;

        return $this;
    }

    /**
     * Indicates that the request should be validated and default values
     * populated, without persisting the request or creating any resources.
     *
     * Generated from protobuf field <code>bool validate_only = 4;</code>
     * @return bool
     */
    public function getValidateOnly()
    {
        return $this->validate_only;
    }

    /**
     * Indicates that the request should be validated and default values
     * populated, without persisting the request or creating any resources.
     *
     * Generated from protobuf field <code>bool validate_only = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setValidateOnly($var)
    {
        GPBUtil::checkBool($var);
        $this->validate_only = $var;

        return $this;
    }

}

