1
0
Fork 0
mirror of synced 2024-06-02 19:04:49 +12:00
appwrite/src/Appwrite/Utopia/Response/Model/Token.php
2022-06-15 14:46:52 +02:00

66 lines
1.7 KiB
PHP

<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class Token extends Model
{
public function __construct()
{
$this
->addRule('$id', [
'type' => self::TYPE_STRING,
'description' => 'Token ID.',
'default' => '',
'example' => 'bb8ea5c16897e',
])
->addRule('$createdAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Token creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('userId', [
'type' => self::TYPE_STRING,
'description' => 'User ID.',
'default' => '',
'example' => '5e5ea5c168bb8',
])
->addRule('secret', [
'type' => self::TYPE_STRING,
'description' => 'Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.',
'default' => '',
'example' => '',
])
->addRule('expire', [
'type' => self::TYPE_INTEGER,
'description' => 'Token expiration date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
;
}
/**
* Get Name
*
* @return string
*/
public function getName(): string
{
return 'Token';
}
/**
* Get Type
*
* @return string
*/
public function getType(): string
{
return Response::MODEL_TOKEN;
}
}