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 LogEntry schema defines the record format for a log.  It is designed for Redfish event logs, OEM-specific log formats, and the IPMI System Event Log (SEL).  The EntryType field indicates the type of log and the resource includes several additional properties dependent on the EntryType.
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
#[derive(derivative::Derivative)]
#[derivative(Default)]
pub struct LogEntry {
    #[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(\"#LogEntry.v1_14_0.LogEntry\".to_string())"))]
    pub odata_type: models::odata_v4::Type,
    #[serde(rename = "Actions")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub actions: Option<models::log_entry::v1_14_0::Actions>,
    /// The size of the additional data for the log entry.
    #[serde(rename = "AdditionalDataSizeBytes")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub additional_data_size_bytes: Option<i64>,
    /// The URI at which to access the additional data for the log entry, such as diagnostic data, image captures, or other files.
    #[serde(rename = "AdditionalDataURI")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub additional_data_uri: Option<String>,
    #[serde(rename = "CXLEntryType")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub cxl_entry_type: Option<models::log_entry::v1_14_0::CXLEntryType>,
    /// The date and time when the log entry was created.
    #[serde(rename = "Created")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub created: Option<String>,
    #[serde(rename = "Description")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<models::resource::Description>,
    #[serde(rename = "DiagnosticDataType")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub diagnostic_data_type: Option<models::log_entry::v1_14_0::LogDiagnosticDataTypes>,
    #[serde(rename = "EntryCode")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub entry_code: Option<models::log_entry::v1_14_0::LogEntryCode>,
    #[serde(rename = "EntryType")]
    pub entry_type: models::log_entry::v1_14_0::LogEntryType,
    /// An identifier that correlates events with the same cause.
    #[serde(rename = "EventGroupId")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub event_group_id: Option<i64>,
    /// The unique instance identifier for an event.
    #[serde(rename = "EventId")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub event_id: Option<String>,
    /// The date and time when the event occurred.
    #[serde(rename = "EventTimestamp")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub event_timestamp: Option<String>,
    #[serde(rename = "EventType")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub event_type: Option<models::event::EventType>,
    /// The timestamp of the first overflow captured after this log entry.
    #[serde(rename = "FirstOverflowTimestamp")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub first_overflow_timestamp: Option<String>,
    /// An identifier of the device that has generated the IPMI SEL Event Record.
    #[serde(rename = "GeneratorId")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub generator_id: Option<String>,
    #[serde(rename = "Id")]
    #[serde(skip_deserializing)]
    pub id: models::resource::Id,
    /// The timestamp of the last overflow captured after this log entry.
    #[serde(rename = "LastOverflowTimestamp")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub last_overflow_timestamp: Option<String>,
    #[serde(rename = "Links")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub links: Option<models::log_entry::v1_14_0::Links>,
    /// The message of the log entry.  This property decodes from the entry type.  If the entry type is `Event`, this property contains a message.  If the entry type is `SEL`, this property contains an SEL-specific message.  If the entry type is `CXL`, this property contains a CXL event record.  Otherwise, this property contains an OEM-specific log entry.  In most cases, this property contains the actual log entry.
    #[serde(rename = "Message")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
    /// The arguments for the message.
    #[serde(rename = "MessageArgs")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message_args: Option<Vec<String>>,
    /// The MessageId, event data, or OEM-specific information.  This property decodes from the entry type.  If the entry type is `Event`, this property contains a Redfish Specification-defined MessageId.  If the entry type is `SEL`, this property contains the Event Data.  Otherwise, this property contains OEM-specific information.
    #[serde(rename = "MessageId")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message_id: Option<String>,
    /// The date and time when the log entry was last modified.
    #[serde(rename = "Modified")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub modified: Option<String>,
    #[serde(rename = "Name")]
    #[serde(skip_deserializing)]
    pub name: models::resource::Name,
    /// The OEM-defined type of diagnostic data at the AdditionalDataURI location.
    #[serde(rename = "OEMDiagnosticDataType")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oem_diagnostic_data_type: Option<String>,
    #[serde(rename = "Oem")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oem: Option<models::resource::Oem>,
    /// The OEM-specific entry code, if the LogEntryCode type is `OEM`.
    #[serde(rename = "OemLogEntryCode")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oem_log_entry_code: Option<String>,
    /// The OEM-specific format of the entry.  If the entry type is `Oem`, this property contains more information about the record format from the OEM.
    #[serde(rename = "OemRecordFormat")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oem_record_format: Option<String>,
    /// The OEM-specific sensor type if the sensor type is `OEM`.
    #[serde(rename = "OemSensorType")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oem_sensor_type: Option<String>,
    /// The source of the log entry.
    #[serde(rename = "Originator")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub originator: Option<String>,
    #[serde(rename = "OriginatorType")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub originator_type: Option<models::log_entry::v1_14_0::OriginatorTypes>,
    /// The count of overflow errors that occurred after this log entry.
    #[serde(rename = "OverflowErrorCount")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub overflow_error_count: Option<i64>,
    /// Indicates whether the log entry is persistent across a cold reset of the device.
    #[serde(rename = "Persistency")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub persistency: Option<bool>,
    /// Used to provide suggestions on how to resolve the situation that caused the log entry.
    #[serde(rename = "Resolution")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resolution: Option<String>,
    /// Indicates if the cause of the log entry has been resolved or repaired.
    #[serde(rename = "Resolved")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resolved: Option<bool>,
    /// The IPMI-defined sensor number.
    #[serde(rename = "SensorNumber")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub sensor_number: Option<i64>,
    #[serde(rename = "SensorType")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub sensor_type: Option<models::log_entry::v1_14_0::SensorType>,
    /// Indicates if the log entry has been sent to the service provider.
    #[serde(rename = "ServiceProviderNotified")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub service_provider_notified: Option<bool>,
    #[serde(rename = "Severity")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub severity: Option<models::log_entry::v1_14_0::EventSeverity>,
    /// Indicates this log entry is equivalent to a more specific log entry within the same EventGroupId.
    #[serde(rename = "SpecificEventExistsInGroup")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub specific_event_exists_in_group: Option<bool>,
}

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