<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: temporal/api/workflowservice/v1/request_response.proto

namespace Temporal\Api\Workflowservice\V1\DescribeTaskQueueResponse;

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

/**
 * Generated from protobuf message <code>temporal.api.workflowservice.v1.DescribeTaskQueueResponse.EffectiveRateLimit</code>
 */
class EffectiveRateLimit extends \Google\Protobuf\Internal\Message
{
    /**
     * The effective rate limit for the task queue.
     *
     * Generated from protobuf field <code>float requests_per_second = 1;</code>
     */
    protected $requests_per_second = 0.0;
    /**
     * Source of the RateLimit Configuration,which can be one of the following values:
     * - SOURCE_API: The rate limit that is set via the TaskQueueConfig api.
     * - SOURCE_WORKER: The rate limit is the value set using the workerOptions in TaskQueueActivitiesPerSecond.
     * - SOURCE_SYSTEM: The rate limit is the default value set by the system
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.RateLimitSource rate_limit_source = 2;</code>
     */
    protected $rate_limit_source = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type float $requests_per_second
     *           The effective rate limit for the task queue.
     *     @type int $rate_limit_source
     *           Source of the RateLimit Configuration,which can be one of the following values:
     *           - SOURCE_API: The rate limit that is set via the TaskQueueConfig api.
     *           - SOURCE_WORKER: The rate limit is the value set using the workerOptions in TaskQueueActivitiesPerSecond.
     *           - SOURCE_SYSTEM: The rate limit is the default value set by the system
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Workflowservice\V1\RequestResponse::initOnce();
        parent::__construct($data);
    }

    /**
     * The effective rate limit for the task queue.
     *
     * Generated from protobuf field <code>float requests_per_second = 1;</code>
     * @return float
     */
    public function getRequestsPerSecond()
    {
        return $this->requests_per_second;
    }

    /**
     * The effective rate limit for the task queue.
     *
     * Generated from protobuf field <code>float requests_per_second = 1;</code>
     * @param float $var
     * @return $this
     */
    public function setRequestsPerSecond($var)
    {
        GPBUtil::checkFloat($var);
        $this->requests_per_second = $var;

        return $this;
    }

    /**
     * Source of the RateLimit Configuration,which can be one of the following values:
     * - SOURCE_API: The rate limit that is set via the TaskQueueConfig api.
     * - SOURCE_WORKER: The rate limit is the value set using the workerOptions in TaskQueueActivitiesPerSecond.
     * - SOURCE_SYSTEM: The rate limit is the default value set by the system
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.RateLimitSource rate_limit_source = 2;</code>
     * @return int
     */
    public function getRateLimitSource()
    {
        return $this->rate_limit_source;
    }

    /**
     * Source of the RateLimit Configuration,which can be one of the following values:
     * - SOURCE_API: The rate limit that is set via the TaskQueueConfig api.
     * - SOURCE_WORKER: The rate limit is the value set using the workerOptions in TaskQueueActivitiesPerSecond.
     * - SOURCE_SYSTEM: The rate limit is the default value set by the system
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.RateLimitSource rate_limit_source = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setRateLimitSource($var)
    {
        GPBUtil::checkEnum($var, \Temporal\Api\Enums\V1\RateLimitSource::class);
        $this->rate_limit_source = $var;

        return $this;
    }

}

