Skip to content

Commit 2c1e6be

Browse files
committed
Add full schema collection create
1 parent c5ed447 commit 2c1e6be

17 files changed

+36
-7
lines changed

Sources/Appwrite/Services/Account.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1953,7 +1953,8 @@ open class Account: Service {
19531953
"success": success,
19541954
"failure": failure,
19551955
"scopes": scopes,
1956-
"project": client.config["project"]
1956+
"project": client.config["project"],
1957+
"session": client.config["session"]
19571958
]
19581959

19591960
let apiHeaders: [String: String] = [:]

Sources/Appwrite/Services/Databases.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,8 @@ open class Databases: Service {
450450
/// - permissions: [String] (optional)
451451
/// - documentSecurity: Bool (optional)
452452
/// - enabled: Bool (optional)
453+
/// - attributes: [Any] (optional)
454+
/// - indexes: [Any] (optional)
453455
/// - Throws: Exception if the request fails
454456
/// - Returns: AppwriteModels.Collection
455457
///
@@ -460,7 +462,9 @@ open class Databases: Service {
460462
name: String,
461463
permissions: [String]? = nil,
462464
documentSecurity: Bool? = nil,
463-
enabled: Bool? = nil
465+
enabled: Bool? = nil,
466+
attributes: [Any]? = nil,
467+
indexes: [Any]? = nil
464468
) async throws -> AppwriteModels.Collection {
465469
let apiPath: String = "/databases/{databaseId}/collections"
466470
.replacingOccurrences(of: "{databaseId}", with: databaseId)
@@ -470,7 +474,9 @@ open class Databases: Service {
470474
"name": name,
471475
"permissions": permissions,
472476
"documentSecurity": documentSecurity,
473-
"enabled": enabled
477+
"enabled": enabled,
478+
"attributes": attributes,
479+
"indexes": indexes
474480
]
475481

476482
let apiHeaders: [String: String] = [

Sources/Appwrite/Services/TablesDB.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,8 @@ open class TablesDB: Service {
444444
/// - permissions: [String] (optional)
445445
/// - rowSecurity: Bool (optional)
446446
/// - enabled: Bool (optional)
447+
/// - columns: [Any] (optional)
448+
/// - indexes: [Any] (optional)
447449
/// - Throws: Exception if the request fails
448450
/// - Returns: AppwriteModels.Table
449451
///
@@ -453,7 +455,9 @@ open class TablesDB: Service {
453455
name: String,
454456
permissions: [String]? = nil,
455457
rowSecurity: Bool? = nil,
456-
enabled: Bool? = nil
458+
enabled: Bool? = nil,
459+
columns: [Any]? = nil,
460+
indexes: [Any]? = nil
457461
) async throws -> AppwriteModels.Table {
458462
let apiPath: String = "/tablesdb/{databaseId}/tables"
459463
.replacingOccurrences(of: "{databaseId}", with: databaseId)
@@ -463,7 +467,9 @@ open class TablesDB: Service {
463467
"name": name,
464468
"permissions": permissions,
465469
"rowSecurity": rowSecurity,
466-
"enabled": enabled
470+
"enabled": enabled,
471+
"columns": columns,
472+
"indexes": indexes
467473
]
468474

469475
let apiHeaders: [String: String] = [

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Appwrite
33
let client = Client()
44
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
55
.setProject("<YOUR_PROJECT_ID>") // Your project ID
6+
.setSession("") // The user session to authenticate with
67

78
let account = Account(client)
89

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Appwrite
33
let client = Client()
44
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
55
.setProject("<YOUR_PROJECT_ID>") // Your project ID
6+
.setSession("") // The user session to authenticate with
67

78
let account = Account(client)
89

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Appwrite
33
let client = Client()
44
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
55
.setProject("<YOUR_PROJECT_ID>") // Your project ID
6+
.setSession("") // The user session to authenticate with
67

78
let account = Account(client)
89

docs/examples/account/create-jwt.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Appwrite
33
let client = Client()
44
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
55
.setProject("<YOUR_PROJECT_ID>") // Your project ID
6+
.setSession("") // The user session to authenticate with
67

78
let account = Account(client)
89

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Appwrite
33
let client = Client()
44
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
55
.setProject("<YOUR_PROJECT_ID>") // Your project ID
6+
.setSession("") // The user session to authenticate with
67

78
let account = Account(client)
89

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import AppwriteEnums
44
let client = Client()
55
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
66
.setProject("<YOUR_PROJECT_ID>") // Your project ID
7+
.setSession("") // The user session to authenticate with
78

89
let account = Account(client)
910

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import AppwriteEnums
44
let client = Client()
55
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
66
.setProject("<YOUR_PROJECT_ID>") // Your project ID
7+
.setSession("") // The user session to authenticate with
78

89
let account = Account(client)
910

0 commit comments

Comments
 (0)