scaleway_api_rs 0.1.8

Generated library to interact with Scaleway API.
Documentation
/*
 * Account API
 *
 * # Introduction  The Account API allows you to manage projects. Project is Scaleway’s resource management feature. Designed to help you organize your infrastructure and cloud services, the feature allows resources to be isolated and grouped into specific projects.
 *
 * The version of the OpenAPI document: v2
 *
 * Generated by: https://openapi-generator.tech
 */

/// ScalewayInstanceV1ServerPlacementGroup : The server placement group

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ScalewayInstanceV1ServerPlacementGroup {
    /// The placement group unique ID
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// The placement group name
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// The placement group organization ID
    #[serde(rename = "organization", skip_serializing_if = "Option::is_none")]
    pub organization: Option<String>,
    /// The placement group project ID
    #[serde(rename = "project", skip_serializing_if = "Option::is_none")]
    pub project: Option<String>,
    /// The placement group tags
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<String>>,
    /// Select the failling mode when the placement cannot be respected, either optional or enforced
    #[serde(rename = "policy_mode", skip_serializing_if = "Option::is_none")]
    pub policy_mode: Option<PolicyMode>,
    /// Select the behavior of the placement group, either low_latency (group) or max_availability (spread)
    #[serde(rename = "policy_type", skip_serializing_if = "Option::is_none")]
    pub policy_type: Option<PolicyType>,
    /// Returns true if the policy is respected, false otherwise
    #[serde(rename = "policy_respected", skip_serializing_if = "Option::is_none")]
    pub policy_respected: Option<bool>,
    /// The zone in which is the placement group
    #[serde(rename = "zone", skip_serializing_if = "Option::is_none")]
    pub zone: Option<String>,
}

impl ScalewayInstanceV1ServerPlacementGroup {
    /// The server placement group
    pub fn new() -> ScalewayInstanceV1ServerPlacementGroup {
        ScalewayInstanceV1ServerPlacementGroup {
            id: None,
            name: None,
            organization: None,
            project: None,
            tags: None,
            policy_mode: None,
            policy_type: None,
            policy_respected: None,
            zone: None,
        }
    }
}

/// Select the failling mode when the placement cannot be respected, either optional or enforced
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum PolicyMode {
    #[serde(rename = "optional")]
    Optional,
    #[serde(rename = "enforced")]
    Enforced,
}

impl Default for PolicyMode {
    fn default() -> PolicyMode {
        Self::Optional
    }
}
/// Select the behavior of the placement group, either low_latency (group) or max_availability (spread)
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum PolicyType {
    #[serde(rename = "max_availability")]
    MaxAvailability,
    #[serde(rename = "low_latency")]
    LowLatency,
}

impl Default for PolicyType {
    fn default() -> PolicyType {
        Self::MaxAvailability
    }
}