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 AllowDeny schema represents a set of allow or deny configurations.
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
#[derive(derivative::Derivative)]
#[derivative(Default)]
pub struct AllowDeny {
    #[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(\"#AllowDeny.v1_0_0.AllowDeny\".to_string())"))]
    pub odata_type: models::odata_v4::Type,
    #[serde(rename = "Actions")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub actions: Option<models::allow_deny::v1_0_0::Actions>,
    #[serde(rename = "AllowType")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub allow_type: Option<models::allow_deny::v1_0_0::AllowType>,
    #[serde(rename = "Description")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<models::resource::Description>,
    /// The TCP, UDP, or other destination port to which this rule begins to application, inclusive.
    #[serde(rename = "DestinationPortLower")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub destination_port_lower: Option<i64>,
    /// The TCP, UDP, or other destination port to which this rule ends application, inclusive.
    #[serde(rename = "DestinationPortUpper")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub destination_port_upper: Option<i64>,
    #[serde(rename = "Direction")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub direction: Option<models::allow_deny::v1_0_0::DataDirection>,
    /// The IANA protocol number to which this permission applies.  For TCP, this is `6`.  For UDP, this is `17`.
    #[serde(rename = "IANAProtocolNumber")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub iana_protocol_number: Option<i64>,
    /// The lower IP address to which this permission applies.
    #[serde(rename = "IPAddressLower")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ip_address_lower: Option<String>,
    #[serde(rename = "IPAddressType")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ip_address_type: Option<models::allow_deny::v1_0_0::IPAddressType>,
    /// The upper IP address to which this permission applies.
    #[serde(rename = "IPAddressUpper")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ip_address_upper: Option<String>,
    #[serde(rename = "Id")]
    #[serde(skip_deserializing)]
    pub id: models::resource::Id,
    #[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>,
    /// The TCP, UDP, or other source port to which this rule begins application, inclusive.
    #[serde(rename = "SourcePortLower")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub source_port_lower: Option<i64>,
    /// The TCP, UDP or other source port to which this rule ends application, inclusive.
    #[serde(rename = "SourcePortUpper")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub source_port_upper: Option<i64>,
    /// Indicates if this is a permission that only applies to stateful connection.
    #[serde(rename = "StatefulSession")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub stateful_session: Option<bool>,
}

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