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 Certificate schema describes a certificate that proves the identify of a component, account, or service.
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
#[derive(derivative::Derivative)]
#[derivative(Default)]
pub struct Certificate {
    #[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(\"#Certificate.v1_6_0.Certificate\".to_string())"))]
    pub odata_type: models::odata_v4::Type,
    #[serde(rename = "Actions")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub actions: Option<models::certificate::v1_6_0::Actions>,
    /// The string for the certificate.
    #[serde(rename = "CertificateString")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub certificate_string: Option<String>,
    #[serde(rename = "CertificateType")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub certificate_type: Option<models::certificate::CertificateType>,
    /// The types or purposes for this certificate.
    #[serde(rename = "CertificateUsageTypes")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub certificate_usage_types: Option<Vec<models::certificate::v1_6_0::CertificateUsageType>>,
    #[serde(rename = "Description")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<models::resource::Description>,
    /// The fingerprint of the certificate.
    #[serde(rename = "Fingerprint")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub fingerprint: Option<String>,
    /// The hash algorithm for the fingerprint of the certificate.
    #[serde(rename = "FingerprintHashAlgorithm")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub fingerprint_hash_algorithm: Option<String>,
    #[serde(rename = "Id")]
    #[serde(skip_deserializing)]
    pub id: models::resource::Id,
    #[serde(rename = "Issuer")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub issuer: Option<models::certificate::v1_6_0::Identifier>,
    /// The key usage extension, which defines the purpose of the public keys in this certificate.
    #[serde(rename = "KeyUsage")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub key_usage: Option<Vec<models::certificate::KeyUsage>>,
    #[serde(rename = "Links")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub links: Option<models::certificate::v1_6_0::Links>,
    #[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 = "SPDM")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub spdm: Option<models::certificate::v1_6_0::SPDM>,
    /// The serial number of the certificate.
    #[serde(rename = "SerialNumber")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub serial_number: Option<String>,
    /// The algorithm used for creating the signature of the certificate.
    #[serde(rename = "SignatureAlgorithm")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub signature_algorithm: Option<String>,
    #[serde(rename = "Subject")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub subject: Option<models::certificate::v1_6_0::Identifier>,
    /// The UEFI signature owner for this certificate.
    #[serde(rename = "UefiSignatureOwner")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub uefi_signature_owner: Option<String>,
    /// The date when the certificate is no longer valid.
    #[serde(rename = "ValidNotAfter")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub valid_not_after: Option<String>,
    /// The date when the certificate becomes valid.
    #[serde(rename = "ValidNotBefore")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub valid_not_before: Option<String>,
}

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