From 2a810758300e275739bf5c9a1e2eb322da89a6a7 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 22 Jul 2025 16:43:02 +0530 Subject: [PATCH] chore: use class --- .../Collections/Attributes/Boolean/Create.php | 9 +++--- .../Collections/Attributes/Boolean/Update.php | 9 +++--- .../Attributes/Datetime/Create.php | 9 +++--- .../Attributes/Datetime/Update.php | 9 +++--- .../Collections/Attributes/Delete.php | 9 +++--- .../Collections/Attributes/Email/Create.php | 9 +++--- .../Collections/Attributes/Email/Update.php | 9 +++--- .../Collections/Attributes/Enum/Create.php | 9 +++--- .../Collections/Attributes/Enum/Update.php | 9 +++--- .../Collections/Attributes/Float/Create.php | 9 +++--- .../Collections/Attributes/Float/Update.php | 9 +++--- .../Databases/Collections/Attributes/Get.php | 9 +++--- .../Collections/Attributes/IP/Create.php | 9 +++--- .../Collections/Attributes/IP/Update.php | 9 +++--- .../Collections/Attributes/Integer/Create.php | 9 +++--- .../Collections/Attributes/Integer/Update.php | 9 +++--- .../Attributes/Relationship/Create.php | 9 +++--- .../Attributes/Relationship/Update.php | 9 +++--- .../Collections/Attributes/String/Create.php | 9 +++--- .../Collections/Attributes/String/Update.php | 9 +++--- .../Collections/Attributes/URL/Create.php | 9 +++--- .../Collections/Attributes/URL/Update.php | 9 +++--- .../Collections/Attributes/XList.php | 9 +++--- .../Http/Databases/Collections/Create.php | 9 +++--- .../Http/Databases/Collections/Delete.php | 9 +++--- .../Documents/Attribute/Decrement.php | 9 +++--- .../Documents/Attribute/Increment.php | 9 +++--- .../Collections/Documents/Bulk/Delete.php | 9 +++--- .../Collections/Documents/Bulk/Update.php | 9 +++--- .../Collections/Documents/Bulk/Upsert.php | 9 +++--- .../Collections/Documents/Create.php | 17 +++++----- .../Collections/Documents/Delete.php | 9 +++--- .../Databases/Collections/Documents/Get.php | 9 +++--- .../Collections/Documents/Logs/XList.php | 9 +++--- .../Collections/Documents/Update.php | 9 +++--- .../Collections/Documents/Upsert.php | 9 +++--- .../Databases/Collections/Documents/XList.php | 9 +++--- .../Http/Databases/Collections/Get.php | 9 +++--- .../Databases/Collections/Indexes/Create.php | 9 +++--- .../Databases/Collections/Indexes/Delete.php | 9 +++--- .../Databases/Collections/Indexes/Get.php | 9 +++--- .../Databases/Collections/Indexes/XList.php | 9 +++--- .../Http/Databases/Collections/Logs/XList.php | 9 +++--- .../Http/Databases/Collections/Update.php | 9 +++--- .../Http/Databases/Collections/Usage/Get.php | 9 +++--- .../Http/Databases/Collections/XList.php | 9 +++--- src/Appwrite/SDK/Deprecated.php | 32 +++++++++++++++++++ src/Appwrite/SDK/Method.php | 10 +++--- .../SDK/Specification/Format/Swagger2.php | 1 + 49 files changed, 272 insertions(+), 193 deletions(-) create mode 100644 src/Appwrite/SDK/Deprecated.php diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Create.php index f35ac34f9b..04fc96456e 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Create.php @@ -6,6 +6,7 @@ use Appwrite\Event\Database as EventDatabase; use Appwrite\Event\Event; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -52,10 +53,10 @@ class Create extends Action model: $this->getResponseModel(), ) ], - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.createBooleanColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.createBooleanColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Update.php index b2f5664632..487eca769f 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Update.php @@ -6,6 +6,7 @@ use Appwrite\Event\Event; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -53,10 +54,10 @@ class Update extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.updateBooleanColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.updateBooleanColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Create.php index 7c118e05c0..a750a53d75 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Create.php @@ -6,6 +6,7 @@ use Appwrite\Event\Database as EventDatabase; use Appwrite\Event\Event; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -53,10 +54,10 @@ class Create extends Action model: $this->getResponseModel() ) ], - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.createDatetimeColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.createDatetimeColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Update.php index 4ff64bcbcb..8d7a383cf1 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Update.php @@ -6,6 +6,7 @@ use Appwrite\Event\Event; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -54,10 +55,10 @@ class Update extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.updateDatetimeColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.updateDatetimeColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Delete.php index f708464800..67ee8d814d 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Delete.php @@ -7,6 +7,7 @@ use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -54,10 +55,10 @@ class Delete extends Action ) ], contentType: ContentType::NONE, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.deleteColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.deleteColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Create.php index cfd528ad6b..9037ce1dcb 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Create.php @@ -7,6 +7,7 @@ use Appwrite\Event\Event; use Appwrite\Network\Validator\Email; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -53,10 +54,10 @@ class Create extends Action model: $this->getResponseModel(), ) ], - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.createEmailColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.createEmailColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Update.php index 75d9759af2..bfe9733449 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Update.php @@ -7,6 +7,7 @@ use Appwrite\Network\Validator\Email; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -54,10 +55,10 @@ class Update extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.updateEmailColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.updateEmailColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Create.php index 646858d0bc..b54dd1c0ad 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Create.php @@ -7,6 +7,7 @@ use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -55,10 +56,10 @@ class Create extends Action model: $this->getResponseModel(), ) ], - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.createEnumColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.createEnumColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Update.php index f144fb038e..2fde9eaecc 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Update.php @@ -6,6 +6,7 @@ use Appwrite\Event\Event; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -55,10 +56,10 @@ class Update extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.updateEnumColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.updateEnumColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Create.php index a5f794797d..bc1eb2d4c9 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Create.php @@ -7,6 +7,7 @@ use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -55,10 +56,10 @@ class Create extends Action model: $this->getResponseModel(), ) ], - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.createFloatColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.createFloatColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Update.php index 9935da15a0..cb770067ff 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Update.php @@ -6,6 +6,7 @@ use Appwrite\Event\Event; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -54,10 +55,10 @@ class Update extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.updateFloatColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.updateFloatColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Get.php index 6760689c23..a9d4d36758 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Get.php @@ -4,6 +4,7 @@ namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attribu use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -57,10 +58,10 @@ class Get extends Action model: $this->getResponseModel() ) ], - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.getColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.getColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Create.php index 78907a063d..e49b775a54 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Create.php @@ -6,6 +6,7 @@ use Appwrite\Event\Database as EventDatabase; use Appwrite\Event\Event; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -53,10 +54,10 @@ class Create extends Action model: $this->getResponseModel(), ) ], - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.createIpColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.createIpColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Update.php index 5af8b7aa01..44b8347807 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Update.php @@ -6,6 +6,7 @@ use Appwrite\Event\Event; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -54,10 +55,10 @@ class Update extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.updateIpColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.updateIpColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Create.php index 75f886f4df..ea8a38e6c1 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Create.php @@ -7,6 +7,7 @@ use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -55,10 +56,10 @@ class Create extends Action model: $this->getResponseModel(), ) ], - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.createIntegerColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.createIntegerColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Update.php index 412a1a7bc3..39e8bad1f9 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Update.php @@ -6,6 +6,7 @@ use Appwrite\Event\Event; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -54,10 +55,10 @@ class Update extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.updateIntegerColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.updateIntegerColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Create.php index a753194e2e..a062b96a36 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Create.php @@ -7,6 +7,7 @@ use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -55,10 +56,10 @@ class Create extends Action model: $this->getResponseModel() ) ], - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.createRelationshipColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.createRelationshipColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Update.php index 48e82fc6d7..08a6475bb0 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Update.php @@ -6,6 +6,7 @@ use Appwrite\Event\Event; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -52,10 +53,10 @@ class Update extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.updateRelationshipColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.updateRelationshipColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Create.php index 459273c007..c1692c77d6 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Create.php @@ -7,6 +7,7 @@ use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -57,10 +58,10 @@ class Create extends Action model: $this->getResponseModel() ) ], - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.createStringColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.createStringColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Update.php index 2e43532e90..770854f0f9 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Update.php @@ -6,6 +6,7 @@ use Appwrite\Event\Event; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -56,10 +57,10 @@ class Update extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.updateStringColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.updateStringColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Create.php index cda120a75e..d471cf24f1 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Create.php @@ -6,6 +6,7 @@ use Appwrite\Event\Database as EventDatabase; use Appwrite\Event\Event; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -53,10 +54,10 @@ class Create extends Action model: $this->getResponseModel(), ) ], - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.createUrlColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.createUrlColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Update.php index ee8b2496e3..dc475194c8 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Update.php @@ -6,6 +6,7 @@ use Appwrite\Event\Event; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -54,10 +55,10 @@ class Update extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.updateUrlColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.updateUrlColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/XList.php index d0982f3143..f4ff635759 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/XList.php @@ -4,6 +4,7 @@ namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attribu use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\Queries\Attributes; @@ -51,10 +52,10 @@ class XList extends Action model: $this->getResponseModel() ) ], - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.listColumns', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.listColumns', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Create.php index 7d72425645..a88652b9e1 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Create.php @@ -6,6 +6,7 @@ use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\CustomId; @@ -62,10 +63,10 @@ class Create extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.create', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.create', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Delete.php index e78d03e9c8..642d0d0978 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Delete.php @@ -7,6 +7,7 @@ use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -52,10 +53,10 @@ class Delete extends Action ) ], contentType: ContentType::NONE, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.delete', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.delete', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Decrement.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Decrement.php index 07a0342c80..cb38f8f75e 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Decrement.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Decrement.php @@ -8,6 +8,7 @@ use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Action; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -62,10 +63,10 @@ class Decrement extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.decrementRowColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.decrementRowColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Increment.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Increment.php index eed2399b53..82b688caae 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Increment.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Increment.php @@ -8,6 +8,7 @@ use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Action; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -62,10 +63,10 @@ class Increment extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.incrementRowColumn', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.incrementRowColumn', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Delete.php index e6f295f1b0..e6ce45f2f9 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Delete.php @@ -7,6 +7,7 @@ use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Action; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -60,10 +61,10 @@ class Delete extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.deleteRows', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.deleteRows', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Update.php index 4f084b75c1..e153d0af20 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Update.php @@ -7,6 +7,7 @@ use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Action; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -63,10 +64,10 @@ class Update extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.updateRows', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.updateRows', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Upsert.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Upsert.php index 31a0ebf272..687a426a3a 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Upsert.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Upsert.php @@ -7,6 +7,7 @@ use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Action; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -61,10 +62,10 @@ class Upsert extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.upsertRows', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.upsertRows', + ), ) ]) ->param('databaseId', '', new UID(), 'Database ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Create.php index 405deeb420..64b1280eff 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Create.php @@ -8,6 +8,7 @@ use Appwrite\Event\StatsUsage; use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Parameter; use Appwrite\SDK\Response as SDKResponse; @@ -81,10 +82,10 @@ class Create extends Action new Parameter('data', optional: false), new Parameter('permissions', optional: true), ], - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.createRow', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.createRow', + ), ), new Method( namespace: $this->getSdkNamespace(), @@ -104,10 +105,10 @@ class Create extends Action new Parameter('collectionId', optional: false), new Parameter('documents', optional: false), ], - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.createRows', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.createRows', + ), ) ]) ->param('databaseId', '', new UID(), 'Database ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Delete.php index 71dfab76b6..8b0b43c05e 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Delete.php @@ -8,6 +8,7 @@ use Appwrite\Event\StatsUsage; use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -62,10 +63,10 @@ class Delete extends Action ) ], contentType: ContentType::NONE, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.deleteRow', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.deleteRow', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Get.php index 8d7d04e6ca..35463d2d40 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Get.php @@ -7,6 +7,7 @@ use Appwrite\Event\StatsUsage; use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -53,10 +54,10 @@ class Get extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.getRow', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.getRow', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Logs/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Logs/XList.php index aa5ded79f1..482b0fb05c 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Logs/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Logs/XList.php @@ -7,6 +7,7 @@ use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Action; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -59,10 +60,10 @@ class XList extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.listLogs', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.listLogs', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Update.php index 360af37098..450f555dd2 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Update.php @@ -8,6 +8,7 @@ use Appwrite\Event\StatsUsage; use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -66,10 +67,10 @@ class Update extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.updateRow', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.updateRow', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Upsert.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Upsert.php index c587ebc3a4..f514237fdf 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Upsert.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Upsert.php @@ -8,6 +8,7 @@ use Appwrite\Event\StatsUsage; use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\CustomId; @@ -68,10 +69,10 @@ class Upsert extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.upsertRow', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.upsertRow', + ), ), ]) ->param('databaseId', '', new UID(), 'Database ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/XList.php index 852c33c505..9c00f9548c 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/XList.php @@ -7,6 +7,7 @@ use Appwrite\Event\StatsUsage; use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -56,10 +57,10 @@ class XList extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.listRows', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.listRows', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Get.php index 9faeefa949..67c6cea5f3 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Get.php @@ -5,6 +5,7 @@ namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections; use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -47,10 +48,10 @@ class Get extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.get', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.get', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php index 335f3f30fa..a826ade364 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php @@ -7,6 +7,7 @@ use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -62,10 +63,10 @@ class Create extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.createIndex', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.createIndex', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Delete.php index 2ba8922c35..1b62e2bec8 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Delete.php @@ -7,6 +7,7 @@ use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -57,10 +58,10 @@ class Delete extends Action ) ], contentType: ContentType::NONE, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.deleteIndex', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.deleteIndex', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Get.php index f7b163b47c..957ca98f61 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Get.php @@ -5,6 +5,7 @@ namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -48,10 +49,10 @@ class Get extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.getIndex', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.getIndex', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/XList.php index 8b6e4ef8d0..ed570d8abd 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/XList.php @@ -5,6 +5,7 @@ namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\Queries\Indexes; @@ -53,10 +54,10 @@ class XList extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.listIndexes', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.listIndexes', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Logs/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Logs/XList.php index 12c1b19340..9527859efa 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Logs/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Logs/XList.php @@ -6,6 +6,7 @@ use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Action; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -59,10 +60,10 @@ class XList extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.listLogs', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.listLogs', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Update.php index e4c8b38c70..cc29b6ea66 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Update.php @@ -6,6 +6,7 @@ use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -55,10 +56,10 @@ class Update extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.update', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.update', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Usage/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Usage/Get.php index ec24f1bab4..d829d18714 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Usage/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Usage/Get.php @@ -6,6 +6,7 @@ use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Action; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; @@ -52,10 +53,10 @@ class Get extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.getUsage', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.getUsage', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/XList.php index 4891fe9783..13269834a2 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/XList.php @@ -5,6 +5,7 @@ namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections; use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\Queries\Collections; @@ -54,10 +55,10 @@ class XList extends Action ) ], contentType: ContentType::JSON, - deprecated: [ - 'since' => '1.8.0', - 'replaceWith' => 'tables.list', - ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tables.list', + ), )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('queries', [], new Collections(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Collections::ALLOWED_ATTRIBUTES), true) diff --git a/src/Appwrite/SDK/Deprecated.php b/src/Appwrite/SDK/Deprecated.php new file mode 100644 index 0000000000..1d74c108c9 --- /dev/null +++ b/src/Appwrite/SDK/Deprecated.php @@ -0,0 +1,32 @@ +since; + } + + /** + * @return string|null + */ + public function getReplaceWith(): ?string + { + return $this->replaceWith; + } +} diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index b6298e1840..945c9e8fae 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -23,7 +23,7 @@ class Method * @param array $responses * @param ContentType $contentType * @param MethodType|null $type - * @param bool|array $deprecated + * @param bool|Deprecated $deprecated * @param array|bool $hide * @param bool $packaging * @param ContentType $requestType @@ -39,7 +39,7 @@ class Method protected array $responses, protected ContentType $contentType = ContentType::JSON, protected ?MethodType $type = null, - protected bool|array $deprecated = false, + protected bool|Deprecated $deprecated = false, protected array|bool $hide = false, protected bool $packaging = false, protected ContentType $requestType = ContentType::JSON, @@ -180,7 +180,7 @@ class Method return $this->deprecated !== false; } - public function getDeprecated(): bool|array + public function getDeprecated(): bool|Deprecated { return $this->deprecated; } @@ -263,13 +263,13 @@ class Method return $this; } - public function setDeprecated(bool|array $deprecated): self + public function setDeprecated(bool|Deprecated $deprecated): self { $this->deprecated = $deprecated; return $this; } - public function setHide(bool|array $hide): self + public function setHide(bool|Deprecated $hide): self { $this->hide = $hide; return $this; diff --git a/src/Appwrite/SDK/Specification/Format/Swagger2.php b/src/Appwrite/SDK/Specification/Format/Swagger2.php index 3eacb2008d..812a6eb9ff 100644 --- a/src/Appwrite/SDK/Specification/Format/Swagger2.php +++ b/src/Appwrite/SDK/Specification/Format/Swagger2.php @@ -102,6 +102,7 @@ class Swagger2 extends Format $additionalMethods = null; if (\is_array($sdk)) { $additionalMethods = $sdk; + /** @var Method $sdk */ $sdk = $sdk[0]; }