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

namespace Temporal\Api\Errordetails\V1;

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

/**
 * Generated from protobuf message <code>temporal.api.errordetails.v1.QueryFailedFailure</code>
 */
class QueryFailedFailure extends \Google\Protobuf\Internal\Message
{
    /**
     * The full reason for this query failure. May not be available if the response is generated by an old
     * SDK. This field can be encoded by the SDK's failure converter to support E2E encryption of messages and stack
     * traces.
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure failure = 1;</code>
     */
    protected $failure = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Temporal\Api\Failure\V1\Failure $failure
     *           The full reason for this query failure. May not be available if the response is generated by an old
     *           SDK. This field can be encoded by the SDK's failure converter to support E2E encryption of messages and stack
     *           traces.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Errordetails\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * The full reason for this query failure. May not be available if the response is generated by an old
     * SDK. This field can be encoded by the SDK's failure converter to support E2E encryption of messages and stack
     * traces.
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure failure = 1;</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);
    }

    /**
     * The full reason for this query failure. May not be available if the response is generated by an old
     * SDK. This field can be encoded by the SDK's failure converter to support E2E encryption of messages and stack
     * traces.
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure failure = 1;</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;
    }

}

