From 5298c1697169315795c9697fdb65ae3c605cf171 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Wed, 24 Jun 2020 09:53:13 +0300 Subject: [PATCH] Updated session model --- .../Utopia/Response/Model/Session.php | 24 +++++++++++++------ src/Appwrite/Utopia/Response/Model/Team.php | 6 ++--- src/Appwrite/Utopia/Response/Model/User.php | 3 +-- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/Appwrite/Utopia/Response/Model/Session.php b/src/Appwrite/Utopia/Response/Model/Session.php index a35703654d..1beabb851e 100644 --- a/src/Appwrite/Utopia/Response/Model/Session.php +++ b/src/Appwrite/Utopia/Response/Model/Session.php @@ -9,13 +9,23 @@ class Session extends Model { public function __construct() { - $this->addRule('roles', [ - 'type' => 'string', - 'description' => 'User list of roles', - 'default' => [], - 'example' => [], - 'array' => true, - ]); + $this + ->addRule('$id', [ + 'type' => 'string', + 'description' => 'Session ID.', + 'example' => '5e5ea5c16897e', + ]) + ->addRule('expire', [ + 'type' => 'string', + 'description' => 'Session expiration date in unix timestamp.', + 'example' => 1592981250, + ]) + ->addRule('ip', [ + 'type' => 'string', + 'description' => 'IP session in use when the session was created.', + 'example' => '127.0.0.1', + ]) + ; } /** diff --git a/src/Appwrite/Utopia/Response/Model/Team.php b/src/Appwrite/Utopia/Response/Model/Team.php index 1c538506ad..38ab909db1 100644 --- a/src/Appwrite/Utopia/Response/Model/Team.php +++ b/src/Appwrite/Utopia/Response/Model/Team.php @@ -24,14 +24,12 @@ class Team extends Model ->addRule('dateCreated', [ 'type' => 'integer', 'description' => 'Team creation date in unix timestamp.', - 'default' => false, - 'example' => true, + 'example' => 1592981250, ]) ->addRule('sum', [ // TODO change key name? 'type' => 'integer', 'description' => 'Total sum of team members.', - 'default' => false, - 'example' => true, + 'example' => 7, ]) ; } diff --git a/src/Appwrite/Utopia/Response/Model/User.php b/src/Appwrite/Utopia/Response/Model/User.php index 6720f31d9f..d68a11bac5 100644 --- a/src/Appwrite/Utopia/Response/Model/User.php +++ b/src/Appwrite/Utopia/Response/Model/User.php @@ -24,8 +24,7 @@ class User extends Model ->addRule('registration', [ 'type' => 'integer', 'description' => 'User registration date in unix timestamp.', - 'default' => false, - 'example' => true, + 'example' => 1592981250, ]) ->addRule('status', [ 'type' => 'integer',