Skip to content

Commit f1ba4a5

Browse files
authored
Merge pull request #64 from appwrite/dev
Update attributes
2 parents 9ee0e37 + 0ab2531 commit f1ba4a5

16 files changed

+49
-15
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Add this to your package's `pubspec.yaml` file:
2323

2424
```yml
2525
dependencies:
26-
dart_appwrite: ^12.0.0
26+
dart_appwrite: ^12.1.0
2727
```
2828
2929
You can install packages from the command line:

docs/examples/databases/update-boolean-attribute.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ AttributeBoolean result = await databases.updateBooleanAttribute(
1313
key: '',
1414
xrequired: false,
1515
xdefault: false,
16+
newKey: '', // (optional)
1617
);

docs/examples/databases/update-datetime-attribute.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ AttributeDatetime result = await databases.updateDatetimeAttribute(
1313
key: '',
1414
xrequired: false,
1515
xdefault: '',
16+
newKey: '', // (optional)
1617
);

docs/examples/databases/update-email-attribute.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ AttributeEmail result = await databases.updateEmailAttribute(
1313
key: '',
1414
xrequired: false,
1515
xdefault: '[email protected]',
16+
newKey: '', // (optional)
1617
);

docs/examples/databases/update-enum-attribute.md

+1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ AttributeEnum result = await databases.updateEnumAttribute(
1414
elements: [],
1515
xrequired: false,
1616
xdefault: '<DEFAULT>',
17+
newKey: '', // (optional)
1718
);

docs/examples/databases/update-float-attribute.md

+1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ AttributeFloat result = await databases.updateFloatAttribute(
1515
min: 0,
1616
max: 0,
1717
xdefault: 0,
18+
newKey: '', // (optional)
1819
);

docs/examples/databases/update-integer-attribute.md

+1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ AttributeInteger result = await databases.updateIntegerAttribute(
1515
min: 0,
1616
max: 0,
1717
xdefault: 0,
18+
newKey: '', // (optional)
1819
);

docs/examples/databases/update-ip-attribute.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ AttributeIp result = await databases.updateIpAttribute(
1313
key: '',
1414
xrequired: false,
1515
xdefault: '',
16+
newKey: '', // (optional)
1617
);

docs/examples/databases/update-relationship-attribute.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ AttributeRelationship result = await databases.updateRelationshipAttribute(
1212
collectionId: '<COLLECTION_ID>',
1313
key: '',
1414
onDelete: RelationMutate.cascade, // (optional)
15+
newKey: '', // (optional)
1516
);

docs/examples/databases/update-string-attribute.md

+2
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ AttributeString result = await databases.updateStringAttribute(
1313
key: '',
1414
xrequired: false,
1515
xdefault: '<DEFAULT>',
16+
size: 0, // (optional)
17+
newKey: '', // (optional)
1618
);

docs/examples/databases/update-url-attribute.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ AttributeUrl result = await databases.updateUrlAttribute(
1313
key: '',
1414
xrequired: false,
1515
xdefault: 'https://example.com',
16+
newKey: '', // (optional)
1617
);

docs/examples/functions/create-deployment.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'dart:io';
12
import 'package:dart_appwrite/dart_appwrite.dart';
23

34
Client client = Client()

lib/services/databases.dart

+32-10
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,8 @@ class Databases extends Service {
318318
required String collectionId,
319319
required String key,
320320
required bool xrequired,
321-
required bool? xdefault}) async {
321+
required bool? xdefault,
322+
String? newKey}) async {
322323
final String apiPath =
323324
'/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}'
324325
.replaceAll('{databaseId}', databaseId)
@@ -328,6 +329,7 @@ class Databases extends Service {
328329
final Map<String, dynamic> apiParams = {
329330
'required': xrequired,
330331
'default': xdefault,
332+
'newKey': newKey,
331333
};
332334

333335
final Map<String, String> apiHeaders = {
@@ -381,7 +383,8 @@ class Databases extends Service {
381383
required String collectionId,
382384
required String key,
383385
required bool xrequired,
384-
required String? xdefault}) async {
386+
required String? xdefault,
387+
String? newKey}) async {
385388
final String apiPath =
386389
'/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}'
387390
.replaceAll('{databaseId}', databaseId)
@@ -391,6 +394,7 @@ class Databases extends Service {
391394
final Map<String, dynamic> apiParams = {
392395
'required': xrequired,
393396
'default': xdefault,
397+
'newKey': newKey,
394398
};
395399

396400
final Map<String, String> apiHeaders = {
@@ -446,7 +450,8 @@ class Databases extends Service {
446450
required String collectionId,
447451
required String key,
448452
required bool xrequired,
449-
required String? xdefault}) async {
453+
required String? xdefault,
454+
String? newKey}) async {
450455
final String apiPath =
451456
'/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}'
452457
.replaceAll('{databaseId}', databaseId)
@@ -456,6 +461,7 @@ class Databases extends Service {
456461
final Map<String, dynamic> apiParams = {
457462
'required': xrequired,
458463
'default': xdefault,
464+
'newKey': newKey,
459465
};
460466

461467
final Map<String, String> apiHeaders = {
@@ -515,7 +521,8 @@ class Databases extends Service {
515521
required String key,
516522
required List<String> elements,
517523
required bool xrequired,
518-
required String? xdefault}) async {
524+
required String? xdefault,
525+
String? newKey}) async {
519526
final String apiPath =
520527
'/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'
521528
.replaceAll('{databaseId}', databaseId)
@@ -526,6 +533,7 @@ class Databases extends Service {
526533
'elements': elements,
527534
'required': xrequired,
528535
'default': xdefault,
536+
'newKey': newKey,
529537
};
530538

531539
final Map<String, String> apiHeaders = {
@@ -588,7 +596,8 @@ class Databases extends Service {
588596
required bool xrequired,
589597
required double min,
590598
required double max,
591-
required double? xdefault}) async {
599+
required double? xdefault,
600+
String? newKey}) async {
592601
final String apiPath =
593602
'/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}'
594603
.replaceAll('{databaseId}', databaseId)
@@ -600,6 +609,7 @@ class Databases extends Service {
600609
'min': min,
601610
'max': max,
602611
'default': xdefault,
612+
'newKey': newKey,
603613
};
604614

605615
final Map<String, String> apiHeaders = {
@@ -662,7 +672,8 @@ class Databases extends Service {
662672
required bool xrequired,
663673
required int min,
664674
required int max,
665-
required int? xdefault}) async {
675+
required int? xdefault,
676+
String? newKey}) async {
666677
final String apiPath =
667678
'/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}'
668679
.replaceAll('{databaseId}', databaseId)
@@ -674,6 +685,7 @@ class Databases extends Service {
674685
'min': min,
675686
'max': max,
676687
'default': xdefault,
688+
'newKey': newKey,
677689
};
678690

679691
final Map<String, String> apiHeaders = {
@@ -729,7 +741,8 @@ class Databases extends Service {
729741
required String collectionId,
730742
required String key,
731743
required bool xrequired,
732-
required String? xdefault}) async {
744+
required String? xdefault,
745+
String? newKey}) async {
733746
final String apiPath =
734747
'/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}'
735748
.replaceAll('{databaseId}', databaseId)
@@ -739,6 +752,7 @@ class Databases extends Service {
739752
final Map<String, dynamic> apiParams = {
740753
'required': xrequired,
741754
'default': xdefault,
755+
'newKey': newKey,
742756
};
743757

744758
final Map<String, String> apiHeaders = {
@@ -836,7 +850,9 @@ class Databases extends Service {
836850
required String collectionId,
837851
required String key,
838852
required bool xrequired,
839-
required String? xdefault}) async {
853+
required String? xdefault,
854+
int? size,
855+
String? newKey}) async {
840856
final String apiPath =
841857
'/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'
842858
.replaceAll('{databaseId}', databaseId)
@@ -846,6 +862,8 @@ class Databases extends Service {
846862
final Map<String, dynamic> apiParams = {
847863
'required': xrequired,
848864
'default': xdefault,
865+
'size': size,
866+
'newKey': newKey,
849867
};
850868

851869
final Map<String, String> apiHeaders = {
@@ -901,7 +919,8 @@ class Databases extends Service {
901919
required String collectionId,
902920
required String key,
903921
required bool xrequired,
904-
required String? xdefault}) async {
922+
required String? xdefault,
923+
String? newKey}) async {
905924
final String apiPath =
906925
'/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}'
907926
.replaceAll('{databaseId}', databaseId)
@@ -911,6 +930,7 @@ class Databases extends Service {
911930
final Map<String, dynamic> apiParams = {
912931
'required': xrequired,
913932
'default': xdefault,
933+
'newKey': newKey,
914934
};
915935

916936
final Map<String, String> apiHeaders = {
@@ -982,7 +1002,8 @@ class Databases extends Service {
9821002
{required String databaseId,
9831003
required String collectionId,
9841004
required String key,
985-
enums.RelationMutate? onDelete}) async {
1005+
enums.RelationMutate? onDelete,
1006+
String? newKey}) async {
9861007
final String apiPath =
9871008
'/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'
9881009
.replaceAll('{databaseId}', databaseId)
@@ -991,6 +1012,7 @@ class Databases extends Service {
9911012

9921013
final Map<String, dynamic> apiParams = {
9931014
'onDelete': onDelete?.value,
1015+
'newKey': newKey,
9941016
};
9951017

9961018
final Map<String, String> apiHeaders = {

lib/src/client_browser.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class ClientBrowser extends ClientBase with ClientMixin {
3333
'x-sdk-name': 'Dart',
3434
'x-sdk-platform': 'server',
3535
'x-sdk-language': 'dart',
36-
'x-sdk-version': '12.0.0',
36+
'x-sdk-version': '12.1.0',
3737
'X-Appwrite-Response-Format': '1.6.0',
3838
};
3939

lib/src/client_io.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ class ClientIO extends ClientBase with ClientMixin {
4242
'x-sdk-name': 'Dart',
4343
'x-sdk-platform': 'server',
4444
'x-sdk-language': 'dart',
45-
'x-sdk-version': '12.0.0',
45+
'x-sdk-version': '12.1.0',
4646
'user-agent':
47-
'AppwriteDartSDK/12.0.0 (${Platform.operatingSystem}; ${Platform.operatingSystemVersion})',
47+
'AppwriteDartSDK/12.1.0 (${Platform.operatingSystem}; ${Platform.operatingSystemVersion})',
4848
'X-Appwrite-Response-Format': '1.6.0',
4949
};
5050

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: dart_appwrite
2-
version: 12.0.0
2+
version: 12.1.0
33
description: Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API
44
homepage: https://appwrite.io
55
repository: https://github.com/appwrite/sdk-for-dart

0 commit comments

Comments
 (0)