From 4d3c5a39ccca95124fd77e5b4f70d73c87aec6cf Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sun, 8 Nov 2020 00:14:48 +0200 Subject: [PATCH] Updated constants --- .../Utopia/Response/Model/BaseList.php | 2 +- .../Utopia/Response/Model/Collection.php | 8 ++--- .../Utopia/Response/Model/Continent.php | 4 +-- .../Utopia/Response/Model/Country.php | 4 +-- .../Utopia/Response/Model/Currency.php | 16 ++++----- src/Appwrite/Utopia/Response/Model/Domain.php | 10 +++--- src/Appwrite/Utopia/Response/Model/Error.php | 6 ++-- .../Utopia/Response/Model/ErrorDev.php | 6 ++-- .../Utopia/Response/Model/Execution.php | 18 +++++----- src/Appwrite/Utopia/Response/Model/File.php | 12 +++---- src/Appwrite/Utopia/Response/Model/Func.php | 26 +++++++------- src/Appwrite/Utopia/Response/Model/Key.php | 8 ++--- .../Utopia/Response/Model/Language.php | 6 ++-- src/Appwrite/Utopia/Response/Model/Locale.php | 14 ++++---- src/Appwrite/Utopia/Response/Model/Log.php | 34 +++++++++--------- .../Utopia/Response/Model/Membership.php | 18 +++++----- .../Utopia/Response/Model/Permissions.php | 4 +-- src/Appwrite/Utopia/Response/Model/Phone.php | 6 ++-- .../Utopia/Response/Model/Platform.php | 16 ++++----- .../Utopia/Response/Model/Project.php | 28 +++++++-------- src/Appwrite/Utopia/Response/Model/Rule.php | 18 +++++----- .../Utopia/Response/Model/Session.php | 36 +++++++++---------- src/Appwrite/Utopia/Response/Model/Tag.php | 10 +++--- src/Appwrite/Utopia/Response/Model/Task.php | 32 ++++++++--------- src/Appwrite/Utopia/Response/Model/Team.php | 8 ++--- src/Appwrite/Utopia/Response/Model/User.php | 16 ++++----- .../Utopia/Response/Model/Webhook.php | 14 ++++---- 27 files changed, 190 insertions(+), 190 deletions(-) diff --git a/src/Appwrite/Utopia/Response/Model/BaseList.php b/src/Appwrite/Utopia/Response/Model/BaseList.php index 21dd6eb926..d1b64d2205 100644 --- a/src/Appwrite/Utopia/Response/Model/BaseList.php +++ b/src/Appwrite/Utopia/Response/Model/BaseList.php @@ -24,7 +24,7 @@ class BaseList extends Model if ($paging) { $this->addRule('sum', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'Total sum of items in the list.', 'example' => '5', ]); diff --git a/src/Appwrite/Utopia/Response/Model/Collection.php b/src/Appwrite/Utopia/Response/Model/Collection.php index 9c6dd15d69..6d0ef9b5f1 100644 --- a/src/Appwrite/Utopia/Response/Model/Collection.php +++ b/src/Appwrite/Utopia/Response/Model/Collection.php @@ -11,7 +11,7 @@ class Collection extends Model { $this ->addRule('$id', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Collection ID.', 'example' => '5e5ea5c16897e', ]) @@ -22,17 +22,17 @@ class Collection extends Model 'array' => false, ]) ->addRule('name', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Collection name.', 'example' => 'Movies', ]) ->addRule('dateCreated', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'Collection creation date in Unix timestamp.', 'example' => 1592981250, ]) ->addRule('dateUpdated', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'Collection creation date in Unix timestamp.', 'example' => 1592981550, ]) diff --git a/src/Appwrite/Utopia/Response/Model/Continent.php b/src/Appwrite/Utopia/Response/Model/Continent.php index a42b39e9e9..faae10c141 100644 --- a/src/Appwrite/Utopia/Response/Model/Continent.php +++ b/src/Appwrite/Utopia/Response/Model/Continent.php @@ -11,12 +11,12 @@ class Continent extends Model { $this ->addRule('name', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Continent name.', 'example' => 'Europe', ]) ->addRule('code', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Continent two letter code.', 'example' => 'EU', ]) diff --git a/src/Appwrite/Utopia/Response/Model/Country.php b/src/Appwrite/Utopia/Response/Model/Country.php index b5ba0f74f5..f9b5ae8784 100644 --- a/src/Appwrite/Utopia/Response/Model/Country.php +++ b/src/Appwrite/Utopia/Response/Model/Country.php @@ -11,12 +11,12 @@ class Country extends Model { $this ->addRule('name', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Country name.', 'example' => 'United States', ]) ->addRule('code', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Country two-character ISO 3166-1 alpha code.', 'example' => 'US', ]) diff --git a/src/Appwrite/Utopia/Response/Model/Currency.php b/src/Appwrite/Utopia/Response/Model/Currency.php index 29b3d78f98..e912f2ab4d 100644 --- a/src/Appwrite/Utopia/Response/Model/Currency.php +++ b/src/Appwrite/Utopia/Response/Model/Currency.php @@ -11,42 +11,42 @@ class Currency extends Model { $this ->addRule('symbol', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Currency symbol.', 'example' => '$', ]) ->addRule('name', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Currency name.', 'example' => 'US dollar', ]) ->addRule('symbolNative', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Currency native symbol.', 'example' => '$', ]) ->addRule('decimalDigits', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'Number of decimal digits.', 'example' => 2, ]) ->addRule('rounding', [ - 'type' => 'float', + 'type' => self::TYPE_FLOAT, 'description' => 'Currency digit rounding.', 'example' => 0, ]) ->addRule('code', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format.', 'example' => 'USD', ]) ->addRule('namePlural', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Currency plural name', 'example' => 'US dollars', ]) // ->addRule('locations', [ - // 'type' => 'string', + // 'type' => self::TYPE_STRING, // 'description' => 'Currency locations list. List of location in two-character ISO 3166-1 alpha code.', // 'example' => ['US'], // 'array' => true, diff --git a/src/Appwrite/Utopia/Response/Model/Domain.php b/src/Appwrite/Utopia/Response/Model/Domain.php index f8273ff876..ee0445e37c 100644 --- a/src/Appwrite/Utopia/Response/Model/Domain.php +++ b/src/Appwrite/Utopia/Response/Model/Domain.php @@ -11,27 +11,27 @@ class Domain extends Model { $this ->addRule('$id', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Domain ID.', 'example' => '5e5ea5c16897e', ]) ->addRule('domain', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Domain name.', 'example' => 'appwrite.company.com', ]) ->addRule('registerable', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Registerable domain name.', 'example' => 'company.com', ]) ->addRule('tld', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'TLD name.', 'example' => 'com', ]) ->addRule('verification', [ - 'type' => 'boolean', + 'type' => self::TYPE_BOOLEAN, 'description' => 'Verification process status.', 'example' => true, ]) diff --git a/src/Appwrite/Utopia/Response/Model/Error.php b/src/Appwrite/Utopia/Response/Model/Error.php index 44cb2a1c85..3ce03bc671 100644 --- a/src/Appwrite/Utopia/Response/Model/Error.php +++ b/src/Appwrite/Utopia/Response/Model/Error.php @@ -11,17 +11,17 @@ class Error extends Model { $this ->addRule('message', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Error message.', 'example' => 'Not found', ]) ->addRule('code', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Error code.', 'example' => '404', ]) ->addRule('version', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Server version number.', 'example' => '1.0', ]) diff --git a/src/Appwrite/Utopia/Response/Model/ErrorDev.php b/src/Appwrite/Utopia/Response/Model/ErrorDev.php index 65ab38d2b5..fea43fd42e 100644 --- a/src/Appwrite/Utopia/Response/Model/ErrorDev.php +++ b/src/Appwrite/Utopia/Response/Model/ErrorDev.php @@ -12,17 +12,17 @@ class ErrorDev extends Error $this ->addRule('file', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'File path.', 'example' => '/usr/code/vendor/utopia-php/framework/src/App.php', ]) ->addRule('line', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'Line number.', 'example' => 209, ]) ->addRule('trace', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Error trace.', 'example' => [ '' diff --git a/src/Appwrite/Utopia/Response/Model/Execution.php b/src/Appwrite/Utopia/Response/Model/Execution.php index 92a00208dd..c1183d6b24 100644 --- a/src/Appwrite/Utopia/Response/Model/Execution.php +++ b/src/Appwrite/Utopia/Response/Model/Execution.php @@ -11,47 +11,47 @@ class Execution extends Model { $this ->addRule('$id', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Execution ID.', 'example' => '5e5ea5c16897e', ]) ->addRule('functionId', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Function ID.', 'example' => '5e5ea6g16897e', ]) ->addRule('dateCreated', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'The execution creation date in Unix timestamp.', 'example' => 1592981250, ]) ->addRule('trigger', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.', 'example' => 'http', ]) ->addRule('status', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.', 'example' => 'processing', ]) ->addRule('exitCode', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'The script exit code.', 'example' => 0, ]) ->addRule('stdout', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'The script stdout output string.', 'example' => '', ]) ->addRule('stderr', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'The script stderr output string.', 'example' => '', ]) ->addRule('time', [ - 'type' => 'float', + 'type' => self::TYPE_FLOAT, 'description' => 'The script execution time in seconds.', 'example' => 0.400, ]) diff --git a/src/Appwrite/Utopia/Response/Model/File.php b/src/Appwrite/Utopia/Response/Model/File.php index 416a02ac53..a7ad05e1e4 100644 --- a/src/Appwrite/Utopia/Response/Model/File.php +++ b/src/Appwrite/Utopia/Response/Model/File.php @@ -11,7 +11,7 @@ class File extends Model { $this ->addRule('$id', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'File ID.', 'example' => '5e5ea5c16897e', ]) @@ -22,27 +22,27 @@ class File extends Model 'array' => false, ]) ->addRule('name', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'File name.', 'example' => 'Pink.png', ]) ->addRule('dateCreated', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'File creation date in Unix timestamp.', 'example' => 1592981250, ]) ->addRule('signature', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'File MD5 signature.', 'example' => '5d529fd02b544198ae075bd57c1762bb', ]) ->addRule('mimeType', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'File mime type.', 'example' => 'image/png', ]) ->addRule('sizeOriginal', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'File original size in bytes.', 'example' => 17890, ]) diff --git a/src/Appwrite/Utopia/Response/Model/Func.php b/src/Appwrite/Utopia/Response/Model/Func.php index e0d3595355..e72dd067b1 100644 --- a/src/Appwrite/Utopia/Response/Model/Func.php +++ b/src/Appwrite/Utopia/Response/Model/Func.php @@ -11,74 +11,74 @@ class Func extends Model { $this ->addRule('$id', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Function ID.', 'example' => '5e5ea5c16897e', ]) ->addRule('name', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Function name.', 'example' => 'My Function', ]) ->addRule('dateCreated', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'Function creation date in Unix timestamp.', 'example' => 1592981250, ]) ->addRule('dateUpdated', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'Function update date in Unix timestamp.', 'example' => 1592981257, ]) ->addRule('status', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Function status. Possible values: disabled, enabled', 'example' => 'enabled', ]) ->addRule('env', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Function execution environment.', 'example' => 'python-3.8', ]) ->addRule('tag', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Function active tag ID.', 'default' => '', 'example' => '5e5ea5c16897e', ]) ->addRule('vars', [ - 'type' => 'json', + 'type' => self::TYPE_JSON, 'description' => 'Function environment variables.', 'default' => new \stdClass, 'example' => ['key' => 'value'], ]) ->addRule('events', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Function trigger events.', 'default' => [], 'example' => ['account.create'], 'array' => true, ]) ->addRule('schedule', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Function execution schedult in CRON format.', 'default' => '', 'example' => '5 4 * * *', ]) ->addRule('scheduleNext', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'Function next scheduled execution date in Unix timestamp.', 'example' => 1592981292, 'default' => 0, ]) ->addRule('schedulePrevious', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'Function next scheduled execution date in Unix timestamp.', 'example' => 1592981237, 'default' => 0, ]) ->addRule('timeout', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'Function execution timeout in seconds.', 'default' => 15, 'example' => 1592981237, diff --git a/src/Appwrite/Utopia/Response/Model/Key.php b/src/Appwrite/Utopia/Response/Model/Key.php index 99abb38d5d..40e3b58a77 100644 --- a/src/Appwrite/Utopia/Response/Model/Key.php +++ b/src/Appwrite/Utopia/Response/Model/Key.php @@ -11,24 +11,24 @@ class Key extends Model { $this ->addRule('$id', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Key ID.', 'example' => '5e5ea5c16897e', ]) ->addRule('name', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Key name.', 'example' => 'My API Key', ]) ->addRule('scopes', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Allowed permission scopes.', 'default' => [], 'example' => ['users.read', 'documents.write'], 'array' => true, ]) ->addRule('secret', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Secret key.', 'example' => '919c2d18fb5d4...a2ae413da83346ad2', ]) diff --git a/src/Appwrite/Utopia/Response/Model/Language.php b/src/Appwrite/Utopia/Response/Model/Language.php index 966efa7e72..e2dd8d638f 100644 --- a/src/Appwrite/Utopia/Response/Model/Language.php +++ b/src/Appwrite/Utopia/Response/Model/Language.php @@ -11,17 +11,17 @@ class Language extends Model { $this ->addRule('name', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Language name.', 'example' => 'Italian', ]) ->addRule('code', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Language two-character ISO 639-1 codes.', 'example' => 'it', ]) ->addRule('nativeName', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Language native name.', 'example' => 'Italiano', ]) diff --git a/src/Appwrite/Utopia/Response/Model/Locale.php b/src/Appwrite/Utopia/Response/Model/Locale.php index 0be4837b98..d67470a39e 100644 --- a/src/Appwrite/Utopia/Response/Model/Locale.php +++ b/src/Appwrite/Utopia/Response/Model/Locale.php @@ -11,38 +11,38 @@ class Locale extends Model { $this ->addRule('ip', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'User IP address.', 'example' => '127.0.0.1', ]) ->addRule('countryCode', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format', 'example' => 'US', ]) ->addRule('country', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Country name. This field support localization.', 'example' => 'United States', ]) ->addRule('continentCode', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America.', 'example' => 'NA', ]) ->addRule('continent', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Continent name. This field support localization.', 'example' => 'North America', ]) ->addRule('eu', [ - 'type' => 'boolean', + 'type' => self::TYPE_BOOLEAN, 'description' => 'True if country is part of the Europian Union.', 'default' => false, 'example' => false, ]) ->addRule('currency', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format', 'example' => 'USD', ]) diff --git a/src/Appwrite/Utopia/Response/Model/Log.php b/src/Appwrite/Utopia/Response/Model/Log.php index 35040d018e..dc3bb6955e 100644 --- a/src/Appwrite/Utopia/Response/Model/Log.php +++ b/src/Appwrite/Utopia/Response/Model/Log.php @@ -11,100 +11,100 @@ class Log extends Model { $this ->addRule('event', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Event name.', 'example' => 'account.sessions.create', ]) ->addRule('ip', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'IP session in use when the session was created.', 'example' => '127.0.0.1', ]) ->addRule('time', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'Log creation time in Unix timestamp.', 'example' => 1592981250, ]) ->addRule('osCode', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json).', 'default' => '', 'example' => 'Mac', ]) ->addRule('osName', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Operating system name.', 'default' => '', 'example' => 'Mac', ]) ->addRule('osVersion', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Operating system version.', 'default' => '', 'example' => 'Mac', ]) ->addRule('clientType', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Client type.', 'default' => '', 'example' => 'browser', ]) ->addRule('clientCode', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json).', 'default' => '', 'example' => 'CM', ]) ->addRule('clientName', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Client name.', 'default' => '', 'example' => 'Chrome Mobile iOS', ]) ->addRule('clientVersion', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Client version.', 'default' => '', 'example' => '84.0', ]) ->addRule('clientEngine', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Client engine name.', 'default' => '', 'example' => 'WebKit', ]) ->addRule('clientEngineVersion', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Client engine name.', 'default' => '', 'example' => '605.1.15', ]) ->addRule('deviceName', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Device name.', 'default' => '', 'example' => 'smartphone', ]) ->addRule('deviceBrand', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Device brand name.', 'default' => '', 'example' => 'Google', ]) ->addRule('deviceModel', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Device model name.', 'default' => '', 'example' => 'Nexus 5', ]) ->addRule('countryCode', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Country two-character ISO 3166-1 alpha code.', 'default' => '', 'example' => 'US', ]) ->addRule('countryName', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Country name.', 'default' => '', 'example' => 'United States', diff --git a/src/Appwrite/Utopia/Response/Model/Membership.php b/src/Appwrite/Utopia/Response/Model/Membership.php index 717cc005a0..34f60a72b8 100644 --- a/src/Appwrite/Utopia/Response/Model/Membership.php +++ b/src/Appwrite/Utopia/Response/Model/Membership.php @@ -11,49 +11,49 @@ class Membership extends Model { $this ->addRule('$id', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Membership ID.', 'example' => '5e5ea5c16897e', ]) ->addRule('userId', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'User ID.', 'example' => '5e5ea5c16897e', ]) ->addRule('teamId', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Team ID.', 'example' => '5e5ea5c16897e', ]) ->addRule('name', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'User name.', 'default' => '', 'example' => 'VIP', ]) ->addRule('email', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'User email address.', 'default' => '', 'example' => 'john@appwrite.io', ]) ->addRule('invited', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'Date, the user has been invited to join the team in Unix timestamp.', 'example' => 1592981250, ]) ->addRule('joined', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'Date, the user has accepted the invitation to join the team in Unix timestamp.', 'example' => 1592981250, ]) ->addRule('confirm', [ - 'type' => 'boolean', + 'type' => self::TYPE_BOOLEAN, 'description' => 'User confirmation status, true if the user has joined the team or false otherwise.', 'example' => false, ]) ->addRule('roles', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'User list of roles', 'default' => [], 'example' => [], diff --git a/src/Appwrite/Utopia/Response/Model/Permissions.php b/src/Appwrite/Utopia/Response/Model/Permissions.php index 8f14ccb86a..3847bd9387 100644 --- a/src/Appwrite/Utopia/Response/Model/Permissions.php +++ b/src/Appwrite/Utopia/Response/Model/Permissions.php @@ -11,13 +11,13 @@ class Permissions extends Model { $this ->addRule('read', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Read permissions.', 'example' => ['*', 'user:5e5ea5c16897e'], 'array' => true, ]) ->addRule('write', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Write permissions.', 'example' => ['*', 'user:5e5ea5c16897e'], 'array' => true, diff --git a/src/Appwrite/Utopia/Response/Model/Phone.php b/src/Appwrite/Utopia/Response/Model/Phone.php index e0242981e9..0d47ebb867 100644 --- a/src/Appwrite/Utopia/Response/Model/Phone.php +++ b/src/Appwrite/Utopia/Response/Model/Phone.php @@ -11,17 +11,17 @@ class Phone extends Model { $this ->addRule('code', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Phone code.', 'example' => '+1', ]) ->addRule('countryCode', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Country two-character ISO 3166-1 alpha code.', 'example' => 'US', ]) ->addRule('countryName', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Country name.', 'example' => 'United States', ]) diff --git a/src/Appwrite/Utopia/Response/Model/Platform.php b/src/Appwrite/Utopia/Response/Model/Platform.php index 861300f887..1abe520b94 100644 --- a/src/Appwrite/Utopia/Response/Model/Platform.php +++ b/src/Appwrite/Utopia/Response/Model/Platform.php @@ -11,43 +11,43 @@ class Platform extends Model { $this ->addRule('$id', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Platform ID.', 'example' => '5e5ea5c16897e', ]) ->addRule('name', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Platform name.', 'example' => 'My Web App', ]) ->addRule('type', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Platform type. Possible values are: web, flutter-ios, flutter-android, ios, android, and unity.', 'example' => 'My Web App', ]) ->addRule('key', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Platform Key. iOS bundle ID or Android package name. Empty string for other platforms.', 'example' => 'com.company.appname', ]) // ->addRule('store', [ - // 'type' => 'string', + // 'type' => self::TYPE_STRING, // 'description' => 'Link to platform store.', // 'example' => '', // ]) ->addRule('hostname', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Web app hostname. Empty string for other platforms.', 'example' => true, ]) ->addRule('httpUser', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'HTTP basic authentication username.', 'default' => '', 'example' => 'username', ]) ->addRule('httpPass', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'HTTP basic authentication password.', 'default' => '', 'example' => 'password', diff --git a/src/Appwrite/Utopia/Response/Model/Project.php b/src/Appwrite/Utopia/Response/Model/Project.php index af5cad3ebe..f57e701314 100644 --- a/src/Appwrite/Utopia/Response/Model/Project.php +++ b/src/Appwrite/Utopia/Response/Model/Project.php @@ -12,71 +12,71 @@ class Project extends Model { $this ->addRule('$id', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Project ID.', 'example' => '5e5ea5c16897e', ]) ->addRule('name', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Project name.', 'default' => '', 'example' => 'New Project', ]) ->addRule('description', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Project description.', 'default' => '', 'example' => 'This is a new project.', ]) ->addRule('teamId', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Project team ID.', 'example' => '1592981250', ]) ->addRule('logo', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Project logo file ID.', 'default' => '', 'example' => '5f5c451b403cb', ]) ->addRule('url', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Project website URL.', 'default' => '', 'example' => '5f5c451b403cb', ]) ->addRule('legalName', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Company legal name.', 'default' => '', 'example' => 'Company LTD.', ]) ->addRule('legalCountry', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format.', 'default' => '', 'example' => 'US', ]) ->addRule('legalState', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'State name.', 'default' => '', 'example' => 'New York', ]) ->addRule('legalCity', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'City name.', 'default' => '', 'example' => 'New York City.', ]) ->addRule('legalAddress', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Company Address.', 'default' => '', 'example' => '620 Eighth Avenue, New York, NY 10018', ]) ->addRule('legalTaxId', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Company Tax ID.', 'default' => '', 'example' => '131102020', @@ -129,13 +129,13 @@ class Project extends Model $this ->addRule('usersOauth2'.\ucfirst($index).'Appid', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => $name.' OAuth app ID.', 'example' => '123247283472834787438', 'default' => '', ]) ->addRule('usersOauth2'.\ucfirst($index).'Secret', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => $name.' OAuth secret ID.', 'example' => 'djsgudsdsewe43434343dd34...', 'default' => '', diff --git a/src/Appwrite/Utopia/Response/Model/Rule.php b/src/Appwrite/Utopia/Response/Model/Rule.php index 234377c432..cb075c8a7f 100644 --- a/src/Appwrite/Utopia/Response/Model/Rule.php +++ b/src/Appwrite/Utopia/Response/Model/Rule.php @@ -11,48 +11,48 @@ class Rule extends Model { $this ->addRule('$id', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Rule ID.', 'example' => '5e5ea5c16897e', ]) ->addRule('$collection', [ // TODO remove this from public response - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Rule Collection.', 'example' => '5e5e66c16897e', ]) ->addRule('type', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Rule type. Possible values: ', 'example' => 'title', ]) ->addRule('key', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Rule key.', 'example' => 'title', ]) ->addRule('label', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Rule label.', 'example' => 'Title', ]) ->addRule('default', [ // TODO should be of mixed types - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Rule default value.', 'example' => 'Movie Name', 'default' => '', ]) ->addRule('array', [ - 'type' => 'boolean', + 'type' => self::TYPE_BOOLEAN, 'description' => 'Is array?', 'example' => false, ]) ->addRule('required', [ - 'type' => 'boolean', + 'type' => self::TYPE_BOOLEAN, 'description' => 'Is required?', 'example' => true, ]) ->addRule('list', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'List of allowed values', 'array' => true, 'default' => [], diff --git a/src/Appwrite/Utopia/Response/Model/Session.php b/src/Appwrite/Utopia/Response/Model/Session.php index 2e22513fdf..a0ca7b7143 100644 --- a/src/Appwrite/Utopia/Response/Model/Session.php +++ b/src/Appwrite/Utopia/Response/Model/Session.php @@ -11,108 +11,108 @@ class Session extends Model { $this ->addRule('$id', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Session ID.', 'example' => '5e5ea5c16897e', ]) ->addRule('expire', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'Session expiration date in Unix timestamp.', 'default' => 0, 'example' => 1592981250, ]) ->addRule('ip', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'IP in use when the session was created.', 'default' => '', 'example' => '127.0.0.1', ]) ->addRule('osCode', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json).', 'default' => '', 'example' => 'Mac', ]) ->addRule('osName', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Operating system name.', 'default' => '', 'example' => 'Mac', ]) ->addRule('osVersion', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Operating system version.', 'default' => '', 'example' => 'Mac', ]) ->addRule('clientType', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Client type.', 'default' => '', 'example' => 'browser', ]) ->addRule('clientCode', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json).', 'default' => '', 'example' => 'CM', ]) ->addRule('clientName', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Client name.', 'default' => '', 'example' => 'Chrome Mobile iOS', ]) ->addRule('clientVersion', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Client version.', 'default' => '', 'example' => '84.0', ]) ->addRule('clientEngine', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Client engine name.', 'default' => '', 'example' => 'WebKit', ]) ->addRule('clientEngineVersion', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Client engine name.', 'default' => '', 'example' => '605.1.15', ]) ->addRule('deviceName', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Device name.', 'default' => '', 'example' => 'smartphone', ]) ->addRule('deviceBrand', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Device brand name.', 'default' => '', 'example' => 'Google', ]) ->addRule('deviceModel', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Device model name.', 'default' => '', 'example' => 'Nexus 5', ]) ->addRule('countryCode', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Country two-character ISO 3166-1 alpha code.', 'default' => '', 'example' => 'US', ]) ->addRule('countryName', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Country name.', 'default' => '', 'example' => 'United States', ]) ->addRule('current', [ - 'type' => 'boolean', + 'type' => self::TYPE_BOOLEAN, 'description' => 'Returns true if this the current user session.', 'default' => '', 'example' => true, diff --git a/src/Appwrite/Utopia/Response/Model/Tag.php b/src/Appwrite/Utopia/Response/Model/Tag.php index 4b6facab82..a3a403187f 100644 --- a/src/Appwrite/Utopia/Response/Model/Tag.php +++ b/src/Appwrite/Utopia/Response/Model/Tag.php @@ -11,27 +11,27 @@ class Tag extends Model { $this ->addRule('$id', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Tag ID.', 'example' => '5e5ea5c16897e', ]) ->addRule('functionId', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Function ID.', 'example' => '5e5ea6g16897e', ]) ->addRule('dateCreated', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'The tag creation date in Unix timestamp.', 'example' => 1592981250, ]) ->addRule('command', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'The entrypoint command in use to execute the tag code.', 'example' => 'enabled', ]) ->addRule('size', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'The code size in bytes.', 'example' => 'python-3.8', ]) diff --git a/src/Appwrite/Utopia/Response/Model/Task.php b/src/Appwrite/Utopia/Response/Model/Task.php index e2ab652fe7..043ac951e1 100644 --- a/src/Appwrite/Utopia/Response/Model/Task.php +++ b/src/Appwrite/Utopia/Response/Model/Task.php @@ -11,91 +11,91 @@ class Task extends Model { $this ->addRule('$id', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Task ID.', 'example' => '5e5ea5c16897e', ]) ->addRule('name', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Task name.', 'example' => 'My Task', ]) ->addRule('security', [ - 'type' => 'boolean', + 'type' => self::TYPE_BOOLEAN, 'description' => 'Indicated if SSL / TLS Certificate verification is enabled.', 'example' => true, ]) ->addRule('httpMethod', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Task HTTP Method.', 'example' => 'POST', ]) ->addRule('httpUrl', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Task HTTP URL.', 'example' => 'https://example.com/task', ]) ->addRule('httpHeaders', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Task HTTP headers.', 'default' => [], 'example' => ['key:value'], 'array' => true, ]) ->addRule('httpUser', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'HTTP basic authentication username.', 'default' => '', 'example' => 'username', ]) ->addRule('httpPass', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'HTTP basic authentication password.', 'default' => '', 'example' => 'password', ]) ->addRule('duration', [ - 'type' => 'float', + 'type' => self::TYPE_FLOAT, 'description' => 'Task duration in seconds.', 'default' => 0, 'example' => 1.2, ]) ->addRule('delay', [ - 'type' => 'float', + 'type' => self::TYPE_FLOAT, 'description' => 'Task delay time in seconds.', 'default' => 0, 'example' => 1.2, ]) ->addRule('failures', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'Number of recurring task failures.', 'default' => 0, 'example' => 0, ]) ->addRule('schedule', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Task schedule in CRON syntax.', 'example' => '* * * * *', ]) ->addRule('status', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Task status. Possible values: play, pause', // TODO - change to enabled disabled 'example' => 'enabled', ]) ->addRule('updated', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'Task last updated time in Unix timestamp.', 'default' => 0, 'example' => 1592981250, ]) ->addRule('previous', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'Task previous run time in Unix timestamp.', 'default' => 0, 'example' => 1592981250, ]) ->addRule('next', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'Task next run time in Unix timestamp.', 'default' => 0, 'example' => 1592981650, diff --git a/src/Appwrite/Utopia/Response/Model/Team.php b/src/Appwrite/Utopia/Response/Model/Team.php index f86ff22e5d..67442dade5 100644 --- a/src/Appwrite/Utopia/Response/Model/Team.php +++ b/src/Appwrite/Utopia/Response/Model/Team.php @@ -11,23 +11,23 @@ class Team extends Model { $this ->addRule('$id', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Team ID.', 'example' => '5e5ea5c16897e', ]) ->addRule('name', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Team name.', 'default' => '', 'example' => 'VIP', ]) ->addRule('dateCreated', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'Team creation date in Unix timestamp.', 'example' => 1592981250, ]) ->addRule('sum', [ // TODO change key name? - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'Total sum of team members.', 'example' => 7, ]) diff --git a/src/Appwrite/Utopia/Response/Model/User.php b/src/Appwrite/Utopia/Response/Model/User.php index 25b50cfa20..fae78a6dbf 100644 --- a/src/Appwrite/Utopia/Response/Model/User.php +++ b/src/Appwrite/Utopia/Response/Model/User.php @@ -11,44 +11,44 @@ class User extends Model { $this ->addRule('$id', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'User ID.', 'example' => '5e5ea5c16897e', ]) ->addRule('name', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'User name.', 'example' => 'John Doe', ]) ->addRule('registration', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'User registration date in Unix timestamp.', 'example' => 1592981250, ]) ->addRule('status', [ - 'type' => 'integer', + 'type' => self::TYPE_INTEGER, 'description' => 'User status. 0 for Unavtivated, 1 for active and 2 is blocked.', 'example' => 0, ]) ->addRule('email', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'User email address.', 'example' => 'john@appwrite.io', ]) ->addRule('emailVerification', [ - 'type' => 'boolean', + 'type' => self::TYPE_BOOLEAN, 'description' => 'Email verification status.', 'default' => false, 'example' => true, ]) ->addRule('prefs', [ - 'type' => 'json', + 'type' => self::TYPE_JSON, 'description' => 'User preferences as a key-value object', 'default' => new \stdClass, 'example' => ['theme' => 'pink', 'timezone' => 'UTC'], ]) ->addRule('roles', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'User list of roles', 'default' => [], 'example' => [], diff --git a/src/Appwrite/Utopia/Response/Model/Webhook.php b/src/Appwrite/Utopia/Response/Model/Webhook.php index e3fe565afb..a58f3fe056 100644 --- a/src/Appwrite/Utopia/Response/Model/Webhook.php +++ b/src/Appwrite/Utopia/Response/Model/Webhook.php @@ -11,40 +11,40 @@ class Webhook extends Model { $this ->addRule('$id', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Webhook ID.', 'example' => '5e5ea5c16897e', ]) ->addRule('name', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Webhook name.', 'example' => 'My Webhook', ]) ->addRule('url', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Webhook URL endpoint.', 'example' => 'https://example.com/webhook', ]) ->addRule('events', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'Webhook trigger events.', 'default' => [], 'example' => ['database.collections.update', 'database.collections.delete'], 'array' => true, ]) ->addRule('security', [ - 'type' => 'boolean', + 'type' => self::TYPE_BOOLEAN, 'description' => 'Indicated if SSL / TLS Certificate verification is enabled.', 'example' => true, ]) ->addRule('httpUser', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'HTTP basic authentication username.', 'default' => '', 'example' => 'username', ]) ->addRule('httpPass', [ - 'type' => 'string', + 'type' => self::TYPE_STRING, 'description' => 'HTTP basic authentication password.', 'default' => '', 'example' => 'password',