Skip to content

Commit

Permalink
CXAN-536 Add status of EditSession (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
maksym-ambroskin authored Aug 8, 2023
1 parent f2a5c8d commit f82128a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
15 changes: 14 additions & 1 deletion models/src/main/java/com/vimeo/networking2/EditSession.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package com.vimeo.networking2

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import com.vimeo.networking2.enums.EditSessionStatusType
import com.vimeo.networking2.enums.asEnum

/**
* Information about the Vimeo Create session of a video.
Expand All @@ -14,6 +16,7 @@ import com.squareup.moshi.JsonClass
* @param isRated Whether the video is rated.
* @param minTierForMovie The minimum required Vimeo membership for the user to be able to share or download the video.
* @param isEditedByTve Whether the video has been edited by Transcript Video Editing.
* @param status The status of the video. See [EditSession.statusType]
*/
@JsonClass(generateAdapter = true)
data class EditSession(
Expand All @@ -40,5 +43,15 @@ data class EditSession(
val minTierForMovie: String? = null,

@Json(name = "is_edited_by_tve")
val isEditedByTve: Boolean? = null
val isEditedByTve: Boolean? = null,

@Json(name = "status")
val status: String? = null,
)

/**
* @see EditSession.status
* @see EditSessionStatusType
*/
val EditSession.statusType: EditSessionStatusType
get() = status.asEnum(EditSessionStatusType.UNKNOWN)
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.vimeo.networking2.enums

/**
* The status of the Create Video session.
*/
enum class EditSessionStatusType(override val value: String?) : StringValue {

/**
* The video is in draft stage.
*/
PROCESSING("processing"),

/**
* The video is finished.
*/
DONE("done"),

/**
* Unknown status value.
*/
UNKNOWN(null)
}

0 comments on commit f82128a

Please sign in to comment.