-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #434 from vimeo/add-video-status-endpoint
Add the video status endpoint
- Loading branch information
Showing
6 changed files
with
114 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.vimeo.networking2 | ||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
import com.vimeo.networking2.enums.VideoStateType | ||
import com.vimeo.networking2.enums.asEnum | ||
import java.io.Serializable | ||
|
||
/** | ||
* The current status of the video transcoding process. | ||
*/ | ||
@JsonClass(generateAdapter = true) | ||
data class VideoStatus( | ||
/** | ||
* The current state of the transcoding process. | ||
*/ | ||
@Json(name = "state") | ||
val state: String? = null, | ||
|
||
/** | ||
* The percentage of the transcoding process that is complete. | ||
*/ | ||
@Json(name = "progress") | ||
val progress: Int? = null, | ||
|
||
/** | ||
* The remaining time in seconds before transcoding is complete. | ||
*/ | ||
@Json(name = "time_left") | ||
val timeLeft: Long? = null | ||
) : Serializable { | ||
|
||
companion object { | ||
private const val serialVersionUID = -72138L | ||
} | ||
} | ||
|
||
/** | ||
* @see VideoStatus.state | ||
* @see VideoStateType | ||
*/ | ||
val VideoStatus.videoStateType: VideoStateType | ||
get() = state.asEnum(VideoStateType.UNKNOWN) |
39 changes: 39 additions & 0 deletions
39
models/src/main/java/com/vimeo/networking2/enums/VideoStateType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.vimeo.networking2.enums | ||
|
||
/** | ||
* Video transcoding states. | ||
*/ | ||
enum class VideoStateType(override val value: String?): StringValue { | ||
|
||
ACTIVE("active"), | ||
|
||
BLOCKED("blocked"), | ||
|
||
EXCEEDS_QUOTA("exceeds_quota"), | ||
|
||
EXCEEDS_TOTAL_CAP("exceeds_total_cap"), | ||
|
||
FAILED("failed"), | ||
|
||
FINISHING("finishing"), | ||
|
||
INTERNAL_ERROR("internal_error"), | ||
|
||
INVALID_FILE("invalid_file"), | ||
|
||
PENDING("pending"), | ||
|
||
READY("ready"), | ||
|
||
RETRIEVED("retrieved"), | ||
|
||
STANDBY("standby"), | ||
|
||
STARTING("starting"), | ||
|
||
UPLOAD_COMPLETE("upload_complete"), | ||
|
||
UPLOAD_INCOMPLETE("upload_incomplete"), | ||
|
||
UNKNOWN("unknown") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters