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

namespace Keyapis\Notification\V1\PushToken;

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

/**
 * Ошибка валидации пуш-токена.
 * Эти проверки выполняются до обращения в базу данных
 *
 * Generated from protobuf message <code>keyapis.notification.v1.PushToken.ValidationError</code>
 */
class ValidationError extends \Google\Protobuf\Internal\Message
{
    protected $reason;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Keyapis\Notification\V1\PushToken\ValidationError\UserAppIdInvalid $user_app_id
     *           Передан некоректный идентификатор устройства пользователя
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Notification\V1\KeyapisNotificationPushTokenV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Передан некоректный идентификатор устройства пользователя
     *
     * Generated from protobuf field <code>.keyapis.notification.v1.PushToken.ValidationError.UserAppIdInvalid user_app_id = 1;</code>
     * @return \Keyapis\Notification\V1\PushToken\ValidationError\UserAppIdInvalid|null
     */
    public function getUserAppId()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Передан некоректный идентификатор устройства пользователя
     *
     * Generated from protobuf field <code>.keyapis.notification.v1.PushToken.ValidationError.UserAppIdInvalid user_app_id = 1;</code>
     * @param \Keyapis\Notification\V1\PushToken\ValidationError\UserAppIdInvalid $var
     * @return $this
     */
    public function setUserAppId($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Notification\V1\PushToken\ValidationError\UserAppIdInvalid::class);
        $this->writeOneof(1, $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(ValidationError::class, \Keyapis\Notification\V1\PushToken_ValidationError::class);

