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 AccountService schema defines an account service.  The properties are common to, and enable management of, all user accounts.  The properties include the password requirements and control features, such as account lockout.  Properties and actions in this service specify general behavior that should be followed for typical accounts, however implementations may override these behaviors for special accounts or situations to avoid denial of service or other deadlock situations.
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
#[derive(derivative::Derivative)]
#[derivative(Default)]
pub struct AccountService {
    #[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(\"#AccountService.v1_13_0.AccountService\".to_string())"))]
    pub odata_type: models::odata_v4::Type,
    /// The period of time, in seconds, between the last failed login attempt and the reset of the lockout threshold counter.  This value must be less than or equal to the AccountLockoutDuration value.  A reset sets the counter to `0`.
    #[serde(rename = "AccountLockoutCounterResetAfter")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub account_lockout_counter_reset_after: Option<i64>,
    /// An indication of whether the threshold counter is reset after AccountLockoutCounterResetAfter expires.  If `true`, it is reset.  If `false`, only a successful login resets the threshold counter and if the user reaches the AccountLockoutThreshold limit, the account will be locked out indefinitely and only an administrator-issued reset clears the threshold counter.  If this property is absent, the default is `true`.
    #[serde(rename = "AccountLockoutCounterResetEnabled")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub account_lockout_counter_reset_enabled: Option<bool>,
    /// The period of time, in seconds, that an account is locked after the number of failed login attempts reaches the account lockout threshold, within the period between the last failed login attempt and the reset of the lockout threshold counter.  If this value is `0`, no lockout will occur.  If the AccountLockoutCounterResetEnabled value is `false`, this property is ignored.
    #[serde(rename = "AccountLockoutDuration")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub account_lockout_duration: Option<i64>,
    /// The number of allowed failed login attempts before a user account is locked for a specified duration.  If `0`, the account is never locked.
    #[serde(rename = "AccountLockoutThreshold")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub account_lockout_threshold: Option<i64>,
    #[serde(rename = "Accounts")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub accounts: Option<models::odata_v4::IdRef>,
    #[serde(rename = "Actions")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub actions: Option<models::account_service::v1_13_0::Actions>,
    #[serde(rename = "ActiveDirectory")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub active_directory: Option<models::account_service::v1_13_0::ExternalAccountProvider>,
    #[serde(rename = "AdditionalExternalAccountProviders")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub additional_external_account_providers: Option<models::odata_v4::IdRef>,
    /// The number of authorization failures per account that are allowed before the failed attempt is logged to the manager log.
    #[serde(rename = "AuthFailureLoggingThreshold")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub auth_failure_logging_threshold: Option<i64>,
    #[serde(rename = "Description")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<models::resource::Description>,
    #[serde(rename = "Id")]
    #[serde(skip_deserializing)]
    pub id: models::resource::Id,
    #[serde(rename = "LDAP")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ldap: Option<models::account_service::v1_13_0::ExternalAccountProvider>,
    #[serde(rename = "LocalAccountAuth")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub local_account_auth: Option<models::account_service::v1_13_0::LocalAccountAuth>,
    /// The maximum password length for this account service.
    #[serde(rename = "MaxPasswordLength")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub max_password_length: Option<i64>,
    /// The minimum password length for this account service.
    #[serde(rename = "MinPasswordLength")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub min_password_length: Option<i64>,
    #[serde(rename = "MultiFactorAuth")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub multi_factor_auth: Option<models::account_service::v1_13_0::MultiFactorAuth>,
    #[serde(rename = "Name")]
    #[serde(skip_deserializing)]
    pub name: models::resource::Name,
    #[serde(rename = "OAuth2")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub o_auth_2: Option<models::account_service::v1_13_0::ExternalAccountProvider>,
    #[serde(rename = "Oem")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oem: Option<models::resource::Oem>,
    /// The number of days before account passwords in this account service will expire.
    #[serde(rename = "PasswordExpirationDays")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub password_expiration_days: Option<i64>,
    #[serde(rename = "PrivilegeMap")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub privilege_map: Option<models::odata_v4::IdRef>,
    /// The set of restricted OEM privileges.
    #[serde(rename = "RestrictedOemPrivileges")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub restricted_oem_privileges: Option<Vec<String>>,
    /// The set of restricted Redfish privileges.
    #[serde(rename = "RestrictedPrivileges")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub restricted_privileges: Option<Vec<models::privileges::PrivilegeType>>,
    #[serde(rename = "Roles")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub roles: Option<models::odata_v4::IdRef>,
    /// An indication of whether the account service is enabled.  If `true`, it is enabled.  If `false`, it is disabled and users cannot be created, deleted, or modified, and new sessions cannot be started.  However, established sessions might still continue to run.  Any service, such as the session service, that attempts to access the disabled account service fails.  However, this does not affect HTTP Basic Authentication connections.
    #[serde(rename = "ServiceEnabled")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub service_enabled: Option<bool>,
    #[serde(rename = "Status")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<models::resource::Status>,
    /// The account types supported by the service.
    #[serde(rename = "SupportedAccountTypes")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supported_account_types: Option<Vec<models::manager_account::AccountTypes>>,
    /// The OEM account types supported by the service.
    #[serde(rename = "SupportedOEMAccountTypes")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supported_oem_account_types: Option<Vec<String>>,
    #[serde(rename = "TACACSplus")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tacac_splus: Option<models::account_service::v1_13_0::ExternalAccountProvider>,
}

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