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

namespace Deviceapis\Device\V1\Rfid;

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

/**
 * Ошибка запроса создания ключа
 *
 * Generated from protobuf message <code>deviceapis.device.v1.Rfid.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\Rfid\SavingError\RelayNotFound $relay_not_found
     *           Реле не найдено
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Deviceapis\Device\V1\DeviceapisDeviceRfidV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Реле не найдено
     *
     * Generated from protobuf field <code>.deviceapis.device.v1.Rfid.SavingError.RelayNotFound relay_not_found = 1;</code>
     * @return \Deviceapis\Device\V1\Rfid\SavingError\RelayNotFound|null
     */
    public function getRelayNotFound()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Реле не найдено
     *
     * Generated from protobuf field <code>.deviceapis.device.v1.Rfid.SavingError.RelayNotFound relay_not_found = 1;</code>
     * @param \Deviceapis\Device\V1\Rfid\SavingError\RelayNotFound $var
     * @return $this
     */
    public function setRelayNotFound($var)
    {
        GPBUtil::checkMessage($var, \Deviceapis\Device\V1\Rfid\SavingError\RelayNotFound::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(SavingError::class, \Deviceapis\Device\V1\Rfid_SavingError::class);

