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

namespace Google\Cloud\AIPlatform\V1\FindNeighborsResponse;

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

/**
 * Nearest neighbors for one query.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors</code>
 */
class NearestNeighbors extends \Google\Protobuf\Internal\Message
{
    /**
     * The ID of the query datapoint.
     *
     * Generated from protobuf field <code>string id = 1;</code>
     */
    protected $id = '';
    /**
     * All its neighbors.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;</code>
     */
    private $neighbors;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $id
     *           The ID of the query datapoint.
     *     @type array<\Google\Cloud\AIPlatform\V1\FindNeighborsResponse\Neighbor>|\Google\Protobuf\Internal\RepeatedField $neighbors
     *           All its neighbors.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\MatchService::initOnce();
        parent::__construct($data);
    }

    /**
     * The ID of the query datapoint.
     *
     * Generated from protobuf field <code>string id = 1;</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * The ID of the query datapoint.
     *
     * Generated from protobuf field <code>string id = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * All its neighbors.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getNeighbors()
    {
        return $this->neighbors;
    }

    /**
     * All its neighbors.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;</code>
     * @param array<\Google\Cloud\AIPlatform\V1\FindNeighborsResponse\Neighbor>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setNeighbors($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\FindNeighborsResponse\Neighbor::class);
        $this->neighbors = $arr;

        return $this;
    }

}


