<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/recommendationengine/v1beta1/catalog.proto

namespace Google\Cloud\RecommendationEngine\V1beta1\CatalogItem;

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

/**
 * Category represents catalog item category hierarchy.
 *
 * Generated from protobuf message <code>google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy</code>
 */
class CategoryHierarchy extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Catalog item categories. Each category should be a UTF-8
     * encoded string with a length limit of 2 KiB.
     * Note that the order in the list denotes the specificity (from least to
     * most specific).
     *
     * Generated from protobuf field <code>repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $categories;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $categories
     *           Required. Catalog item categories. Each category should be a UTF-8
     *           encoded string with a length limit of 2 KiB.
     *           Note that the order in the list denotes the specificity (from least to
     *           most specific).
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Catalog::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Catalog item categories. Each category should be a UTF-8
     * encoded string with a length limit of 2 KiB.
     * Note that the order in the list denotes the specificity (from least to
     * most specific).
     *
     * Generated from protobuf field <code>repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getCategories()
    {
        return $this->categories;
    }

    /**
     * Required. Catalog item categories. Each category should be a UTF-8
     * encoded string with a length limit of 2 KiB.
     * Note that the order in the list denotes the specificity (from least to
     * most specific).
     *
     * Generated from protobuf field <code>repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setCategories($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->categories = $arr;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(CategoryHierarchy::class, \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem_CategoryHierarchy::class);

