Skip to content

Commit a7dbb3d

Browse files
committed
Refactor API parameters to replace 'includeTotal' with 'total' across multiple endpoints for consistency in response handling.
1 parent 3300013 commit a7dbb3d

38 files changed

Lines changed: 73 additions & 73 deletions

File tree

app/controllers/api/account.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2814,7 +2814,7 @@ function sendSessionAlert(Locale $locale, Document $user, Document $project, Doc
28142814
contentType: ContentType::JSON,
28152815
))
28162816
->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true)
2817-
->param('includeTotal', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
2817+
->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
28182818
->inject('response')
28192819
->inject('user')
28202820
->inject('locale')
@@ -5212,7 +5212,7 @@ function sendSessionAlert(Locale $locale, Document $user, Document $project, Doc
52125212
contentType: ContentType::JSON
52135213
))
52145214
->param('queries', [], new Identities(), '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(', ', Identities::ALLOWED_ATTRIBUTES), true)
5215-
->param('includeTotal', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
5215+
->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
52165216
->inject('response')
52175217
->inject('user')
52185218
->inject('dbForProject')

app/controllers/api/messaging.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@
10671067
))
10681068
->param('queries', [], new Providers(), '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(', ', Providers::ALLOWED_ATTRIBUTES), true)
10691069
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
1070-
->param('includeTotal', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
1070+
->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
10711071
->inject('dbForProject')
10721072
->inject('response')
10731073
->action(function (array $queries, string $search, bool $includeTotal, Database $dbForProject, Response $response) {
@@ -1136,7 +1136,7 @@
11361136
))
11371137
->param('providerId', '', new UID(), 'Provider ID.')
11381138
->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true)
1139-
->param('includeTotal', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
1139+
->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
11401140
->inject('response')
11411141
->inject('dbForProject')
11421142
->inject('locale')
@@ -2474,7 +2474,7 @@
24742474
))
24752475
->param('queries', [], new Topics(), '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(', ', Topics::ALLOWED_ATTRIBUTES), true)
24762476
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
2477-
->param('includeTotal', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
2477+
->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
24782478
->inject('dbForProject')
24792479
->inject('response')
24802480
->action(function (array $queries, string $search, bool $includeTotal, Database $dbForProject, Response $response) {
@@ -2543,7 +2543,7 @@
25432543
))
25442544
->param('topicId', '', new UID(), 'Topic ID.')
25452545
->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true)
2546-
->param('includeTotal', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
2546+
->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
25472547
->inject('response')
25482548
->inject('dbForProject')
25492549
->inject('locale')
@@ -2877,7 +2877,7 @@
28772877
->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.')
28782878
->param('queries', [], new Subscribers(), '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(', ', Providers::ALLOWED_ATTRIBUTES), true)
28792879
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
2880-
->param('includeTotal', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
2880+
->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
28812881
->inject('dbForProject')
28822882
->inject('response')
28832883
->action(function (string $topicId, array $queries, string $search, bool $includeTotal, Database $dbForProject, Response $response) {
@@ -2966,7 +2966,7 @@
29662966
))
29672967
->param('subscriberId', '', new UID(), 'Subscriber ID.')
29682968
->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true)
2969-
->param('includeTotal', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
2969+
->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
29702970
->inject('response')
29712971
->inject('dbForProject')
29722972
->inject('locale')
@@ -3697,7 +3697,7 @@
36973697
))
36983698
->param('queries', [], new Messages(), '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(', ', Messages::ALLOWED_ATTRIBUTES), true)
36993699
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
3700-
->param('includeTotal', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
3700+
->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
37013701
->inject('dbForProject')
37023702
->inject('response')
37033703
->action(function (array $queries, string $search, bool $includeTotal, Database $dbForProject, Response $response) {
@@ -3766,7 +3766,7 @@
37663766
))
37673767
->param('messageId', '', new UID(), 'Message ID.')
37683768
->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true)
3769-
->param('includeTotal', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
3769+
->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
37703770
->inject('response')
37713771
->inject('dbForProject')
37723772
->inject('locale')
@@ -3865,7 +3865,7 @@
38653865
))
38663866
->param('messageId', '', new UID(), 'Message ID.')
38673867
->param('queries', [], new Targets(), '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(', ', Targets::ALLOWED_ATTRIBUTES), true)
3868-
->param('includeTotal', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
3868+
->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
38693869
->inject('response')
38703870
->inject('dbForProject')
38713871
->action(function (string $messageId, array $queries, bool $includeTotal, Response $response, Database $dbForProject) {

app/controllers/api/migrations.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@
597597
))
598598
->param('queries', [], new Migrations(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). 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(', ', Migrations::ALLOWED_ATTRIBUTES), true)
599599
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
600-
->param('includeTotal', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
600+
->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
601601
->inject('response')
602602
->inject('dbForProject')
603603
->action(function (array $queries, string $search, bool $includeTotal, Response $response, Database $dbForProject) {

app/controllers/api/projects.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,7 @@
12341234
]
12351235
))
12361236
->param('projectId', '', new UID(), 'Project unique ID.')
1237-
->param('includeTotal', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
1237+
->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
12381238
->inject('response')
12391239
->inject('dbForPlatform')
12401240
->action(function (string $projectId, bool $includeTotal, Response $response, Database $dbForPlatform) {
@@ -1532,7 +1532,7 @@
15321532
]
15331533
))
15341534
->param('projectId', '', new UID(), 'Project unique ID.')
1535-
->param('includeTotal', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
1535+
->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
15361536
->inject('response')
15371537
->inject('dbForPlatform')
15381538
->action(function (string $projectId, bool $includeTotal, Response $response, Database $dbForPlatform) {
@@ -1836,7 +1836,7 @@
18361836
]
18371837
))
18381838
->param('projectId', '', new UID(), 'Project unique ID.')
1839-
->param('includeTotal', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
1839+
->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
18401840
->inject('response')
18411841
->inject('dbForPlatform')
18421842
->action(function (string $projectId, bool $includeTotal, Response $response, Database $dbForPlatform) {

app/controllers/api/storage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
))
181181
->param('queries', [], new Buckets(), '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(', ', Buckets::ALLOWED_ATTRIBUTES), true)
182182
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
183-
->param('includeTotal', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
183+
->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
184184
->inject('response')
185185
->inject('dbForProject')
186186
->action(function (array $queries, string $search, bool $includeTotal, Response $response, Database $dbForProject) {
@@ -786,7 +786,7 @@
786786
->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).')
787787
->param('queries', [], new Files(), '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(', ', Files::ALLOWED_ATTRIBUTES), true)
788788
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
789-
->param('includeTotal', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
789+
->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
790790
->inject('response')
791791
->inject('dbForProject')
792792
->inject('mode')

app/controllers/api/teams.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
))
171171
->param('queries', [], new Teams(), '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(', ', Teams::ALLOWED_ATTRIBUTES), true)
172172
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
173-
->param('includeTotal', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
173+
->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
174174
->inject('response')
175175
->inject('dbForProject')
176176
->action(function (array $queries, string $search, bool $includeTotal, Response $response, Database $dbForProject) {
@@ -840,7 +840,7 @@
840840
->param('teamId', '', new UID(), 'Team ID.')
841841
->param('queries', [], new Memberships(), '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(', ', Memberships::ALLOWED_ATTRIBUTES), true)
842842
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
843-
->param('includeTotal', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
843+
->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
844844
->inject('response')
845845
->inject('project')
846846
->inject('dbForProject')
@@ -1433,7 +1433,7 @@
14331433
))
14341434
->param('teamId', '', new UID(), 'Team ID.')
14351435
->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true)
1436-
->param('includeTotal', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
1436+
->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true)
14371437
->inject('response')
14381438
->inject('dbForProject')
14391439
->inject('locale')

0 commit comments

Comments
 (0)