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

namespace Temporal\Api\Batch\V1;

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

/**
 * BatchOperationTriggerWorkflowRule sends TriggerWorkflowRule requests to batch workflows.
 *
 * Generated from protobuf message <code>temporal.api.batch.v1.BatchOperationTriggerWorkflowRule</code>
 */
class BatchOperationTriggerWorkflowRule extends \Google\Protobuf\Internal\Message
{
    /**
     * The identity of the worker/client.
     *
     * Generated from protobuf field <code>string identity = 1;</code>
     */
    protected $identity = '';
    protected $rule;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $identity
     *           The identity of the worker/client.
     *     @type string $id
     *           ID of existing rule.
     *     @type \Temporal\Api\Rules\V1\WorkflowRuleSpec $spec
     *           Rule specification to be applied to the workflow without creating a new rule.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Batch\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * The identity of the worker/client.
     *
     * Generated from protobuf field <code>string identity = 1;</code>
     * @return string
     */
    public function getIdentity()
    {
        return $this->identity;
    }

    /**
     * The identity of the worker/client.
     *
     * Generated from protobuf field <code>string identity = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setIdentity($var)
    {
        GPBUtil::checkString($var, True);
        $this->identity = $var;

        return $this;
    }

    /**
     * ID of existing rule.
     *
     * Generated from protobuf field <code>string id = 2;</code>
     * @return string
     */
    public function getId()
    {
        return $this->readOneof(2);
    }

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

    /**
     * ID of existing rule.
     *
     * Generated from protobuf field <code>string id = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Rule specification to be applied to the workflow without creating a new rule.
     *
     * Generated from protobuf field <code>.temporal.api.rules.v1.WorkflowRuleSpec spec = 3;</code>
     * @return \Temporal\Api\Rules\V1\WorkflowRuleSpec|null
     */
    public function getSpec()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Rule specification to be applied to the workflow without creating a new rule.
     *
     * Generated from protobuf field <code>.temporal.api.rules.v1.WorkflowRuleSpec spec = 3;</code>
     * @param \Temporal\Api\Rules\V1\WorkflowRuleSpec $var
     * @return $this
     */
    public function setSpec($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Rules\V1\WorkflowRuleSpec::class);
        $this->writeOneof(3, $var);

        return $this;
    }

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

}

