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

namespace Temporal\Api\Sdk\V1;

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

/**
 * Generated from protobuf message <code>temporal.api.sdk.v1.WorkerConfig</code>
 */
class WorkerConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>int32 workflow_cache_size = 1;</code>
     */
    protected $workflow_cache_size = 0;
    protected $poller_behavior;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $workflow_cache_size
     *     @type \Temporal\Api\Sdk\V1\WorkerConfig\SimplePollerBehavior $simple_poller_behavior
     *     @type \Temporal\Api\Sdk\V1\WorkerConfig\AutoscalingPollerBehavior $autoscaling_poller_behavior
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Sdk\V1\WorkerConfig::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>int32 workflow_cache_size = 1;</code>
     * @return int
     */
    public function getWorkflowCacheSize()
    {
        return $this->workflow_cache_size;
    }

    /**
     * Generated from protobuf field <code>int32 workflow_cache_size = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setWorkflowCacheSize($var)
    {
        GPBUtil::checkInt32($var);
        $this->workflow_cache_size = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.sdk.v1.WorkerConfig.SimplePollerBehavior simple_poller_behavior = 2;</code>
     * @return \Temporal\Api\Sdk\V1\WorkerConfig\SimplePollerBehavior|null
     */
    public function getSimplePollerBehavior()
    {
        return $this->readOneof(2);
    }

    public function hasSimplePollerBehavior()
    {
        return $this->hasOneof(2);
    }

    /**
     * Generated from protobuf field <code>.temporal.api.sdk.v1.WorkerConfig.SimplePollerBehavior simple_poller_behavior = 2;</code>
     * @param \Temporal\Api\Sdk\V1\WorkerConfig\SimplePollerBehavior $var
     * @return $this
     */
    public function setSimplePollerBehavior($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Sdk\V1\WorkerConfig\SimplePollerBehavior::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.sdk.v1.WorkerConfig.AutoscalingPollerBehavior autoscaling_poller_behavior = 3;</code>
     * @return \Temporal\Api\Sdk\V1\WorkerConfig\AutoscalingPollerBehavior|null
     */
    public function getAutoscalingPollerBehavior()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Generated from protobuf field <code>.temporal.api.sdk.v1.WorkerConfig.AutoscalingPollerBehavior autoscaling_poller_behavior = 3;</code>
     * @param \Temporal\Api\Sdk\V1\WorkerConfig\AutoscalingPollerBehavior $var
     * @return $this
     */
    public function setAutoscalingPollerBehavior($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Sdk\V1\WorkerConfig\AutoscalingPollerBehavior::class);
        $this->writeOneof(3, $var);

        return $this;
    }

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

}

