<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: keyapis/multiapp/v1/keyapis_multiapp_notification_template_v1.proto

namespace Keyapis\Multiapp\V1\PostNotificationTemplateResponse;

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

/**
 * Ошибка запроса сохранения шаблона уведомления
 *
 * Generated from protobuf message <code>keyapis.multiapp.v1.PostNotificationTemplateResponse.Error</code>
 */
class Error extends \Google\Protobuf\Internal\Message
{
    protected $reason;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Keyapis\Multiapp\V1\ValidationError $validation
     *           Ошибка валидации
     *     @type \Keyapis\Multiapp\V1\NotificationTemplate\SavingError $saving
     *           Ошибка сохранения
     *     @type \Keyapis\Multiapp\V1\PostNotificationTemplateResponse\Error\IncorrectDataTypeError $incorrect_data_type
     *           Некорректный тип данных для переменной в шаблоне
     *     @type \Keyapis\Multiapp\V1\PostNotificationTemplateResponse\Error\IncorrectVariableNameError $incorrect_variable_name_error
     *           Некорректное наименование переменной в шаблоне
     *     @type \Keyapis\Multiapp\V1\PostNotificationTemplateResponse\Error\IncorrectTagFormatError $incorrect_tag_format_error
     *           Некорректный формат Mustache тегов
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Multiapp\V1\KeyapisMultiappNotificationTemplateV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Ошибка валидации
     *
     * Generated from protobuf field <code>.keyapis.multiapp.v1.ValidationError validation = 1;</code>
     * @return \Keyapis\Multiapp\V1\ValidationError|null
     */
    public function getValidation()
    {
        return $this->readOneof(1);
    }

    public function hasValidation()
    {
        return $this->hasOneof(1);
    }

    /**
     * Ошибка валидации
     *
     * Generated from protobuf field <code>.keyapis.multiapp.v1.ValidationError validation = 1;</code>
     * @param \Keyapis\Multiapp\V1\ValidationError $var
     * @return $this
     */
    public function setValidation($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Multiapp\V1\ValidationError::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Ошибка сохранения
     *
     * Generated from protobuf field <code>.keyapis.multiapp.v1.NotificationTemplate.SavingError saving = 2;</code>
     * @return \Keyapis\Multiapp\V1\NotificationTemplate\SavingError|null
     */
    public function getSaving()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Ошибка сохранения
     *
     * Generated from protobuf field <code>.keyapis.multiapp.v1.NotificationTemplate.SavingError saving = 2;</code>
     * @param \Keyapis\Multiapp\V1\NotificationTemplate\SavingError $var
     * @return $this
     */
    public function setSaving($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Multiapp\V1\NotificationTemplate\SavingError::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Некорректный тип данных для переменной в шаблоне
     *
     * Generated from protobuf field <code>.keyapis.multiapp.v1.PostNotificationTemplateResponse.Error.IncorrectDataTypeError incorrect_data_type = 3;</code>
     * @return \Keyapis\Multiapp\V1\PostNotificationTemplateResponse\Error\IncorrectDataTypeError|null
     */
    public function getIncorrectDataType()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Некорректный тип данных для переменной в шаблоне
     *
     * Generated from protobuf field <code>.keyapis.multiapp.v1.PostNotificationTemplateResponse.Error.IncorrectDataTypeError incorrect_data_type = 3;</code>
     * @param \Keyapis\Multiapp\V1\PostNotificationTemplateResponse\Error\IncorrectDataTypeError $var
     * @return $this
     */
    public function setIncorrectDataType($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Multiapp\V1\PostNotificationTemplateResponse\Error\IncorrectDataTypeError::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Некорректное наименование переменной в шаблоне
     *
     * Generated from protobuf field <code>.keyapis.multiapp.v1.PostNotificationTemplateResponse.Error.IncorrectVariableNameError incorrect_variable_name_error = 4;</code>
     * @return \Keyapis\Multiapp\V1\PostNotificationTemplateResponse\Error\IncorrectVariableNameError|null
     */
    public function getIncorrectVariableNameError()
    {
        return $this->readOneof(4);
    }

    public function hasIncorrectVariableNameError()
    {
        return $this->hasOneof(4);
    }

    /**
     * Некорректное наименование переменной в шаблоне
     *
     * Generated from protobuf field <code>.keyapis.multiapp.v1.PostNotificationTemplateResponse.Error.IncorrectVariableNameError incorrect_variable_name_error = 4;</code>
     * @param \Keyapis\Multiapp\V1\PostNotificationTemplateResponse\Error\IncorrectVariableNameError $var
     * @return $this
     */
    public function setIncorrectVariableNameError($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Multiapp\V1\PostNotificationTemplateResponse\Error\IncorrectVariableNameError::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Некорректный формат Mustache тегов
     *
     * Generated from protobuf field <code>.keyapis.multiapp.v1.PostNotificationTemplateResponse.Error.IncorrectTagFormatError incorrect_tag_format_error = 5;</code>
     * @return \Keyapis\Multiapp\V1\PostNotificationTemplateResponse\Error\IncorrectTagFormatError|null
     */
    public function getIncorrectTagFormatError()
    {
        return $this->readOneof(5);
    }

    public function hasIncorrectTagFormatError()
    {
        return $this->hasOneof(5);
    }

    /**
     * Некорректный формат Mustache тегов
     *
     * Generated from protobuf field <code>.keyapis.multiapp.v1.PostNotificationTemplateResponse.Error.IncorrectTagFormatError incorrect_tag_format_error = 5;</code>
     * @param \Keyapis\Multiapp\V1\PostNotificationTemplateResponse\Error\IncorrectTagFormatError $var
     * @return $this
     */
    public function setIncorrectTagFormatError($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Multiapp\V1\PostNotificationTemplateResponse\Error\IncorrectTagFormatError::class);
        $this->writeOneof(5, $var);

        return $this;
    }

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

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Error::class, \Keyapis\Multiapp\V1\PostNotificationTemplateResponse_Error::class);

