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

namespace Google\Cloud\Retail\V2;

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

/**
 * Request for creating a model.
 *
 * Generated from protobuf message <code>google.cloud.retail.v2.CreateModelRequest</code>
 */
class CreateModelRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The parent resource under which to create the model. Format:
     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';
    /**
     * Required. The payload of the [Model][google.cloud.retail.v2.Model]  to
     * create.
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.Model model = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $model = null;
    /**
     * Optional. Whether to run a dry run to validate the request (without
     * actually creating the model).
     *
     * Generated from protobuf field <code>bool dry_run = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $dry_run = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The parent resource under which to create the model. Format:
     *           `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
     *     @type \Google\Cloud\Retail\V2\Model $model
     *           Required. The payload of the [Model][google.cloud.retail.v2.Model]  to
     *           create.
     *     @type bool $dry_run
     *           Optional. Whether to run a dry run to validate the request (without
     *           actually creating the model).
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The parent resource under which to create the model. Format:
     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
     *
     * 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 resource under which to create the model. Format:
     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
     *
     * 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 payload of the [Model][google.cloud.retail.v2.Model]  to
     * create.
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.Model model = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Retail\V2\Model|null
     */
    public function getModel()
    {
        return $this->model;
    }

    public function hasModel()
    {
        return isset($this->model);
    }

    public function clearModel()
    {
        unset($this->model);
    }

    /**
     * Required. The payload of the [Model][google.cloud.retail.v2.Model]  to
     * create.
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.Model model = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Retail\V2\Model $var
     * @return $this
     */
    public function setModel($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Model::class);
        $this->model = $var;

        return $this;
    }

    /**
     * Optional. Whether to run a dry run to validate the request (without
     * actually creating the model).
     *
     * Generated from protobuf field <code>bool dry_run = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return bool
     */
    public function getDryRun()
    {
        return $this->dry_run;
    }

    /**
     * Optional. Whether to run a dry run to validate the request (without
     * actually creating the model).
     *
     * Generated from protobuf field <code>bool dry_run = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param bool $var
     * @return $this
     */
    public function setDryRun($var)
    {
        GPBUtil::checkBool($var);
        $this->dry_run = $var;

        return $this;
    }

}

