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

namespace Keyapis\TelemetryControl\V1;

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

/**
 * Ответ на замену прибора учета
 *
 * Generated from protobuf message <code>keyapis.telemetry_control.v1.PostDeviceReplaceResponse</code>
 */
class PostDeviceReplaceResponse extends \Google\Protobuf\Internal\Message
{
    protected $type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Keyapis\TelemetryControl\V1\Device $data
     *           Созданный на замену ПУ
     *     @type \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error $error
     *           Ошибка
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\TelemetryControl\V1\KeyapisTelemetryControlDeviceV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Созданный на замену ПУ
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.Device data = 1;</code>
     * @return \Keyapis\TelemetryControl\V1\Device|null
     */
    public function getData()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Созданный на замену ПУ
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.Device data = 1;</code>
     * @param \Keyapis\TelemetryControl\V1\Device $var
     * @return $this
     */
    public function setData($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\TelemetryControl\V1\Device::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Ошибка
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.PostDeviceReplaceResponse.Error error = 2;</code>
     * @return \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error|null
     */
    public function getError()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Ошибка
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.PostDeviceReplaceResponse.Error error = 2;</code>
     * @param \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error $var
     * @return $this
     */
    public function setError($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error::class);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

