mirror of
https://github.com/appwrite/sdk-for-swift.git
synced 2026-04-07 19:17:48 +00:00
Add array-based enum parameters
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# Change Log
|
||||
|
||||
## 15.0.0
|
||||
|
||||
* Add array-based enum parameters (e.g., `permissions: [BrowserPermission]`).
|
||||
|
||||
## 14.1.0
|
||||
|
||||
* Added ability to create columns and indexes synchronously while creating a table
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2025 Appwrite (https://appwrite.io) and individual contributors.
|
||||
Copyright (c) 2026 Appwrite (https://appwrite.io) and individual contributors.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
[](https://travis-ci.com/appwrite/sdk-generator)
|
||||
[](https://twitter.com/appwrite)
|
||||
[](https://appwrite.io/discord)
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
> This is the Swift SDK for integrating with Appwrite from your Swift server-side code. If you're looking for the Apple SDK you should check [appwrite/sdk-for-apple](https://github.com/appwrite/sdk-for-apple)
|
||||
|
||||
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Swift SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
|
||||
Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Swift SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
|
||||
|
||||

|
||||
|
||||
@@ -33,7 +33,7 @@ Add the package to your `Package.swift` dependencies:
|
||||
|
||||
```swift
|
||||
dependencies: [
|
||||
.package(url: "git@github.com:appwrite/sdk-for-swift.git", from: "14.1.0"),
|
||||
.package(url: "git@github.com:appwrite/sdk-for-swift.git", from: "15.0.0"),
|
||||
],
|
||||
```
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ open class Client {
|
||||
"x-sdk-name": "Swift",
|
||||
"x-sdk-platform": "server",
|
||||
"x-sdk-language": "swift",
|
||||
"x-sdk-version": "14.1.0",
|
||||
"x-sdk-version": "15.0.0",
|
||||
"x-appwrite-response-format": "1.8.0"
|
||||
]
|
||||
|
||||
@@ -380,7 +380,6 @@ open class Client {
|
||||
var request = HTTPClientRequest(url: endPoint + path + queryParameters)
|
||||
request.method = .RAW(value: method)
|
||||
|
||||
|
||||
for (key, value) in self.headers.merging(headers, uniquingKeysWith: { $1 }) {
|
||||
request.headers.add(name: key, value: value)
|
||||
}
|
||||
|
||||
@@ -165,6 +165,20 @@ public struct Query : Codable, CustomStringConvertible {
|
||||
).description
|
||||
}
|
||||
|
||||
/// Filter resources where attribute matches a regular expression pattern.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - attribute: The attribute to filter on.
|
||||
/// - pattern: The regular expression pattern to match.
|
||||
/// - Returns: The query string.
|
||||
public static func regex(_ attribute: String, pattern: String) -> String {
|
||||
return Query(
|
||||
method: "regex",
|
||||
attribute: attribute,
|
||||
values: [pattern]
|
||||
).description
|
||||
}
|
||||
|
||||
public static func lessThan(_ attribute: String, value: Any) -> String {
|
||||
return Query(
|
||||
method: "lessThan",
|
||||
@@ -211,6 +225,28 @@ public struct Query : Codable, CustomStringConvertible {
|
||||
).description
|
||||
}
|
||||
|
||||
/// Filter resources where the specified attributes exist.
|
||||
///
|
||||
/// - Parameter attributes: The list of attributes that must exist.
|
||||
/// - Returns: The query string.
|
||||
public static func exists(_ attributes: [String]) -> String {
|
||||
return Query(
|
||||
method: "exists",
|
||||
values: attributes
|
||||
).description
|
||||
}
|
||||
|
||||
/// Filter resources where the specified attributes do not exist.
|
||||
///
|
||||
/// - Parameter attributes: The list of attributes that must not exist.
|
||||
/// - Returns: The query string.
|
||||
public static func notExists(_ attributes: [String]) -> String {
|
||||
return Query(
|
||||
method: "notExists",
|
||||
values: attributes
|
||||
).description
|
||||
}
|
||||
|
||||
public static func between(_ attribute: String, start: Int, end: Int) -> String {
|
||||
return Query(
|
||||
method: "between",
|
||||
@@ -432,6 +468,28 @@ public struct Query : Codable, CustomStringConvertible {
|
||||
).description
|
||||
}
|
||||
|
||||
/// Filter array elements where at least one element matches all the specified queries.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - attribute: The attribute containing the array to filter on.
|
||||
/// - queries: The list of query strings to match against array elements.
|
||||
/// - Returns: The query string.
|
||||
public static func elemMatch(_ attribute: String, queries: [String]) -> String {
|
||||
let decoder = JSONDecoder()
|
||||
let decodedQueries = queries.compactMap { queryStr -> Query? in
|
||||
guard let data = queryStr.data(using: .utf8) else {
|
||||
return nil
|
||||
}
|
||||
return try? decoder.decode(Query.self, from: data)
|
||||
}
|
||||
|
||||
return Query(
|
||||
method: "elemMatch",
|
||||
attribute: attribute,
|
||||
values: decodedQueries
|
||||
).description
|
||||
}
|
||||
|
||||
public static func distanceEqual(_ attribute: String, values: [Any], distance: Double, meters: Bool = true) -> String {
|
||||
return Query(
|
||||
method: "distanceEqual",
|
||||
|
||||
@@ -272,14 +272,19 @@ open class Account: Service {
|
||||
/// from its creation and will be invalid if the user will logout in that time
|
||||
/// frame.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - duration: Int (optional)
|
||||
/// - Throws: Exception if the request fails
|
||||
/// - Returns: AppwriteModels.Jwt
|
||||
///
|
||||
open func createJWT(
|
||||
duration: Int? = nil
|
||||
) async throws -> AppwriteModels.Jwt {
|
||||
let apiPath: String = "/account/jwts"
|
||||
|
||||
let apiParams: [String: Any] = [:]
|
||||
let apiParams: [String: Any?] = [
|
||||
"duration": duration
|
||||
]
|
||||
|
||||
let apiHeaders: [String: String] = [
|
||||
"content-type": "application/json"
|
||||
|
||||
@@ -338,12 +338,12 @@ open class Avatars: Service {
|
||||
/// - longitude: Double (optional)
|
||||
/// - accuracy: Double (optional)
|
||||
/// - touch: Bool (optional)
|
||||
/// - permissions: [String] (optional)
|
||||
/// - permissions: [AppwriteEnums.BrowserPermission] (optional)
|
||||
/// - sleep: Int (optional)
|
||||
/// - width: Int (optional)
|
||||
/// - height: Int (optional)
|
||||
/// - quality: Int (optional)
|
||||
/// - output: AppwriteEnums.Output (optional)
|
||||
/// - output: AppwriteEnums.ImageFormat (optional)
|
||||
/// - Throws: Exception if the request fails
|
||||
/// - Returns: ByteBuffer
|
||||
///
|
||||
@@ -362,12 +362,12 @@ open class Avatars: Service {
|
||||
longitude: Double? = nil,
|
||||
accuracy: Double? = nil,
|
||||
touch: Bool? = nil,
|
||||
permissions: [String]? = nil,
|
||||
permissions: [AppwriteEnums.BrowserPermission]? = nil,
|
||||
sleep: Int? = nil,
|
||||
width: Int? = nil,
|
||||
height: Int? = nil,
|
||||
quality: Int? = nil,
|
||||
output: AppwriteEnums.Output? = nil
|
||||
output: AppwriteEnums.ImageFormat? = nil
|
||||
) async throws -> ByteBuffer {
|
||||
let apiPath: String = "/avatars/screenshots"
|
||||
|
||||
|
||||
@@ -329,7 +329,7 @@ open class Databases: Service {
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - databaseId: String
|
||||
/// - name: String
|
||||
/// - name: String (optional)
|
||||
/// - enabled: Bool (optional)
|
||||
/// - Throws: Exception if the request fails
|
||||
/// - Returns: AppwriteModels.Database
|
||||
@@ -337,7 +337,7 @@ open class Databases: Service {
|
||||
@available(*, deprecated, message: "This API has been deprecated since 1.8.0. Please use `TablesDB.update` instead.")
|
||||
open func update(
|
||||
databaseId: String,
|
||||
name: String,
|
||||
name: String? = nil,
|
||||
enabled: Bool? = nil
|
||||
) async throws -> AppwriteModels.Database {
|
||||
let apiPath: String = "/databases/{databaseId}"
|
||||
@@ -538,7 +538,7 @@ open class Databases: Service {
|
||||
/// - Parameters:
|
||||
/// - databaseId: String
|
||||
/// - collectionId: String
|
||||
/// - name: String
|
||||
/// - name: String (optional)
|
||||
/// - permissions: [String] (optional)
|
||||
/// - documentSecurity: Bool (optional)
|
||||
/// - enabled: Bool (optional)
|
||||
@@ -549,7 +549,7 @@ open class Databases: Service {
|
||||
open func updateCollection(
|
||||
databaseId: String,
|
||||
collectionId: String,
|
||||
name: String,
|
||||
name: String? = nil,
|
||||
permissions: [String]? = nil,
|
||||
documentSecurity: Bool? = nil,
|
||||
enabled: Bool? = nil
|
||||
@@ -1999,11 +1999,17 @@ open class Databases: Service {
|
||||
|
||||
let apiHeaders: [String: String] = [:]
|
||||
|
||||
let converter: (Any) -> Any = { response in
|
||||
return AppwriteModels.AttributeBoolean.from(map: response as! [String: Any])
|
||||
}
|
||||
|
||||
return try await client.call(
|
||||
method: "GET",
|
||||
path: apiPath,
|
||||
headers: apiHeaders,
|
||||
params: apiParams )
|
||||
params: apiParams,
|
||||
converter: converter
|
||||
)
|
||||
}
|
||||
|
||||
///
|
||||
@@ -2659,7 +2665,7 @@ open class Databases: Service {
|
||||
/// - databaseId: String
|
||||
/// - collectionId: String
|
||||
/// - documentId: String
|
||||
/// - data: Any
|
||||
/// - data: Any (optional)
|
||||
/// - permissions: [String] (optional)
|
||||
/// - transactionId: String (optional)
|
||||
/// - Throws: Exception if the request fails
|
||||
@@ -2670,7 +2676,7 @@ open class Databases: Service {
|
||||
databaseId: String,
|
||||
collectionId: String,
|
||||
documentId: String,
|
||||
data: Any,
|
||||
data: Any? = nil,
|
||||
permissions: [String]? = nil,
|
||||
transactionId: String? = nil,
|
||||
nestedType: T.Type
|
||||
@@ -2713,7 +2719,7 @@ open class Databases: Service {
|
||||
/// - databaseId: String
|
||||
/// - collectionId: String
|
||||
/// - documentId: String
|
||||
/// - data: Any
|
||||
/// - data: Any (optional)
|
||||
/// - permissions: [String] (optional)
|
||||
/// - transactionId: String (optional)
|
||||
/// - Throws: Exception if the request fails
|
||||
@@ -2724,7 +2730,7 @@ open class Databases: Service {
|
||||
databaseId: String,
|
||||
collectionId: String,
|
||||
documentId: String,
|
||||
data: Any,
|
||||
data: Any? = nil,
|
||||
permissions: [String]? = nil,
|
||||
transactionId: String? = nil
|
||||
) async throws -> AppwriteModels.Document<[String: AnyCodable]> {
|
||||
@@ -3096,7 +3102,7 @@ open class Databases: Service {
|
||||
/// - key: String
|
||||
/// - type: AppwriteEnums.IndexType
|
||||
/// - attributes: [String]
|
||||
/// - orders: [String] (optional)
|
||||
/// - orders: [AppwriteEnums.OrderBy] (optional)
|
||||
/// - lengths: [Int] (optional)
|
||||
/// - Throws: Exception if the request fails
|
||||
/// - Returns: AppwriteModels.Index
|
||||
@@ -3108,7 +3114,7 @@ open class Databases: Service {
|
||||
key: String,
|
||||
type: AppwriteEnums.IndexType,
|
||||
attributes: [String],
|
||||
orders: [String]? = nil,
|
||||
orders: [AppwriteEnums.OrderBy]? = nil,
|
||||
lengths: [Int]? = nil
|
||||
) async throws -> AppwriteModels.Index {
|
||||
let apiPath: String = "/databases/{databaseId}/collections/{collectionId}/indexes"
|
||||
|
||||
@@ -65,7 +65,7 @@ open class Functions: Service {
|
||||
/// - logging: Bool (optional)
|
||||
/// - entrypoint: String (optional)
|
||||
/// - commands: String (optional)
|
||||
/// - scopes: [String] (optional)
|
||||
/// - scopes: [AppwriteEnums.Scopes] (optional)
|
||||
/// - installationId: String (optional)
|
||||
/// - providerRepositoryId: String (optional)
|
||||
/// - providerBranch: String (optional)
|
||||
@@ -87,7 +87,7 @@ open class Functions: Service {
|
||||
logging: Bool? = nil,
|
||||
entrypoint: String? = nil,
|
||||
commands: String? = nil,
|
||||
scopes: [String]? = nil,
|
||||
scopes: [AppwriteEnums.Scopes]? = nil,
|
||||
installationId: String? = nil,
|
||||
providerRepositoryId: String? = nil,
|
||||
providerBranch: String? = nil,
|
||||
@@ -235,7 +235,7 @@ open class Functions: Service {
|
||||
/// - logging: Bool (optional)
|
||||
/// - entrypoint: String (optional)
|
||||
/// - commands: String (optional)
|
||||
/// - scopes: [String] (optional)
|
||||
/// - scopes: [AppwriteEnums.Scopes] (optional)
|
||||
/// - installationId: String (optional)
|
||||
/// - providerRepositoryId: String (optional)
|
||||
/// - providerBranch: String (optional)
|
||||
@@ -257,7 +257,7 @@ open class Functions: Service {
|
||||
logging: Bool? = nil,
|
||||
entrypoint: String? = nil,
|
||||
commands: String? = nil,
|
||||
scopes: [String]? = nil,
|
||||
scopes: [AppwriteEnums.Scopes]? = nil,
|
||||
installationId: String? = nil,
|
||||
providerRepositoryId: String? = nil,
|
||||
providerBranch: String? = nil,
|
||||
|
||||
@@ -67,18 +67,18 @@ open class Health: Service {
|
||||
/// successful.
|
||||
///
|
||||
/// - Throws: Exception if the request fails
|
||||
/// - Returns: AppwriteModels.HealthStatus
|
||||
/// - Returns: AppwriteModels.HealthStatusList
|
||||
///
|
||||
open func getCache(
|
||||
) async throws -> AppwriteModels.HealthStatus {
|
||||
) async throws -> AppwriteModels.HealthStatusList {
|
||||
let apiPath: String = "/health/cache"
|
||||
|
||||
let apiParams: [String: Any] = [:]
|
||||
|
||||
let apiHeaders: [String: String] = [:]
|
||||
|
||||
let converter: (Any) -> AppwriteModels.HealthStatus = { response in
|
||||
return AppwriteModels.HealthStatus.from(map: response as! [String: Any])
|
||||
let converter: (Any) -> AppwriteModels.HealthStatusList = { response in
|
||||
return AppwriteModels.HealthStatusList.from(map: response as! [String: Any])
|
||||
}
|
||||
|
||||
return try await client.call(
|
||||
@@ -126,18 +126,18 @@ open class Health: Service {
|
||||
/// Check the Appwrite database servers are up and connection is successful.
|
||||
///
|
||||
/// - Throws: Exception if the request fails
|
||||
/// - Returns: AppwriteModels.HealthStatus
|
||||
/// - Returns: AppwriteModels.HealthStatusList
|
||||
///
|
||||
open func getDB(
|
||||
) async throws -> AppwriteModels.HealthStatus {
|
||||
) async throws -> AppwriteModels.HealthStatusList {
|
||||
let apiPath: String = "/health/db"
|
||||
|
||||
let apiParams: [String: Any] = [:]
|
||||
|
||||
let apiHeaders: [String: String] = [:]
|
||||
|
||||
let converter: (Any) -> AppwriteModels.HealthStatus = { response in
|
||||
return AppwriteModels.HealthStatus.from(map: response as! [String: Any])
|
||||
let converter: (Any) -> AppwriteModels.HealthStatusList = { response in
|
||||
return AppwriteModels.HealthStatusList.from(map: response as! [String: Any])
|
||||
}
|
||||
|
||||
return try await client.call(
|
||||
@@ -153,18 +153,51 @@ open class Health: Service {
|
||||
/// Check the Appwrite pub-sub servers are up and connection is successful.
|
||||
///
|
||||
/// - Throws: Exception if the request fails
|
||||
/// - Returns: AppwriteModels.HealthStatus
|
||||
/// - Returns: AppwriteModels.HealthStatusList
|
||||
///
|
||||
open func getPubSub(
|
||||
) async throws -> AppwriteModels.HealthStatus {
|
||||
) async throws -> AppwriteModels.HealthStatusList {
|
||||
let apiPath: String = "/health/pubsub"
|
||||
|
||||
let apiParams: [String: Any] = [:]
|
||||
|
||||
let apiHeaders: [String: String] = [:]
|
||||
|
||||
let converter: (Any) -> AppwriteModels.HealthStatus = { response in
|
||||
return AppwriteModels.HealthStatus.from(map: response as! [String: Any])
|
||||
let converter: (Any) -> AppwriteModels.HealthStatusList = { response in
|
||||
return AppwriteModels.HealthStatusList.from(map: response as! [String: Any])
|
||||
}
|
||||
|
||||
return try await client.call(
|
||||
method: "GET",
|
||||
path: apiPath,
|
||||
headers: apiHeaders,
|
||||
params: apiParams,
|
||||
converter: converter
|
||||
)
|
||||
}
|
||||
|
||||
///
|
||||
/// Get the number of audit logs that are waiting to be processed in the
|
||||
/// Appwrite internal queue server.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - threshold: Int (optional)
|
||||
/// - Throws: Exception if the request fails
|
||||
/// - Returns: AppwriteModels.HealthQueue
|
||||
///
|
||||
open func getQueueAudits(
|
||||
threshold: Int? = nil
|
||||
) async throws -> AppwriteModels.HealthQueue {
|
||||
let apiPath: String = "/health/queue/audits"
|
||||
|
||||
let apiParams: [String: Any?] = [
|
||||
"threshold": threshold
|
||||
]
|
||||
|
||||
let apiHeaders: [String: String] = [:]
|
||||
|
||||
let converter: (Any) -> AppwriteModels.HealthQueue = { response in
|
||||
return AppwriteModels.HealthQueue.from(map: response as! [String: Any])
|
||||
}
|
||||
|
||||
return try await client.call(
|
||||
|
||||
@@ -326,14 +326,14 @@ open class TablesDB: Service {
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - databaseId: String
|
||||
/// - name: String
|
||||
/// - name: String (optional)
|
||||
/// - enabled: Bool (optional)
|
||||
/// - Throws: Exception if the request fails
|
||||
/// - Returns: AppwriteModels.Database
|
||||
///
|
||||
open func update(
|
||||
databaseId: String,
|
||||
name: String,
|
||||
name: String? = nil,
|
||||
enabled: Bool? = nil
|
||||
) async throws -> AppwriteModels.Database {
|
||||
let apiPath: String = "/tablesdb/{databaseId}"
|
||||
@@ -530,7 +530,7 @@ open class TablesDB: Service {
|
||||
/// - Parameters:
|
||||
/// - databaseId: String
|
||||
/// - tableId: String
|
||||
/// - name: String
|
||||
/// - name: String (optional)
|
||||
/// - permissions: [String] (optional)
|
||||
/// - rowSecurity: Bool (optional)
|
||||
/// - enabled: Bool (optional)
|
||||
@@ -540,7 +540,7 @@ open class TablesDB: Service {
|
||||
open func updateTable(
|
||||
databaseId: String,
|
||||
tableId: String,
|
||||
name: String,
|
||||
name: String? = nil,
|
||||
permissions: [String]? = nil,
|
||||
rowSecurity: Bool? = nil,
|
||||
enabled: Bool? = nil
|
||||
@@ -1961,11 +1961,17 @@ open class TablesDB: Service {
|
||||
|
||||
let apiHeaders: [String: String] = [:]
|
||||
|
||||
let converter: (Any) -> Any = { response in
|
||||
return AppwriteModels.ColumnBoolean.from(map: response as! [String: Any])
|
||||
}
|
||||
|
||||
return try await client.call(
|
||||
method: "GET",
|
||||
path: apiPath,
|
||||
headers: apiHeaders,
|
||||
params: apiParams )
|
||||
params: apiParams,
|
||||
converter: converter
|
||||
)
|
||||
}
|
||||
|
||||
///
|
||||
@@ -2101,7 +2107,7 @@ open class TablesDB: Service {
|
||||
/// - key: String
|
||||
/// - type: AppwriteEnums.IndexType
|
||||
/// - columns: [String]
|
||||
/// - orders: [String] (optional)
|
||||
/// - orders: [AppwriteEnums.OrderBy] (optional)
|
||||
/// - lengths: [Int] (optional)
|
||||
/// - Throws: Exception if the request fails
|
||||
/// - Returns: AppwriteModels.ColumnIndex
|
||||
@@ -2112,7 +2118,7 @@ open class TablesDB: Service {
|
||||
key: String,
|
||||
type: AppwriteEnums.IndexType,
|
||||
columns: [String],
|
||||
orders: [String]? = nil,
|
||||
orders: [AppwriteEnums.OrderBy]? = nil,
|
||||
lengths: [Int]? = nil
|
||||
) async throws -> AppwriteModels.ColumnIndex {
|
||||
let apiPath: String = "/tablesdb/{databaseId}/tables/{tableId}/indexes"
|
||||
|
||||
@@ -343,7 +343,7 @@ open class Teams: Service {
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - teamId: String
|
||||
/// - roles: [String]
|
||||
/// - roles: [AppwriteEnums.Roles]
|
||||
/// - email: String (optional)
|
||||
/// - userId: String (optional)
|
||||
/// - phone: String (optional)
|
||||
@@ -354,7 +354,7 @@ open class Teams: Service {
|
||||
///
|
||||
open func createMembership(
|
||||
teamId: String,
|
||||
roles: [String],
|
||||
roles: [AppwriteEnums.Roles],
|
||||
email: String? = nil,
|
||||
userId: String? = nil,
|
||||
phone: String? = nil,
|
||||
@@ -435,14 +435,14 @@ open class Teams: Service {
|
||||
/// - Parameters:
|
||||
/// - teamId: String
|
||||
/// - membershipId: String
|
||||
/// - roles: [String]
|
||||
/// - roles: [AppwriteEnums.Roles]
|
||||
/// - Throws: Exception if the request fails
|
||||
/// - Returns: AppwriteModels.Membership
|
||||
///
|
||||
open func updateMembership(
|
||||
teamId: String,
|
||||
membershipId: String,
|
||||
roles: [String]
|
||||
roles: [AppwriteEnums.Roles]
|
||||
) async throws -> AppwriteModels.Membership {
|
||||
let apiPath: String = "/teams/{teamId}/memberships/{membershipId}"
|
||||
.replacingOccurrences(of: "{teamId}", with: teamId)
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import Foundation
|
||||
|
||||
public enum BrowserPermission: String, CustomStringConvertible {
|
||||
case geolocation = "geolocation"
|
||||
case camera = "camera"
|
||||
case microphone = "microphone"
|
||||
case notifications = "notifications"
|
||||
case midi = "midi"
|
||||
case push = "push"
|
||||
case clipboardRead = "clipboard-read"
|
||||
case clipboardWrite = "clipboard-write"
|
||||
case paymentHandler = "payment-handler"
|
||||
case usb = "usb"
|
||||
case bluetooth = "bluetooth"
|
||||
case accelerometer = "accelerometer"
|
||||
case gyroscope = "gyroscope"
|
||||
case magnetometer = "magnetometer"
|
||||
case ambientLightSensor = "ambient-light-sensor"
|
||||
case backgroundSync = "background-sync"
|
||||
case persistentStorage = "persistent-storage"
|
||||
case screenWakeLock = "screen-wake-lock"
|
||||
case webShare = "web-share"
|
||||
case xrSpatialTracking = "xr-spatial-tracking"
|
||||
|
||||
public var description: String {
|
||||
return rawValue
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ public enum DeploymentStatus: String, CustomStringConvertible {
|
||||
case processing = "processing"
|
||||
case building = "building"
|
||||
case ready = "ready"
|
||||
case canceled = "canceled"
|
||||
case failed = "failed"
|
||||
|
||||
public var description: String {
|
||||
|
||||
@@ -11,6 +11,7 @@ public enum Name: String, CustomStringConvertible {
|
||||
case v1Webhooks = "v1-webhooks"
|
||||
case v1Certificates = "v1-certificates"
|
||||
case v1Builds = "v1-builds"
|
||||
case v1Screenshots = "v1-screenshots"
|
||||
case v1Messaging = "v1-messaging"
|
||||
case v1Migrations = "v1-migrations"
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ public enum OAuthProvider: String, CustomStringConvertible {
|
||||
case yandex = "yandex"
|
||||
case zoho = "zoho"
|
||||
case zoom = "zoom"
|
||||
case mock = "mock"
|
||||
|
||||
public var description: String {
|
||||
return rawValue
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import Foundation
|
||||
|
||||
public enum OrderBy: String, CustomStringConvertible {
|
||||
case asc = "asc"
|
||||
case desc = "desc"
|
||||
|
||||
public var description: String {
|
||||
return rawValue
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
import Foundation
|
||||
|
||||
public enum Output: String, CustomStringConvertible {
|
||||
case jpg = "jpg"
|
||||
case jpeg = "jpeg"
|
||||
case png = "png"
|
||||
case webp = "webp"
|
||||
case heic = "heic"
|
||||
case avif = "avif"
|
||||
case gif = "gif"
|
||||
|
||||
public var description: String {
|
||||
return rawValue
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import Foundation
|
||||
|
||||
public enum Roles: String, CustomStringConvertible {
|
||||
case admin = "admin"
|
||||
case developer = "developer"
|
||||
case owner = "owner"
|
||||
|
||||
public var description: String {
|
||||
return rawValue
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
import Foundation
|
||||
|
||||
public enum Scopes: String, CustomStringConvertible {
|
||||
case sessionsWrite = "sessions.write"
|
||||
case usersRead = "users.read"
|
||||
case usersWrite = "users.write"
|
||||
case teamsRead = "teams.read"
|
||||
case teamsWrite = "teams.write"
|
||||
case databasesRead = "databases.read"
|
||||
case databasesWrite = "databases.write"
|
||||
case collectionsRead = "collections.read"
|
||||
case collectionsWrite = "collections.write"
|
||||
case tablesRead = "tables.read"
|
||||
case tablesWrite = "tables.write"
|
||||
case attributesRead = "attributes.read"
|
||||
case attributesWrite = "attributes.write"
|
||||
case columnsRead = "columns.read"
|
||||
case columnsWrite = "columns.write"
|
||||
case indexesRead = "indexes.read"
|
||||
case indexesWrite = "indexes.write"
|
||||
case documentsRead = "documents.read"
|
||||
case documentsWrite = "documents.write"
|
||||
case rowsRead = "rows.read"
|
||||
case rowsWrite = "rows.write"
|
||||
case filesRead = "files.read"
|
||||
case filesWrite = "files.write"
|
||||
case bucketsRead = "buckets.read"
|
||||
case bucketsWrite = "buckets.write"
|
||||
case functionsRead = "functions.read"
|
||||
case functionsWrite = "functions.write"
|
||||
case sitesRead = "sites.read"
|
||||
case sitesWrite = "sites.write"
|
||||
case logRead = "log.read"
|
||||
case logWrite = "log.write"
|
||||
case executionRead = "execution.read"
|
||||
case executionWrite = "execution.write"
|
||||
case localeRead = "locale.read"
|
||||
case avatarsRead = "avatars.read"
|
||||
case healthRead = "health.read"
|
||||
case providersRead = "providers.read"
|
||||
case providersWrite = "providers.write"
|
||||
case messagesRead = "messages.read"
|
||||
case messagesWrite = "messages.write"
|
||||
case topicsRead = "topics.read"
|
||||
case topicsWrite = "topics.write"
|
||||
case subscribersRead = "subscribers.read"
|
||||
case subscribersWrite = "subscribers.write"
|
||||
case targetsRead = "targets.read"
|
||||
case targetsWrite = "targets.write"
|
||||
case rulesRead = "rules.read"
|
||||
case rulesWrite = "rules.write"
|
||||
case migrationsRead = "migrations.read"
|
||||
case migrationsWrite = "migrations.write"
|
||||
case vcsRead = "vcs.read"
|
||||
case vcsWrite = "vcs.write"
|
||||
case assistantRead = "assistant.read"
|
||||
case tokensRead = "tokens.read"
|
||||
case tokensWrite = "tokens.write"
|
||||
|
||||
public var description: String {
|
||||
return rawValue
|
||||
}
|
||||
}
|
||||
@@ -13,17 +13,13 @@ open class AlgoArgon2: Codable {
|
||||
|
||||
/// Algo type.
|
||||
public let type: String
|
||||
|
||||
/// Memory used to compute hash.
|
||||
public let memoryCost: Int
|
||||
|
||||
/// Amount of time consumed to compute hash
|
||||
public let timeCost: Int
|
||||
|
||||
/// Number of threads used to compute hash.
|
||||
public let threads: Int
|
||||
|
||||
|
||||
init(
|
||||
type: String,
|
||||
memoryCost: Int,
|
||||
|
||||
@@ -11,7 +11,6 @@ open class AlgoBcrypt: Codable {
|
||||
/// Algo type.
|
||||
public let type: String
|
||||
|
||||
|
||||
init(
|
||||
type: String
|
||||
) {
|
||||
|
||||
@@ -11,7 +11,6 @@ open class AlgoMd5: Codable {
|
||||
/// Algo type.
|
||||
public let type: String
|
||||
|
||||
|
||||
init(
|
||||
type: String
|
||||
) {
|
||||
|
||||
@@ -11,7 +11,6 @@ open class AlgoPhpass: Codable {
|
||||
/// Algo type.
|
||||
public let type: String
|
||||
|
||||
|
||||
init(
|
||||
type: String
|
||||
) {
|
||||
|
||||
@@ -14,20 +14,15 @@ open class AlgoScrypt: Codable {
|
||||
|
||||
/// Algo type.
|
||||
public let type: String
|
||||
|
||||
/// CPU complexity of computed hash.
|
||||
public let costCpu: Int
|
||||
|
||||
/// Memory complexity of computed hash.
|
||||
public let costMemory: Int
|
||||
|
||||
/// Parallelization of computed hash.
|
||||
public let costParallel: Int
|
||||
|
||||
/// Length used to compute hash.
|
||||
public let length: Int
|
||||
|
||||
|
||||
init(
|
||||
type: String,
|
||||
costCpu: Int,
|
||||
|
||||
@@ -13,17 +13,13 @@ open class AlgoScryptModified: Codable {
|
||||
|
||||
/// Algo type.
|
||||
public let type: String
|
||||
|
||||
/// Salt used to compute hash.
|
||||
public let salt: String
|
||||
|
||||
/// Separator used to compute hash.
|
||||
public let saltSeparator: String
|
||||
|
||||
/// Key used to compute hash.
|
||||
public let signerKey: String
|
||||
|
||||
|
||||
init(
|
||||
type: String,
|
||||
salt: String,
|
||||
|
||||
@@ -11,7 +11,6 @@ open class AlgoSha: Codable {
|
||||
/// Algo type.
|
||||
public let type: String
|
||||
|
||||
|
||||
init(
|
||||
type: String
|
||||
) {
|
||||
|
||||
@@ -19,32 +19,23 @@ open class AttributeBoolean: Codable {
|
||||
|
||||
/// Attribute Key.
|
||||
public let key: String
|
||||
|
||||
/// Attribute type.
|
||||
public let type: String
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.AttributeStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
public let error: String
|
||||
|
||||
/// Is attribute required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is attribute an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Attribute creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Attribute update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
public let `default`: Bool?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -20,35 +20,25 @@ open class AttributeDatetime: Codable {
|
||||
|
||||
/// Attribute Key.
|
||||
public let key: String
|
||||
|
||||
/// Attribute type.
|
||||
public let type: String
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.AttributeStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
public let error: String
|
||||
|
||||
/// Is attribute required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is attribute an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Attribute creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Attribute update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// ISO 8601 format.
|
||||
public let format: String
|
||||
|
||||
/// Default value for attribute when not provided. Only null is optional
|
||||
public let `default`: String?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -20,35 +20,25 @@ open class AttributeEmail: Codable {
|
||||
|
||||
/// Attribute Key.
|
||||
public let key: String
|
||||
|
||||
/// Attribute type.
|
||||
public let type: String
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.AttributeStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
public let error: String
|
||||
|
||||
/// Is attribute required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is attribute an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Attribute creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Attribute update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// String format.
|
||||
public let format: String
|
||||
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
public let `default`: String?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -21,38 +21,27 @@ open class AttributeEnum: Codable {
|
||||
|
||||
/// Attribute Key.
|
||||
public let key: String
|
||||
|
||||
/// Attribute type.
|
||||
public let type: String
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.AttributeStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
public let error: String
|
||||
|
||||
/// Is attribute required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is attribute an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Attribute creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Attribute update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Array of elements in enumerated type.
|
||||
public let elements: [String]
|
||||
|
||||
/// String format.
|
||||
public let format: String
|
||||
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
public let `default`: String?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -21,38 +21,27 @@ open class AttributeFloat: Codable {
|
||||
|
||||
/// Attribute Key.
|
||||
public let key: String
|
||||
|
||||
/// Attribute type.
|
||||
public let type: String
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.AttributeStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
public let error: String
|
||||
|
||||
/// Is attribute required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is attribute an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Attribute creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Attribute update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Minimum value to enforce for new documents.
|
||||
public let min: Double?
|
||||
|
||||
/// Maximum value to enforce for new documents.
|
||||
public let max: Double?
|
||||
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
public let `default`: Double?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -21,38 +21,27 @@ open class AttributeInteger: Codable {
|
||||
|
||||
/// Attribute Key.
|
||||
public let key: String
|
||||
|
||||
/// Attribute type.
|
||||
public let type: String
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.AttributeStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
public let error: String
|
||||
|
||||
/// Is attribute required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is attribute an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Attribute creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Attribute update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Minimum value to enforce for new documents.
|
||||
public let min: Int?
|
||||
|
||||
/// Maximum value to enforce for new documents.
|
||||
public let max: Int?
|
||||
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
public let `default`: Int?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -20,35 +20,25 @@ open class AttributeIp: Codable {
|
||||
|
||||
/// Attribute Key.
|
||||
public let key: String
|
||||
|
||||
/// Attribute type.
|
||||
public let type: String
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.AttributeStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
public let error: String
|
||||
|
||||
/// Is attribute required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is attribute an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Attribute creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Attribute update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// String format.
|
||||
public let format: String
|
||||
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
public let `default`: String?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -19,32 +19,23 @@ open class AttributeLine: Codable {
|
||||
|
||||
/// Attribute Key.
|
||||
public let key: String
|
||||
|
||||
/// Attribute type.
|
||||
public let type: String
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.AttributeStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
public let error: String
|
||||
|
||||
/// Is attribute required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is attribute an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Attribute creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Attribute update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
public let `default`: [AnyCodable]?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -11,11 +11,9 @@ open class AttributeList: Codable {
|
||||
|
||||
/// Total number of attributes in the given collection.
|
||||
public let total: Int
|
||||
|
||||
/// List of attributes.
|
||||
public let attributes: [AnyCodable]
|
||||
|
||||
|
||||
init(
|
||||
total: Int,
|
||||
attributes: [AnyCodable]
|
||||
|
||||
@@ -19,32 +19,23 @@ open class AttributePoint: Codable {
|
||||
|
||||
/// Attribute Key.
|
||||
public let key: String
|
||||
|
||||
/// Attribute type.
|
||||
public let type: String
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.AttributeStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
public let error: String
|
||||
|
||||
/// Is attribute required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is attribute an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Attribute creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Attribute update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
public let `default`: [AnyCodable]?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -19,32 +19,23 @@ open class AttributePolygon: Codable {
|
||||
|
||||
/// Attribute Key.
|
||||
public let key: String
|
||||
|
||||
/// Attribute type.
|
||||
public let type: String
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.AttributeStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
public let error: String
|
||||
|
||||
/// Is attribute required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is attribute an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Attribute creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Attribute update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
public let `default`: [AnyCodable]?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -24,47 +24,33 @@ open class AttributeRelationship: Codable {
|
||||
|
||||
/// Attribute Key.
|
||||
public let key: String
|
||||
|
||||
/// Attribute type.
|
||||
public let type: String
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.AttributeStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
public let error: String
|
||||
|
||||
/// Is attribute required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is attribute an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Attribute creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Attribute update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// The ID of the related collection.
|
||||
public let relatedCollection: String
|
||||
|
||||
/// The type of the relationship.
|
||||
public let relationType: String
|
||||
|
||||
/// Is the relationship two-way?
|
||||
public let twoWay: Bool
|
||||
|
||||
/// The key of the two-way relationship.
|
||||
public let twoWayKey: String
|
||||
|
||||
/// How deleting the parent document will propagate to child documents.
|
||||
public let onDelete: String
|
||||
|
||||
/// Whether this is the parent or child side of the relationship
|
||||
public let side: String
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -21,38 +21,27 @@ open class AttributeString: Codable {
|
||||
|
||||
/// Attribute Key.
|
||||
public let key: String
|
||||
|
||||
/// Attribute type.
|
||||
public let type: String
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.AttributeStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
public let error: String
|
||||
|
||||
/// Is attribute required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is attribute an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Attribute creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Attribute update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Attribute size.
|
||||
public let size: Int
|
||||
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
public let `default`: String?
|
||||
|
||||
/// Defines whether this attribute is encrypted or not.
|
||||
public let encrypt: Bool?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -20,35 +20,25 @@ open class AttributeUrl: Codable {
|
||||
|
||||
/// Attribute Key.
|
||||
public let key: String
|
||||
|
||||
/// Attribute type.
|
||||
public let type: String
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.AttributeStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
public let error: String
|
||||
|
||||
/// Is attribute required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is attribute an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Attribute creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Attribute update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// String format.
|
||||
public let format: String
|
||||
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
public let `default`: String?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -18,47 +18,37 @@ open class Bucket: Codable {
|
||||
case encryption = "encryption"
|
||||
case antivirus = "antivirus"
|
||||
case transformations = "transformations"
|
||||
case totalSize = "totalSize"
|
||||
}
|
||||
|
||||
/// Bucket ID.
|
||||
public let id: String
|
||||
|
||||
/// Bucket creation time in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Bucket update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Bucket permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
public let permissions: [String]
|
||||
|
||||
/// Whether file-level security is enabled. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
public let fileSecurity: Bool
|
||||
|
||||
/// Bucket name.
|
||||
public let name: String
|
||||
|
||||
/// Bucket enabled.
|
||||
public let enabled: Bool
|
||||
|
||||
/// Maximum file size supported.
|
||||
public let maximumFileSize: Int
|
||||
|
||||
/// Allowed file extensions.
|
||||
public let allowedFileExtensions: [String]
|
||||
|
||||
/// Compression algorithm choosen for compression. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd).
|
||||
/// Compression algorithm chosen for compression. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd).
|
||||
public let compression: String
|
||||
|
||||
/// Bucket is encrypted.
|
||||
public let encryption: Bool
|
||||
|
||||
/// Virus scanning is enabled.
|
||||
public let antivirus: Bool
|
||||
|
||||
/// Image transformations are enabled.
|
||||
public let transformations: Bool
|
||||
|
||||
/// Total size of this bucket in bytes.
|
||||
public let totalSize: Int
|
||||
|
||||
init(
|
||||
id: String,
|
||||
@@ -73,7 +63,8 @@ open class Bucket: Codable {
|
||||
compression: String,
|
||||
encryption: Bool,
|
||||
antivirus: Bool,
|
||||
transformations: Bool
|
||||
transformations: Bool,
|
||||
totalSize: Int
|
||||
) {
|
||||
self.id = id
|
||||
self.createdAt = createdAt
|
||||
@@ -88,6 +79,7 @@ open class Bucket: Codable {
|
||||
self.encryption = encryption
|
||||
self.antivirus = antivirus
|
||||
self.transformations = transformations
|
||||
self.totalSize = totalSize
|
||||
}
|
||||
|
||||
public required init(from decoder: Decoder) throws {
|
||||
@@ -106,6 +98,7 @@ open class Bucket: Codable {
|
||||
self.encryption = try container.decode(Bool.self, forKey: .encryption)
|
||||
self.antivirus = try container.decode(Bool.self, forKey: .antivirus)
|
||||
self.transformations = try container.decode(Bool.self, forKey: .transformations)
|
||||
self.totalSize = try container.decode(Int.self, forKey: .totalSize)
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
@@ -124,6 +117,7 @@ open class Bucket: Codable {
|
||||
try container.encode(encryption, forKey: .encryption)
|
||||
try container.encode(antivirus, forKey: .antivirus)
|
||||
try container.encode(transformations, forKey: .transformations)
|
||||
try container.encode(totalSize, forKey: .totalSize)
|
||||
}
|
||||
|
||||
public func toMap() -> [String: Any] {
|
||||
@@ -140,7 +134,8 @@ open class Bucket: Codable {
|
||||
"compression": compression as Any,
|
||||
"encryption": encryption as Any,
|
||||
"antivirus": antivirus as Any,
|
||||
"transformations": transformations as Any
|
||||
"transformations": transformations as Any,
|
||||
"totalSize": totalSize as Any
|
||||
]
|
||||
}
|
||||
|
||||
@@ -158,7 +153,8 @@ open class Bucket: Codable {
|
||||
compression: map["compression"] as! String,
|
||||
encryption: map["encryption"] as! Bool,
|
||||
antivirus: map["antivirus"] as! Bool,
|
||||
transformations: map["transformations"] as! Bool
|
||||
transformations: map["transformations"] as! Bool,
|
||||
totalSize: map["totalSize"] as! Int
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,11 +11,9 @@ open class BucketList: Codable {
|
||||
|
||||
/// Total number of buckets that matched your query.
|
||||
public let total: Int
|
||||
|
||||
/// List of buckets.
|
||||
public let buckets: [Bucket]
|
||||
|
||||
|
||||
init(
|
||||
total: Int,
|
||||
buckets: [Bucket]
|
||||
|
||||
@@ -19,35 +19,25 @@ open class Collection: Codable {
|
||||
|
||||
/// Collection ID.
|
||||
public let id: String
|
||||
|
||||
/// Collection creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Collection update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Collection permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
public let permissions: [String]
|
||||
|
||||
/// Database ID.
|
||||
public let databaseId: String
|
||||
|
||||
/// Collection name.
|
||||
public let name: String
|
||||
|
||||
/// Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys.
|
||||
public let enabled: Bool
|
||||
|
||||
/// Whether document-level permissions are enabled. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
public let documentSecurity: Bool
|
||||
|
||||
/// Collection attributes.
|
||||
public let attributes: [AnyCodable]
|
||||
|
||||
/// Collection indexes.
|
||||
public let indexes: [Index]
|
||||
|
||||
|
||||
init(
|
||||
id: String,
|
||||
createdAt: String,
|
||||
|
||||
@@ -11,11 +11,9 @@ open class CollectionList: Codable {
|
||||
|
||||
/// Total number of collections that matched your query.
|
||||
public let total: Int
|
||||
|
||||
/// List of collections.
|
||||
public let collections: [Collection]
|
||||
|
||||
|
||||
init(
|
||||
total: Int,
|
||||
collections: [Collection]
|
||||
|
||||
@@ -19,32 +19,23 @@ open class ColumnBoolean: Codable {
|
||||
|
||||
/// Column Key.
|
||||
public let key: String
|
||||
|
||||
/// Column type.
|
||||
public let type: String
|
||||
|
||||
/// Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.ColumnStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an column.
|
||||
public let error: String
|
||||
|
||||
/// Is column required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is column an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Column creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Column update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Default value for column when not provided. Cannot be set when column is required.
|
||||
public let `default`: Bool?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -20,35 +20,25 @@ open class ColumnDatetime: Codable {
|
||||
|
||||
/// Column Key.
|
||||
public let key: String
|
||||
|
||||
/// Column type.
|
||||
public let type: String
|
||||
|
||||
/// Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.ColumnStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an column.
|
||||
public let error: String
|
||||
|
||||
/// Is column required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is column an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Column creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Column update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// ISO 8601 format.
|
||||
public let format: String
|
||||
|
||||
/// Default value for column when not provided. Only null is optional
|
||||
public let `default`: String?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -20,35 +20,25 @@ open class ColumnEmail: Codable {
|
||||
|
||||
/// Column Key.
|
||||
public let key: String
|
||||
|
||||
/// Column type.
|
||||
public let type: String
|
||||
|
||||
/// Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.ColumnStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an column.
|
||||
public let error: String
|
||||
|
||||
/// Is column required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is column an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Column creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Column update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// String format.
|
||||
public let format: String
|
||||
|
||||
/// Default value for column when not provided. Cannot be set when column is required.
|
||||
public let `default`: String?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -21,38 +21,27 @@ open class ColumnEnum: Codable {
|
||||
|
||||
/// Column Key.
|
||||
public let key: String
|
||||
|
||||
/// Column type.
|
||||
public let type: String
|
||||
|
||||
/// Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.ColumnStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an column.
|
||||
public let error: String
|
||||
|
||||
/// Is column required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is column an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Column creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Column update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Array of elements in enumerated type.
|
||||
public let elements: [String]
|
||||
|
||||
/// String format.
|
||||
public let format: String
|
||||
|
||||
/// Default value for column when not provided. Cannot be set when column is required.
|
||||
public let `default`: String?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -21,38 +21,27 @@ open class ColumnFloat: Codable {
|
||||
|
||||
/// Column Key.
|
||||
public let key: String
|
||||
|
||||
/// Column type.
|
||||
public let type: String
|
||||
|
||||
/// Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.ColumnStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an column.
|
||||
public let error: String
|
||||
|
||||
/// Is column required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is column an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Column creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Column update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Minimum value to enforce for new documents.
|
||||
public let min: Double?
|
||||
|
||||
/// Maximum value to enforce for new documents.
|
||||
public let max: Double?
|
||||
|
||||
/// Default value for column when not provided. Cannot be set when column is required.
|
||||
public let `default`: Double?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -19,35 +19,25 @@ open class ColumnIndex: Codable {
|
||||
|
||||
/// Index ID.
|
||||
public let id: String
|
||||
|
||||
/// Index creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Index update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Index Key.
|
||||
public let key: String
|
||||
|
||||
/// Index type.
|
||||
public let type: String
|
||||
|
||||
/// Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: String
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an index.
|
||||
public let error: String
|
||||
|
||||
/// Index columns.
|
||||
public let columns: [String]
|
||||
|
||||
/// Index columns length.
|
||||
public let lengths: [Int]
|
||||
|
||||
/// Index orders.
|
||||
public let orders: [String]?
|
||||
|
||||
|
||||
init(
|
||||
id: String,
|
||||
createdAt: String,
|
||||
|
||||
@@ -11,11 +11,9 @@ open class ColumnIndexList: Codable {
|
||||
|
||||
/// Total number of indexes that matched your query.
|
||||
public let total: Int
|
||||
|
||||
/// List of indexes.
|
||||
public let indexes: [ColumnIndex]
|
||||
|
||||
|
||||
init(
|
||||
total: Int,
|
||||
indexes: [ColumnIndex]
|
||||
|
||||
@@ -21,38 +21,27 @@ open class ColumnInteger: Codable {
|
||||
|
||||
/// Column Key.
|
||||
public let key: String
|
||||
|
||||
/// Column type.
|
||||
public let type: String
|
||||
|
||||
/// Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.ColumnStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an column.
|
||||
public let error: String
|
||||
|
||||
/// Is column required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is column an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Column creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Column update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Minimum value to enforce for new documents.
|
||||
public let min: Int?
|
||||
|
||||
/// Maximum value to enforce for new documents.
|
||||
public let max: Int?
|
||||
|
||||
/// Default value for column when not provided. Cannot be set when column is required.
|
||||
public let `default`: Int?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -20,35 +20,25 @@ open class ColumnIp: Codable {
|
||||
|
||||
/// Column Key.
|
||||
public let key: String
|
||||
|
||||
/// Column type.
|
||||
public let type: String
|
||||
|
||||
/// Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.ColumnStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an column.
|
||||
public let error: String
|
||||
|
||||
/// Is column required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is column an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Column creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Column update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// String format.
|
||||
public let format: String
|
||||
|
||||
/// Default value for column when not provided. Cannot be set when column is required.
|
||||
public let `default`: String?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -19,32 +19,23 @@ open class ColumnLine: Codable {
|
||||
|
||||
/// Column Key.
|
||||
public let key: String
|
||||
|
||||
/// Column type.
|
||||
public let type: String
|
||||
|
||||
/// Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.ColumnStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an column.
|
||||
public let error: String
|
||||
|
||||
/// Is column required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is column an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Column creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Column update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Default value for column when not provided. Cannot be set when column is required.
|
||||
public let `default`: [AnyCodable]?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -11,11 +11,9 @@ open class ColumnList: Codable {
|
||||
|
||||
/// Total number of columns in the given table.
|
||||
public let total: Int
|
||||
|
||||
/// List of columns.
|
||||
public let columns: [AnyCodable]
|
||||
|
||||
|
||||
init(
|
||||
total: Int,
|
||||
columns: [AnyCodable]
|
||||
|
||||
@@ -19,32 +19,23 @@ open class ColumnPoint: Codable {
|
||||
|
||||
/// Column Key.
|
||||
public let key: String
|
||||
|
||||
/// Column type.
|
||||
public let type: String
|
||||
|
||||
/// Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.ColumnStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an column.
|
||||
public let error: String
|
||||
|
||||
/// Is column required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is column an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Column creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Column update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Default value for column when not provided. Cannot be set when column is required.
|
||||
public let `default`: [AnyCodable]?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -19,32 +19,23 @@ open class ColumnPolygon: Codable {
|
||||
|
||||
/// Column Key.
|
||||
public let key: String
|
||||
|
||||
/// Column type.
|
||||
public let type: String
|
||||
|
||||
/// Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.ColumnStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an column.
|
||||
public let error: String
|
||||
|
||||
/// Is column required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is column an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Column creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Column update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Default value for column when not provided. Cannot be set when column is required.
|
||||
public let `default`: [AnyCodable]?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -24,47 +24,33 @@ open class ColumnRelationship: Codable {
|
||||
|
||||
/// Column Key.
|
||||
public let key: String
|
||||
|
||||
/// Column type.
|
||||
public let type: String
|
||||
|
||||
/// Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.ColumnStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an column.
|
||||
public let error: String
|
||||
|
||||
/// Is column required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is column an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Column creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Column update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// The ID of the related table.
|
||||
public let relatedTable: String
|
||||
|
||||
/// The type of the relationship.
|
||||
public let relationType: String
|
||||
|
||||
/// Is the relationship two-way?
|
||||
public let twoWay: Bool
|
||||
|
||||
/// The key of the two-way relationship.
|
||||
public let twoWayKey: String
|
||||
|
||||
/// How deleting the parent document will propagate to child documents.
|
||||
public let onDelete: String
|
||||
|
||||
/// Whether this is the parent or child side of the relationship
|
||||
public let side: String
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -21,38 +21,27 @@ open class ColumnString: Codable {
|
||||
|
||||
/// Column Key.
|
||||
public let key: String
|
||||
|
||||
/// Column type.
|
||||
public let type: String
|
||||
|
||||
/// Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.ColumnStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an column.
|
||||
public let error: String
|
||||
|
||||
/// Is column required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is column an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Column creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Column update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Column size.
|
||||
public let size: Int
|
||||
|
||||
/// Default value for column when not provided. Cannot be set when column is required.
|
||||
public let `default`: String?
|
||||
|
||||
/// Defines whether this column is encrypted or not.
|
||||
public let encrypt: Bool?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -20,35 +20,25 @@ open class ColumnUrl: Codable {
|
||||
|
||||
/// Column Key.
|
||||
public let key: String
|
||||
|
||||
/// Column type.
|
||||
public let type: String
|
||||
|
||||
/// Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.ColumnStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an column.
|
||||
public let error: String
|
||||
|
||||
/// Is column required?
|
||||
public let `required`: Bool
|
||||
|
||||
/// Is column an array?
|
||||
public let array: Bool?
|
||||
|
||||
/// Column creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Column update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// String format.
|
||||
public let format: String
|
||||
|
||||
/// Default value for column when not provided. Cannot be set when column is required.
|
||||
public let `default`: String?
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
type: String,
|
||||
|
||||
@@ -11,11 +11,9 @@ open class Continent: Codable {
|
||||
|
||||
/// Continent name.
|
||||
public let name: String
|
||||
|
||||
/// Continent two letter code.
|
||||
public let code: String
|
||||
|
||||
|
||||
init(
|
||||
name: String,
|
||||
code: String
|
||||
|
||||
@@ -11,11 +11,9 @@ open class ContinentList: Codable {
|
||||
|
||||
/// Total number of continents that matched your query.
|
||||
public let total: Int
|
||||
|
||||
/// List of continents.
|
||||
public let continents: [Continent]
|
||||
|
||||
|
||||
init(
|
||||
total: Int,
|
||||
continents: [Continent]
|
||||
|
||||
@@ -11,11 +11,9 @@ open class Country: Codable {
|
||||
|
||||
/// Country name.
|
||||
public let name: String
|
||||
|
||||
/// Country two-character ISO 3166-1 alpha code.
|
||||
public let code: String
|
||||
|
||||
|
||||
init(
|
||||
name: String,
|
||||
code: String
|
||||
|
||||
@@ -11,11 +11,9 @@ open class CountryList: Codable {
|
||||
|
||||
/// Total number of countries that matched your query.
|
||||
public let total: Int
|
||||
|
||||
/// List of countries.
|
||||
public let countries: [Country]
|
||||
|
||||
|
||||
init(
|
||||
total: Int,
|
||||
countries: [Country]
|
||||
|
||||
@@ -16,26 +16,19 @@ open class Currency: Codable {
|
||||
|
||||
/// Currency symbol.
|
||||
public let symbol: String
|
||||
|
||||
/// Currency name.
|
||||
public let name: String
|
||||
|
||||
/// Currency native symbol.
|
||||
public let symbolNative: String
|
||||
|
||||
/// Number of decimal digits.
|
||||
public let decimalDigits: Int
|
||||
|
||||
/// Currency digit rounding.
|
||||
public let rounding: Double
|
||||
|
||||
/// Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format.
|
||||
public let code: String
|
||||
|
||||
/// Currency plural name
|
||||
public let namePlural: String
|
||||
|
||||
|
||||
init(
|
||||
symbol: String,
|
||||
name: String,
|
||||
|
||||
@@ -11,11 +11,9 @@ open class CurrencyList: Codable {
|
||||
|
||||
/// Total number of currencies that matched your query.
|
||||
public let total: Int
|
||||
|
||||
/// List of currencies.
|
||||
public let currencies: [Currency]
|
||||
|
||||
|
||||
init(
|
||||
total: Int,
|
||||
currencies: [Currency]
|
||||
|
||||
@@ -16,23 +16,17 @@ open class Database: Codable {
|
||||
|
||||
/// Database ID.
|
||||
public let id: String
|
||||
|
||||
/// Database name.
|
||||
public let name: String
|
||||
|
||||
/// Database creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Database update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys.
|
||||
public let enabled: Bool
|
||||
|
||||
/// Database type.
|
||||
public let type: AppwriteEnums.DatabaseType
|
||||
|
||||
|
||||
init(
|
||||
id: String,
|
||||
name: String,
|
||||
|
||||
@@ -11,11 +11,9 @@ open class DatabaseList: Codable {
|
||||
|
||||
/// Total number of databases that matched your query.
|
||||
public let total: Int
|
||||
|
||||
/// List of databases.
|
||||
public let databases: [Database]
|
||||
|
||||
|
||||
init(
|
||||
total: Int,
|
||||
databases: [Database]
|
||||
|
||||
@@ -37,86 +37,59 @@ open class Deployment: Codable {
|
||||
|
||||
/// Deployment ID.
|
||||
public let id: String
|
||||
|
||||
/// Deployment creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Deployment update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Type of deployment.
|
||||
public let type: String
|
||||
|
||||
/// Resource ID.
|
||||
public let resourceId: String
|
||||
|
||||
/// Resource type.
|
||||
public let resourceType: String
|
||||
|
||||
/// The entrypoint file to use to execute the deployment code.
|
||||
public let entrypoint: String
|
||||
|
||||
/// The code size in bytes.
|
||||
public let sourceSize: Int
|
||||
|
||||
/// The build output size in bytes.
|
||||
public let buildSize: Int
|
||||
|
||||
/// The total size in bytes (source and build output).
|
||||
public let totalSize: Int
|
||||
|
||||
/// The current build ID.
|
||||
public let buildId: String
|
||||
|
||||
/// Whether the deployment should be automatically activated.
|
||||
public let activate: Bool
|
||||
|
||||
/// Screenshot with light theme preference file ID.
|
||||
public let screenshotLight: String
|
||||
|
||||
/// Screenshot with dark theme preference file ID.
|
||||
public let screenshotDark: String
|
||||
|
||||
/// The deployment status. Possible values are "waiting", "processing", "building", "ready", and "failed".
|
||||
/// The deployment status. Possible values are "waiting", "processing", "building", "ready", "canceled" and "failed".
|
||||
public let status: AppwriteEnums.DeploymentStatus
|
||||
|
||||
/// The build logs.
|
||||
public let buildLogs: String
|
||||
|
||||
/// The current build time in seconds.
|
||||
public let buildDuration: Int
|
||||
|
||||
/// The name of the vcs provider repository
|
||||
public let providerRepositoryName: String
|
||||
|
||||
/// The name of the vcs provider repository owner
|
||||
public let providerRepositoryOwner: String
|
||||
|
||||
/// The url of the vcs provider repository
|
||||
public let providerRepositoryUrl: String
|
||||
|
||||
/// The commit hash of the vcs commit
|
||||
public let providerCommitHash: String
|
||||
|
||||
/// The url of vcs commit author
|
||||
public let providerCommitAuthorUrl: String
|
||||
|
||||
/// The name of vcs commit author
|
||||
public let providerCommitAuthor: String
|
||||
|
||||
/// The commit message
|
||||
public let providerCommitMessage: String
|
||||
|
||||
/// The url of the vcs commit
|
||||
public let providerCommitUrl: String
|
||||
|
||||
/// The branch of the vcs repository
|
||||
public let providerBranch: String
|
||||
|
||||
/// The branch of the vcs repository
|
||||
public let providerBranchUrl: String
|
||||
|
||||
|
||||
init(
|
||||
id: String,
|
||||
createdAt: String,
|
||||
|
||||
@@ -11,11 +11,9 @@ open class DeploymentList: Codable {
|
||||
|
||||
/// Total number of deployments that matched your query.
|
||||
public let total: Int
|
||||
|
||||
/// List of deployments.
|
||||
public let deployments: [Deployment]
|
||||
|
||||
|
||||
init(
|
||||
total: Int,
|
||||
deployments: [Deployment]
|
||||
|
||||
@@ -17,25 +17,18 @@ open class Document<T : Codable>: Codable {
|
||||
|
||||
/// Document ID.
|
||||
public let id: String
|
||||
|
||||
/// Document automatically incrementing ID.
|
||||
public let sequence: Int
|
||||
|
||||
/// Collection ID.
|
||||
public let collectionId: String
|
||||
|
||||
/// Database ID.
|
||||
public let databaseId: String
|
||||
|
||||
/// Document creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Document update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Document permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
public let permissions: [String]
|
||||
|
||||
/// Additional properties
|
||||
public let data: T
|
||||
|
||||
|
||||
@@ -11,11 +11,9 @@ open class DocumentList<T : Codable>: Codable {
|
||||
|
||||
/// Total number of documents that matched your query.
|
||||
public let total: Int
|
||||
|
||||
/// List of documents.
|
||||
public let documents: [Document<T>]
|
||||
|
||||
|
||||
init(
|
||||
total: Int,
|
||||
documents: [Document<T>]
|
||||
|
||||
@@ -28,59 +28,41 @@ open class Execution: Codable {
|
||||
|
||||
/// Execution ID.
|
||||
public let id: String
|
||||
|
||||
/// Execution creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Execution update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Execution roles.
|
||||
public let permissions: [String]
|
||||
|
||||
/// Function ID.
|
||||
public let functionId: String
|
||||
|
||||
/// Function's deployment ID used to create the execution.
|
||||
public let deploymentId: String
|
||||
|
||||
/// The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.
|
||||
public let trigger: AppwriteEnums.ExecutionTrigger
|
||||
|
||||
/// The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, `failed`, or `scheduled`.
|
||||
public let status: AppwriteEnums.ExecutionStatus
|
||||
|
||||
/// HTTP request method type.
|
||||
public let requestMethod: String
|
||||
|
||||
/// HTTP request path and query.
|
||||
public let requestPath: String
|
||||
|
||||
/// HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
|
||||
public let requestHeaders: [Headers]
|
||||
|
||||
/// HTTP response status code.
|
||||
public let responseStatusCode: Int
|
||||
|
||||
/// HTTP response body. This will return empty unless execution is created as synchronous.
|
||||
public let responseBody: String
|
||||
|
||||
/// HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
|
||||
public let responseHeaders: [Headers]
|
||||
|
||||
/// Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
|
||||
public let logs: String
|
||||
|
||||
/// Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
|
||||
public let errors: String
|
||||
|
||||
/// Resource(function/site) execution duration in seconds.
|
||||
public let duration: Double
|
||||
|
||||
/// The scheduled time for execution. If left empty, execution will be queued immediately.
|
||||
public let scheduledAt: String?
|
||||
|
||||
|
||||
init(
|
||||
id: String,
|
||||
createdAt: String,
|
||||
|
||||
@@ -11,11 +11,9 @@ open class ExecutionList: Codable {
|
||||
|
||||
/// Total number of executions that matched your query.
|
||||
public let total: Int
|
||||
|
||||
/// List of executions.
|
||||
public let executions: [Execution]
|
||||
|
||||
|
||||
init(
|
||||
total: Int,
|
||||
executions: [Execution]
|
||||
|
||||
@@ -16,41 +16,36 @@ open class File: Codable {
|
||||
case sizeOriginal = "sizeOriginal"
|
||||
case chunksTotal = "chunksTotal"
|
||||
case chunksUploaded = "chunksUploaded"
|
||||
case encryption = "encryption"
|
||||
case compression = "compression"
|
||||
}
|
||||
|
||||
/// File ID.
|
||||
public let id: String
|
||||
|
||||
/// Bucket ID.
|
||||
public let bucketId: String
|
||||
|
||||
/// File creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// File update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// File permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
public let permissions: [String]
|
||||
|
||||
/// File name.
|
||||
public let name: String
|
||||
|
||||
/// File MD5 signature.
|
||||
public let signature: String
|
||||
|
||||
/// File mime type.
|
||||
public let mimeType: String
|
||||
|
||||
/// File original size in bytes.
|
||||
public let sizeOriginal: Int
|
||||
|
||||
/// Total number of chunks available
|
||||
public let chunksTotal: Int
|
||||
|
||||
/// Total number of chunks uploaded
|
||||
public let chunksUploaded: Int
|
||||
|
||||
/// Whether file contents are encrypted at rest.
|
||||
public let encryption: Bool
|
||||
/// Compression algorithm used for the file. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd).
|
||||
public let compression: String
|
||||
|
||||
init(
|
||||
id: String,
|
||||
@@ -63,7 +58,9 @@ open class File: Codable {
|
||||
mimeType: String,
|
||||
sizeOriginal: Int,
|
||||
chunksTotal: Int,
|
||||
chunksUploaded: Int
|
||||
chunksUploaded: Int,
|
||||
encryption: Bool,
|
||||
compression: String
|
||||
) {
|
||||
self.id = id
|
||||
self.bucketId = bucketId
|
||||
@@ -76,6 +73,8 @@ open class File: Codable {
|
||||
self.sizeOriginal = sizeOriginal
|
||||
self.chunksTotal = chunksTotal
|
||||
self.chunksUploaded = chunksUploaded
|
||||
self.encryption = encryption
|
||||
self.compression = compression
|
||||
}
|
||||
|
||||
public required init(from decoder: Decoder) throws {
|
||||
@@ -92,6 +91,8 @@ open class File: Codable {
|
||||
self.sizeOriginal = try container.decode(Int.self, forKey: .sizeOriginal)
|
||||
self.chunksTotal = try container.decode(Int.self, forKey: .chunksTotal)
|
||||
self.chunksUploaded = try container.decode(Int.self, forKey: .chunksUploaded)
|
||||
self.encryption = try container.decode(Bool.self, forKey: .encryption)
|
||||
self.compression = try container.decode(String.self, forKey: .compression)
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
@@ -108,6 +109,8 @@ open class File: Codable {
|
||||
try container.encode(sizeOriginal, forKey: .sizeOriginal)
|
||||
try container.encode(chunksTotal, forKey: .chunksTotal)
|
||||
try container.encode(chunksUploaded, forKey: .chunksUploaded)
|
||||
try container.encode(encryption, forKey: .encryption)
|
||||
try container.encode(compression, forKey: .compression)
|
||||
}
|
||||
|
||||
public func toMap() -> [String: Any] {
|
||||
@@ -122,7 +125,9 @@ open class File: Codable {
|
||||
"mimeType": mimeType as Any,
|
||||
"sizeOriginal": sizeOriginal as Any,
|
||||
"chunksTotal": chunksTotal as Any,
|
||||
"chunksUploaded": chunksUploaded as Any
|
||||
"chunksUploaded": chunksUploaded as Any,
|
||||
"encryption": encryption as Any,
|
||||
"compression": compression as Any
|
||||
]
|
||||
}
|
||||
|
||||
@@ -138,7 +143,9 @@ open class File: Codable {
|
||||
mimeType: map["mimeType"] as! String,
|
||||
sizeOriginal: map["sizeOriginal"] as! Int,
|
||||
chunksTotal: map["chunksTotal"] as! Int,
|
||||
chunksUploaded: map["chunksUploaded"] as! Int
|
||||
chunksUploaded: map["chunksUploaded"] as! Int,
|
||||
encryption: map["encryption"] as! Bool,
|
||||
compression: map["compression"] as! String
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,11 +11,9 @@ open class FileList: Codable {
|
||||
|
||||
/// Total number of files that matched your query.
|
||||
public let total: Int
|
||||
|
||||
/// List of files.
|
||||
public let files: [File]
|
||||
|
||||
|
||||
init(
|
||||
total: Int,
|
||||
files: [File]
|
||||
|
||||
@@ -14,20 +14,15 @@ open class Framework: Codable {
|
||||
|
||||
/// Framework key.
|
||||
public let key: String
|
||||
|
||||
/// Framework Name.
|
||||
public let name: String
|
||||
|
||||
/// Default runtime version.
|
||||
public let buildRuntime: String
|
||||
|
||||
/// List of supported runtime versions.
|
||||
public let runtimes: [String]
|
||||
|
||||
/// List of supported adapters.
|
||||
public let adapters: [FrameworkAdapter]
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
name: String,
|
||||
|
||||
@@ -14,20 +14,15 @@ open class FrameworkAdapter: Codable {
|
||||
|
||||
/// Adapter key.
|
||||
public let key: String
|
||||
|
||||
/// Default command to download dependencies.
|
||||
public let installCommand: String
|
||||
|
||||
/// Default command to build site into output directory.
|
||||
public let buildCommand: String
|
||||
|
||||
/// Default output directory of build.
|
||||
public let outputDirectory: String
|
||||
|
||||
/// Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.
|
||||
public let fallbackFile: String
|
||||
|
||||
|
||||
init(
|
||||
key: String,
|
||||
installCommand: String,
|
||||
|
||||
@@ -11,11 +11,9 @@ open class FrameworkList: Codable {
|
||||
|
||||
/// Total number of frameworks that matched your query.
|
||||
public let total: Int
|
||||
|
||||
/// List of frameworks.
|
||||
public let frameworks: [Framework]
|
||||
|
||||
|
||||
init(
|
||||
total: Int,
|
||||
frameworks: [Framework]
|
||||
|
||||
@@ -37,89 +37,61 @@ open class Function: Codable {
|
||||
|
||||
/// Function ID.
|
||||
public let id: String
|
||||
|
||||
/// Function creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Function update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Execution permissions.
|
||||
public let execute: [String]
|
||||
|
||||
/// Function name.
|
||||
public let name: String
|
||||
|
||||
/// Function enabled.
|
||||
public let enabled: Bool
|
||||
|
||||
/// Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration.
|
||||
public let live: Bool
|
||||
|
||||
/// When disabled, executions will exclude logs and errors, and will be slightly faster.
|
||||
public let logging: Bool
|
||||
|
||||
/// Function execution and build runtime.
|
||||
public let runtime: String
|
||||
|
||||
/// Function's active deployment ID.
|
||||
public let deploymentId: String
|
||||
|
||||
/// Active deployment creation date in ISO 8601 format.
|
||||
public let deploymentCreatedAt: String
|
||||
|
||||
/// Function's latest deployment ID.
|
||||
public let latestDeploymentId: String
|
||||
|
||||
/// Latest deployment creation date in ISO 8601 format.
|
||||
public let latestDeploymentCreatedAt: String
|
||||
|
||||
/// Status of latest deployment. Possible values are "waiting", "processing", "building", "ready", and "failed".
|
||||
public let latestDeploymentStatus: String
|
||||
|
||||
/// Allowed permission scopes.
|
||||
public let scopes: [String]
|
||||
|
||||
/// Function variables.
|
||||
public let vars: [Variable]
|
||||
|
||||
/// Function trigger events.
|
||||
public let events: [String]
|
||||
|
||||
/// Function execution schedule in CRON format.
|
||||
public let schedule: String
|
||||
|
||||
/// Function execution timeout in seconds.
|
||||
public let timeout: Int
|
||||
|
||||
/// The entrypoint file used to execute the deployment.
|
||||
public let entrypoint: String
|
||||
|
||||
/// The build command used to build the deployment.
|
||||
public let commands: String
|
||||
|
||||
/// Version of Open Runtimes used for the function.
|
||||
public let version: String
|
||||
|
||||
/// Function VCS (Version Control System) installation id.
|
||||
public let installationId: String
|
||||
|
||||
/// VCS (Version Control System) Repository ID
|
||||
public let providerRepositoryId: String
|
||||
|
||||
/// VCS (Version Control System) branch name
|
||||
public let providerBranch: String
|
||||
|
||||
/// Path to function in VCS (Version Control System) repository
|
||||
public let providerRootDirectory: String
|
||||
|
||||
/// Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests
|
||||
public let providerSilentMode: Bool
|
||||
|
||||
/// Machine specification for builds and executions.
|
||||
public let specification: String
|
||||
|
||||
|
||||
init(
|
||||
id: String,
|
||||
createdAt: String,
|
||||
|
||||
@@ -11,11 +11,9 @@ open class FunctionList: Codable {
|
||||
|
||||
/// Total number of functions that matched your query.
|
||||
public let total: Int
|
||||
|
||||
/// List of functions.
|
||||
public let functions: [Function]
|
||||
|
||||
|
||||
init(
|
||||
total: Int,
|
||||
functions: [Function]
|
||||
|
||||
@@ -11,11 +11,9 @@ open class Headers: Codable {
|
||||
|
||||
/// Header name.
|
||||
public let name: String
|
||||
|
||||
/// Header value.
|
||||
public let value: String
|
||||
|
||||
|
||||
init(
|
||||
name: String,
|
||||
value: String
|
||||
|
||||
@@ -12,11 +12,9 @@ open class HealthAntivirus: Codable {
|
||||
|
||||
/// Antivirus version.
|
||||
public let version: String
|
||||
|
||||
/// Antivirus status. Possible values are: `disabled`, `offline`, `online`
|
||||
public let status: AppwriteEnums.HealthAntivirusStatus
|
||||
|
||||
|
||||
init(
|
||||
version: String,
|
||||
status: AppwriteEnums.HealthAntivirusStatus
|
||||
|
||||
@@ -15,23 +15,17 @@ open class HealthCertificate: Codable {
|
||||
|
||||
/// Certificate name
|
||||
public let name: String
|
||||
|
||||
/// Subject SN
|
||||
public let subjectSN: String
|
||||
|
||||
/// Issuer organisation
|
||||
public let issuerOrganisation: String
|
||||
|
||||
/// Valid from
|
||||
public let validFrom: String
|
||||
|
||||
/// Valid to
|
||||
public let validTo: String
|
||||
|
||||
/// Signature type SN
|
||||
public let signatureTypeSN: String
|
||||
|
||||
|
||||
init(
|
||||
name: String,
|
||||
subjectSN: String,
|
||||
|
||||
@@ -11,7 +11,6 @@ open class HealthQueue: Codable {
|
||||
/// Amount of actions in the queue.
|
||||
public let size: Int
|
||||
|
||||
|
||||
init(
|
||||
size: Int
|
||||
) {
|
||||
|
||||
@@ -13,14 +13,11 @@ open class HealthStatus: Codable {
|
||||
|
||||
/// Name of the service.
|
||||
public let name: String
|
||||
|
||||
/// Duration in milliseconds how long the health check took.
|
||||
public let ping: Int
|
||||
|
||||
/// Service status. Possible values are: `pass`, `fail`
|
||||
public let status: AppwriteEnums.HealthCheckStatus
|
||||
|
||||
|
||||
init(
|
||||
name: String,
|
||||
ping: Int,
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
import Foundation
|
||||
import JSONCodable
|
||||
|
||||
/// Status List
|
||||
open class HealthStatusList: Codable {
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case total = "total"
|
||||
case statuses = "statuses"
|
||||
}
|
||||
|
||||
/// Total number of statuses that matched your query.
|
||||
public let total: Int
|
||||
/// List of statuses.
|
||||
public let statuses: [HealthStatus]
|
||||
|
||||
init(
|
||||
total: Int,
|
||||
statuses: [HealthStatus]
|
||||
) {
|
||||
self.total = total
|
||||
self.statuses = statuses
|
||||
}
|
||||
|
||||
public required init(from decoder: Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||
|
||||
self.total = try container.decode(Int.self, forKey: .total)
|
||||
self.statuses = try container.decode([HealthStatus].self, forKey: .statuses)
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
|
||||
try container.encode(total, forKey: .total)
|
||||
try container.encode(statuses, forKey: .statuses)
|
||||
}
|
||||
|
||||
public func toMap() -> [String: Any] {
|
||||
return [
|
||||
"total": total as Any,
|
||||
"statuses": statuses.map { $0.toMap() } as Any
|
||||
]
|
||||
}
|
||||
|
||||
public static func from(map: [String: Any] ) -> HealthStatusList {
|
||||
return HealthStatusList(
|
||||
total: map["total"] as! Int,
|
||||
statuses: (map["statuses"] as! [[String: Any]]).map { HealthStatus.from(map: $0) }
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -12,14 +12,11 @@ open class HealthTime: Codable {
|
||||
|
||||
/// Current unix timestamp on trustful remote server.
|
||||
public let remoteTime: Int
|
||||
|
||||
/// Current unix timestamp of local server where Appwrite runs.
|
||||
public let localTime: Int
|
||||
|
||||
/// Difference of unix remote and local timestamps in milliseconds.
|
||||
public let diff: Int
|
||||
|
||||
|
||||
init(
|
||||
remoteTime: Int,
|
||||
localTime: Int,
|
||||
|
||||
@@ -19,35 +19,25 @@ open class Identity: Codable {
|
||||
|
||||
/// Identity ID.
|
||||
public let id: String
|
||||
|
||||
/// Identity creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Identity update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// User ID.
|
||||
public let userId: String
|
||||
|
||||
/// Identity Provider.
|
||||
public let provider: String
|
||||
|
||||
/// ID of the User in the Identity Provider.
|
||||
public let providerUid: String
|
||||
|
||||
/// Email of the User in the Identity Provider.
|
||||
public let providerEmail: String
|
||||
|
||||
/// Identity Provider Access Token.
|
||||
public let providerAccessToken: String
|
||||
|
||||
/// The date of when the access token expires in ISO 8601 format.
|
||||
public let providerAccessTokenExpiry: String
|
||||
|
||||
/// Identity Provider Refresh Token.
|
||||
public let providerRefreshToken: String
|
||||
|
||||
|
||||
init(
|
||||
id: String,
|
||||
createdAt: String,
|
||||
|
||||
@@ -11,11 +11,9 @@ open class IdentityList: Codable {
|
||||
|
||||
/// Total number of identities that matched your query.
|
||||
public let total: Int
|
||||
|
||||
/// List of identities.
|
||||
public let identities: [Identity]
|
||||
|
||||
|
||||
init(
|
||||
total: Int,
|
||||
identities: [Identity]
|
||||
|
||||
@@ -20,35 +20,25 @@ open class Index: Codable {
|
||||
|
||||
/// Index ID.
|
||||
public let id: String
|
||||
|
||||
/// Index creation date in ISO 8601 format.
|
||||
public let createdAt: String
|
||||
|
||||
/// Index update date in ISO 8601 format.
|
||||
public let updatedAt: String
|
||||
|
||||
/// Index key.
|
||||
public let key: String
|
||||
|
||||
/// Index type.
|
||||
public let type: String
|
||||
|
||||
/// Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
public let status: AppwriteEnums.IndexStatus
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an index.
|
||||
public let error: String
|
||||
|
||||
/// Index attributes.
|
||||
public let attributes: [String]
|
||||
|
||||
/// Index attributes length.
|
||||
public let lengths: [Int]
|
||||
|
||||
/// Index orders.
|
||||
public let orders: [String]?
|
||||
|
||||
|
||||
init(
|
||||
id: String,
|
||||
createdAt: String,
|
||||
|
||||
@@ -11,11 +11,9 @@ open class IndexList: Codable {
|
||||
|
||||
/// Total number of indexes that matched your query.
|
||||
public let total: Int
|
||||
|
||||
/// List of indexes.
|
||||
public let indexes: [Index]
|
||||
|
||||
|
||||
init(
|
||||
total: Int,
|
||||
indexes: [Index]
|
||||
|
||||
@@ -11,7 +11,6 @@ open class Jwt: Codable {
|
||||
/// JWT encoded string.
|
||||
public let jwt: String
|
||||
|
||||
|
||||
init(
|
||||
jwt: String
|
||||
) {
|
||||
|
||||
@@ -12,14 +12,11 @@ open class Language: Codable {
|
||||
|
||||
/// Language name.
|
||||
public let name: String
|
||||
|
||||
/// Language two-character ISO 639-1 codes.
|
||||
public let code: String
|
||||
|
||||
/// Language native name.
|
||||
public let nativeName: String
|
||||
|
||||
|
||||
init(
|
||||
name: String,
|
||||
code: String,
|
||||
|
||||
@@ -11,11 +11,9 @@ open class LanguageList: Codable {
|
||||
|
||||
/// Total number of languages that matched your query.
|
||||
public let total: Int
|
||||
|
||||
/// List of languages.
|
||||
public let languages: [Language]
|
||||
|
||||
|
||||
init(
|
||||
total: Int,
|
||||
languages: [Language]
|
||||
|
||||
@@ -16,26 +16,19 @@ open class Locale: Codable {
|
||||
|
||||
/// User IP address.
|
||||
public let ip: String
|
||||
|
||||
/// Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format
|
||||
public let countryCode: String
|
||||
|
||||
/// Country name. This field support localization.
|
||||
public let country: String
|
||||
|
||||
/// Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America.
|
||||
public let continentCode: String
|
||||
|
||||
/// Continent name. This field support localization.
|
||||
public let continent: String
|
||||
|
||||
/// True if country is part of the European Union.
|
||||
public let eu: Bool
|
||||
|
||||
/// Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format
|
||||
public let currency: String
|
||||
|
||||
|
||||
init(
|
||||
ip: String,
|
||||
countryCode: String,
|
||||
|
||||
@@ -11,11 +11,9 @@ open class LocaleCode: Codable {
|
||||
|
||||
/// Locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
|
||||
public let code: String
|
||||
|
||||
/// Locale name
|
||||
public let name: String
|
||||
|
||||
|
||||
init(
|
||||
code: String,
|
||||
name: String
|
||||
|
||||
@@ -11,11 +11,9 @@ open class LocaleCodeList: Codable {
|
||||
|
||||
/// Total number of localeCodes that matched your query.
|
||||
public let total: Int
|
||||
|
||||
/// List of localeCodes.
|
||||
public let localeCodes: [LocaleCode]
|
||||
|
||||
|
||||
init(
|
||||
total: Int,
|
||||
localeCodes: [LocaleCode]
|
||||
|
||||
@@ -30,68 +30,47 @@ open class Log: Codable {
|
||||
|
||||
/// Event name.
|
||||
public let event: String
|
||||
|
||||
/// User ID.
|
||||
public let userId: String
|
||||
|
||||
/// User Email.
|
||||
public let userEmail: String
|
||||
|
||||
/// User Name.
|
||||
public let userName: String
|
||||
|
||||
/// API mode when event triggered.
|
||||
public let mode: String
|
||||
|
||||
/// IP session in use when the session was created.
|
||||
public let ip: String
|
||||
|
||||
/// Log creation date in ISO 8601 format.
|
||||
public let time: String
|
||||
|
||||
/// Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json).
|
||||
public let osCode: String
|
||||
|
||||
/// Operating system name.
|
||||
public let osName: String
|
||||
|
||||
/// Operating system version.
|
||||
public let osVersion: String
|
||||
|
||||
/// Client type.
|
||||
public let clientType: String
|
||||
|
||||
/// Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json).
|
||||
public let clientCode: String
|
||||
|
||||
/// Client name.
|
||||
public let clientName: String
|
||||
|
||||
/// Client version.
|
||||
public let clientVersion: String
|
||||
|
||||
/// Client engine name.
|
||||
public let clientEngine: String
|
||||
|
||||
/// Client engine name.
|
||||
public let clientEngineVersion: String
|
||||
|
||||
/// Device name.
|
||||
public let deviceName: String
|
||||
|
||||
/// Device brand name.
|
||||
public let deviceBrand: String
|
||||
|
||||
/// Device model name.
|
||||
public let deviceModel: String
|
||||
|
||||
/// Country two-character ISO 3166-1 alpha code.
|
||||
public let countryCode: String
|
||||
|
||||
/// Country name.
|
||||
public let countryName: String
|
||||
|
||||
|
||||
init(
|
||||
event: String,
|
||||
userId: String,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user