<?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 updating an existing model.
 *
 * Generated from protobuf message <code>google.cloud.retail.v2.UpdateModelRequest</code>
 */
class UpdateModelRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The body of the updated [Model][google.cloud.retail.v2.Model].
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.Model model = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $model = null;
    /**
     * Optional. Indicates which fields in the provided 'model' to
     * update. If not set, by default updates all fields.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $update_mask = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Retail\V2\Model $model
     *           Required. The body of the updated [Model][google.cloud.retail.v2.Model].
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           Optional. Indicates which fields in the provided 'model' to
     *           update. If not set, by default updates all fields.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Retail\V2\ModelService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The body of the updated [Model][google.cloud.retail.v2.Model].
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.Model model = 1 [(.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 body of the updated [Model][google.cloud.retail.v2.Model].
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.Model model = 1 [(.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. Indicates which fields in the provided 'model' to
     * update. If not set, by default updates all fields.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\FieldMask|null
     */
    public function getUpdateMask()
    {
        return $this->update_mask;
    }

    public function hasUpdateMask()
    {
        return isset($this->update_mask);
    }

    public function clearUpdateMask()
    {
        unset($this->update_mask);
    }

    /**
     * Optional. Indicates which fields in the provided 'model' to
     * update. If not set, by default updates all fields.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\FieldMask $var
     * @return $this
     */
    public function setUpdateMask($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class);
        $this->update_mask = $var;

        return $this;
    }

}

