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

namespace Google\Cloud\CloudDms\V1;

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

/**
 * Request message to create a new Database Migration Service migration job
 * in the specified project and region.
 *
 * Generated from protobuf message <code>google.cloud.clouddms.v1.CreateMigrationJobRequest</code>
 */
class CreateMigrationJobRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The parent which owns this collection of migration jobs.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Required. The ID of the instance to create.
     *
     * Generated from protobuf field <code>string migration_job_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $migration_job_id = '';
    /**
     * Required. Represents a [migration
     * job](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs)
     * object.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.MigrationJob migration_job = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $migration_job = null;
    /**
     * Optional. A unique ID used to identify the request. If the server receives
     * two requests with the same ID, then the second request is ignored.
     * It is recommended to always set this value to a UUID.
     * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
     * (_), and hyphens (-). The maximum length is 40 characters.
     *
     * Generated from protobuf field <code>string request_id = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $request_id = '';

    /**
     * @param string                                 $parent         Required. The parent which owns this collection of migration jobs. Please see
     *                                                               {@see DataMigrationServiceClient::locationName()} for help formatting this field.
     * @param \Google\Cloud\CloudDms\V1\MigrationJob $migrationJob   Required. Represents a [migration
     *                                                               job](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs)
     *                                                               object.
     * @param string                                 $migrationJobId Required. The ID of the instance to create.
     *
     * @return \Google\Cloud\CloudDms\V1\CreateMigrationJobRequest
     *
     * @experimental
     */
    public static function build(string $parent, \Google\Cloud\CloudDms\V1\MigrationJob $migrationJob, string $migrationJobId): self
    {
        return (new self())
            ->setParent($parent)
            ->setMigrationJob($migrationJob)
            ->setMigrationJobId($migrationJobId);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The parent which owns this collection of migration jobs.
     *     @type string $migration_job_id
     *           Required. The ID of the instance to create.
     *     @type \Google\Cloud\CloudDms\V1\MigrationJob $migration_job
     *           Required. Represents a [migration
     *           job](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs)
     *           object.
     *     @type string $request_id
     *           Optional. A unique ID used to identify the request. If the server receives
     *           two requests with the same ID, then the second request is ignored.
     *           It is recommended to always set this value to a UUID.
     *           The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
     *           (_), and hyphens (-). The maximum length is 40 characters.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Clouddms\V1\Clouddms::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The parent which owns this collection of migration jobs.
     *
     * 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 parent which owns this collection of migration jobs.
     *
     * 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 ID of the instance to create.
     *
     * Generated from protobuf field <code>string migration_job_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getMigrationJobId()
    {
        return $this->migration_job_id;
    }

    /**
     * Required. The ID of the instance to create.
     *
     * Generated from protobuf field <code>string migration_job_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setMigrationJobId($var)
    {
        GPBUtil::checkString($var, True);
        $this->migration_job_id = $var;

        return $this;
    }

    /**
     * Required. Represents a [migration
     * job](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs)
     * object.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.MigrationJob migration_job = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\CloudDms\V1\MigrationJob|null
     */
    public function getMigrationJob()
    {
        return $this->migration_job;
    }

    public function hasMigrationJob()
    {
        return isset($this->migration_job);
    }

    public function clearMigrationJob()
    {
        unset($this->migration_job);
    }

    /**
     * Required. Represents a [migration
     * job](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs)
     * object.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.MigrationJob migration_job = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\CloudDms\V1\MigrationJob $var
     * @return $this
     */
    public function setMigrationJob($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\CloudDms\V1\MigrationJob::class);
        $this->migration_job = $var;

        return $this;
    }

    /**
     * Optional. A unique ID used to identify the request. If the server receives
     * two requests with the same ID, then the second request is ignored.
     * It is recommended to always set this value to a UUID.
     * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
     * (_), and hyphens (-). The maximum length is 40 characters.
     *
     * Generated from protobuf field <code>string request_id = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getRequestId()
    {
        return $this->request_id;
    }

    /**
     * Optional. A unique ID used to identify the request. If the server receives
     * two requests with the same ID, then the second request is ignored.
     * It is recommended to always set this value to a UUID.
     * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
     * (_), and hyphens (-). The maximum length is 40 characters.
     *
     * Generated from protobuf field <code>string request_id = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setRequestId($var)
    {
        GPBUtil::checkString($var, True);
        $this->request_id = $var;

        return $this;
    }

}

