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

namespace Keyapis\Identity\V1\GetOauth2ConsentResponse;

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

/**
 * Ошибка запроса авторизации пользователя
 *
 * Generated from protobuf message <code>keyapis.identity.v1.GetOauth2ConsentResponse.Error</code>
 */
class Error extends \Google\Protobuf\Internal\Message
{
    protected $reason;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Keyapis\Identity\V1\AuthServiceError $auth_service
     *           Ошибки авторизационного сервиса
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Identity\V1\KeyapisIdentityOauth2V1::initOnce();
        parent::__construct($data);
    }

    /**
     * Ошибки авторизационного сервиса
     *
     * Generated from protobuf field <code>.keyapis.identity.v1.AuthServiceError auth_service = 1;</code>
     * @return \Keyapis\Identity\V1\AuthServiceError|null
     */
    public function getAuthService()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Ошибки авторизационного сервиса
     *
     * Generated from protobuf field <code>.keyapis.identity.v1.AuthServiceError auth_service = 1;</code>
     * @param \Keyapis\Identity\V1\AuthServiceError $var
     * @return $this
     */
    public function setAuthService($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Identity\V1\AuthServiceError::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(Error::class, \Keyapis\Identity\V1\GetOauth2ConsentResponse_Error::class);

