use super::super::ResultStatus;

use crate::api::v3;

/// A raw Result object.
#[derive(Debug, Clone, Default)]
pub struct Raw {
    /// The session ID.
    pub session_id: String,
    /// The result name. Given by the client.
    pub name: String,
    /// The owner task ID.
    pub owner_task_id: String,
    /// The result status.
    pub status: ResultStatus,
    /// The result creation date.
    pub created_at: Option<prost_types::Timestamp>,
    /// The result completion date.
    pub completed_at: Option<prost_types::Timestamp>,
    /// The result ID. Uniquely generated by the server.
    pub result_id: String,
    /// The size of the Result Data.
    pub size: i64,
    /// The ID of the Task that as submitted this result.
    pub created_by: String,
}

super::super::impl_convert!(
    struct Raw = v3::results::ResultRaw {
        session_id,
        name,
        owner_task_id,
        status = enum status,
        created_at,
        completed_at,
        result_id,
        size,
        created_by,
    }
);
