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

namespace Google\Cloud\Retail\V2;

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

/**
 * Request message for
 * [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories]
 * method.
 *
 * Generated from protobuf message <code>google.cloud.retail.v2.RemoveLocalInventoriesRequest</code>
 */
class RemoveLocalInventoriesRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Full resource name of [Product][google.cloud.retail.v2.Product],
     * such as
     * `projects/&#42;&#47;locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
     * If the caller does not have permission to access the
     * [Product][google.cloud.retail.v2.Product], regardless of whether or not it
     * exists, a PERMISSION_DENIED error is returned.
     *
     * Generated from protobuf field <code>string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $product = '';
    /**
     * Required. A list of place IDs to have their inventory deleted.
     * At most 3000 place IDs are allowed per request.
     *
     * Generated from protobuf field <code>repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $place_ids;
    /**
     * The time when the inventory deletions are issued. Used to prevent
     * out-of-order updates and deletions on local inventory fields. If not
     * provided, the internal system time will be used.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp remove_time = 5;</code>
     */
    private $remove_time = null;
    /**
     * If set to true, and the [Product][google.cloud.retail.v2.Product] is not
     * found, the local inventory removal request will still be processed and
     * retained for at most 1 day and processed once the
     * [Product][google.cloud.retail.v2.Product] is created. If set to false, a
     * NOT_FOUND error is returned if the
     * [Product][google.cloud.retail.v2.Product] is not found.
     *
     * Generated from protobuf field <code>bool allow_missing = 3;</code>
     */
    private $allow_missing = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $product
     *           Required. Full resource name of [Product][google.cloud.retail.v2.Product],
     *           such as
     *           `projects/&#42;&#47;locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
     *           If the caller does not have permission to access the
     *           [Product][google.cloud.retail.v2.Product], regardless of whether or not it
     *           exists, a PERMISSION_DENIED error is returned.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $place_ids
     *           Required. A list of place IDs to have their inventory deleted.
     *           At most 3000 place IDs are allowed per request.
     *     @type \Google\Protobuf\Timestamp $remove_time
     *           The time when the inventory deletions are issued. Used to prevent
     *           out-of-order updates and deletions on local inventory fields. If not
     *           provided, the internal system time will be used.
     *     @type bool $allow_missing
     *           If set to true, and the [Product][google.cloud.retail.v2.Product] is not
     *           found, the local inventory removal request will still be processed and
     *           retained for at most 1 day and processed once the
     *           [Product][google.cloud.retail.v2.Product] is created. If set to false, a
     *           NOT_FOUND error is returned if the
     *           [Product][google.cloud.retail.v2.Product] is not found.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Retail\V2\ProductService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Full resource name of [Product][google.cloud.retail.v2.Product],
     * such as
     * `projects/&#42;&#47;locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
     * If the caller does not have permission to access the
     * [Product][google.cloud.retail.v2.Product], regardless of whether or not it
     * exists, a PERMISSION_DENIED error is returned.
     *
     * Generated from protobuf field <code>string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getProduct()
    {
        return $this->product;
    }

    /**
     * Required. Full resource name of [Product][google.cloud.retail.v2.Product],
     * such as
     * `projects/&#42;&#47;locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
     * If the caller does not have permission to access the
     * [Product][google.cloud.retail.v2.Product], regardless of whether or not it
     * exists, a PERMISSION_DENIED error is returned.
     *
     * Generated from protobuf field <code>string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setProduct($var)
    {
        GPBUtil::checkString($var, True);
        $this->product = $var;

        return $this;
    }

    /**
     * Required. A list of place IDs to have their inventory deleted.
     * At most 3000 place IDs are allowed per request.
     *
     * Generated from protobuf field <code>repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getPlaceIds()
    {
        return $this->place_ids;
    }

    /**
     * Required. A list of place IDs to have their inventory deleted.
     * At most 3000 place IDs are allowed per request.
     *
     * Generated from protobuf field <code>repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setPlaceIds($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->place_ids = $arr;

        return $this;
    }

    /**
     * The time when the inventory deletions are issued. Used to prevent
     * out-of-order updates and deletions on local inventory fields. If not
     * provided, the internal system time will be used.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp remove_time = 5;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getRemoveTime()
    {
        return $this->remove_time;
    }

    public function hasRemoveTime()
    {
        return isset($this->remove_time);
    }

    public function clearRemoveTime()
    {
        unset($this->remove_time);
    }

    /**
     * The time when the inventory deletions are issued. Used to prevent
     * out-of-order updates and deletions on local inventory fields. If not
     * provided, the internal system time will be used.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp remove_time = 5;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setRemoveTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->remove_time = $var;

        return $this;
    }

    /**
     * If set to true, and the [Product][google.cloud.retail.v2.Product] is not
     * found, the local inventory removal request will still be processed and
     * retained for at most 1 day and processed once the
     * [Product][google.cloud.retail.v2.Product] is created. If set to false, a
     * NOT_FOUND error is returned if the
     * [Product][google.cloud.retail.v2.Product] is not found.
     *
     * Generated from protobuf field <code>bool allow_missing = 3;</code>
     * @return bool
     */
    public function getAllowMissing()
    {
        return $this->allow_missing;
    }

    /**
     * If set to true, and the [Product][google.cloud.retail.v2.Product] is not
     * found, the local inventory removal request will still be processed and
     * retained for at most 1 day and processed once the
     * [Product][google.cloud.retail.v2.Product] is created. If set to false, a
     * NOT_FOUND error is returned if the
     * [Product][google.cloud.retail.v2.Product] is not found.
     *
     * Generated from protobuf field <code>bool allow_missing = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setAllowMissing($var)
    {
        GPBUtil::checkBool($var);
        $this->allow_missing = $var;

        return $this;
    }

}

