redfish-codegen 0.3.1

An unopinionated translation of the Redfish specification into Rust.
Documentation
// Generated by redfish-codegen. Do not modify.

use crate::models;

/// The Task schema contains information about a task that the Redfish Task Service schedules or executes.  Tasks represent operations that take more time than a client typically wants to wait.
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
#[derive(derivative::Derivative)]
#[derivative(Default)]
pub struct Task {
    #[serde(rename = "@odata.context")]
    #[serde(skip_deserializing)]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub odata_context: Option<models::odata_v4::Context>,
    #[serde(rename = "@odata.etag")]
    #[serde(skip_deserializing)]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub odata_etag: Option<models::odata_v4::Etag>,
    #[serde(rename = "@odata.id")]
    #[serde(skip_deserializing)]
    pub odata_id: models::odata_v4::Id,
    #[serde(rename = "@odata.type")]
    #[serde(skip_deserializing)]
    #[derivative(Default(value = "models::odata_v4::Type(\"#Task.v1_5_1.Task\".to_string())"))]
    pub odata_type: models::odata_v4::Type,
    #[serde(rename = "Actions")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub actions: Option<models::task::v1_5_1::Actions>,
    #[serde(rename = "Description")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<models::resource::Description>,
    /// The date and time when the task was completed.  This property will only appear when the task is complete.
    #[serde(rename = "EndTime")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end_time: Option<String>,
    /// An indication of whether the contents of the payload are hidden from view after the task has been created.  If `true`, responses do not return the payload.  If `false`, responses return the payload.  If this property is not present when the task is created, the default is `false`.
    #[serde(rename = "HidePayload")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub hide_payload: Option<bool>,
    #[serde(rename = "Id")]
    #[serde(skip_deserializing)]
    pub id: models::resource::Id,
    /// An array of messages associated with the task.
    #[serde(rename = "Messages")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub messages: Option<Vec<models::message::Message>>,
    #[serde(rename = "Name")]
    #[serde(skip_deserializing)]
    pub name: models::resource::Name,
    #[serde(rename = "Oem")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oem: Option<models::resource::Oem>,
    #[serde(rename = "Payload")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub payload: Option<models::task::v1_5_1::Payload>,
    /// The completion percentage of this task.
    #[serde(rename = "PercentComplete")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub percent_complete: Option<i64>,
    /// The date and time when the task was started.
    #[serde(rename = "StartTime")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start_time: Option<String>,
    #[serde(rename = "SubTasks")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub sub_tasks: Option<models::odata_v4::IdRef>,
    /// The URI of the Task Monitor for this task.
    #[serde(rename = "TaskMonitor")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub task_monitor: Option<String>,
    #[serde(rename = "TaskState")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub task_state: Option<models::task::v1_5_1::TaskState>,
    #[serde(rename = "TaskStatus")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub task_status: Option<models::resource::Health>,
}

impl crate::Metadata<'static> for Task {
    const JSON_SCHEMA: &'static str = "Task.v1_5_1.json";
}