<?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.WorkerSlotsInfo</code>
 */
class WorkerSlotsInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * Number of slots available for the worker to specific tasks.
     * May be -1 if the upper bound is not known.
     *
     * Generated from protobuf field <code>int32 current_available_slots = 1;</code>
     */
    protected $current_available_slots = 0;
    /**
     * Number of slots used by the worker for specific tasks.
     *
     * Generated from protobuf field <code>int32 current_used_slots = 2;</code>
     */
    protected $current_used_slots = 0;
    /**
     * Kind of the slot supplier, which is used to determine how the slots are allocated.
     * Possible values: "Fixed | ResourceBased | Custom String"
     *
     * Generated from protobuf field <code>string slot_supplier_kind = 3;</code>
     */
    protected $slot_supplier_kind = '';
    /**
     * Total number of tasks processed (completed both successfully and unsuccesfully, or any other way)
     * by the worker since the worker started. This is a cumulative counter.
     *
     * Generated from protobuf field <code>int32 total_processed_tasks = 4;</code>
     */
    protected $total_processed_tasks = 0;
    /**
     * Total number of failed tasks processed by the worker so far.
     *
     * Generated from protobuf field <code>int32 total_failed_tasks = 5;</code>
     */
    protected $total_failed_tasks = 0;
    /**
     * Number of tasks processed in since the last heartbeat from the worker.
     * This is a cumulative counter, and it is reset to 0 each time the worker sends a heartbeat.
     * Contains both successful and failed tasks.
     *
     * Generated from protobuf field <code>int32 last_interval_processed_tasks = 6;</code>
     */
    protected $last_interval_processed_tasks = 0;
    /**
     * Number of failed tasks processed since the last heartbeat from the worker.
     *
     * Generated from protobuf field <code>int32 last_interval_failure_tasks = 7;</code>
     */
    protected $last_interval_failure_tasks = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $current_available_slots
     *           Number of slots available for the worker to specific tasks.
     *           May be -1 if the upper bound is not known.
     *     @type int $current_used_slots
     *           Number of slots used by the worker for specific tasks.
     *     @type string $slot_supplier_kind
     *           Kind of the slot supplier, which is used to determine how the slots are allocated.
     *           Possible values: "Fixed | ResourceBased | Custom String"
     *     @type int $total_processed_tasks
     *           Total number of tasks processed (completed both successfully and unsuccesfully, or any other way)
     *           by the worker since the worker started. This is a cumulative counter.
     *     @type int $total_failed_tasks
     *           Total number of failed tasks processed by the worker so far.
     *     @type int $last_interval_processed_tasks
     *           Number of tasks processed in since the last heartbeat from the worker.
     *           This is a cumulative counter, and it is reset to 0 each time the worker sends a heartbeat.
     *           Contains both successful and failed tasks.
     *     @type int $last_interval_failure_tasks
     *           Number of failed tasks processed since the last heartbeat from the worker.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Worker\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * Number of slots available for the worker to specific tasks.
     * May be -1 if the upper bound is not known.
     *
     * Generated from protobuf field <code>int32 current_available_slots = 1;</code>
     * @return int
     */
    public function getCurrentAvailableSlots()
    {
        return $this->current_available_slots;
    }

    /**
     * Number of slots available for the worker to specific tasks.
     * May be -1 if the upper bound is not known.
     *
     * Generated from protobuf field <code>int32 current_available_slots = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setCurrentAvailableSlots($var)
    {
        GPBUtil::checkInt32($var);
        $this->current_available_slots = $var;

        return $this;
    }

    /**
     * Number of slots used by the worker for specific tasks.
     *
     * Generated from protobuf field <code>int32 current_used_slots = 2;</code>
     * @return int
     */
    public function getCurrentUsedSlots()
    {
        return $this->current_used_slots;
    }

    /**
     * Number of slots used by the worker for specific tasks.
     *
     * Generated from protobuf field <code>int32 current_used_slots = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setCurrentUsedSlots($var)
    {
        GPBUtil::checkInt32($var);
        $this->current_used_slots = $var;

        return $this;
    }

    /**
     * Kind of the slot supplier, which is used to determine how the slots are allocated.
     * Possible values: "Fixed | ResourceBased | Custom String"
     *
     * Generated from protobuf field <code>string slot_supplier_kind = 3;</code>
     * @return string
     */
    public function getSlotSupplierKind()
    {
        return $this->slot_supplier_kind;
    }

    /**
     * Kind of the slot supplier, which is used to determine how the slots are allocated.
     * Possible values: "Fixed | ResourceBased | Custom String"
     *
     * Generated from protobuf field <code>string slot_supplier_kind = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setSlotSupplierKind($var)
    {
        GPBUtil::checkString($var, True);
        $this->slot_supplier_kind = $var;

        return $this;
    }

    /**
     * Total number of tasks processed (completed both successfully and unsuccesfully, or any other way)
     * by the worker since the worker started. This is a cumulative counter.
     *
     * Generated from protobuf field <code>int32 total_processed_tasks = 4;</code>
     * @return int
     */
    public function getTotalProcessedTasks()
    {
        return $this->total_processed_tasks;
    }

    /**
     * Total number of tasks processed (completed both successfully and unsuccesfully, or any other way)
     * by the worker since the worker started. This is a cumulative counter.
     *
     * Generated from protobuf field <code>int32 total_processed_tasks = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setTotalProcessedTasks($var)
    {
        GPBUtil::checkInt32($var);
        $this->total_processed_tasks = $var;

        return $this;
    }

    /**
     * Total number of failed tasks processed by the worker so far.
     *
     * Generated from protobuf field <code>int32 total_failed_tasks = 5;</code>
     * @return int
     */
    public function getTotalFailedTasks()
    {
        return $this->total_failed_tasks;
    }

    /**
     * Total number of failed tasks processed by the worker so far.
     *
     * Generated from protobuf field <code>int32 total_failed_tasks = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setTotalFailedTasks($var)
    {
        GPBUtil::checkInt32($var);
        $this->total_failed_tasks = $var;

        return $this;
    }

    /**
     * Number of tasks processed in since the last heartbeat from the worker.
     * This is a cumulative counter, and it is reset to 0 each time the worker sends a heartbeat.
     * Contains both successful and failed tasks.
     *
     * Generated from protobuf field <code>int32 last_interval_processed_tasks = 6;</code>
     * @return int
     */
    public function getLastIntervalProcessedTasks()
    {
        return $this->last_interval_processed_tasks;
    }

    /**
     * Number of tasks processed in since the last heartbeat from the worker.
     * This is a cumulative counter, and it is reset to 0 each time the worker sends a heartbeat.
     * Contains both successful and failed tasks.
     *
     * Generated from protobuf field <code>int32 last_interval_processed_tasks = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setLastIntervalProcessedTasks($var)
    {
        GPBUtil::checkInt32($var);
        $this->last_interval_processed_tasks = $var;

        return $this;
    }

    /**
     * Number of failed tasks processed since the last heartbeat from the worker.
     *
     * Generated from protobuf field <code>int32 last_interval_failure_tasks = 7;</code>
     * @return int
     */
    public function getLastIntervalFailureTasks()
    {
        return $this->last_interval_failure_tasks;
    }

    /**
     * Number of failed tasks processed since the last heartbeat from the worker.
     *
     * Generated from protobuf field <code>int32 last_interval_failure_tasks = 7;</code>
     * @param int $var
     * @return $this
     */
    public function setLastIntervalFailureTasks($var)
    {
        GPBUtil::checkInt32($var);
        $this->last_interval_failure_tasks = $var;

        return $this;
    }

}

