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

namespace Google\Shopping\Merchant\Products\V1;

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

/**
 * Request message for the UpdateProductInput method.
 * The product (primary input) must exist for the update to succeed.
 * If the update is for a primary product input, the existing primary product
 * input must be from the same data source.
 *
 * Generated from protobuf message <code>google.shopping.merchant.products.v1.UpdateProductInputRequest</code>
 */
class UpdateProductInputRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The product input resource to update. Information you submit will
     * be applied to the processed product as well. The `name` field within this
     * resource identifies the product input to be updated.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductInput product_input = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $product_input = null;
    /**
     * Optional. The list of product attributes to be updated.
     * If the update mask is omitted, then it is treated as implied field mask
     * equivalent to all fields that are populated (have a non-empty value).
     * Attributes specified in the update mask without a value specified in the
     * body will be deleted from the product.
     * Update mask can only be specified for top level fields in
     * attributes and custom attributes.
     * To specify the update mask for custom attributes you need to add the
     * `custom_attribute.` prefix.
     * Providing special "*" value for full product replacement is not supported.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $update_mask = null;
    /**
     * Required. The primary or supplemental product data source where
     * `data_source` name identifies the product input to be updated.
     * Only API data sources are supported.
     * Format: `accounts/{account}/dataSources/{datasource}`. For example,
     * `accounts/123456/dataSources/104628`.
     *
     * Generated from protobuf field <code>string data_source = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $data_source = '';

    /**
     * @param \Google\Shopping\Merchant\Products\V1\ProductInput $productInput Required. The product input resource to update. Information you submit will
     *                                                                         be applied to the processed product as well. The `name` field within this
     *                                                                         resource identifies the product input to be updated.
     * @param \Google\Protobuf\FieldMask                         $updateMask   Optional. The list of product attributes to be updated.
     *
     *                                                                         If the update mask is omitted, then it is treated as implied field mask
     *                                                                         equivalent to all fields that are populated (have a non-empty value).
     *
     *                                                                         Attributes specified in the update mask without a value specified in the
     *                                                                         body will be deleted from the product.
     *
     *                                                                         Update mask can only be specified for top level fields in
     *                                                                         attributes and custom attributes.
     *
     *                                                                         To specify the update mask for custom attributes you need to add the
     *                                                                         `custom_attribute.` prefix.
     *
     *                                                                         Providing special "*" value for full product replacement is not supported.
     *
     * @return \Google\Shopping\Merchant\Products\V1\UpdateProductInputRequest
     *
     * @experimental
     */
    public static function build(\Google\Shopping\Merchant\Products\V1\ProductInput $productInput, \Google\Protobuf\FieldMask $updateMask): self
    {
        return (new self())
            ->setProductInput($productInput)
            ->setUpdateMask($updateMask);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Shopping\Merchant\Products\V1\ProductInput $product_input
     *           Required. The product input resource to update. Information you submit will
     *           be applied to the processed product as well. The `name` field within this
     *           resource identifies the product input to be updated.
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           Optional. The list of product attributes to be updated.
     *           If the update mask is omitted, then it is treated as implied field mask
     *           equivalent to all fields that are populated (have a non-empty value).
     *           Attributes specified in the update mask without a value specified in the
     *           body will be deleted from the product.
     *           Update mask can only be specified for top level fields in
     *           attributes and custom attributes.
     *           To specify the update mask for custom attributes you need to add the
     *           `custom_attribute.` prefix.
     *           Providing special "*" value for full product replacement is not supported.
     *     @type string $data_source
     *           Required. The primary or supplemental product data source where
     *           `data_source` name identifies the product input to be updated.
     *           Only API data sources are supported.
     *           Format: `accounts/{account}/dataSources/{datasource}`. For example,
     *           `accounts/123456/dataSources/104628`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Products\V1\Productinputs::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The product input resource to update. Information you submit will
     * be applied to the processed product as well. The `name` field within this
     * resource identifies the product input to be updated.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductInput product_input = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Shopping\Merchant\Products\V1\ProductInput|null
     */
    public function getProductInput()
    {
        return $this->product_input;
    }

    public function hasProductInput()
    {
        return isset($this->product_input);
    }

    public function clearProductInput()
    {
        unset($this->product_input);
    }

    /**
     * Required. The product input resource to update. Information you submit will
     * be applied to the processed product as well. The `name` field within this
     * resource identifies the product input to be updated.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductInput product_input = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Shopping\Merchant\Products\V1\ProductInput $var
     * @return $this
     */
    public function setProductInput($var)
    {
        GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1\ProductInput::class);
        $this->product_input = $var;

        return $this;
    }

    /**
     * Optional. The list of product attributes to be updated.
     * If the update mask is omitted, then it is treated as implied field mask
     * equivalent to all fields that are populated (have a non-empty value).
     * Attributes specified in the update mask without a value specified in the
     * body will be deleted from the product.
     * Update mask can only be specified for top level fields in
     * attributes and custom attributes.
     * To specify the update mask for custom attributes you need to add the
     * `custom_attribute.` prefix.
     * Providing special "*" value for full product replacement is not supported.
     *
     * 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. The list of product attributes to be updated.
     * If the update mask is omitted, then it is treated as implied field mask
     * equivalent to all fields that are populated (have a non-empty value).
     * Attributes specified in the update mask without a value specified in the
     * body will be deleted from the product.
     * Update mask can only be specified for top level fields in
     * attributes and custom attributes.
     * To specify the update mask for custom attributes you need to add the
     * `custom_attribute.` prefix.
     * Providing special "*" value for full product replacement is not supported.
     *
     * 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;
    }

    /**
     * Required. The primary or supplemental product data source where
     * `data_source` name identifies the product input to be updated.
     * Only API data sources are supported.
     * Format: `accounts/{account}/dataSources/{datasource}`. For example,
     * `accounts/123456/dataSources/104628`.
     *
     * Generated from protobuf field <code>string data_source = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getDataSource()
    {
        return $this->data_source;
    }

    /**
     * Required. The primary or supplemental product data source where
     * `data_source` name identifies the product input to be updated.
     * Only API data sources are supported.
     * Format: `accounts/{account}/dataSources/{datasource}`. For example,
     * `accounts/123456/dataSources/104628`.
     *
     * Generated from protobuf field <code>string data_source = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setDataSource($var)
    {
        GPBUtil::checkString($var, True);
        $this->data_source = $var;

        return $this;
    }

}

