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

namespace Temporal\Api\Worker\V1;

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

/**
 * Generated from protobuf message <code>temporal.api.worker.v1.WorkerPollerInfo</code>
 */
class WorkerPollerInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * Number of polling RPCs that are currently in flight.
     *
     * Generated from protobuf field <code>int32 current_pollers = 1;</code>
     */
    protected $current_pollers = 0;
    /**
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_successful_poll_time = 2;</code>
     */
    protected $last_successful_poll_time = null;
    /**
     * Set true if the number of concurrent pollers is auto-scaled
     *
     * Generated from protobuf field <code>bool is_autoscaling = 3;</code>
     */
    protected $is_autoscaling = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $current_pollers
     *           Number of polling RPCs that are currently in flight.
     *     @type \Google\Protobuf\Timestamp $last_successful_poll_time
     *     @type bool $is_autoscaling
     *           Set true if the number of concurrent pollers is auto-scaled
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Worker\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * Number of polling RPCs that are currently in flight.
     *
     * Generated from protobuf field <code>int32 current_pollers = 1;</code>
     * @return int
     */
    public function getCurrentPollers()
    {
        return $this->current_pollers;
    }

    /**
     * Number of polling RPCs that are currently in flight.
     *
     * Generated from protobuf field <code>int32 current_pollers = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setCurrentPollers($var)
    {
        GPBUtil::checkInt32($var);
        $this->current_pollers = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_successful_poll_time = 2;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getLastSuccessfulPollTime()
    {
        return $this->last_successful_poll_time;
    }

    public function hasLastSuccessfulPollTime()
    {
        return isset($this->last_successful_poll_time);
    }

    public function clearLastSuccessfulPollTime()
    {
        unset($this->last_successful_poll_time);
    }

    /**
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_successful_poll_time = 2;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setLastSuccessfulPollTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->last_successful_poll_time = $var;

        return $this;
    }

    /**
     * Set true if the number of concurrent pollers is auto-scaled
     *
     * Generated from protobuf field <code>bool is_autoscaling = 3;</code>
     * @return bool
     */
    public function getIsAutoscaling()
    {
        return $this->is_autoscaling;
    }

    /**
     * Set true if the number of concurrent pollers is auto-scaled
     *
     * Generated from protobuf field <code>bool is_autoscaling = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setIsAutoscaling($var)
    {
        GPBUtil::checkBool($var);
        $this->is_autoscaling = $var;

        return $this;
    }

}

