<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: apache/rocketmq/v2/service.proto

namespace Apache\Rocketmq\V2;

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

/**
 * Generated from protobuf message <code>apache.rocketmq.v2.Settings</code>
 */
class Settings extends \Google\Protobuf\Internal\Message
{
    /**
     * Configurations for all clients.
     *
     * Generated from protobuf field <code>optional .apache.rocketmq.v2.ClientType client_type = 1;</code>
     */
    protected $client_type = null;
    /**
     * Generated from protobuf field <code>optional .apache.rocketmq.v2.Endpoints access_point = 2;</code>
     */
    protected $access_point = null;
    /**
     * If publishing of messages encounters throttling or server internal errors,
     * publishers should implement automatic retries after progressive longer
     * back-offs for consecutive errors.
     * When processing message fails, `backoff_policy` describes an interval
     * after which the message should be available to consume again.
     * For FIFO messages, the interval should be relatively small because
     * messages of the same message group would not be readily available until
     * the prior one depletes its lifecycle.
     *
     * Generated from protobuf field <code>optional .apache.rocketmq.v2.RetryPolicy backoff_policy = 3;</code>
     */
    protected $backoff_policy = null;
    /**
     * Request timeout for RPCs excluding long-polling.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Duration request_timeout = 4;</code>
     */
    protected $request_timeout = null;
    /**
     * User agent details
     *
     * Generated from protobuf field <code>.apache.rocketmq.v2.UA user_agent = 7;</code>
     */
    protected $user_agent = null;
    /**
     * Generated from protobuf field <code>.apache.rocketmq.v2.Metric metric = 8;</code>
     */
    protected $metric = null;
    protected $pub_sub;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $client_type
     *           Configurations for all clients.
     *     @type \Apache\Rocketmq\V2\Endpoints $access_point
     *     @type \Apache\Rocketmq\V2\RetryPolicy $backoff_policy
     *           If publishing of messages encounters throttling or server internal errors,
     *           publishers should implement automatic retries after progressive longer
     *           back-offs for consecutive errors.
     *           When processing message fails, `backoff_policy` describes an interval
     *           after which the message should be available to consume again.
     *           For FIFO messages, the interval should be relatively small because
     *           messages of the same message group would not be readily available until
     *           the prior one depletes its lifecycle.
     *     @type \Google\Protobuf\Duration $request_timeout
     *           Request timeout for RPCs excluding long-polling.
     *     @type \Apache\Rocketmq\V2\Publishing $publishing
     *     @type \Apache\Rocketmq\V2\Subscription $subscription
     *     @type \Apache\Rocketmq\V2\UA $user_agent
     *           User agent details
     *     @type \Apache\Rocketmq\V2\Metric $metric
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Apache\Rocketmq\V2\Service::initOnce();
        parent::__construct($data);
    }

    /**
     * Configurations for all clients.
     *
     * Generated from protobuf field <code>optional .apache.rocketmq.v2.ClientType client_type = 1;</code>
     * @return int
     */
    public function getClientType()
    {
        return isset($this->client_type) ? $this->client_type : 0;
    }

    public function hasClientType()
    {
        return isset($this->client_type);
    }

    public function clearClientType()
    {
        unset($this->client_type);
    }

    /**
     * Configurations for all clients.
     *
     * Generated from protobuf field <code>optional .apache.rocketmq.v2.ClientType client_type = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setClientType($var)
    {
        GPBUtil::checkEnum($var, \Apache\Rocketmq\V2\ClientType::class);
        $this->client_type = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .apache.rocketmq.v2.Endpoints access_point = 2;</code>
     * @return \Apache\Rocketmq\V2\Endpoints|null
     */
    public function getAccessPoint()
    {
        return $this->access_point;
    }

    public function hasAccessPoint()
    {
        return isset($this->access_point);
    }

    public function clearAccessPoint()
    {
        unset($this->access_point);
    }

    /**
     * Generated from protobuf field <code>optional .apache.rocketmq.v2.Endpoints access_point = 2;</code>
     * @param \Apache\Rocketmq\V2\Endpoints $var
     * @return $this
     */
    public function setAccessPoint($var)
    {
        GPBUtil::checkMessage($var, \Apache\Rocketmq\V2\Endpoints::class);
        $this->access_point = $var;

        return $this;
    }

    /**
     * If publishing of messages encounters throttling or server internal errors,
     * publishers should implement automatic retries after progressive longer
     * back-offs for consecutive errors.
     * When processing message fails, `backoff_policy` describes an interval
     * after which the message should be available to consume again.
     * For FIFO messages, the interval should be relatively small because
     * messages of the same message group would not be readily available until
     * the prior one depletes its lifecycle.
     *
     * Generated from protobuf field <code>optional .apache.rocketmq.v2.RetryPolicy backoff_policy = 3;</code>
     * @return \Apache\Rocketmq\V2\RetryPolicy|null
     */
    public function getBackoffPolicy()
    {
        return $this->backoff_policy;
    }

    public function hasBackoffPolicy()
    {
        return isset($this->backoff_policy);
    }

    public function clearBackoffPolicy()
    {
        unset($this->backoff_policy);
    }

    /**
     * If publishing of messages encounters throttling or server internal errors,
     * publishers should implement automatic retries after progressive longer
     * back-offs for consecutive errors.
     * When processing message fails, `backoff_policy` describes an interval
     * after which the message should be available to consume again.
     * For FIFO messages, the interval should be relatively small because
     * messages of the same message group would not be readily available until
     * the prior one depletes its lifecycle.
     *
     * Generated from protobuf field <code>optional .apache.rocketmq.v2.RetryPolicy backoff_policy = 3;</code>
     * @param \Apache\Rocketmq\V2\RetryPolicy $var
     * @return $this
     */
    public function setBackoffPolicy($var)
    {
        GPBUtil::checkMessage($var, \Apache\Rocketmq\V2\RetryPolicy::class);
        $this->backoff_policy = $var;

        return $this;
    }

    /**
     * Request timeout for RPCs excluding long-polling.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Duration request_timeout = 4;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getRequestTimeout()
    {
        return $this->request_timeout;
    }

    public function hasRequestTimeout()
    {
        return isset($this->request_timeout);
    }

    public function clearRequestTimeout()
    {
        unset($this->request_timeout);
    }

    /**
     * Request timeout for RPCs excluding long-polling.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Duration request_timeout = 4;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setRequestTimeout($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->request_timeout = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.apache.rocketmq.v2.Publishing publishing = 5;</code>
     * @return \Apache\Rocketmq\V2\Publishing|null
     */
    public function getPublishing()
    {
        return $this->readOneof(5);
    }

    public function hasPublishing()
    {
        return $this->hasOneof(5);
    }

    /**
     * Generated from protobuf field <code>.apache.rocketmq.v2.Publishing publishing = 5;</code>
     * @param \Apache\Rocketmq\V2\Publishing $var
     * @return $this
     */
    public function setPublishing($var)
    {
        GPBUtil::checkMessage($var, \Apache\Rocketmq\V2\Publishing::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.apache.rocketmq.v2.Subscription subscription = 6;</code>
     * @return \Apache\Rocketmq\V2\Subscription|null
     */
    public function getSubscription()
    {
        return $this->readOneof(6);
    }

    public function hasSubscription()
    {
        return $this->hasOneof(6);
    }

    /**
     * Generated from protobuf field <code>.apache.rocketmq.v2.Subscription subscription = 6;</code>
     * @param \Apache\Rocketmq\V2\Subscription $var
     * @return $this
     */
    public function setSubscription($var)
    {
        GPBUtil::checkMessage($var, \Apache\Rocketmq\V2\Subscription::class);
        $this->writeOneof(6, $var);

        return $this;
    }

    /**
     * User agent details
     *
     * Generated from protobuf field <code>.apache.rocketmq.v2.UA user_agent = 7;</code>
     * @return \Apache\Rocketmq\V2\UA|null
     */
    public function getUserAgent()
    {
        return $this->user_agent;
    }

    public function hasUserAgent()
    {
        return isset($this->user_agent);
    }

    public function clearUserAgent()
    {
        unset($this->user_agent);
    }

    /**
     * User agent details
     *
     * Generated from protobuf field <code>.apache.rocketmq.v2.UA user_agent = 7;</code>
     * @param \Apache\Rocketmq\V2\UA $var
     * @return $this
     */
    public function setUserAgent($var)
    {
        GPBUtil::checkMessage($var, \Apache\Rocketmq\V2\UA::class);
        $this->user_agent = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.apache.rocketmq.v2.Metric metric = 8;</code>
     * @return \Apache\Rocketmq\V2\Metric|null
     */
    public function getMetric()
    {
        return $this->metric;
    }

    public function hasMetric()
    {
        return isset($this->metric);
    }

    public function clearMetric()
    {
        unset($this->metric);
    }

    /**
     * Generated from protobuf field <code>.apache.rocketmq.v2.Metric metric = 8;</code>
     * @param \Apache\Rocketmq\V2\Metric $var
     * @return $this
     */
    public function setMetric($var)
    {
        GPBUtil::checkMessage($var, \Apache\Rocketmq\V2\Metric::class);
        $this->metric = $var;

        return $this;
    }

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

}

