1
0
Fork 0
mirror of synced 2024-07-06 07:00:56 +12:00
appwrite/src/Appwrite/Utopia/Response/Model/Token.php

52 lines
1.2 KiB
PHP
Raw Normal View History

2020-06-24 03:01:20 +12:00
<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class Token extends Model
{
public function __construct()
{
2020-11-13 00:54:16 +13:00
$this
->addRule('$id', [
'type' => self::TYPE_STRING,
'description' => 'Token ID.',
'example' => '5e5ea5c16897e',
])
// ->addRule('type', [ TODO: use this when token types will be strings
// 'type' => self::TYPE_STRING,
// 'description' => 'Token type. Possible values: play, pause',
// 'default' => '',
// 'example' => '127.0.0.1',
// ])
->addRule('expire', [
'type' => self::TYPE_INTEGER,
'description' => 'Token expiration date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
;
2020-06-24 03:01:20 +12:00
}
/**
* Get Name
*
* @return string
*/
public function getName():string
{
2020-11-13 00:54:16 +13:00
return 'Token';
2020-06-24 03:01:20 +12:00
}
/**
* Get Collection
*
* @return string
*/
public function getType():string
{
2020-11-13 00:54:16 +13:00
return Response::MODEL_TOKEN;
2020-06-24 03:01:20 +12:00
}
}