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

namespace Keyapis\Identity\V1;

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

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

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

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

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

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

        return $this;
    }

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

}

