Skip to main content

bitwarden_api_api/models/
update_target_system_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/// UpdateTargetSystemRequestModel : The body of `PUT rotation/target-systems/{id}` (spec
16/// `UpdateAutomaticTargetSystem` / `UpdateManualTargetSystem`), which replaces the separate rename
17/// and policy operations. Carries the target's whole updatable shape: every field is written as
18/// sent, so a caller editing one of them must send the others as they stand rather than omitting
19/// them. The target's method and kind are fixed at registration and cannot be updated here.
20#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
21pub struct UpdateTargetSystemRequestModel {
22    /// The target system's display name.
23    #[serde(rename = "name", alias = "Name")]
24    pub name: String,
25    #[serde(
26        rename = "passwordPolicy",
27        alias = "PasswordPolicy",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub password_policy: Option<Box<models::PamPasswordPolicyRequestModel>>,
31    /// Whether the integration can terminate the account's live sessions after a rotation; gates
32    /// whether rotation configs on this target may request session termination.
33    #[serde(
34        rename = "supportsSessionTermination",
35        alias = "SupportsSessionTermination",
36        skip_serializing_if = "Option::is_none"
37    )]
38    pub supports_session_termination: Option<bool>,
39}
40
41impl UpdateTargetSystemRequestModel {
42    /// The body of `PUT rotation/target-systems/{id}` (spec `UpdateAutomaticTargetSystem` /
43    /// `UpdateManualTargetSystem`), which replaces the separate rename and policy operations.
44    /// Carries the target's whole updatable shape: every field is written as sent, so a caller
45    /// editing one of them must send the others as they stand rather than omitting them. The
46    /// target's method and kind are fixed at registration and cannot be updated here.
47    pub fn new(name: String) -> UpdateTargetSystemRequestModel {
48        UpdateTargetSystemRequestModel {
49            name,
50            password_policy: None,
51            supports_session_termination: None,
52        }
53    }
54}