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

namespace Google\Cloud\DiscoveryEngine\V1beta;

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

/**
 * A custom attribute that is not explicitly modeled in a resource, e.g.
 * [UserEvent][google.cloud.discoveryengine.v1beta.UserEvent].
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1beta.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".
     * Empty string is not allowed. Otherwise, an `INVALID_ARGUMENT` error is
     * returned.
     * Exactly one of
     * [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
     * or
     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.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".
     * Exactly one of
     * [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
     * or
     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.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 array<string>|\Google\Protobuf\Internal\RepeatedField $text
     *           The textual values of this custom attribute. For example, `["yellow",
     *           "green"]` when the key is "color".
     *           Empty string is not allowed. Otherwise, an `INVALID_ARGUMENT` error is
     *           returned.
     *           Exactly one of
     *           [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
     *           or
     *           [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
     *           should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
     *     @type array<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".
     *           Exactly one of
     *           [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
     *           or
     *           [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
     *           should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\Common::initOnce();
        parent::__construct($data);
    }

    /**
     * The textual values of this custom attribute. For example, `["yellow",
     * "green"]` when the key is "color".
     * Empty string is not allowed. Otherwise, an `INVALID_ARGUMENT` error is
     * returned.
     * Exactly one of
     * [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
     * or
     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.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".
     * Empty string is not allowed. Otherwise, an `INVALID_ARGUMENT` error is
     * returned.
     * Exactly one of
     * [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
     * or
     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
     * should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
     *
     * Generated from protobuf field <code>repeated string text = 1;</code>
     * @param array<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".
     * Exactly one of
     * [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
     * or
     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.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".
     * Exactly one of
     * [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
     * or
     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
     * should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
     *
     * Generated from protobuf field <code>repeated double numbers = 2;</code>
     * @param array<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;
    }

}

