Skip to content

Commit c4a32c2

Browse files
committed
Add full schema collection create
1 parent b23c03d commit c4a32c2

16 files changed

+38
-18
lines changed

Appwrite/Services/Databases.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ static Models.CollectionList Convert(Dictionary<string, object> it) =>
406406
/// </para>
407407
/// </summary>
408408
[Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createTable` instead.")]
409-
public Task<Models.Collection> CreateCollection(string databaseId, string collectionId, string name, List<string>? permissions = null, bool? documentSecurity = null, bool? enabled = null)
409+
public Task<Models.Collection> CreateCollection(string databaseId, string collectionId, string name, List<string>? permissions = null, bool? documentSecurity = null, bool? enabled = null, List<object>? attributes = null, List<object>? indexes = null)
410410
{
411411
var apiPath = "/databases/{databaseId}/collections"
412412
.Replace("{databaseId}", databaseId);
@@ -417,7 +417,9 @@ static Models.CollectionList Convert(Dictionary<string, object> it) =>
417417
{ "name", name },
418418
{ "permissions", permissions },
419419
{ "documentSecurity", documentSecurity },
420-
{ "enabled", enabled }
420+
{ "enabled", enabled },
421+
{ "attributes", attributes },
422+
{ "indexes", indexes }
421423
};
422424

423425
var apiHeaders = new Dictionary<string, string>()

Appwrite/Services/TablesDB.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ static Models.TableList Convert(Dictionary<string, object> it) =>
399399
/// API or directly from your database console.
400400
/// </para>
401401
/// </summary>
402-
public Task<Models.Table> CreateTable(string databaseId, string tableId, string name, List<string>? permissions = null, bool? rowSecurity = null, bool? enabled = null)
402+
public Task<Models.Table> CreateTable(string databaseId, string tableId, string name, List<string>? permissions = null, bool? rowSecurity = null, bool? enabled = null, List<object>? columns = null, List<object>? indexes = null)
403403
{
404404
var apiPath = "/tablesdb/{databaseId}/tables"
405405
.Replace("{databaseId}", databaseId);
@@ -410,7 +410,9 @@ static Models.TableList Convert(Dictionary<string, object> it) =>
410410
{ "name", name },
411411
{ "permissions", permissions },
412412
{ "rowSecurity", rowSecurity },
413-
{ "enabled", enabled }
413+
{ "enabled", enabled },
414+
{ "columns", columns },
415+
{ "indexes", indexes }
414416
};
415417

416418
var apiHeaders = new Dictionary<string, string>()

docs/examples/account/create-anonymous-session.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ using Appwrite.Services;
44

55
Client client = new Client()
66
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7-
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
7+
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
8+
.SetSession(""); // The user session to authenticate with
89

910
Account account = new Account(client);
1011

docs/examples/account/create-email-password-session.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ using Appwrite.Services;
44

55
Client client = new Client()
66
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7-
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
7+
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
8+
.SetSession(""); // The user session to authenticate with
89

910
Account account = new Account(client);
1011

docs/examples/account/create-email-token.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ using Appwrite.Services;
44

55
Client client = new Client()
66
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7-
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
7+
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
8+
.SetSession(""); // The user session to authenticate with
89

910
Account account = new Account(client);
1011

docs/examples/account/create-jwt.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ using Appwrite.Services;
44

55
Client client = new Client()
66
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7-
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
7+
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
8+
.SetSession(""); // The user session to authenticate with
89

910
Account account = new Account(client);
1011

docs/examples/account/create-magic-url-token.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ using Appwrite.Services;
44

55
Client client = new Client()
66
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7-
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
7+
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
8+
.SetSession(""); // The user session to authenticate with
89

910
Account account = new Account(client);
1011

docs/examples/account/create-mfa-challenge.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ using Appwrite.Services;
55

66
Client client = new Client()
77
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
8-
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
8+
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
9+
.SetSession(""); // The user session to authenticate with
910

1011
Account account = new Account(client);
1112

docs/examples/account/create-o-auth-2-token.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ using Appwrite.Services;
55

66
Client client = new Client()
77
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
8-
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
8+
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
9+
.SetSession(""); // The user session to authenticate with
910

1011
Account account = new Account(client);
1112

docs/examples/account/create-phone-token.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ using Appwrite.Services;
44

55
Client client = new Client()
66
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7-
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
7+
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
8+
.SetSession(""); // The user session to authenticate with
89

910
Account account = new Account(client);
1011

0 commit comments

Comments
 (0)