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

namespace Temporal\Api\Failure\V1;

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

/**
 * Generated from protobuf message <code>temporal.api.failure.v1.NexusHandlerFailureInfo</code>
 */
class NexusHandlerFailureInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * The Nexus error type as defined in the spec:
     * https://github.com/nexus-rpc/api/blob/main/SPEC.md#predefined-handler-errors.
     *
     * Generated from protobuf field <code>string type = 1;</code>
     */
    protected $type = '';
    /**
     * Retry behavior, defaults to the retry behavior of the error type as defined in the spec.
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.NexusHandlerErrorRetryBehavior retry_behavior = 2;</code>
     */
    protected $retry_behavior = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $type
     *           The Nexus error type as defined in the spec:
     *           https://github.com/nexus-rpc/api/blob/main/SPEC.md#predefined-handler-errors.
     *     @type int $retry_behavior
     *           Retry behavior, defaults to the retry behavior of the error type as defined in the spec.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Failure\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * The Nexus error type as defined in the spec:
     * https://github.com/nexus-rpc/api/blob/main/SPEC.md#predefined-handler-errors.
     *
     * Generated from protobuf field <code>string type = 1;</code>
     * @return string
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * The Nexus error type as defined in the spec:
     * https://github.com/nexus-rpc/api/blob/main/SPEC.md#predefined-handler-errors.
     *
     * Generated from protobuf field <code>string type = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkString($var, True);
        $this->type = $var;

        return $this;
    }

    /**
     * Retry behavior, defaults to the retry behavior of the error type as defined in the spec.
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.NexusHandlerErrorRetryBehavior retry_behavior = 2;</code>
     * @return int
     */
    public function getRetryBehavior()
    {
        return $this->retry_behavior;
    }

    /**
     * Retry behavior, defaults to the retry behavior of the error type as defined in the spec.
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.NexusHandlerErrorRetryBehavior retry_behavior = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setRetryBehavior($var)
    {
        GPBUtil::checkEnum($var, \Temporal\Api\Enums\V1\NexusHandlerErrorRetryBehavior::class);
        $this->retry_behavior = $var;

        return $this;
    }

}

