@@ -17,14 +17,13 @@ open class Presences: Service {
1717 /// - total: Bool (optional)
1818 /// - ttl: Int (optional)
1919 /// - Throws: Exception if the request fails
20- /// - Returns: AppwriteModels.PresenceList<T>
20+ /// - Returns: AppwriteModels.PresenceList
2121 ///
22- open func list< T > (
22+ open func list(
2323 queries: [ String ] ? = nil ,
2424 total: Bool ? = nil ,
25- ttl: Int ? = nil ,
26- nestedType: T . Type
27- ) async throws -> AppwriteModels . PresenceList < T > {
25+ ttl: Int ? = nil
26+ ) async throws -> AppwriteModels . PresenceList {
2827 let apiPath : String = " /presences "
2928
3029 let apiParams : [ String : Any ? ] = [
@@ -35,7 +34,7 @@ open class Presences: Service {
3534
3635 let apiHeaders : [ String : String ] = [ : ]
3736
38- let converter : ( Any ) throws -> AppwriteModels . PresenceList < T > = { response in
37+ let converter : ( Any ) throws -> AppwriteModels . PresenceList = { response in
3938 return AppwriteModels . PresenceList. from ( map: response as! [ String : Any ] )
4039 }
4140
@@ -48,30 +47,6 @@ open class Presences: Service {
4847 )
4948 }
5049
51- ///
52- /// List presence logs. Expired entries are filtered out automatically.
53- ///
54- ///
55- /// - Parameters:
56- /// - queries: [String] (optional)
57- /// - total: Bool (optional)
58- /// - ttl: Int (optional)
59- /// - Throws: Exception if the request fails
60- /// - Returns: AppwriteModels.PresenceList<T>
61- ///
62- open func list(
63- queries: [ String ] ? = nil ,
64- total: Bool ? = nil ,
65- ttl: Int ? = nil
66- ) async throws -> AppwriteModels . PresenceList < [ String : AnyCodable ] > {
67- return try await list (
68- queries: queries,
69- total: total,
70- ttl: ttl,
71- nestedType: [ String : AnyCodable ] . self
72- )
73- }
74-
7550 ///
7651 /// Get a presence log by its unique ID. Entries whose `expiresAt` is in the
7752 /// past are treated as not found.
@@ -80,20 +55,19 @@ open class Presences: Service {
8055 /// - Parameters:
8156 /// - presenceId: String
8257 /// - Throws: Exception if the request fails
83- /// - Returns: AppwriteModels.Presence<T>
58+ /// - Returns: AppwriteModels.Presence
8459 ///
85- open func get< T> (
86- presenceId: String ,
87- nestedType: T . Type
88- ) async throws -> AppwriteModels . Presence < T > {
60+ open func get(
61+ presenceId: String
62+ ) async throws -> AppwriteModels . Presence {
8963 let apiPath : String = " /presences/{presenceId} "
9064 . replacingOccurrences ( of: " {presenceId} " , with: presenceId)
9165
9266 let apiParams : [ String : Any ] = [ : ]
9367
9468 let apiHeaders : [ String : String ] = [ : ]
9569
96- let converter : ( Any ) throws -> AppwriteModels . Presence < T > = { response in
70+ let converter : ( Any ) throws -> AppwriteModels . Presence = { response in
9771 return AppwriteModels . Presence. from ( map: response as! [ String : Any ] )
9872 }
9973
@@ -106,25 +80,6 @@ open class Presences: Service {
10680 )
10781 }
10882
109- ///
110- /// Get a presence log by its unique ID. Entries whose `expiresAt` is in the
111- /// past are treated as not found.
112- ///
113- ///
114- /// - Parameters:
115- /// - presenceId: String
116- /// - Throws: Exception if the request fails
117- /// - Returns: AppwriteModels.Presence<T>
118- ///
119- open func get(
120- presenceId: String
121- ) async throws -> AppwriteModels . Presence < [ String : AnyCodable ] > {
122- return try await get (
123- presenceId: presenceId,
124- nestedType: [ String : AnyCodable ] . self
125- )
126- }
127-
12883 ///
12984 /// Create or update a presence log by its user ID.
13085 ///
@@ -136,16 +91,15 @@ open class Presences: Service {
13691 /// - expiresAt: String (optional)
13792 /// - metadata: Any (optional)
13893 /// - Throws: Exception if the request fails
139- /// - Returns: AppwriteModels.Presence<T>
94+ /// - Returns: AppwriteModels.Presence
14095 ///
141- open func upsert< T > (
96+ open func upsert(
14297 presenceId: String ,
14398 status: String ,
14499 permissions: [ String ] ? = nil ,
145100 expiresAt: String ? = nil ,
146- metadata: Any ? = nil ,
147- nestedType: T . Type
148- ) async throws -> AppwriteModels . Presence < T > {
101+ metadata: Any ? = nil
102+ ) async throws -> AppwriteModels . Presence {
149103 let apiPath : String = " /presences/{presenceId} "
150104 . replacingOccurrences ( of: " {presenceId} " , with: presenceId)
151105
@@ -160,7 +114,7 @@ open class Presences: Service {
160114 " content-type " : " application/json "
161115 ]
162116
163- let converter : ( Any ) throws -> AppwriteModels . Presence < T > = { response in
117+ let converter : ( Any ) throws -> AppwriteModels . Presence = { response in
164118 return AppwriteModels . Presence. from ( map: response as! [ String : Any ] )
165119 }
166120
@@ -173,36 +127,6 @@ open class Presences: Service {
173127 )
174128 }
175129
176- ///
177- /// Create or update a presence log by its user ID.
178- ///
179- ///
180- /// - Parameters:
181- /// - presenceId: String
182- /// - status: String
183- /// - permissions: [String] (optional)
184- /// - expiresAt: String (optional)
185- /// - metadata: Any (optional)
186- /// - Throws: Exception if the request fails
187- /// - Returns: AppwriteModels.Presence<T>
188- ///
189- open func upsert(
190- presenceId: String ,
191- status: String ,
192- permissions: [ String ] ? = nil ,
193- expiresAt: String ? = nil ,
194- metadata: Any ? = nil
195- ) async throws -> AppwriteModels . Presence < [ String : AnyCodable ] > {
196- return try await upsert (
197- presenceId: presenceId,
198- status: status,
199- permissions: permissions,
200- expiresAt: expiresAt,
201- metadata: metadata,
202- nestedType: [ String : AnyCodable ] . self
203- )
204- }
205-
206130 ///
207131 /// Update a presence log by its unique ID. Using the patch method you can pass
208132 /// only specific fields that will get updated.
@@ -216,17 +140,16 @@ open class Presences: Service {
216140 /// - permissions: [String] (optional)
217141 /// - purge: Bool (optional)
218142 /// - Throws: Exception if the request fails
219- /// - Returns: AppwriteModels.Presence<T>
143+ /// - Returns: AppwriteModels.Presence
220144 ///
221- open func update< T > (
145+ open func update(
222146 presenceId: String ,
223147 status: String ? = nil ,
224148 expiresAt: String ? = nil ,
225149 metadata: Any ? = nil ,
226150 permissions: [ String ] ? = nil ,
227- purge: Bool ? = nil ,
228- nestedType: T . Type
229- ) async throws -> AppwriteModels . Presence < T > {
151+ purge: Bool ? = nil
152+ ) async throws -> AppwriteModels . Presence {
230153 let apiPath : String = " /presences/{presenceId} "
231154 . replacingOccurrences ( of: " {presenceId} " , with: presenceId)
232155
@@ -242,7 +165,7 @@ open class Presences: Service {
242165 " content-type " : " application/json "
243166 ]
244167
245- let converter : ( Any ) throws -> AppwriteModels . Presence < T > = { response in
168+ let converter : ( Any ) throws -> AppwriteModels . Presence = { response in
246169 return AppwriteModels . Presence. from ( map: response as! [ String : Any ] )
247170 }
248171
@@ -255,40 +178,6 @@ open class Presences: Service {
255178 )
256179 }
257180
258- ///
259- /// Update a presence log by its unique ID. Using the patch method you can pass
260- /// only specific fields that will get updated.
261- ///
262- ///
263- /// - Parameters:
264- /// - presenceId: String
265- /// - status: String (optional)
266- /// - expiresAt: String (optional)
267- /// - metadata: Any (optional)
268- /// - permissions: [String] (optional)
269- /// - purge: Bool (optional)
270- /// - Throws: Exception if the request fails
271- /// - Returns: AppwriteModels.Presence<T>
272- ///
273- open func update(
274- presenceId: String ,
275- status: String ? = nil ,
276- expiresAt: String ? = nil ,
277- metadata: Any ? = nil ,
278- permissions: [ String ] ? = nil ,
279- purge: Bool ? = nil
280- ) async throws -> AppwriteModels . Presence < [ String : AnyCodable ] > {
281- return try await update (
282- presenceId: presenceId,
283- status: status,
284- expiresAt: expiresAt,
285- metadata: metadata,
286- permissions: permissions,
287- purge: purge,
288- nestedType: [ String : AnyCodable ] . self
289- )
290- }
291-
292181 ///
293182 /// Delete a presence log by its unique ID.
294183 ///
0 commit comments