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

namespace Keyapis\Ecosystem\V1\GetLegoAdapterServiceCheckResponse;

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

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

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Keyapis\Ecosystem\V1\ValidationError $validation
     *           Ошибка валидации запроса информации об услугах пользователя
     *     @type \Keyapis\Ecosystem\V1\GetLegoAdapterServiceCheckResponse\Error\EcosystemApiError $ecosystem_api_error
     *           Ошибка запроса к API экосистемы
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Ecosystem\V1\KeyapisEcosystemLegoAdapterV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Ошибка валидации запроса информации об услугах пользователя
     *
     * Generated from protobuf field <code>.keyapis.ecosystem.v1.ValidationError validation = 1;</code>
     * @return \Keyapis\Ecosystem\V1\ValidationError|null
     */
    public function getValidation()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Ошибка валидации запроса информации об услугах пользователя
     *
     * Generated from protobuf field <code>.keyapis.ecosystem.v1.ValidationError validation = 1;</code>
     * @param \Keyapis\Ecosystem\V1\ValidationError $var
     * @return $this
     */
    public function setValidation($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Ecosystem\V1\ValidationError::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Ошибка запроса к API экосистемы
     *
     * Generated from protobuf field <code>.keyapis.ecosystem.v1.GetLegoAdapterServiceCheckResponse.Error.EcosystemApiError ecosystem_api_error = 2;</code>
     * @return \Keyapis\Ecosystem\V1\GetLegoAdapterServiceCheckResponse\Error\EcosystemApiError|null
     */
    public function getEcosystemApiError()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Ошибка запроса к API экосистемы
     *
     * Generated from protobuf field <code>.keyapis.ecosystem.v1.GetLegoAdapterServiceCheckResponse.Error.EcosystemApiError ecosystem_api_error = 2;</code>
     * @param \Keyapis\Ecosystem\V1\GetLegoAdapterServiceCheckResponse\Error\EcosystemApiError $var
     * @return $this
     */
    public function setEcosystemApiError($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Ecosystem\V1\GetLegoAdapterServiceCheckResponse\Error\EcosystemApiError::class);
        $this->writeOneof(2, $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\Ecosystem\V1\GetLegoAdapterServiceCheckResponse_Error::class);

