@@ -28,8 +28,7 @@ extension Twift {
2828 queryItems += fieldsAndExpansions ( for: Tweet . self, fields: fields, expansions: expansions)
2929
3030 return try await call ( route: . listTweets( listId) ,
31- queryItems: queryItems,
32- expectedReturnType: TwitterAPIDataIncludesAndMeta . self)
31+ queryItems: queryItems)
3332 }
3433
3534 // MARK: List Lookup
@@ -48,8 +47,7 @@ extension Twift {
4847 ) async throws -> TwitterAPIDataAndIncludes < List , List . Includes > {
4948 return try await call ( route: . list( listId) ,
5049 method: . GET,
51- queryItems: fieldsAndExpansions ( for: List . self, fields: fields, expansions: expansions) ,
52- expectedReturnType: TwitterAPIDataAndIncludes . self)
50+ queryItems: fieldsAndExpansions ( for: List . self, fields: fields, expansions: expansions) )
5351 }
5452
5553 /// Returns all Lists owned by the specified user.
@@ -77,8 +75,7 @@ extension Twift {
7775 queryItems += fieldsAndExpansions ( for: List . self, fields: fields, expansions: expansions)
7876
7977 return try await call ( route: . userOwnedLists( userId) ,
80- queryItems: queryItems,
81- expectedReturnType: TwitterAPIDataIncludesAndMeta . self)
78+ queryItems: queryItems)
8279 }
8380
8481 // MARK: Manage Lists
@@ -87,7 +84,7 @@ extension Twift {
8784 /// - Parameter listId: The ID of the List to be deleted.
8885 /// - Returns: A response object containing the result of the delete request
8986 public func deleteList( _ listId: List . ID ) async throws -> TwitterAPIData < DeleteResponse > {
90- return try await call ( route: . list( listId) , method: . DELETE, expectedReturnType : TwitterAPIData . self )
87+ return try await call ( route: . list( listId) , method: . DELETE)
9188 }
9289
9390 /// Enables the authenticated user to create a new List.
@@ -111,8 +108,7 @@ extension Twift {
111108 let serializedBody = try JSONSerialization . data ( withJSONObject: body)
112109 return try await call ( route: . createList,
113110 method: . POST,
114- body: serializedBody,
115- expectedReturnType: TwitterAPIData . self)
111+ body: serializedBody)
116112 }
117113
118114 /// Enables the authenticated user to create a new List.
@@ -134,8 +130,7 @@ extension Twift {
134130 let serializedBody = try JSONSerialization . data ( withJSONObject: body)
135131 return try await call ( route: . list( id) ,
136132 method: . PUT,
137- body: serializedBody,
138- expectedReturnType: TwitterAPIData . self)
133+ body: serializedBody)
139134 }
140135
141136}
@@ -168,8 +163,7 @@ extension Twift {
168163 queryItems += fieldsAndExpansions ( for: List . self, fields: fields, expansions: expansions)
169164
170165 return try await call ( route: . userListMemberships( userId) ,
171- queryItems: queryItems,
172- expectedReturnType: TwitterAPIDataIncludesAndMeta . self)
166+ queryItems: queryItems)
173167 }
174168
175169 /// Returns a list of users who are members of the specified List.
@@ -197,8 +191,7 @@ extension Twift {
197191 queryItems += fieldsAndExpansions ( for: User . self, fields: fields, expansions: expansions)
198192
199193 return try await call ( route: . listMembers( listId) ,
200- queryItems: queryItems,
201- expectedReturnType: TwitterAPIDataIncludesAndMeta . self)
194+ queryItems: queryItems)
202195 }
203196
204197 /// Enables the authenticated user to remove a member from a List they own.
@@ -208,8 +201,7 @@ extension Twift {
208201 /// - Returns: A response object containing the result of this delete request
209202 public func deleteListMember( _ userId: User . ID , from listId: List . ID ) async throws -> TwitterAPIData < ListMembershipResponse > {
210203 return try await call ( route: . removeListMember( listId, userId: userId) ,
211- method: . DELETE,
212- expectedReturnType: TwitterAPIData . self)
204+ method: . DELETE)
213205 }
214206
215207 /// Enables the authenticated user to add a member to a List they own.
@@ -222,8 +214,7 @@ extension Twift {
222214 let serializedBody = try JSONSerialization . data ( withJSONObject: body)
223215 return try await call ( route: . listMembers( listId) ,
224216 method: . POST,
225- body: serializedBody,
226- expectedReturnType: TwitterAPIData . self)
217+ body: serializedBody)
227218 }
228219}
229220
@@ -243,8 +234,7 @@ extension Twift {
243234 /// - Returns: A response object containing the result of the unfollow request
244235 public func unfollowList( _ listId: List . ID , userId: User . ID ) async throws -> TwitterAPIData < FollowResponse > {
245236 return try await call ( route: . userFollowingLists( userId, listId: listId) ,
246- method: . DELETE,
247- expectedReturnType: TwitterAPIData . self)
237+ method: . DELETE)
248238 }
249239
250240 /// Enables the authenticated user to follow a List.
@@ -258,8 +248,7 @@ extension Twift {
258248
259249 return try await call ( route: . userFollowingLists( userId) ,
260250 method: . POST,
261- body: serializedBody,
262- expectedReturnType: TwitterAPIData . self)
251+ body: serializedBody)
263252 }
264253
265254 /// Returns a list of users who are followers of the specified List.
@@ -286,8 +275,7 @@ extension Twift {
286275
287276 return try await call ( route: . listFollowers( listId) ,
288277 method: . GET,
289- queryItems: queryItems,
290- expectedReturnType: TwitterAPIDataIncludesAndMeta . self)
278+ queryItems: queryItems)
291279 }
292280
293281 /// Returns all Lists a specified user follows.
@@ -315,8 +303,7 @@ extension Twift {
315303
316304 return try await call ( route: . userFollowingLists( userId) ,
317305 method: . GET,
318- queryItems: queryItems,
319- expectedReturnType: TwitterAPIDataIncludesAndMeta . self)
306+ queryItems: queryItems)
320307 }
321308}
322309
@@ -333,8 +320,7 @@ extension Twift {
333320 let serializedBody = try JSONSerialization . data ( withJSONObject: body)
334321 return try await call ( route: . userPinnedLists( userId) ,
335322 method: . POST,
336- body: serializedBody,
337- expectedReturnType: TwitterAPIData . self)
323+ body: serializedBody)
338324 }
339325
340326 /// Enables the authenticated user to unpin a List.
@@ -346,8 +332,7 @@ extension Twift {
346332 /// - Returns: A response object containing the result of this unpin list request
347333 public func unpinList( _ listId: List . ID , userId: User . ID ) async throws -> TwitterAPIData < PinnedResponse > {
348334 return try await call ( route: . userPinnedLists( userId, listId: listId) ,
349- method: . DELETE,
350- expectedReturnType: TwitterAPIData . self)
335+ method: . DELETE)
351336 }
352337
353338 /// Returns all Lists a specified user has pinned.
@@ -362,8 +347,7 @@ extension Twift {
362347 ) async throws -> TwitterAPIDataAndIncludes < [ List ] , List . Includes > {
363348 return try await call ( route: . userPinnedLists( userId) ,
364349 method: . GET,
365- queryItems: fieldsAndExpansions ( for: List . self, fields: fields, expansions: expansions) ,
366- expectedReturnType: TwitterAPIDataAndIncludes . self)
350+ queryItems: fieldsAndExpansions ( for: List . self, fields: fields, expansions: expansions) )
367351 }
368352}
369353
0 commit comments