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

namespace Temporal\Api\Workflowservice\V1;

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

/**
 * Generated from protobuf message <code>temporal.api.workflowservice.v1.CreateWorkflowRuleRequest</code>
 */
class CreateWorkflowRuleRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string namespace = 1;</code>
     */
    protected $namespace = '';
    /**
     * The rule specification .
     *
     * Generated from protobuf field <code>.temporal.api.rules.v1.WorkflowRuleSpec spec = 2;</code>
     */
    protected $spec = null;
    /**
     * If true, the rule will be applied to the currently running workflows via batch job.
     * If not set , the rule will only be applied when triggering condition is satisfied.
     * visibility_query in the rule will be used to select the workflows to apply the rule to.
     *
     * Generated from protobuf field <code>bool force_scan = 3;</code>
     */
    protected $force_scan = false;
    /**
     * Used to de-dupe requests. Typically should be UUID.
     *
     * Generated from protobuf field <code>string request_id = 4;</code>
     */
    protected $request_id = '';
    /**
     * Identity of the actor who created the rule. Will be stored with the rule.
     *
     * Generated from protobuf field <code>string identity = 5;</code>
     */
    protected $identity = '';
    /**
     * Rule description.Will be stored with the rule.
     *
     * Generated from protobuf field <code>string description = 6;</code>
     */
    protected $description = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $namespace
     *     @type \Temporal\Api\Rules\V1\WorkflowRuleSpec $spec
     *           The rule specification .
     *     @type bool $force_scan
     *           If true, the rule will be applied to the currently running workflows via batch job.
     *           If not set , the rule will only be applied when triggering condition is satisfied.
     *           visibility_query in the rule will be used to select the workflows to apply the rule to.
     *     @type string $request_id
     *           Used to de-dupe requests. Typically should be UUID.
     *     @type string $identity
     *           Identity of the actor who created the rule. Will be stored with the rule.
     *     @type string $description
     *           Rule description.Will be stored with the rule.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Workflowservice\V1\RequestResponse::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>string namespace = 1;</code>
     * @return string
     */
    public function getNamespace()
    {
        return $this->namespace;
    }

    /**
     * Generated from protobuf field <code>string namespace = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setNamespace($var)
    {
        GPBUtil::checkString($var, True);
        $this->namespace = $var;

        return $this;
    }

    /**
     * The rule specification .
     *
     * Generated from protobuf field <code>.temporal.api.rules.v1.WorkflowRuleSpec spec = 2;</code>
     * @return \Temporal\Api\Rules\V1\WorkflowRuleSpec|null
     */
    public function getSpec()
    {
        return $this->spec;
    }

    public function hasSpec()
    {
        return isset($this->spec);
    }

    public function clearSpec()
    {
        unset($this->spec);
    }

    /**
     * The rule specification .
     *
     * Generated from protobuf field <code>.temporal.api.rules.v1.WorkflowRuleSpec spec = 2;</code>
     * @param \Temporal\Api\Rules\V1\WorkflowRuleSpec $var
     * @return $this
     */
    public function setSpec($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Rules\V1\WorkflowRuleSpec::class);
        $this->spec = $var;

        return $this;
    }

    /**
     * If true, the rule will be applied to the currently running workflows via batch job.
     * If not set , the rule will only be applied when triggering condition is satisfied.
     * visibility_query in the rule will be used to select the workflows to apply the rule to.
     *
     * Generated from protobuf field <code>bool force_scan = 3;</code>
     * @return bool
     */
    public function getForceScan()
    {
        return $this->force_scan;
    }

    /**
     * If true, the rule will be applied to the currently running workflows via batch job.
     * If not set , the rule will only be applied when triggering condition is satisfied.
     * visibility_query in the rule will be used to select the workflows to apply the rule to.
     *
     * Generated from protobuf field <code>bool force_scan = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setForceScan($var)
    {
        GPBUtil::checkBool($var);
        $this->force_scan = $var;

        return $this;
    }

    /**
     * Used to de-dupe requests. Typically should be UUID.
     *
     * Generated from protobuf field <code>string request_id = 4;</code>
     * @return string
     */
    public function getRequestId()
    {
        return $this->request_id;
    }

    /**
     * Used to de-dupe requests. Typically should be UUID.
     *
     * Generated from protobuf field <code>string request_id = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setRequestId($var)
    {
        GPBUtil::checkString($var, True);
        $this->request_id = $var;

        return $this;
    }

    /**
     * Identity of the actor who created the rule. Will be stored with the rule.
     *
     * Generated from protobuf field <code>string identity = 5;</code>
     * @return string
     */
    public function getIdentity()
    {
        return $this->identity;
    }

    /**
     * Identity of the actor who created the rule. Will be stored with the rule.
     *
     * Generated from protobuf field <code>string identity = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setIdentity($var)
    {
        GPBUtil::checkString($var, True);
        $this->identity = $var;

        return $this;
    }

    /**
     * Rule description.Will be stored with the rule.
     *
     * Generated from protobuf field <code>string description = 6;</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Rule description.Will be stored with the rule.
     *
     * Generated from protobuf field <code>string description = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

}

