chore: use class

This commit is contained in:
Chirag Aggarwal 2025-07-22 16:43:02 +05:30
parent 51614105df
commit 2a81075830
49 changed files with 272 additions and 193 deletions

View file

@ -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).')

View file

@ -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).')

View file

@ -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).')

View file

@ -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.')

View file

@ -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.')

View file

@ -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.')

View file

@ -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.')

View file

@ -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.')

View file

@ -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.')

View file

@ -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.')

View file

@ -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.')

View file

@ -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.')

View file

@ -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.')

View file

@ -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.')

View file

@ -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.')

View file

@ -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.')

View file

@ -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.')

View file

@ -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.')

View file

@ -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).')

View file

@ -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).')

View file

@ -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.')

View file

@ -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.')

View file

@ -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.')

View file

@ -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.')

View file

@ -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.')

View file

@ -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.')

View file

@ -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.')

View file

@ -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).')

View file

@ -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.')

View file

@ -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.')

View file

@ -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.')

View file

@ -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).')

View file

@ -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).')

View file

@ -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.')

View file

@ -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.')

View file

@ -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.')

View file

@ -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).')

View file

@ -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.')

View file

@ -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).')

View file

@ -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).')

View file

@ -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).')

View file

@ -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).')

View file

@ -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.')

View file

@ -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.')

View file

@ -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)

View file

@ -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)

View file

@ -0,0 +1,32 @@
<?php
namespace Appwrite\SDK;
class Deprecated
{
/**
* @param string $since
* @param string|null $replaceWith
*/
public function __construct(
private string $since,
private ?string $replaceWith = null,
) {
}
/**
* @return string
*/
public function getSince(): string
{
return $this->since;
}
/**
* @return string|null
*/
public function getReplaceWith(): ?string
{
return $this->replaceWith;
}
}

View file

@ -23,7 +23,7 @@ class Method
* @param array<SDKResponse> $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;

View file

@ -102,6 +102,7 @@ class Swagger2 extends Format
$additionalMethods = null;
if (\is_array($sdk)) {
$additionalMethods = $sdk;
/** @var Method $sdk */
$sdk = $sdk[0];
}