Skip to content

Commit a3f7cb3

Browse files
committed
chore: update title and desc
1 parent 04571fb commit a3f7cb3

18 files changed

+123
-86
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Add the package to your `Package.swift` dependencies:
3333

3434
```swift
3535
dependencies: [
36-
.package(url: "git@github.com:appwrite/sdk-for-swift.git", from: "12.2.0"),
36+
.package(url: "git@github.com:appwrite/sdk-for-swift.git", from: "13.0.0"),
3737
],
3838
```
3939

Sources/Appwrite/Client.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ open class Client {
2121
"x-sdk-name": "Swift",
2222
"x-sdk-platform": "server",
2323
"x-sdk-language": "swift",
24-
"x-sdk-version": "12.2.0",
24+
"x-sdk-version": "13.0.0",
2525
"x-appwrite-response-format": "1.8.0"
2626
]
2727

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Foundation
2+
3+
public enum ColumnStatus: String, CustomStringConvertible {
4+
case available = "available"
5+
case processing = "processing"
6+
case deleting = "deleting"
7+
case stuck = "stuck"
8+
case failed = "failed"
9+
10+
public var description: String {
11+
return rawValue
12+
}
13+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Foundation
2+
3+
public enum DatabaseType: String, CustomStringConvertible {
4+
case legacy = "legacy"
5+
case tablesdb = "tablesdb"
6+
7+
public var description: String {
8+
return rawValue
9+
}
10+
}

Sources/AppwriteModels/ColumnBoolean.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Foundation
22
import JSONCodable
3+
import AppwriteEnums
34

45
/// ColumnBoolean
56
open class ColumnBoolean: Codable {
@@ -23,7 +24,7 @@ open class ColumnBoolean: Codable {
2324
public let type: String
2425

2526
/// Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
26-
public let status: String
27+
public let status: AppwriteEnums.ColumnStatus
2728

2829
/// Error message. Displays error generated on failure of creating or deleting an column.
2930
public let error: String
@@ -47,7 +48,7 @@ open class ColumnBoolean: Codable {
4748
init(
4849
key: String,
4950
type: String,
50-
status: String,
51+
status: AppwriteEnums.ColumnStatus,
5152
error: String,
5253
`required`: Bool,
5354
array: Bool?,
@@ -71,7 +72,7 @@ open class ColumnBoolean: Codable {
7172

7273
self.key = try container.decode(String.self, forKey: .key)
7374
self.type = try container.decode(String.self, forKey: .type)
74-
self.status = try container.decode(String.self, forKey: .status)
75+
self.status = AppwriteEnums.ColumnStatus(rawValue: try container.decode(String.self, forKey: .status))!
7576
self.error = try container.decode(String.self, forKey: .error)
7677
self.`required` = try container.decode(Bool.self, forKey: .`required`)
7778
self.array = try container.decodeIfPresent(Bool.self, forKey: .array)
@@ -85,7 +86,7 @@ open class ColumnBoolean: Codable {
8586

8687
try container.encode(key, forKey: .key)
8788
try container.encode(type, forKey: .type)
88-
try container.encode(status, forKey: .status)
89+
try container.encode(status.rawValue, forKey: .status)
8990
try container.encode(error, forKey: .error)
9091
try container.encode(`required`, forKey: .`required`)
9192
try container.encodeIfPresent(array, forKey: .array)
@@ -98,7 +99,7 @@ open class ColumnBoolean: Codable {
9899
return [
99100
"key": key as Any,
100101
"type": type as Any,
101-
"status": status as Any,
102+
"status": status.rawValue as Any,
102103
"error": error as Any,
103104
"required": `required` as Any,
104105
"array": array as Any,
@@ -112,7 +113,7 @@ open class ColumnBoolean: Codable {
112113
return ColumnBoolean(
113114
key: map["key"] as! String,
114115
type: map["type"] as! String,
115-
status: map["status"] as! String,
116+
status: ColumnStatus(rawValue: map["status"] as! String)!,
116117
error: map["error"] as! String,
117118
required: map["required"] as! Bool,
118119
array: map["array"] as? Bool,

Sources/AppwriteModels/ColumnDatetime.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Foundation
22
import JSONCodable
3+
import AppwriteEnums
34

45
/// ColumnDatetime
56
open class ColumnDatetime: Codable {
@@ -24,7 +25,7 @@ open class ColumnDatetime: Codable {
2425
public let type: String
2526

2627
/// Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
27-
public let status: String
28+
public let status: AppwriteEnums.ColumnStatus
2829

2930
/// Error message. Displays error generated on failure of creating or deleting an column.
3031
public let error: String
@@ -51,7 +52,7 @@ open class ColumnDatetime: Codable {
5152
init(
5253
key: String,
5354
type: String,
54-
status: String,
55+
status: AppwriteEnums.ColumnStatus,
5556
error: String,
5657
`required`: Bool,
5758
array: Bool?,
@@ -77,7 +78,7 @@ open class ColumnDatetime: Codable {
7778

7879
self.key = try container.decode(String.self, forKey: .key)
7980
self.type = try container.decode(String.self, forKey: .type)
80-
self.status = try container.decode(String.self, forKey: .status)
81+
self.status = AppwriteEnums.ColumnStatus(rawValue: try container.decode(String.self, forKey: .status))!
8182
self.error = try container.decode(String.self, forKey: .error)
8283
self.`required` = try container.decode(Bool.self, forKey: .`required`)
8384
self.array = try container.decodeIfPresent(Bool.self, forKey: .array)
@@ -92,7 +93,7 @@ open class ColumnDatetime: Codable {
9293

9394
try container.encode(key, forKey: .key)
9495
try container.encode(type, forKey: .type)
95-
try container.encode(status, forKey: .status)
96+
try container.encode(status.rawValue, forKey: .status)
9697
try container.encode(error, forKey: .error)
9798
try container.encode(`required`, forKey: .`required`)
9899
try container.encodeIfPresent(array, forKey: .array)
@@ -106,7 +107,7 @@ open class ColumnDatetime: Codable {
106107
return [
107108
"key": key as Any,
108109
"type": type as Any,
109-
"status": status as Any,
110+
"status": status.rawValue as Any,
110111
"error": error as Any,
111112
"required": `required` as Any,
112113
"array": array as Any,
@@ -121,7 +122,7 @@ open class ColumnDatetime: Codable {
121122
return ColumnDatetime(
122123
key: map["key"] as! String,
123124
type: map["type"] as! String,
124-
status: map["status"] as! String,
125+
status: ColumnStatus(rawValue: map["status"] as! String)!,
125126
error: map["error"] as! String,
126127
required: map["required"] as! Bool,
127128
array: map["array"] as? Bool,

Sources/AppwriteModels/ColumnEmail.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Foundation
22
import JSONCodable
3+
import AppwriteEnums
34

45
/// ColumnEmail
56
open class ColumnEmail: Codable {
@@ -24,7 +25,7 @@ open class ColumnEmail: Codable {
2425
public let type: String
2526

2627
/// Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
27-
public let status: String
28+
public let status: AppwriteEnums.ColumnStatus
2829

2930
/// Error message. Displays error generated on failure of creating or deleting an column.
3031
public let error: String
@@ -51,7 +52,7 @@ open class ColumnEmail: Codable {
5152
init(
5253
key: String,
5354
type: String,
54-
status: String,
55+
status: AppwriteEnums.ColumnStatus,
5556
error: String,
5657
`required`: Bool,
5758
array: Bool?,
@@ -77,7 +78,7 @@ open class ColumnEmail: Codable {
7778

7879
self.key = try container.decode(String.self, forKey: .key)
7980
self.type = try container.decode(String.self, forKey: .type)
80-
self.status = try container.decode(String.self, forKey: .status)
81+
self.status = AppwriteEnums.ColumnStatus(rawValue: try container.decode(String.self, forKey: .status))!
8182
self.error = try container.decode(String.self, forKey: .error)
8283
self.`required` = try container.decode(Bool.self, forKey: .`required`)
8384
self.array = try container.decodeIfPresent(Bool.self, forKey: .array)
@@ -92,7 +93,7 @@ open class ColumnEmail: Codable {
9293

9394
try container.encode(key, forKey: .key)
9495
try container.encode(type, forKey: .type)
95-
try container.encode(status, forKey: .status)
96+
try container.encode(status.rawValue, forKey: .status)
9697
try container.encode(error, forKey: .error)
9798
try container.encode(`required`, forKey: .`required`)
9899
try container.encodeIfPresent(array, forKey: .array)
@@ -106,7 +107,7 @@ open class ColumnEmail: Codable {
106107
return [
107108
"key": key as Any,
108109
"type": type as Any,
109-
"status": status as Any,
110+
"status": status.rawValue as Any,
110111
"error": error as Any,
111112
"required": `required` as Any,
112113
"array": array as Any,
@@ -121,7 +122,7 @@ open class ColumnEmail: Codable {
121122
return ColumnEmail(
122123
key: map["key"] as! String,
123124
type: map["type"] as! String,
124-
status: map["status"] as! String,
125+
status: ColumnStatus(rawValue: map["status"] as! String)!,
125126
error: map["error"] as! String,
126127
required: map["required"] as! Bool,
127128
array: map["array"] as? Bool,

Sources/AppwriteModels/ColumnEnum.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Foundation
22
import JSONCodable
3+
import AppwriteEnums
34

45
/// ColumnEnum
56
open class ColumnEnum: Codable {
@@ -25,7 +26,7 @@ open class ColumnEnum: Codable {
2526
public let type: String
2627

2728
/// Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
28-
public let status: String
29+
public let status: AppwriteEnums.ColumnStatus
2930

3031
/// Error message. Displays error generated on failure of creating or deleting an column.
3132
public let error: String
@@ -55,7 +56,7 @@ open class ColumnEnum: Codable {
5556
init(
5657
key: String,
5758
type: String,
58-
status: String,
59+
status: AppwriteEnums.ColumnStatus,
5960
error: String,
6061
`required`: Bool,
6162
array: Bool?,
@@ -83,7 +84,7 @@ open class ColumnEnum: Codable {
8384

8485
self.key = try container.decode(String.self, forKey: .key)
8586
self.type = try container.decode(String.self, forKey: .type)
86-
self.status = try container.decode(String.self, forKey: .status)
87+
self.status = AppwriteEnums.ColumnStatus(rawValue: try container.decode(String.self, forKey: .status))!
8788
self.error = try container.decode(String.self, forKey: .error)
8889
self.`required` = try container.decode(Bool.self, forKey: .`required`)
8990
self.array = try container.decodeIfPresent(Bool.self, forKey: .array)
@@ -99,7 +100,7 @@ open class ColumnEnum: Codable {
99100

100101
try container.encode(key, forKey: .key)
101102
try container.encode(type, forKey: .type)
102-
try container.encode(status, forKey: .status)
103+
try container.encode(status.rawValue, forKey: .status)
103104
try container.encode(error, forKey: .error)
104105
try container.encode(`required`, forKey: .`required`)
105106
try container.encodeIfPresent(array, forKey: .array)
@@ -114,7 +115,7 @@ open class ColumnEnum: Codable {
114115
return [
115116
"key": key as Any,
116117
"type": type as Any,
117-
"status": status as Any,
118+
"status": status.rawValue as Any,
118119
"error": error as Any,
119120
"required": `required` as Any,
120121
"array": array as Any,
@@ -130,7 +131,7 @@ open class ColumnEnum: Codable {
130131
return ColumnEnum(
131132
key: map["key"] as! String,
132133
type: map["type"] as! String,
133-
status: map["status"] as! String,
134+
status: ColumnStatus(rawValue: map["status"] as! String)!,
134135
error: map["error"] as! String,
135136
required: map["required"] as! Bool,
136137
array: map["array"] as? Bool,

Sources/AppwriteModels/ColumnFloat.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Foundation
22
import JSONCodable
3+
import AppwriteEnums
34

45
/// ColumnFloat
56
open class ColumnFloat: Codable {
@@ -25,7 +26,7 @@ open class ColumnFloat: Codable {
2526
public let type: String
2627

2728
/// Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
28-
public let status: String
29+
public let status: AppwriteEnums.ColumnStatus
2930

3031
/// Error message. Displays error generated on failure of creating or deleting an column.
3132
public let error: String
@@ -55,7 +56,7 @@ open class ColumnFloat: Codable {
5556
init(
5657
key: String,
5758
type: String,
58-
status: String,
59+
status: AppwriteEnums.ColumnStatus,
5960
error: String,
6061
`required`: Bool,
6162
array: Bool?,
@@ -83,7 +84,7 @@ open class ColumnFloat: Codable {
8384

8485
self.key = try container.decode(String.self, forKey: .key)
8586
self.type = try container.decode(String.self, forKey: .type)
86-
self.status = try container.decode(String.self, forKey: .status)
87+
self.status = AppwriteEnums.ColumnStatus(rawValue: try container.decode(String.self, forKey: .status))!
8788
self.error = try container.decode(String.self, forKey: .error)
8889
self.`required` = try container.decode(Bool.self, forKey: .`required`)
8990
self.array = try container.decodeIfPresent(Bool.self, forKey: .array)
@@ -99,7 +100,7 @@ open class ColumnFloat: Codable {
99100

100101
try container.encode(key, forKey: .key)
101102
try container.encode(type, forKey: .type)
102-
try container.encode(status, forKey: .status)
103+
try container.encode(status.rawValue, forKey: .status)
103104
try container.encode(error, forKey: .error)
104105
try container.encode(`required`, forKey: .`required`)
105106
try container.encodeIfPresent(array, forKey: .array)
@@ -114,7 +115,7 @@ open class ColumnFloat: Codable {
114115
return [
115116
"key": key as Any,
116117
"type": type as Any,
117-
"status": status as Any,
118+
"status": status.rawValue as Any,
118119
"error": error as Any,
119120
"required": `required` as Any,
120121
"array": array as Any,
@@ -130,7 +131,7 @@ open class ColumnFloat: Codable {
130131
return ColumnFloat(
131132
key: map["key"] as! String,
132133
type: map["type"] as! String,
133-
status: map["status"] as! String,
134+
status: ColumnStatus(rawValue: map["status"] as! String)!,
134135
error: map["error"] as! String,
135136
required: map["required"] as! Bool,
136137
array: map["array"] as? Bool,

0 commit comments

Comments
 (0)