babelforce-manager-sdk 0.42.1

Rust SDK for the babelforce manager APIs — auth, user & agent management, call reporting, metrics, and task automations.
Documentation
/*
 * Manager API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 0.0.0-dev
 * Contact: support@babelforce.com
 * Generated by: https://openapi-generator.tech
 */

use crate::gen::manager::models;
use serde::{Deserialize, Serialize};

/// CreateManagedUserRequest : Request body to create a user.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateManagedUserRequest {
    /// The user's initial password; a random one is generated if omitted.
    #[serde(rename = "password", skip_serializing_if = "Option::is_none")]
    pub password: Option<String>,
    /// The user's login email address (unique per account).
    #[serde(rename = "email")]
    pub email: String,
    /// Whether to enable and activate the user immediately.
    #[serde(rename = "activated", skip_serializing_if = "Option::is_none")]
    pub activated: Option<bool>,
    /// A List of Roles which are associated with the current User
    #[serde(rename = "roles")]
    pub roles: Vec<models::AccountRole>,
}

impl CreateManagedUserRequest {
    /// Request body to create a user.
    pub fn new(email: String, roles: Vec<models::AccountRole>) -> CreateManagedUserRequest {
        CreateManagedUserRequest {
            password: None,
            email,
            activated: None,
            roles,
        }
    }
}