1
0
Fork 0
mirror of synced 2024-07-03 21:50:34 +12:00
appwrite/src/Appwrite/Utopia/Response/Model/Token.php

57 lines
1.4 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' => 'bb8ea5c16897e',
])
->addRule('userId', [
'type' => self::TYPE_STRING,
'description' => 'User ID.',
'example' => '5e5ea5c168bb8',
2020-11-13 00:54:16 +13:00
])
2020-11-19 08:38:31 +13:00
->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' => 0,
'example' => '',
])
2020-11-13 00:54:16 +13:00
->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
}
}