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

namespace Google\Cloud\Retail\V2;

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

/**
 * Request for
 * [CatalogService.UpdateCatalog][google.cloud.retail.v2.CatalogService.UpdateCatalog]
 * method.
 *
 * Generated from protobuf message <code>google.cloud.retail.v2.UpdateCatalogRequest</code>
 */
class UpdateCatalogRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The [Catalog][google.cloud.retail.v2.Catalog] to update.
     * If the caller does not have permission to update the
     * [Catalog][google.cloud.retail.v2.Catalog], regardless of whether or not it
     * exists, a PERMISSION_DENIED error is returned.
     * If the [Catalog][google.cloud.retail.v2.Catalog] to update does not exist,
     * a NOT_FOUND error is returned.
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $catalog = null;
    /**
     * Indicates which fields in the provided
     * [Catalog][google.cloud.retail.v2.Catalog] to update.
     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
     * is returned.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2;</code>
     */
    private $update_mask = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Retail\V2\Catalog $catalog
     *           Required. The [Catalog][google.cloud.retail.v2.Catalog] to update.
     *           If the caller does not have permission to update the
     *           [Catalog][google.cloud.retail.v2.Catalog], regardless of whether or not it
     *           exists, a PERMISSION_DENIED error is returned.
     *           If the [Catalog][google.cloud.retail.v2.Catalog] to update does not exist,
     *           a NOT_FOUND error is returned.
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           Indicates which fields in the provided
     *           [Catalog][google.cloud.retail.v2.Catalog] to update.
     *           If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
     *           is returned.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Retail\V2\CatalogService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The [Catalog][google.cloud.retail.v2.Catalog] to update.
     * If the caller does not have permission to update the
     * [Catalog][google.cloud.retail.v2.Catalog], regardless of whether or not it
     * exists, a PERMISSION_DENIED error is returned.
     * If the [Catalog][google.cloud.retail.v2.Catalog] to update does not exist,
     * a NOT_FOUND error is returned.
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Retail\V2\Catalog|null
     */
    public function getCatalog()
    {
        return $this->catalog;
    }

    public function hasCatalog()
    {
        return isset($this->catalog);
    }

    public function clearCatalog()
    {
        unset($this->catalog);
    }

    /**
     * Required. The [Catalog][google.cloud.retail.v2.Catalog] to update.
     * If the caller does not have permission to update the
     * [Catalog][google.cloud.retail.v2.Catalog], regardless of whether or not it
     * exists, a PERMISSION_DENIED error is returned.
     * If the [Catalog][google.cloud.retail.v2.Catalog] to update does not exist,
     * a NOT_FOUND error is returned.
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Retail\V2\Catalog $var
     * @return $this
     */
    public function setCatalog($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Catalog::class);
        $this->catalog = $var;

        return $this;
    }

    /**
     * Indicates which fields in the provided
     * [Catalog][google.cloud.retail.v2.Catalog] to update.
     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
     * is returned.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2;</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);
    }

    /**
     * Indicates which fields in the provided
     * [Catalog][google.cloud.retail.v2.Catalog] to update.
     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
     * is returned.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2;</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;
    }

}

