<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: keyapis/identity/v1/keyapis_identity_authorization_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.UserToken</code>
 */
class UserToken extends \Google\Protobuf\Internal\Message
{
    /**
     * Токен
     *
     * Generated from protobuf field <code>string access_token = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $access_token = '';
    /**
     * Окончание действия токена
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp expired_at = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $expired_at = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $access_token
     *           Токен
     *     @type \Google\Protobuf\Timestamp $expired_at
     *           Окончание действия токена
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Identity\V1\KeyapisIdentityAuthorizationV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Токен
     *
     * Generated from protobuf field <code>string access_token = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getAccessToken()
    {
        return $this->access_token;
    }

    /**
     * Токен
     *
     * Generated from protobuf field <code>string access_token = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setAccessToken($var)
    {
        GPBUtil::checkString($var, True);
        $this->access_token = $var;

        return $this;
    }

    /**
     * Окончание действия токена
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp expired_at = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getExpiredAt()
    {
        return $this->expired_at;
    }

    public function hasExpiredAt()
    {
        return isset($this->expired_at);
    }

    public function clearExpiredAt()
    {
        unset($this->expired_at);
    }

    /**
     * Окончание действия токена
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp expired_at = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setExpiredAt($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->expired_at = $var;

        return $this;
    }

}

