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

namespace Google\Cloud\Retail\V2;

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

/**
 * Request message for Import methods.
 *
 * Generated from protobuf message <code>google.cloud.retail.v2.ImportProductsRequest</code>
 */
class ImportProductsRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required.
     * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
     * If no updateMask is specified, requires products.create permission.
     * If updateMask is specified, requires products.update permission.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';
    /**
     * Deprecated. This field has no effect.
     *
     * Generated from protobuf field <code>string request_id = 6 [deprecated = true];</code>
     * @deprecated
     */
    protected $request_id = '';
    /**
     * Required. The desired input location of the data.
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $input_config = null;
    /**
     * The desired location of errors incurred during the Import.
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.ImportErrorsConfig errors_config = 3;</code>
     */
    private $errors_config = null;
    /**
     * Indicates which fields in the provided imported `products` to update. If
     * not set, all fields are updated.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 4;</code>
     */
    private $update_mask = null;
    /**
     * The mode of reconciliation between existing products and the products to be
     * imported. Defaults to
     * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5;</code>
     */
    private $reconciliation_mode = 0;
    /**
     * Full Pub/Sub topic name for receiving notification. If this field is set,
     * when the import is finished, a notification is sent to
     * specified Pub/Sub topic. The message data is JSON string of a
     * [Operation][google.longrunning.Operation].
     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has
     * to be within the same project as
     * [ImportProductsRequest.parent][google.cloud.retail.v2.ImportProductsRequest.parent].
     * Make sure that `service-<project
     * number>&#64;gcp-sa-retail.iam.gserviceaccount.com` has the
     * `pubsub.topics.publish` IAM permission on the topic.
     *
     * Generated from protobuf field <code>string notification_pubsub_topic = 7;</code>
     */
    private $notification_pubsub_topic = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required.
     *           `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
     *           If no updateMask is specified, requires products.create permission.
     *           If updateMask is specified, requires products.update permission.
     *     @type string $request_id
     *           Deprecated. This field has no effect.
     *     @type \Google\Cloud\Retail\V2\ProductInputConfig $input_config
     *           Required. The desired input location of the data.
     *     @type \Google\Cloud\Retail\V2\ImportErrorsConfig $errors_config
     *           The desired location of errors incurred during the Import.
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           Indicates which fields in the provided imported `products` to update. If
     *           not set, all fields are updated.
     *     @type int $reconciliation_mode
     *           The mode of reconciliation between existing products and the products to be
     *           imported. Defaults to
     *           [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
     *     @type string $notification_pubsub_topic
     *           Full Pub/Sub topic name for receiving notification. If this field is set,
     *           when the import is finished, a notification is sent to
     *           specified Pub/Sub topic. The message data is JSON string of a
     *           [Operation][google.longrunning.Operation].
     *           Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has
     *           to be within the same project as
     *           [ImportProductsRequest.parent][google.cloud.retail.v2.ImportProductsRequest.parent].
     *           Make sure that `service-<project
     *           number>&#64;gcp-sa-retail.iam.gserviceaccount.com` has the
     *           `pubsub.topics.publish` IAM permission on the topic.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Retail\V2\ImportConfig::initOnce();
        parent::__construct($data);
    }

    /**
     * Required.
     * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
     * If no updateMask is specified, requires products.create permission.
     * If updateMask is specified, requires products.update permission.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required.
     * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
     * If no updateMask is specified, requires products.create permission.
     * If updateMask is specified, requires products.update permission.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Deprecated. This field has no effect.
     *
     * Generated from protobuf field <code>string request_id = 6 [deprecated = true];</code>
     * @return string
     * @deprecated
     */
    public function getRequestId()
    {
        @trigger_error('request_id is deprecated.', E_USER_DEPRECATED);
        return $this->request_id;
    }

    /**
     * Deprecated. This field has no effect.
     *
     * Generated from protobuf field <code>string request_id = 6 [deprecated = true];</code>
     * @param string $var
     * @return $this
     * @deprecated
     */
    public function setRequestId($var)
    {
        @trigger_error('request_id is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkString($var, True);
        $this->request_id = $var;

        return $this;
    }

    /**
     * Required. The desired input location of the data.
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Retail\V2\ProductInputConfig|null
     */
    public function getInputConfig()
    {
        return $this->input_config;
    }

    public function hasInputConfig()
    {
        return isset($this->input_config);
    }

    public function clearInputConfig()
    {
        unset($this->input_config);
    }

    /**
     * Required. The desired input location of the data.
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Retail\V2\ProductInputConfig $var
     * @return $this
     */
    public function setInputConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductInputConfig::class);
        $this->input_config = $var;

        return $this;
    }

    /**
     * The desired location of errors incurred during the Import.
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.ImportErrorsConfig errors_config = 3;</code>
     * @return \Google\Cloud\Retail\V2\ImportErrorsConfig|null
     */
    public function getErrorsConfig()
    {
        return $this->errors_config;
    }

    public function hasErrorsConfig()
    {
        return isset($this->errors_config);
    }

    public function clearErrorsConfig()
    {
        unset($this->errors_config);
    }

    /**
     * The desired location of errors incurred during the Import.
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.ImportErrorsConfig errors_config = 3;</code>
     * @param \Google\Cloud\Retail\V2\ImportErrorsConfig $var
     * @return $this
     */
    public function setErrorsConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ImportErrorsConfig::class);
        $this->errors_config = $var;

        return $this;
    }

    /**
     * Indicates which fields in the provided imported `products` to update. If
     * not set, all fields are updated.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 4;</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 imported `products` to update. If
     * not set, all fields are updated.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 4;</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;
    }

    /**
     * The mode of reconciliation between existing products and the products to be
     * imported. Defaults to
     * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5;</code>
     * @return int
     */
    public function getReconciliationMode()
    {
        return $this->reconciliation_mode;
    }

    /**
     * The mode of reconciliation between existing products and the products to be
     * imported. Defaults to
     * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setReconciliationMode($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\ImportProductsRequest\ReconciliationMode::class);
        $this->reconciliation_mode = $var;

        return $this;
    }

    /**
     * Full Pub/Sub topic name for receiving notification. If this field is set,
     * when the import is finished, a notification is sent to
     * specified Pub/Sub topic. The message data is JSON string of a
     * [Operation][google.longrunning.Operation].
     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has
     * to be within the same project as
     * [ImportProductsRequest.parent][google.cloud.retail.v2.ImportProductsRequest.parent].
     * Make sure that `service-<project
     * number>&#64;gcp-sa-retail.iam.gserviceaccount.com` has the
     * `pubsub.topics.publish` IAM permission on the topic.
     *
     * Generated from protobuf field <code>string notification_pubsub_topic = 7;</code>
     * @return string
     */
    public function getNotificationPubsubTopic()
    {
        return $this->notification_pubsub_topic;
    }

    /**
     * Full Pub/Sub topic name for receiving notification. If this field is set,
     * when the import is finished, a notification is sent to
     * specified Pub/Sub topic. The message data is JSON string of a
     * [Operation][google.longrunning.Operation].
     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has
     * to be within the same project as
     * [ImportProductsRequest.parent][google.cloud.retail.v2.ImportProductsRequest.parent].
     * Make sure that `service-<project
     * number>&#64;gcp-sa-retail.iam.gserviceaccount.com` has the
     * `pubsub.topics.publish` IAM permission on the topic.
     *
     * Generated from protobuf field <code>string notification_pubsub_topic = 7;</code>
     * @param string $var
     * @return $this
     */
    public function setNotificationPubsubTopic($var)
    {
        GPBUtil::checkString($var, True);
        $this->notification_pubsub_topic = $var;

        return $this;
    }

}

