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

namespace Google\Cloud\Retail\V2;

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

/**
 * A custom attribute that is not explicitly modeled in
 * [Product][google.cloud.retail.v2.Product]].
 *
 * Generated from protobuf message <code>google.cloud.retail.v2.CustomAttribute</code>
 */
class CustomAttribute extends \Google\Protobuf\Internal\Message
{
    /**
     * The textual values of this custom attribute. For example, `["yellow",
     * "green"]` when the key is "color".
     * At most 400 values are allowed. Empty values are not allowed. Each value
     * must be a UTF-8 encoded string with a length limit of 256 characters.
     * Otherwise, an INVALID_ARGUMENT error is returned.
     * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or
     * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set.
     * Otherwise, an INVALID_ARGUMENT error is returned.
     *
     * Generated from protobuf field <code>repeated string text = 1;</code>
     */
    private $text;
    /**
     * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
     * when the key is "lengths_cm".
     * At most 400 values are allowed.Otherwise, an INVALID_ARGUMENT error is
     * returned.
     * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or
     * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set.
     * Otherwise, an INVALID_ARGUMENT error is returned.
     *
     * Generated from protobuf field <code>repeated double numbers = 2;</code>
     */
    private $numbers;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $text
     *           The textual values of this custom attribute. For example, `["yellow",
     *           "green"]` when the key is "color".
     *           At most 400 values are allowed. Empty values are not allowed. Each value
     *           must be a UTF-8 encoded string with a length limit of 256 characters.
     *           Otherwise, an INVALID_ARGUMENT error is returned.
     *           Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or
     *           [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set.
     *           Otherwise, an INVALID_ARGUMENT error is returned.
     *     @type float[]|\Google\Protobuf\Internal\RepeatedField $numbers
     *           The numerical values of this custom attribute. For example, `[2.3, 15.4]`
     *           when the key is "lengths_cm".
     *           At most 400 values are allowed.Otherwise, an INVALID_ARGUMENT error is
     *           returned.
     *           Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or
     *           [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set.
     *           Otherwise, an INVALID_ARGUMENT error is returned.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Retail\V2\Common::initOnce();
        parent::__construct($data);
    }

    /**
     * The textual values of this custom attribute. For example, `["yellow",
     * "green"]` when the key is "color".
     * At most 400 values are allowed. Empty values are not allowed. Each value
     * must be a UTF-8 encoded string with a length limit of 256 characters.
     * Otherwise, an INVALID_ARGUMENT error is returned.
     * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or
     * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set.
     * Otherwise, an INVALID_ARGUMENT error is returned.
     *
     * Generated from protobuf field <code>repeated string text = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getText()
    {
        return $this->text;
    }

    /**
     * The textual values of this custom attribute. For example, `["yellow",
     * "green"]` when the key is "color".
     * At most 400 values are allowed. Empty values are not allowed. Each value
     * must be a UTF-8 encoded string with a length limit of 256 characters.
     * Otherwise, an INVALID_ARGUMENT error is returned.
     * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or
     * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set.
     * Otherwise, an INVALID_ARGUMENT error is returned.
     *
     * Generated from protobuf field <code>repeated string text = 1;</code>
     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setText($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->text = $arr;

        return $this;
    }

    /**
     * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
     * when the key is "lengths_cm".
     * At most 400 values are allowed.Otherwise, an INVALID_ARGUMENT error is
     * returned.
     * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or
     * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set.
     * Otherwise, an INVALID_ARGUMENT error is returned.
     *
     * Generated from protobuf field <code>repeated double numbers = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getNumbers()
    {
        return $this->numbers;
    }

    /**
     * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
     * when the key is "lengths_cm".
     * At most 400 values are allowed.Otherwise, an INVALID_ARGUMENT error is
     * returned.
     * Exactly one of [text][google.cloud.retail.v2.CustomAttribute.text] or
     * [numbers][google.cloud.retail.v2.CustomAttribute.numbers] should be set.
     * Otherwise, an INVALID_ARGUMENT error is returned.
     *
     * Generated from protobuf field <code>repeated double numbers = 2;</code>
     * @param float[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setNumbers($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::DOUBLE);
        $this->numbers = $arr;

        return $this;
    }

}

