<?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\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 * Request message for 'ImportMappingRules' request.
 *
 * Generated from protobuf message <code>google.cloud.clouddms.v1.ImportMappingRulesRequest</code>
 */
class ImportMappingRulesRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Name of the conversion workspace resource to import the rules to
     * in the form of:
     * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Required. The format of the rules content file.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.ImportRulesFileFormat rules_format = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $rules_format = 0;
    /**
     * Required. One or more rules files.
     *
     * Generated from protobuf field <code>repeated .google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile rules_files = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $rules_files;
    /**
     * Required. Should the conversion workspace be committed automatically after
     * the import operation.
     *
     * Generated from protobuf field <code>bool auto_commit = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $auto_commit = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. Name of the conversion workspace resource to import the rules to
     *           in the form of:
     *           projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
     *     @type int $rules_format
     *           Required. The format of the rules content file.
     *     @type \Google\Cloud\CloudDms\V1\ImportMappingRulesRequest\RulesFile[] $rules_files
     *           Required. One or more rules files.
     *     @type bool $auto_commit
     *           Required. Should the conversion workspace be committed automatically after
     *           the import operation.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Clouddms\V1\Clouddms::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Name of the conversion workspace resource to import the rules to
     * in the form of:
     * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
     *
     * 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. Name of the conversion workspace resource to import the rules to
     * in the form of:
     * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
     *
     * 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 format of the rules content file.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.ImportRulesFileFormat rules_format = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getRulesFormat()
    {
        return $this->rules_format;
    }

    /**
     * Required. The format of the rules content file.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.ImportRulesFileFormat rules_format = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setRulesFormat($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\CloudDms\V1\ImportRulesFileFormat::class);
        $this->rules_format = $var;

        return $this;
    }

    /**
     * Required. One or more rules files.
     *
     * Generated from protobuf field <code>repeated .google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile rules_files = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return RepeatedField<\Google\Cloud\CloudDms\V1\ImportMappingRulesRequest\RulesFile>
     */
    public function getRulesFiles()
    {
        return $this->rules_files;
    }

    /**
     * Required. One or more rules files.
     *
     * Generated from protobuf field <code>repeated .google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile rules_files = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\CloudDms\V1\ImportMappingRulesRequest\RulesFile[] $var
     * @return $this
     */
    public function setRulesFiles($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\CloudDms\V1\ImportMappingRulesRequest\RulesFile::class);
        $this->rules_files = $arr;

        return $this;
    }

    /**
     * Required. Should the conversion workspace be committed automatically after
     * the import operation.
     *
     * Generated from protobuf field <code>bool auto_commit = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return bool
     */
    public function getAutoCommit()
    {
        return $this->auto_commit;
    }

    /**
     * Required. Should the conversion workspace be committed automatically after
     * the import operation.
     *
     * Generated from protobuf field <code>bool auto_commit = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param bool $var
     * @return $this
     */
    public function setAutoCommit($var)
    {
        GPBUtil::checkBool($var);
        $this->auto_commit = $var;

        return $this;
    }

}

