You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Allows the user to provide additional information about the uploaded `mediaId`. This feature is currently only supported for images and GIFs.
16
+
/// Allows the user to provide alt text for the `mediaId`. This feature is currently only supported for images and GIFs.
17
17
///
18
18
/// Usage:
19
19
/// 1. Upload media using the `upload(mediaData)` method
@@ -53,6 +53,9 @@ extension Twift {
53
53
}
54
54
}
55
55
56
+
/// Checks to see whether the `mediaId` has finished processing successfully. This method will wait for the `GET /1.1/media/upload.json?command=STATUS` endpoint to return either `succeeded` or `failed`; for large videos, this may take some time.
57
+
/// - Parameter mediaId: The media ID to check the upload status of
58
+
/// - Returns: A `Bool` indicating whether the media has uploaded successfully (`true`) or not (`false`).
/// A response object containing information about the uploaded media
220
224
publicstructMediaUploadResponse:Codable{
225
+
/// The uploaded media's unique Integer ID
221
226
publicletmediaId:Int
227
+
228
+
/// The uploaded media's ID represented as a `String`. The string representation of the ID is preferred for ensuring precision.
222
229
publicletmediaIdString:String
230
+
231
+
/// The size of the uploaded media
223
232
publicletsize:Int?
233
+
234
+
/// When this media upload will expire, if not attached to a Tweet
224
235
publicletexpiresAfterSecs:Int?
236
+
237
+
/// Information about the media's processing status. Most images are processed instantly, but large gifs and videos may take longer to process before they can be used in a Tweet.
238
+
///
239
+
/// Use the ``Twift.checkMediaUploadSuccessful()`` method to wait until the media is successfully processed.
225
240
publicletprocessingInfo:MediaProcessingInfo?
226
241
242
+
/// An object containing information about the media's processing status.
227
243
publicstructMediaProcessingInfo:Codable{
244
+
/// The current processing state of the media
228
245
publicletstate:State
246
+
247
+
/// How many seconds the user is advised to wait before checking the status of the media again
229
248
publicletcheckAfterSecs:Int?
249
+
250
+
/// The percent completion of the media processing
230
251
publicletprogressPercent:Int?
252
+
253
+
/// Any errors that caused the media processing to fail
231
254
publicleterror:ProcessingError?
232
255
233
256
publicenumState:String,Codable{
257
+
/// The media is queued to be processed
234
258
case pending
259
+
260
+
/// The media is currently being processed
235
261
case inProgress ="in_progress"
262
+
263
+
/// The media could not be processed
236
264
case failed
265
+
266
+
/// The media was successfully processed and is ready to be attached to a Tweet
0 commit comments