Skip to content

Commit ea96ef3

Browse files
committed
Additional state identifiers
1 parent 20097b0 commit ea96ef3

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

Sources/ATProtoKit/Models/Lexicons/app.bsky/Video/AppBskyVideoDefs.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,41 @@ extension AppBskyLexicon.Video {
6666
/// The job is currently encoding.
6767
case jobStateEncoding = "JOB_STATE_ENCODING"
6868

69+
/// The job is encoded.
70+
case jobStateEncoded = "JOB_STATE_ENCODED"
71+
6972
/// The job is currently scanning.
7073
case jobStateScanning = "JOB_STATE_SCANNING"
7174

7275
/// The job is scanned.
7376
case jobStateScanned = "JOB_STATE_SCANNED"
7477

78+
/// The job is currently uploading.
79+
case jobStateUploading = "JOB_STATE_UPLOADING"
80+
81+
/// The job is uploaded.
82+
case jobStateUploaded = "JOB_STATE_UPLOADED"
83+
7584
/// The job is completed processing.
7685
case jobStateCompleted = "JOB_STATE_COMPLETED"
7786

7887
/// The job failed to complete the processing.
7988
case jobStateFailed = "JOB_STATE_FAILED"
89+
90+
/// A state this version of the lexicon does not name.
91+
///
92+
/// `app.bsky.video.defs` declares `state` as an open set: "All values
93+
/// not listed as a known value indicate that the job is in process."
94+
/// Decoding an unrecognised value as an error fails the whole upload
95+
/// the moment the service reports a state added after this type was
96+
/// written, so anything unknown lands here and callers treat it the
97+
/// same as any other in-progress state.
98+
case jobStateInProcess = "JOB_STATE_IN_PROCESS"
99+
100+
public init(from decoder: any Decoder) throws {
101+
let rawValue = try decoder.singleValueContainer().decode(String.self)
102+
self = State(rawValue: rawValue) ?? .jobStateInProcess
103+
}
80104
}
81105
}
82106
}

0 commit comments

Comments
 (0)