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

namespace Temporal\Api\History\V1;

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

/**
 * Generated from protobuf message <code>temporal.api.history.v1.MarkerRecordedEventAttributes</code>
 */
class MarkerRecordedEventAttributes extends \Google\Protobuf\Internal\Message
{
    /**
     * Workers use this to identify the "types" of various markers. Ex: Local activity, side effect.
     *
     * Generated from protobuf field <code>string marker_name = 1;</code>
     */
    protected $marker_name = '';
    /**
     * Serialized information recorded in the marker
     *
     * Generated from protobuf field <code>map<string, .temporal.api.common.v1.Payloads> details = 2;</code>
     */
    private $details;
    /**
     * The `WORKFLOW_TASK_COMPLETED` event which this command was reported with
     *
     * Generated from protobuf field <code>int64 workflow_task_completed_event_id = 3;</code>
     */
    protected $workflow_task_completed_event_id = 0;
    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.Header header = 4;</code>
     */
    protected $header = null;
    /**
     * Some uses of markers, like a local activity, could "fail". If they did that is recorded here.
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure failure = 5;</code>
     */
    protected $failure = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $marker_name
     *           Workers use this to identify the "types" of various markers. Ex: Local activity, side effect.
     *     @type array|\Google\Protobuf\Internal\MapField $details
     *           Serialized information recorded in the marker
     *     @type int|string $workflow_task_completed_event_id
     *           The `WORKFLOW_TASK_COMPLETED` event which this command was reported with
     *     @type \Temporal\Api\Common\V1\Header $header
     *     @type \Temporal\Api\Failure\V1\Failure $failure
     *           Some uses of markers, like a local activity, could "fail". If they did that is recorded here.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\History\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * Workers use this to identify the "types" of various markers. Ex: Local activity, side effect.
     *
     * Generated from protobuf field <code>string marker_name = 1;</code>
     * @return string
     */
    public function getMarkerName()
    {
        return $this->marker_name;
    }

    /**
     * Workers use this to identify the "types" of various markers. Ex: Local activity, side effect.
     *
     * Generated from protobuf field <code>string marker_name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setMarkerName($var)
    {
        GPBUtil::checkString($var, True);
        $this->marker_name = $var;

        return $this;
    }

    /**
     * Serialized information recorded in the marker
     *
     * Generated from protobuf field <code>map<string, .temporal.api.common.v1.Payloads> details = 2;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getDetails()
    {
        return $this->details;
    }

    /**
     * Serialized information recorded in the marker
     *
     * Generated from protobuf field <code>map<string, .temporal.api.common.v1.Payloads> details = 2;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setDetails($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Temporal\Api\Common\V1\Payloads::class);
        $this->details = $arr;

        return $this;
    }

    /**
     * The `WORKFLOW_TASK_COMPLETED` event which this command was reported with
     *
     * Generated from protobuf field <code>int64 workflow_task_completed_event_id = 3;</code>
     * @return int|string
     */
    public function getWorkflowTaskCompletedEventId()
    {
        return $this->workflow_task_completed_event_id;
    }

    /**
     * The `WORKFLOW_TASK_COMPLETED` event which this command was reported with
     *
     * Generated from protobuf field <code>int64 workflow_task_completed_event_id = 3;</code>
     * @param int|string $var
     * @return $this
     */
    public function setWorkflowTaskCompletedEventId($var)
    {
        GPBUtil::checkInt64($var);
        $this->workflow_task_completed_event_id = $var;

        return $this;
    }

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

    public function hasHeader()
    {
        return isset($this->header);
    }

    public function clearHeader()
    {
        unset($this->header);
    }

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

        return $this;
    }

    /**
     * Some uses of markers, like a local activity, could "fail". If they did that is recorded here.
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure failure = 5;</code>
     * @return \Temporal\Api\Failure\V1\Failure|null
     */
    public function getFailure()
    {
        return $this->failure;
    }

    public function hasFailure()
    {
        return isset($this->failure);
    }

    public function clearFailure()
    {
        unset($this->failure);
    }

    /**
     * Some uses of markers, like a local activity, could "fail". If they did that is recorded here.
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure failure = 5;</code>
     * @param \Temporal\Api\Failure\V1\Failure $var
     * @return $this
     */
    public function setFailure($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Failure\V1\Failure::class);
        $this->failure = $var;

        return $this;
    }

}

