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

namespace Google\Shopping\Merchant\DataSources\V1;

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

/**
 * Request message for the UpdateDataSource method.
 *
 * Generated from protobuf message <code>google.shopping.merchant.datasources.v1.UpdateDataSourceRequest</code>
 */
class UpdateDataSourceRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The data source resource to update.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $data_source = null;
    /**
     * Required. The list of data source fields to be updated.
     * Fields specified in the update mask without a value specified in the
     * body will be deleted from the data source.
     * Providing special "*" value for full data source replacement is not
     * supported.
     * For example, If you insert `updateMask=displayName` in the request, it will
     * only update the `displayName` leaving all other fields untouched.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $update_mask = null;

    /**
     * @param \Google\Shopping\Merchant\DataSources\V1\DataSource $dataSource Required. The data source resource to update.
     * @param \Google\Protobuf\FieldMask                          $updateMask Required. The list of data source fields to be updated.
     *
     *                                                                        Fields specified in the update mask without a value specified in the
     *                                                                        body will be deleted from the data source.
     *
     *                                                                        Providing special "*" value for full data source replacement is not
     *                                                                        supported.
     *
     *                                                                        For example, If you insert `updateMask=displayName` in the request, it will
     *                                                                        only update the `displayName` leaving all other fields untouched.
     *
     * @return \Google\Shopping\Merchant\DataSources\V1\UpdateDataSourceRequest
     *
     * @experimental
     */
    public static function build(\Google\Shopping\Merchant\DataSources\V1\DataSource $dataSource, \Google\Protobuf\FieldMask $updateMask): self
    {
        return (new self())
            ->setDataSource($dataSource)
            ->setUpdateMask($updateMask);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Shopping\Merchant\DataSources\V1\DataSource $data_source
     *           Required. The data source resource to update.
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           Required. The list of data source fields to be updated.
     *           Fields specified in the update mask without a value specified in the
     *           body will be deleted from the data source.
     *           Providing special "*" value for full data source replacement is not
     *           supported.
     *           For example, If you insert `updateMask=displayName` in the request, it will
     *           only update the `displayName` leaving all other fields untouched.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Datasources\V1\Datasources::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The data source resource to update.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Shopping\Merchant\DataSources\V1\DataSource|null
     */
    public function getDataSource()
    {
        return $this->data_source;
    }

    public function hasDataSource()
    {
        return isset($this->data_source);
    }

    public function clearDataSource()
    {
        unset($this->data_source);
    }

    /**
     * Required. The data source resource to update.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Shopping\Merchant\DataSources\V1\DataSource $var
     * @return $this
     */
    public function setDataSource($var)
    {
        GPBUtil::checkMessage($var, \Google\Shopping\Merchant\DataSources\V1\DataSource::class);
        $this->data_source = $var;

        return $this;
    }

    /**
     * Required. The list of data source fields to be updated.
     * Fields specified in the update mask without a value specified in the
     * body will be deleted from the data source.
     * Providing special "*" value for full data source replacement is not
     * supported.
     * For example, If you insert `updateMask=displayName` in the request, it will
     * only update the `displayName` leaving all other fields untouched.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];</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);
    }

    /**
     * Required. The list of data source fields to be updated.
     * Fields specified in the update mask without a value specified in the
     * body will be deleted from the data source.
     * Providing special "*" value for full data source replacement is not
     * supported.
     * For example, If you insert `updateMask=displayName` in the request, it will
     * only update the `displayName` leaving all other fields untouched.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];</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;
    }

}

