//
// VideoStatusIngest.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//

import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif

/** Details about the capturing, transferring, and storing of your video for use immediately or in the future. */
public struct VideoStatusIngest: Codable, Hashable {

    public enum Status: String, Codable, CaseIterable {
        case missing = "missing"
        case uploading = "uploading"
        case uploaded = "uploaded"
    }
    /** There are three possible ingest statuses. missing - you are missing information required to ingest the video. uploading - the video is in the process of being uploaded. uploaded - the video is ready for use. */
    public var status: Status?
    /** The size of your file in bytes. */
    public var filesize: Int?
    /** The total number of bytes received, listed for each chunk of the upload. */
    public var receivedBytes: [BytesRange]?
    public var receivedParts: VideoStatusIngestReceivedParts?

    public init(status: Status? = nil, filesize: Int? = nil, receivedBytes: [BytesRange]? = nil, receivedParts: VideoStatusIngestReceivedParts? = nil) {
        self.status = status
        self.filesize = filesize
        self.receivedBytes = receivedBytes
        self.receivedParts = receivedParts
    }

    public enum CodingKeys: String, CodingKey, CaseIterable {
        case status
        case filesize
        case receivedBytes
        case receivedParts
    }

    // Encodable protocol methods

    public func encode(to encoder: Encoder) throws {
        var container = encoder.container(keyedBy: CodingKeys.self)
        try container.encodeIfPresent(status, forKey: .status)
        try container.encodeIfPresent(filesize, forKey: .filesize)
        try container.encodeIfPresent(receivedBytes, forKey: .receivedBytes)
        try container.encodeIfPresent(receivedParts, forKey: .receivedParts)
    }
}

