<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: couchbase/routing/v1/routing.proto

namespace Couchbase\Protostellar\Generated\Routing\V1;

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

/**
 * Generated from protobuf message <code>couchbase.routing.v1.WatchRoutingResponse</code>
 */
class WatchRoutingResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * Represents the revision of this configuration.  The revision not being
     * included indicates that this configuration is not versioned.  Configuration
     * revisions can only be compared for responses from the same request values
     * (different buckets may have uniquely incremented revisions).  Revision
     * comparison is done in order of the revision data, for instance we may have
     * [major, minor, patch].  Revisions may be any number of values long, and any
     * missing values should be assumed as 0 (except in the completely empty case,
     * where it is considered unused).
     *
     * Generated from protobuf field <code>repeated uint64 revision = 1;</code>
     */
    private $revision;
    /**
     * Represents a complete list of all endpoints that are available for this
     * cluster.
     *
     * Generated from protobuf field <code>repeated .couchbase.routing.v1.RoutingEndpoint endpoints = 2;</code>
     */
    private $endpoints;
    /**
     * Generated from protobuf field <code>optional .couchbase.routing.v1.QueryRouting query_routing = 4;</code>
     */
    protected $query_routing = null;
    /**
     * Generated from protobuf field <code>optional .couchbase.routing.v1.ViewsRouting views_routing = 5;</code>
     */
    protected $views_routing = null;
    protected $data_routing;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<int>|array<string>|\Google\Protobuf\Internal\RepeatedField $revision
     *           Represents the revision of this configuration.  The revision not being
     *           included indicates that this configuration is not versioned.  Configuration
     *           revisions can only be compared for responses from the same request values
     *           (different buckets may have uniquely incremented revisions).  Revision
     *           comparison is done in order of the revision data, for instance we may have
     *           [major, minor, patch].  Revisions may be any number of values long, and any
     *           missing values should be assumed as 0 (except in the completely empty case,
     *           where it is considered unused).
     *     @type array<\Couchbase\Protostellar\Generated\Routing\V1\RoutingEndpoint>|\Google\Protobuf\Internal\RepeatedField $endpoints
     *           Represents a complete list of all endpoints that are available for this
     *           cluster.
     *     @type \Couchbase\Protostellar\Generated\Routing\V1\VbucketDataRoutingStrategy $vbucket_data_routing
     *     @type \Couchbase\Protostellar\Generated\Routing\V1\QueryRouting $query_routing
     *     @type \Couchbase\Protostellar\Generated\Routing\V1\ViewsRouting $views_routing
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Couchbase\Routing\V1\Routing::initOnce();
        parent::__construct($data);
    }

    /**
     * Represents the revision of this configuration.  The revision not being
     * included indicates that this configuration is not versioned.  Configuration
     * revisions can only be compared for responses from the same request values
     * (different buckets may have uniquely incremented revisions).  Revision
     * comparison is done in order of the revision data, for instance we may have
     * [major, minor, patch].  Revisions may be any number of values long, and any
     * missing values should be assumed as 0 (except in the completely empty case,
     * where it is considered unused).
     *
     * Generated from protobuf field <code>repeated uint64 revision = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getRevision()
    {
        return $this->revision;
    }

    /**
     * Represents the revision of this configuration.  The revision not being
     * included indicates that this configuration is not versioned.  Configuration
     * revisions can only be compared for responses from the same request values
     * (different buckets may have uniquely incremented revisions).  Revision
     * comparison is done in order of the revision data, for instance we may have
     * [major, minor, patch].  Revisions may be any number of values long, and any
     * missing values should be assumed as 0 (except in the completely empty case,
     * where it is considered unused).
     *
     * Generated from protobuf field <code>repeated uint64 revision = 1;</code>
     * @param array<int>|array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setRevision($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::UINT64);
        $this->revision = $arr;

        return $this;
    }

    /**
     * Represents a complete list of all endpoints that are available for this
     * cluster.
     *
     * Generated from protobuf field <code>repeated .couchbase.routing.v1.RoutingEndpoint endpoints = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getEndpoints()
    {
        return $this->endpoints;
    }

    /**
     * Represents a complete list of all endpoints that are available for this
     * cluster.
     *
     * Generated from protobuf field <code>repeated .couchbase.routing.v1.RoutingEndpoint endpoints = 2;</code>
     * @param array<\Couchbase\Protostellar\Generated\Routing\V1\RoutingEndpoint>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setEndpoints($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Couchbase\Protostellar\Generated\Routing\V1\RoutingEndpoint::class);
        $this->endpoints = $arr;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.couchbase.routing.v1.VbucketDataRoutingStrategy vbucket_data_routing = 3;</code>
     * @return \Couchbase\Protostellar\Generated\Routing\V1\VbucketDataRoutingStrategy|null
     */
    public function getVbucketDataRouting()
    {
        return $this->readOneof(3);
    }

    public function hasVbucketDataRouting()
    {
        return $this->hasOneof(3);
    }

    /**
     * Generated from protobuf field <code>.couchbase.routing.v1.VbucketDataRoutingStrategy vbucket_data_routing = 3;</code>
     * @param \Couchbase\Protostellar\Generated\Routing\V1\VbucketDataRoutingStrategy $var
     * @return $this
     */
    public function setVbucketDataRouting($var)
    {
        GPBUtil::checkMessage($var, \Couchbase\Protostellar\Generated\Routing\V1\VbucketDataRoutingStrategy::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .couchbase.routing.v1.QueryRouting query_routing = 4;</code>
     * @return \Couchbase\Protostellar\Generated\Routing\V1\QueryRouting|null
     */
    public function getQueryRouting()
    {
        return $this->query_routing;
    }

    public function hasQueryRouting()
    {
        return isset($this->query_routing);
    }

    public function clearQueryRouting()
    {
        unset($this->query_routing);
    }

    /**
     * Generated from protobuf field <code>optional .couchbase.routing.v1.QueryRouting query_routing = 4;</code>
     * @param \Couchbase\Protostellar\Generated\Routing\V1\QueryRouting $var
     * @return $this
     */
    public function setQueryRouting($var)
    {
        GPBUtil::checkMessage($var, \Couchbase\Protostellar\Generated\Routing\V1\QueryRouting::class);
        $this->query_routing = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .couchbase.routing.v1.ViewsRouting views_routing = 5;</code>
     * @return \Couchbase\Protostellar\Generated\Routing\V1\ViewsRouting|null
     */
    public function getViewsRouting()
    {
        return $this->views_routing;
    }

    public function hasViewsRouting()
    {
        return isset($this->views_routing);
    }

    public function clearViewsRouting()
    {
        unset($this->views_routing);
    }

    /**
     * Generated from protobuf field <code>optional .couchbase.routing.v1.ViewsRouting views_routing = 5;</code>
     * @param \Couchbase\Protostellar\Generated\Routing\V1\ViewsRouting $var
     * @return $this
     */
    public function setViewsRouting($var)
    {
        GPBUtil::checkMessage($var, \Couchbase\Protostellar\Generated\Routing\V1\ViewsRouting::class);
        $this->views_routing = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getDataRouting()
    {
        return $this->whichOneof("data_routing");
    }

}

