Skip to main content

bitwarden_api_api/models/
pam_password_policy_request_model.rs

1/*
2 * Bitwarden Internal API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: latest
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12
13use crate::models;
14
15/// PamPasswordPolicyRequestModel : The password-generation constraints an automatic target system's
16/// access connector must satisfy. Embedded in
17/// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Request.RegisterTargetSystemRequestModel
18/// and Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Request.UpdateTargetSystemRequestModel.
19#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
20pub struct PamPasswordPolicyRequestModel {
21    /// The shortest password the access connector may generate.
22    #[serde(rename = "minLength", alias = "MinLength")]
23    pub min_length: i32,
24    /// The longest password the access connector may generate.
25    #[serde(rename = "maxLength", alias = "MaxLength")]
26    pub max_length: i32,
27    /// Whether generated passwords include uppercase letters.
28    #[serde(
29        rename = "includeUppercase",
30        alias = "IncludeUppercase",
31        skip_serializing_if = "Option::is_none"
32    )]
33    pub include_uppercase: Option<bool>,
34    /// Whether generated passwords include lowercase letters.
35    #[serde(
36        rename = "includeLowercase",
37        alias = "IncludeLowercase",
38        skip_serializing_if = "Option::is_none"
39    )]
40    pub include_lowercase: Option<bool>,
41    /// Whether generated passwords include digits.
42    #[serde(
43        rename = "includeDigits",
44        alias = "IncludeDigits",
45        skip_serializing_if = "Option::is_none"
46    )]
47    pub include_digits: Option<bool>,
48    /// Whether generated passwords include symbols.
49    #[serde(
50        rename = "includeSymbols",
51        alias = "IncludeSymbols",
52        skip_serializing_if = "Option::is_none"
53    )]
54    pub include_symbols: Option<bool>,
55}
56
57impl PamPasswordPolicyRequestModel {
58    /// The password-generation constraints an automatic target system's access connector must
59    /// satisfy. Embedded in
60    /// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Request.
61    /// RegisterTargetSystemRequestModel and
62    /// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Request.UpdateTargetSystemRequestModel.
63    pub fn new(min_length: i32, max_length: i32) -> PamPasswordPolicyRequestModel {
64        PamPasswordPolicyRequestModel {
65            min_length,
66            max_length,
67            include_uppercase: None,
68            include_lowercase: None,
69            include_digits: None,
70            include_symbols: None,
71        }
72    }
73}