Skip to content

Commit f545e49

Browse files
committed
chore: regenerate sdk
1 parent a0b6b69 commit f545e49

File tree

4 files changed

+90
-4
lines changed

4 files changed

+90
-4
lines changed

Sources/Appwrite/Services/Databases.swift

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,6 +1655,82 @@ open class Databases: Service {
16551655
)
16561656
}
16571657

1658+
///
1659+
/// **WARNING: Experimental Feature** - This endpoint is experimental and not
1660+
/// yet officially supported. It may be subject to breaking changes or removal
1661+
/// in future versions.
1662+
///
1663+
/// Create new Documents. Before using this route, you should create a new
1664+
/// collection resource using either a [server
1665+
/// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
1666+
/// API or directly from your database console.
1667+
///
1668+
/// @param String databaseId
1669+
/// @param String collectionId
1670+
/// @param [Any] documents
1671+
/// @throws Exception
1672+
/// @return array
1673+
///
1674+
open func createDocuments<T>(
1675+
databaseId: String,
1676+
collectionId: String,
1677+
documents: [Any],
1678+
nestedType: T.Type
1679+
) async throws -> AppwriteModels.DocumentList<T> {
1680+
let apiPath: String = "/databases/{databaseId}/collections/{collectionId}/documents"
1681+
.replacingOccurrences(of: "{databaseId}", with: databaseId)
1682+
.replacingOccurrences(of: "{collectionId}", with: collectionId)
1683+
1684+
let apiParams: [String: Any?] = [
1685+
"documents": documents
1686+
]
1687+
1688+
let apiHeaders: [String: String] = [
1689+
"content-type": "application/json"
1690+
]
1691+
1692+
let converter: (Any) -> AppwriteModels.DocumentList<T> = { response in
1693+
return AppwriteModels.DocumentList.from(map: response as! [String: Any])
1694+
}
1695+
1696+
return try await client.call(
1697+
method: "POST",
1698+
path: apiPath,
1699+
headers: apiHeaders,
1700+
params: apiParams,
1701+
converter: converter
1702+
)
1703+
}
1704+
1705+
///
1706+
/// **WARNING: Experimental Feature** - This endpoint is experimental and not
1707+
/// yet officially supported. It may be subject to breaking changes or removal
1708+
/// in future versions.
1709+
///
1710+
/// Create new Documents. Before using this route, you should create a new
1711+
/// collection resource using either a [server
1712+
/// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
1713+
/// API or directly from your database console.
1714+
///
1715+
/// @param String databaseId
1716+
/// @param String collectionId
1717+
/// @param [Any] documents
1718+
/// @throws Exception
1719+
/// @return array
1720+
///
1721+
open func createDocuments(
1722+
databaseId: String,
1723+
collectionId: String,
1724+
documents: [Any]
1725+
) async throws -> AppwriteModels.DocumentList<[String: AnyCodable]> {
1726+
return try await createDocuments(
1727+
databaseId: databaseId,
1728+
collectionId: collectionId,
1729+
documents: documents,
1730+
nestedType: [String: AnyCodable].self
1731+
)
1732+
}
1733+
16581734
///
16591735
/// **WARNING: Experimental Feature** - This endpoint is experimental and not
16601736
/// yet officially supported. It may be subject to breaking changes or removal

Sources/AppwriteEnums/BuildRuntime.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public enum BuildRuntime: String, CustomStringConvertible {
3838
case dart31 = "dart-3.1"
3939
case dart33 = "dart-3.3"
4040
case dart35 = "dart-3.5"
41-
case dart38 = "dart-3.8"
4241
case dotnet60 = "dotnet-6.0"
4342
case dotnet70 = "dotnet-7.0"
4443
case dotnet80 = "dotnet-8.0"
@@ -65,7 +64,6 @@ public enum BuildRuntime: String, CustomStringConvertible {
6564
case flutter324 = "flutter-3.24"
6665
case flutter327 = "flutter-3.27"
6766
case flutter329 = "flutter-3.29"
68-
case flutter332 = "flutter-3.32"
6967

7068
public var description: String {
7169
return rawValue

Sources/AppwriteEnums/Runtime.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public enum Runtime: String, CustomStringConvertible {
3838
case dart31 = "dart-3.1"
3939
case dart33 = "dart-3.3"
4040
case dart35 = "dart-3.5"
41-
case dart38 = "dart-3.8"
4241
case dotnet60 = "dotnet-6.0"
4342
case dotnet70 = "dotnet-7.0"
4443
case dotnet80 = "dotnet-8.0"
@@ -65,7 +64,6 @@ public enum Runtime: String, CustomStringConvertible {
6564
case flutter324 = "flutter-3.24"
6665
case flutter327 = "flutter-3.27"
6766
case flutter329 = "flutter-3.29"
68-
case flutter332 = "flutter-3.32"
6967

7068
public var description: String {
7169
return rawValue
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import Appwrite
2+
3+
let client = Client()
4+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
5+
.setKey("<YOUR_API_KEY>") // Your secret API key
6+
7+
let databases = Databases(client)
8+
9+
let documentList = try await databases.createDocuments(
10+
databaseId: "<DATABASE_ID>",
11+
collectionId: "<COLLECTION_ID>",
12+
documents: []
13+
)
14+

0 commit comments

Comments
 (0)