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

namespace Deviceapis\Device\V1\Reader;

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

/**
 * Ошибки сохранения
 *
 * Generated from protobuf message <code>deviceapis.device.v1.Reader.SavingError</code>
 */
class SavingError extends \Google\Protobuf\Internal\Message
{
    protected $reason;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Deviceapis\Device\V1\Reader\SavingError\ReaderNotFound $reader_not_found
     *           Считыватель не найден
     *     @type \Deviceapis\Device\V1\Reader\SavingError\ProfileIsNotSupported $profile_is_not_supported
     *           Профиль не поддерживается для этого считывателя
     *     @type \Deviceapis\Device\V1\Reader\SavingError\ProfileNotFound $profile_not_found
     *           Выбранный профиль не найден
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Deviceapis\Device\V1\DeviceapisDeviceReaderV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Считыватель не найден
     *
     * Generated from protobuf field <code>.deviceapis.device.v1.Reader.SavingError.ReaderNotFound reader_not_found = 1;</code>
     * @return \Deviceapis\Device\V1\Reader\SavingError\ReaderNotFound|null
     */
    public function getReaderNotFound()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Считыватель не найден
     *
     * Generated from protobuf field <code>.deviceapis.device.v1.Reader.SavingError.ReaderNotFound reader_not_found = 1;</code>
     * @param \Deviceapis\Device\V1\Reader\SavingError\ReaderNotFound $var
     * @return $this
     */
    public function setReaderNotFound($var)
    {
        GPBUtil::checkMessage($var, \Deviceapis\Device\V1\Reader\SavingError\ReaderNotFound::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Профиль не поддерживается для этого считывателя
     *
     * Generated from protobuf field <code>.deviceapis.device.v1.Reader.SavingError.ProfileIsNotSupported profile_is_not_supported = 2;</code>
     * @return \Deviceapis\Device\V1\Reader\SavingError\ProfileIsNotSupported|null
     */
    public function getProfileIsNotSupported()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Профиль не поддерживается для этого считывателя
     *
     * Generated from protobuf field <code>.deviceapis.device.v1.Reader.SavingError.ProfileIsNotSupported profile_is_not_supported = 2;</code>
     * @param \Deviceapis\Device\V1\Reader\SavingError\ProfileIsNotSupported $var
     * @return $this
     */
    public function setProfileIsNotSupported($var)
    {
        GPBUtil::checkMessage($var, \Deviceapis\Device\V1\Reader\SavingError\ProfileIsNotSupported::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Выбранный профиль не найден
     *
     * Generated from protobuf field <code>.deviceapis.device.v1.Reader.SavingError.ProfileNotFound profile_not_found = 3;</code>
     * @return \Deviceapis\Device\V1\Reader\SavingError\ProfileNotFound|null
     */
    public function getProfileNotFound()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Выбранный профиль не найден
     *
     * Generated from protobuf field <code>.deviceapis.device.v1.Reader.SavingError.ProfileNotFound profile_not_found = 3;</code>
     * @param \Deviceapis\Device\V1\Reader\SavingError\ProfileNotFound $var
     * @return $this
     */
    public function setProfileNotFound($var)
    {
        GPBUtil::checkMessage($var, \Deviceapis\Device\V1\Reader\SavingError\ProfileNotFound::class);
        $this->writeOneof(3, $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(SavingError::class, \Deviceapis\Device\V1\Reader_SavingError::class);

