From 1d7e8a76a12057c80718ca91469511f346690db8 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 14 Mar 2022 06:03:55 +0000 Subject: [PATCH 1/2] update attribute examples --- .../Utopia/Response/Model/AttributeBoolean.php | 12 ++++++++++++ .../Utopia/Response/Model/AttributeEmail.php | 12 ++++++++++++ src/Appwrite/Utopia/Response/Model/AttributeEnum.php | 12 ++++++++++++ .../Utopia/Response/Model/AttributeFloat.php | 12 ++++++++++++ src/Appwrite/Utopia/Response/Model/AttributeIP.php | 12 ++++++++++++ .../Utopia/Response/Model/AttributeInteger.php | 12 ++++++++++++ src/Appwrite/Utopia/Response/Model/AttributeURL.php | 12 ++++++++++++ 7 files changed, 84 insertions(+) diff --git a/src/Appwrite/Utopia/Response/Model/AttributeBoolean.php b/src/Appwrite/Utopia/Response/Model/AttributeBoolean.php index de7ae58130..97bab3d8a1 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributeBoolean.php +++ b/src/Appwrite/Utopia/Response/Model/AttributeBoolean.php @@ -12,6 +12,18 @@ class AttributeBoolean extends Attribute parent::__construct(); $this + ->addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Attribute Key.', + 'default' => '', + 'example' => 'isEnabled', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Attribute type.', + 'default' => '', + 'example' => 'boolean', + ]) ->addRule('default', [ 'type' => self::TYPE_BOOLEAN, 'description' => 'Default value for attribute when not provided. Cannot be set when attribute is required.', diff --git a/src/Appwrite/Utopia/Response/Model/AttributeEmail.php b/src/Appwrite/Utopia/Response/Model/AttributeEmail.php index 268412a557..77cffe9113 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributeEmail.php +++ b/src/Appwrite/Utopia/Response/Model/AttributeEmail.php @@ -12,6 +12,18 @@ class AttributeEmail extends Attribute parent::__construct(); $this + ->addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Attribute Key.', + 'default' => '', + 'example' => 'userEmail', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Attribute type.', + 'default' => '', + 'example' => 'string', + ]) ->addRule('format', [ 'type' => self::TYPE_STRING, 'description' => 'String format.', diff --git a/src/Appwrite/Utopia/Response/Model/AttributeEnum.php b/src/Appwrite/Utopia/Response/Model/AttributeEnum.php index d04ac7491a..e38c92a9bd 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributeEnum.php +++ b/src/Appwrite/Utopia/Response/Model/AttributeEnum.php @@ -12,6 +12,18 @@ class AttributeEnum extends Attribute parent::__construct(); $this + ->addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Attribute Key.', + 'default' => '', + 'example' => 'status', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Attribute type.', + 'default' => '', + 'example' => 'string', + ]) ->addRule('elements', [ 'type' => self::TYPE_STRING, 'description' => 'Array of elements in enumerated type.', diff --git a/src/Appwrite/Utopia/Response/Model/AttributeFloat.php b/src/Appwrite/Utopia/Response/Model/AttributeFloat.php index 93033f5b0a..bfbc98bf60 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributeFloat.php +++ b/src/Appwrite/Utopia/Response/Model/AttributeFloat.php @@ -12,6 +12,18 @@ class AttributeFloat extends Attribute parent::__construct(); $this + ->addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Attribute Key.', + 'default' => '', + 'example' => 'percentCompleted', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Attribute type.', + 'default' => '', + 'example' => 'double', + ]) ->addRule('min', [ 'type' => self::TYPE_FLOAT, 'description' => 'Minimum value to enforce for new documents.', diff --git a/src/Appwrite/Utopia/Response/Model/AttributeIP.php b/src/Appwrite/Utopia/Response/Model/AttributeIP.php index 2b8f64dede..0e8701e67c 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributeIP.php +++ b/src/Appwrite/Utopia/Response/Model/AttributeIP.php @@ -12,6 +12,18 @@ class AttributeIP extends Attribute parent::__construct(); $this + ->addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Attribute Key.', + 'default' => '', + 'example' => 'ipAddress', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Attribute type.', + 'default' => '', + 'example' => 'string', + ]) ->addRule('format', [ 'type' => self::TYPE_STRING, 'description' => 'String format.', diff --git a/src/Appwrite/Utopia/Response/Model/AttributeInteger.php b/src/Appwrite/Utopia/Response/Model/AttributeInteger.php index 9ff94c8f56..a8bb6fb095 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributeInteger.php +++ b/src/Appwrite/Utopia/Response/Model/AttributeInteger.php @@ -12,6 +12,18 @@ class AttributeInteger extends Attribute parent::__construct(); $this + ->addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Attribute Key.', + 'default' => '', + 'example' => 'count', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Attribute type.', + 'default' => '', + 'example' => 'integer', + ]) ->addRule('min', [ 'type' => self::TYPE_INTEGER, 'description' => 'Minimum value to enforce for new documents.', diff --git a/src/Appwrite/Utopia/Response/Model/AttributeURL.php b/src/Appwrite/Utopia/Response/Model/AttributeURL.php index 489e038851..d0d0931935 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributeURL.php +++ b/src/Appwrite/Utopia/Response/Model/AttributeURL.php @@ -12,6 +12,18 @@ class AttributeURL extends Attribute parent::__construct(); $this + ->addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Attribute Key.', + 'default' => '', + 'example' => 'githubUrl', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Attribute type.', + 'default' => '', + 'example' => 'string', + ]) ->addRule('format', [ 'type' => self::TYPE_STRING, 'description' => 'String format.', From 5bf0202490b002048dfc48f371eaa68919f64dcb Mon Sep 17 00:00:00 2001 From: "Eldad A. Fux" Date: Mon, 14 Mar 2022 19:40:19 +0200 Subject: [PATCH 2/2] Update src/Appwrite/Utopia/Response/Model/AttributeFloat.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Matej Bačo --- src/Appwrite/Utopia/Response/Model/AttributeFloat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Utopia/Response/Model/AttributeFloat.php b/src/Appwrite/Utopia/Response/Model/AttributeFloat.php index bfbc98bf60..e8a8a07aea 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributeFloat.php +++ b/src/Appwrite/Utopia/Response/Model/AttributeFloat.php @@ -16,7 +16,7 @@ class AttributeFloat extends Attribute 'type' => self::TYPE_STRING, 'description' => 'Attribute Key.', 'default' => '', - 'example' => 'percentCompleted', + 'example' => 'percentageCompleted', ]) ->addRule('type', [ 'type' => self::TYPE_STRING,