<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/vision/v1/product_search_service.proto

namespace Google\Cloud\Vision\V1;

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

/**
 * A Product contains ReferenceImages.
 *
 * Generated from protobuf message <code>google.cloud.vision.v1.Product</code>
 */
class Product extends \Google\Protobuf\Internal\Message
{
    /**
     * The resource name of the product.
     * Format is:
     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
     * This field is ignored when creating a product.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    private $name = '';
    /**
     * The user-provided name for this Product. Must not be empty. Must be at most
     * 4096 characters long.
     *
     * Generated from protobuf field <code>string display_name = 2;</code>
     */
    private $display_name = '';
    /**
     * User-provided metadata to be stored with this product. Must be at most 4096
     * characters long.
     *
     * Generated from protobuf field <code>string description = 3;</code>
     */
    private $description = '';
    /**
     * The category for the product identified by the reference image. This should
     * be either "homegoods", "apparel", or "toys".
     * This field is immutable.
     *
     * Generated from protobuf field <code>string product_category = 4;</code>
     */
    private $product_category = '';
    /**
     * Key-value pairs that can be attached to a product. At query time,
     * constraints can be specified based on the product_labels.
     * Note that integer values can be provided as strings, e.g. "1199". Only
     * strings with integer values can match a range-based restriction which is
     * to be supported soon.
     * Multiple values can be assigned to the same key. One product may have up to
     * 100 product_labels.
     *
     * Generated from protobuf field <code>repeated .google.cloud.vision.v1.Product.KeyValue product_labels = 5;</code>
     */
    private $product_labels;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           The resource name of the product.
     *           Format is:
     *           `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
     *           This field is ignored when creating a product.
     *     @type string $display_name
     *           The user-provided name for this Product. Must not be empty. Must be at most
     *           4096 characters long.
     *     @type string $description
     *           User-provided metadata to be stored with this product. Must be at most 4096
     *           characters long.
     *     @type string $product_category
     *           The category for the product identified by the reference image. This should
     *           be either "homegoods", "apparel", or "toys".
     *           This field is immutable.
     *     @type \Google\Cloud\Vision\V1\Product\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $product_labels
     *           Key-value pairs that can be attached to a product. At query time,
     *           constraints can be specified based on the product_labels.
     *           Note that integer values can be provided as strings, e.g. "1199". Only
     *           strings with integer values can match a range-based restriction which is
     *           to be supported soon.
     *           Multiple values can be assigned to the same key. One product may have up to
     *           100 product_labels.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Vision\V1\ProductSearchService::initOnce();
        parent::__construct($data);
    }

    /**
     * The resource name of the product.
     * Format is:
     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
     * This field is ignored when creating a product.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * The resource name of the product.
     * Format is:
     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
     * This field is ignored when creating a product.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * The user-provided name for this Product. Must not be empty. Must be at most
     * 4096 characters long.
     *
     * Generated from protobuf field <code>string display_name = 2;</code>
     * @return string
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }

    /**
     * The user-provided name for this Product. Must not be empty. Must be at most
     * 4096 characters long.
     *
     * Generated from protobuf field <code>string display_name = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setDisplayName($var)
    {
        GPBUtil::checkString($var, True);
        $this->display_name = $var;

        return $this;
    }

    /**
     * User-provided metadata to be stored with this product. Must be at most 4096
     * characters long.
     *
     * Generated from protobuf field <code>string description = 3;</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * User-provided metadata to be stored with this product. Must be at most 4096
     * characters long.
     *
     * Generated from protobuf field <code>string description = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * The category for the product identified by the reference image. This should
     * be either "homegoods", "apparel", or "toys".
     * This field is immutable.
     *
     * Generated from protobuf field <code>string product_category = 4;</code>
     * @return string
     */
    public function getProductCategory()
    {
        return $this->product_category;
    }

    /**
     * The category for the product identified by the reference image. This should
     * be either "homegoods", "apparel", or "toys".
     * This field is immutable.
     *
     * Generated from protobuf field <code>string product_category = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setProductCategory($var)
    {
        GPBUtil::checkString($var, True);
        $this->product_category = $var;

        return $this;
    }

    /**
     * Key-value pairs that can be attached to a product. At query time,
     * constraints can be specified based on the product_labels.
     * Note that integer values can be provided as strings, e.g. "1199". Only
     * strings with integer values can match a range-based restriction which is
     * to be supported soon.
     * Multiple values can be assigned to the same key. One product may have up to
     * 100 product_labels.
     *
     * Generated from protobuf field <code>repeated .google.cloud.vision.v1.Product.KeyValue product_labels = 5;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getProductLabels()
    {
        return $this->product_labels;
    }

    /**
     * Key-value pairs that can be attached to a product. At query time,
     * constraints can be specified based on the product_labels.
     * Note that integer values can be provided as strings, e.g. "1199". Only
     * strings with integer values can match a range-based restriction which is
     * to be supported soon.
     * Multiple values can be assigned to the same key. One product may have up to
     * 100 product_labels.
     *
     * Generated from protobuf field <code>repeated .google.cloud.vision.v1.Product.KeyValue product_labels = 5;</code>
     * @param \Google\Cloud\Vision\V1\Product\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setProductLabels($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Vision\V1\Product\KeyValue::class);
        $this->product_labels = $arr;

        return $this;
    }

}

