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

namespace Temporal\Api\Query\V1;

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

/**
 * See https://docs.temporal.io/docs/concepts/queries/
 *
 * Generated from protobuf message <code>temporal.api.query.v1.WorkflowQuery</code>
 */
class WorkflowQuery extends \Google\Protobuf\Internal\Message
{
    /**
     * The workflow-author-defined identifier of the query. Typically a function name.
     *
     * Generated from protobuf field <code>string query_type = 1;</code>
     */
    protected $query_type = '';
    /**
     * Serialized arguments that will be provided to the query handler.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Payloads query_args = 2;</code>
     */
    protected $query_args = null;
    /**
     * Headers that were passed by the caller of the query and copied by temporal
     * server into the workflow task.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Header header = 3;</code>
     */
    protected $header = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $query_type
     *           The workflow-author-defined identifier of the query. Typically a function name.
     *     @type \Temporal\Api\Common\V1\Payloads $query_args
     *           Serialized arguments that will be provided to the query handler.
     *     @type \Temporal\Api\Common\V1\Header $header
     *           Headers that were passed by the caller of the query and copied by temporal
     *           server into the workflow task.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Query\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * The workflow-author-defined identifier of the query. Typically a function name.
     *
     * Generated from protobuf field <code>string query_type = 1;</code>
     * @return string
     */
    public function getQueryType()
    {
        return $this->query_type;
    }

    /**
     * The workflow-author-defined identifier of the query. Typically a function name.
     *
     * Generated from protobuf field <code>string query_type = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setQueryType($var)
    {
        GPBUtil::checkString($var, True);
        $this->query_type = $var;

        return $this;
    }

    /**
     * Serialized arguments that will be provided to the query handler.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Payloads query_args = 2;</code>
     * @return \Temporal\Api\Common\V1\Payloads|null
     */
    public function getQueryArgs()
    {
        return $this->query_args;
    }

    public function hasQueryArgs()
    {
        return isset($this->query_args);
    }

    public function clearQueryArgs()
    {
        unset($this->query_args);
    }

    /**
     * Serialized arguments that will be provided to the query handler.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Payloads query_args = 2;</code>
     * @param \Temporal\Api\Common\V1\Payloads $var
     * @return $this
     */
    public function setQueryArgs($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\Payloads::class);
        $this->query_args = $var;

        return $this;
    }

    /**
     * Headers that were passed by the caller of the query and copied by temporal
     * server into the workflow task.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Header header = 3;</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);
    }

    /**
     * Headers that were passed by the caller of the query and copied by temporal
     * server into the workflow task.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Header header = 3;</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;
    }

}

