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

namespace Keyapis\Device\V1\PostDeviceReplaceResponse;

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

/**
 * Ошибка замены устройства
 *
 * Generated from protobuf message <code>keyapis.device.v1.PostDeviceReplaceResponse.Error</code>
 */
class Error extends \Google\Protobuf\Internal\Message
{
    protected $reason;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Keyapis\Device\V1\ValidationError $validation_error
     *           Ошибка валидации
     *     @type \Keyapis\Device\V1\PostDeviceReplaceResponse\Error\HostExists $host_exists
     *           На платформе уже существует устройство с таким хостом
     *     @type \Keyapis\Device\V1\PostDeviceReplaceResponse\Error\MacAddressExists $mac_address_exists
     *           На платформе уже существует устройство с таким MAC-адресом
     *     @type \Keyapis\Device\V1\PostDeviceReplaceResponse\Error\SerialNumberExists $serial_number_exists
     *           На платформе уже существует устройство с таким серийным номером
     *     @type \Keyapis\Device\V1\PostDeviceReplaceResponse\Error\LoginExists $login_exists
     *           На платформе уже существует устройство с таким логином (для устройст модели "Спутник")
     *     @type \Keyapis\Device\V1\PostDeviceReplaceResponse\Error\LoginIsRequired $login_is_required
     *           Отсутствует поле Login для модели "Спутник"
     *     @type \Keyapis\Device\V1\ReinstallError $reinstall_error
     *           Ошибка реинстала
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Device\V1\KeyapisDeviceDeviceV1::initOnce();
        parent::__construct($data);
    }

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

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

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

        return $this;
    }

    /**
     * На платформе уже существует устройство с таким хостом
     *
     * Generated from protobuf field <code>.keyapis.device.v1.PostDeviceReplaceResponse.Error.HostExists host_exists = 2;</code>
     * @return \Keyapis\Device\V1\PostDeviceReplaceResponse\Error\HostExists|null
     */
    public function getHostExists()
    {
        return $this->readOneof(2);
    }

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

    /**
     * На платформе уже существует устройство с таким хостом
     *
     * Generated from protobuf field <code>.keyapis.device.v1.PostDeviceReplaceResponse.Error.HostExists host_exists = 2;</code>
     * @param \Keyapis\Device\V1\PostDeviceReplaceResponse\Error\HostExists $var
     * @return $this
     */
    public function setHostExists($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Device\V1\PostDeviceReplaceResponse\Error\HostExists::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * На платформе уже существует устройство с таким MAC-адресом
     *
     * Generated from protobuf field <code>.keyapis.device.v1.PostDeviceReplaceResponse.Error.MacAddressExists mac_address_exists = 3;</code>
     * @return \Keyapis\Device\V1\PostDeviceReplaceResponse\Error\MacAddressExists|null
     */
    public function getMacAddressExists()
    {
        return $this->readOneof(3);
    }

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

    /**
     * На платформе уже существует устройство с таким MAC-адресом
     *
     * Generated from protobuf field <code>.keyapis.device.v1.PostDeviceReplaceResponse.Error.MacAddressExists mac_address_exists = 3;</code>
     * @param \Keyapis\Device\V1\PostDeviceReplaceResponse\Error\MacAddressExists $var
     * @return $this
     */
    public function setMacAddressExists($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Device\V1\PostDeviceReplaceResponse\Error\MacAddressExists::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * На платформе уже существует устройство с таким серийным номером
     *
     * Generated from protobuf field <code>.keyapis.device.v1.PostDeviceReplaceResponse.Error.SerialNumberExists serial_number_exists = 4;</code>
     * @return \Keyapis\Device\V1\PostDeviceReplaceResponse\Error\SerialNumberExists|null
     */
    public function getSerialNumberExists()
    {
        return $this->readOneof(4);
    }

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

    /**
     * На платформе уже существует устройство с таким серийным номером
     *
     * Generated from protobuf field <code>.keyapis.device.v1.PostDeviceReplaceResponse.Error.SerialNumberExists serial_number_exists = 4;</code>
     * @param \Keyapis\Device\V1\PostDeviceReplaceResponse\Error\SerialNumberExists $var
     * @return $this
     */
    public function setSerialNumberExists($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Device\V1\PostDeviceReplaceResponse\Error\SerialNumberExists::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * На платформе уже существует устройство с таким логином (для устройст модели "Спутник")
     *
     * Generated from protobuf field <code>.keyapis.device.v1.PostDeviceReplaceResponse.Error.LoginExists login_exists = 5;</code>
     * @return \Keyapis\Device\V1\PostDeviceReplaceResponse\Error\LoginExists|null
     */
    public function getLoginExists()
    {
        return $this->readOneof(5);
    }

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

    /**
     * На платформе уже существует устройство с таким логином (для устройст модели "Спутник")
     *
     * Generated from protobuf field <code>.keyapis.device.v1.PostDeviceReplaceResponse.Error.LoginExists login_exists = 5;</code>
     * @param \Keyapis\Device\V1\PostDeviceReplaceResponse\Error\LoginExists $var
     * @return $this
     */
    public function setLoginExists($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Device\V1\PostDeviceReplaceResponse\Error\LoginExists::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Отсутствует поле Login для модели "Спутник"
     *
     * Generated from protobuf field <code>.keyapis.device.v1.PostDeviceReplaceResponse.Error.LoginIsRequired login_is_required = 6;</code>
     * @return \Keyapis\Device\V1\PostDeviceReplaceResponse\Error\LoginIsRequired|null
     */
    public function getLoginIsRequired()
    {
        return $this->readOneof(6);
    }

    public function hasLoginIsRequired()
    {
        return $this->hasOneof(6);
    }

    /**
     * Отсутствует поле Login для модели "Спутник"
     *
     * Generated from protobuf field <code>.keyapis.device.v1.PostDeviceReplaceResponse.Error.LoginIsRequired login_is_required = 6;</code>
     * @param \Keyapis\Device\V1\PostDeviceReplaceResponse\Error\LoginIsRequired $var
     * @return $this
     */
    public function setLoginIsRequired($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Device\V1\PostDeviceReplaceResponse\Error\LoginIsRequired::class);
        $this->writeOneof(6, $var);

        return $this;
    }

    /**
     * Ошибка реинстала
     *
     * Generated from protobuf field <code>.keyapis.device.v1.ReinstallError reinstall_error = 7;</code>
     * @return \Keyapis\Device\V1\ReinstallError|null
     */
    public function getReinstallError()
    {
        return $this->readOneof(7);
    }

    public function hasReinstallError()
    {
        return $this->hasOneof(7);
    }

    /**
     * Ошибка реинстала
     *
     * Generated from protobuf field <code>.keyapis.device.v1.ReinstallError reinstall_error = 7;</code>
     * @param \Keyapis\Device\V1\ReinstallError $var
     * @return $this
     */
    public function setReinstallError($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Device\V1\ReinstallError::class);
        $this->writeOneof(7, $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\Device\V1\PostDeviceReplaceResponse_Error::class);

