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
 */

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct SetPrivilegeRequest {
    /// Name of the database
    #[serde(rename = "database_name", skip_serializing_if = "Option::is_none")]
    pub database_name: Option<String>,
    /// Name of the user
    #[serde(rename = "user_name", skip_serializing_if = "Option::is_none")]
    pub user_name: Option<String>,
    /// Permission to set (Read, Read/Write, All, Custom)
    #[serde(rename = "permission", skip_serializing_if = "Option::is_none")]
    pub permission: Option<Permission>,
}

impl SetPrivilegeRequest {
    pub fn new() -> SetPrivilegeRequest {
        SetPrivilegeRequest {
            database_name: None,
            user_name: None,
            permission: None,
        }
    }
}

/// Permission to set (Read, Read/Write, All, Custom)
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Permission {
    #[serde(rename = "readonly")]
    Readonly,
    #[serde(rename = "readwrite")]
    Readwrite,
    #[serde(rename = "all")]
    All,
    #[serde(rename = "custom")]
    Custom,
    #[serde(rename = "none")]
    None,
}

impl Default for Permission {
    fn default() -> Permission {
        Self::Readonly
    }
}