windmill_api/models/create_service_account_request.rs
1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.723.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct CreateServiceAccountRequest {
16 #[serde(rename = "username")]
17 pub username: String,
18 /// Grant the service account workspace admin. Defaults to false. Cannot be combined with operator=true.
19 #[serde(rename = "is_admin", skip_serializing_if = "Option::is_none")]
20 pub is_admin: Option<bool>,
21 /// Make the service account an operator. Defaults to true for backward compatibility. Set to false to count as a developer (1 seat) instead of 0.5 seat.
22 #[serde(rename = "operator", skip_serializing_if = "Option::is_none")]
23 pub operator: Option<bool>,
24 /// Add the service account to the workspace `wm_deployers` group on creation. Recommended when the account will be used as a CLI sync / CI deploy identity so it can deploy on behalf of other users.
25 #[serde(rename = "add_to_deployers", skip_serializing_if = "Option::is_none")]
26 pub add_to_deployers: Option<bool>,
27}
28
29impl CreateServiceAccountRequest {
30 pub fn new(username: String) -> CreateServiceAccountRequest {
31 CreateServiceAccountRequest {
32 username,
33 is_admin: None,
34 operator: None,
35 add_to_deployers: None,
36 }
37 }
38}
39