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

namespace Keyapis\Ecosystem\V1;

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

/**
 * Результат запроса метода проверки услуги на квартире
 *
 * Generated from protobuf message <code>keyapis.ecosystem.v1.GetLegoAdapterServiceCheckResponse</code>
 */
class GetLegoAdapterServiceCheckResponse extends \Google\Protobuf\Internal\Message
{
    protected $type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $data
     *           Наличие активной услуги на квартире
     *     @type \Keyapis\Ecosystem\V1\GetLegoAdapterServiceCheckResponse\Error $error
     *           Ошибка
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Ecosystem\V1\KeyapisEcosystemLegoAdapterV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Наличие активной услуги на квартире
     *
     * Generated from protobuf field <code>bool data = 1;</code>
     * @return bool
     */
    public function getData()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Наличие активной услуги на квартире
     *
     * Generated from protobuf field <code>bool data = 1;</code>
     * @param bool $var
     * @return $this
     */
    public function setData($var)
    {
        GPBUtil::checkBool($var);
        $this->writeOneof(1, $var);

        return $this;
    }

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

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

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

        return $this;
    }

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

}

