1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Generated by redfish-codegen. Do not modify.
// Author: Ethan D. Twardy <ethan.twardy@gmail.com>
//
// Copyright 2023, Ethan Twardy. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the \"License\");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an \"AS IS\" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

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(Default)]
pub struct Task {
    #[serde(rename = "@odata.context")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub odata_context: Option<models::odata_v4::Context>,
    #[serde(rename = "@odata.etag")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub odata_etag: Option<models::odata_v4::Etag>,
    #[serde(rename = "@odata.id")]
    pub odata_id: models::odata_v4::Id,
    #[serde(rename = "@odata.type")]
    pub odata_type: monostate::MustBe!("#Task.v1_5_1.Task"),
    #[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")]
    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")]
    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>,
}