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

namespace Temporal\Api\Activity\V1;

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

/**
 * Generated from protobuf message <code>temporal.api.activity.v1.ActivityOptions</code>
 */
class ActivityOptions extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>.temporal.api.taskqueue.v1.TaskQueue task_queue = 1;</code>
     */
    protected $task_queue = null;
    /**
     * Indicates how long the caller is willing to wait for an activity completion. Limits how long
     * retries will be attempted. Either this or `start_to_close_timeout` must be specified.
     * (-- api-linter: core::0140::prepositions=disabled
     *     aip.dev/not-precedent: "to" is used to indicate interval. --)
     *
     * Generated from protobuf field <code>.google.protobuf.Duration schedule_to_close_timeout = 2;</code>
     */
    protected $schedule_to_close_timeout = null;
    /**
     * Limits time an activity task can stay in a task queue before a worker picks it up. This
     * timeout is always non retryable, as all a retry would achieve is to put it back into the same
     * queue. Defaults to `schedule_to_close_timeout` or workflow execution timeout if not
     * specified.
     * (-- api-linter: core::0140::prepositions=disabled
     *     aip.dev/not-precedent: "to" is used to indicate interval. --)
     *
     * Generated from protobuf field <code>.google.protobuf.Duration schedule_to_start_timeout = 3;</code>
     */
    protected $schedule_to_start_timeout = null;
    /**
     * Maximum time an activity is allowed to execute after being picked up by a worker. This
     * timeout is always retryable. Either this or `schedule_to_close_timeout` must be
     * specified.
     * (-- api-linter: core::0140::prepositions=disabled
     *     aip.dev/not-precedent: "to" is used to indicate interval. --)
     *
     * Generated from protobuf field <code>.google.protobuf.Duration start_to_close_timeout = 4;</code>
     */
    protected $start_to_close_timeout = null;
    /**
     * Maximum permitted time between successful worker heartbeats.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration heartbeat_timeout = 5;</code>
     */
    protected $heartbeat_timeout = null;
    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.RetryPolicy retry_policy = 6;</code>
     */
    protected $retry_policy = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Temporal\Api\Taskqueue\V1\TaskQueue $task_queue
     *     @type \Google\Protobuf\Duration $schedule_to_close_timeout
     *           Indicates how long the caller is willing to wait for an activity completion. Limits how long
     *           retries will be attempted. Either this or `start_to_close_timeout` must be specified.
     *           (-- api-linter: core::0140::prepositions=disabled
     *               aip.dev/not-precedent: "to" is used to indicate interval. --)
     *     @type \Google\Protobuf\Duration $schedule_to_start_timeout
     *           Limits time an activity task can stay in a task queue before a worker picks it up. This
     *           timeout is always non retryable, as all a retry would achieve is to put it back into the same
     *           queue. Defaults to `schedule_to_close_timeout` or workflow execution timeout if not
     *           specified.
     *           (-- api-linter: core::0140::prepositions=disabled
     *               aip.dev/not-precedent: "to" is used to indicate interval. --)
     *     @type \Google\Protobuf\Duration $start_to_close_timeout
     *           Maximum time an activity is allowed to execute after being picked up by a worker. This
     *           timeout is always retryable. Either this or `schedule_to_close_timeout` must be
     *           specified.
     *           (-- api-linter: core::0140::prepositions=disabled
     *               aip.dev/not-precedent: "to" is used to indicate interval. --)
     *     @type \Google\Protobuf\Duration $heartbeat_timeout
     *           Maximum permitted time between successful worker heartbeats.
     *     @type \Temporal\Api\Common\V1\RetryPolicy $retry_policy
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Activity\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>.temporal.api.taskqueue.v1.TaskQueue task_queue = 1;</code>
     * @return \Temporal\Api\Taskqueue\V1\TaskQueue|null
     */
    public function getTaskQueue()
    {
        return $this->task_queue;
    }

    public function hasTaskQueue()
    {
        return isset($this->task_queue);
    }

    public function clearTaskQueue()
    {
        unset($this->task_queue);
    }

    /**
     * Generated from protobuf field <code>.temporal.api.taskqueue.v1.TaskQueue task_queue = 1;</code>
     * @param \Temporal\Api\Taskqueue\V1\TaskQueue $var
     * @return $this
     */
    public function setTaskQueue($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Taskqueue\V1\TaskQueue::class);
        $this->task_queue = $var;

        return $this;
    }

    /**
     * Indicates how long the caller is willing to wait for an activity completion. Limits how long
     * retries will be attempted. Either this or `start_to_close_timeout` must be specified.
     * (-- api-linter: core::0140::prepositions=disabled
     *     aip.dev/not-precedent: "to" is used to indicate interval. --)
     *
     * Generated from protobuf field <code>.google.protobuf.Duration schedule_to_close_timeout = 2;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getScheduleToCloseTimeout()
    {
        return $this->schedule_to_close_timeout;
    }

    public function hasScheduleToCloseTimeout()
    {
        return isset($this->schedule_to_close_timeout);
    }

    public function clearScheduleToCloseTimeout()
    {
        unset($this->schedule_to_close_timeout);
    }

    /**
     * Indicates how long the caller is willing to wait for an activity completion. Limits how long
     * retries will be attempted. Either this or `start_to_close_timeout` must be specified.
     * (-- api-linter: core::0140::prepositions=disabled
     *     aip.dev/not-precedent: "to" is used to indicate interval. --)
     *
     * Generated from protobuf field <code>.google.protobuf.Duration schedule_to_close_timeout = 2;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setScheduleToCloseTimeout($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->schedule_to_close_timeout = $var;

        return $this;
    }

    /**
     * Limits time an activity task can stay in a task queue before a worker picks it up. This
     * timeout is always non retryable, as all a retry would achieve is to put it back into the same
     * queue. Defaults to `schedule_to_close_timeout` or workflow execution timeout if not
     * specified.
     * (-- api-linter: core::0140::prepositions=disabled
     *     aip.dev/not-precedent: "to" is used to indicate interval. --)
     *
     * Generated from protobuf field <code>.google.protobuf.Duration schedule_to_start_timeout = 3;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getScheduleToStartTimeout()
    {
        return $this->schedule_to_start_timeout;
    }

    public function hasScheduleToStartTimeout()
    {
        return isset($this->schedule_to_start_timeout);
    }

    public function clearScheduleToStartTimeout()
    {
        unset($this->schedule_to_start_timeout);
    }

    /**
     * Limits time an activity task can stay in a task queue before a worker picks it up. This
     * timeout is always non retryable, as all a retry would achieve is to put it back into the same
     * queue. Defaults to `schedule_to_close_timeout` or workflow execution timeout if not
     * specified.
     * (-- api-linter: core::0140::prepositions=disabled
     *     aip.dev/not-precedent: "to" is used to indicate interval. --)
     *
     * Generated from protobuf field <code>.google.protobuf.Duration schedule_to_start_timeout = 3;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setScheduleToStartTimeout($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->schedule_to_start_timeout = $var;

        return $this;
    }

    /**
     * Maximum time an activity is allowed to execute after being picked up by a worker. This
     * timeout is always retryable. Either this or `schedule_to_close_timeout` must be
     * specified.
     * (-- api-linter: core::0140::prepositions=disabled
     *     aip.dev/not-precedent: "to" is used to indicate interval. --)
     *
     * Generated from protobuf field <code>.google.protobuf.Duration start_to_close_timeout = 4;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getStartToCloseTimeout()
    {
        return $this->start_to_close_timeout;
    }

    public function hasStartToCloseTimeout()
    {
        return isset($this->start_to_close_timeout);
    }

    public function clearStartToCloseTimeout()
    {
        unset($this->start_to_close_timeout);
    }

    /**
     * Maximum time an activity is allowed to execute after being picked up by a worker. This
     * timeout is always retryable. Either this or `schedule_to_close_timeout` must be
     * specified.
     * (-- api-linter: core::0140::prepositions=disabled
     *     aip.dev/not-precedent: "to" is used to indicate interval. --)
     *
     * Generated from protobuf field <code>.google.protobuf.Duration start_to_close_timeout = 4;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setStartToCloseTimeout($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->start_to_close_timeout = $var;

        return $this;
    }

    /**
     * Maximum permitted time between successful worker heartbeats.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration heartbeat_timeout = 5;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getHeartbeatTimeout()
    {
        return $this->heartbeat_timeout;
    }

    public function hasHeartbeatTimeout()
    {
        return isset($this->heartbeat_timeout);
    }

    public function clearHeartbeatTimeout()
    {
        unset($this->heartbeat_timeout);
    }

    /**
     * Maximum permitted time between successful worker heartbeats.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration heartbeat_timeout = 5;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setHeartbeatTimeout($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->heartbeat_timeout = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.RetryPolicy retry_policy = 6;</code>
     * @return \Temporal\Api\Common\V1\RetryPolicy|null
     */
    public function getRetryPolicy()
    {
        return $this->retry_policy;
    }

    public function hasRetryPolicy()
    {
        return isset($this->retry_policy);
    }

    public function clearRetryPolicy()
    {
        unset($this->retry_policy);
    }

    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.RetryPolicy retry_policy = 6;</code>
     * @param \Temporal\Api\Common\V1\RetryPolicy $var
     * @return $this
     */
    public function setRetryPolicy($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\RetryPolicy::class);
        $this->retry_policy = $var;

        return $this;
    }

}

