Skip to main content

bitwarden_api_api/models/
update_rotation_config_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/// UpdateRotationConfigRequestModel : The body of `PUT rotation/configs/{id}` (spec
16/// `UpdateRotationConfig`), which replaces the separate settings and account operations. Carries
17/// the config's whole updatable shape: every field is written as sent, so a caller editing one of
18/// them must send the others as they stand rather than omitting them.
19#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
20pub struct UpdateRotationConfigRequestModel {
21    /// The account this config rotates on the target system. Opaque to the server -- never parsed.
22    #[serde(rename = "accountIdentity", alias = "AccountIdentity")]
23    pub account_identity: String,
24    /// When true, the access connector terminates the account's live sessions after each rotation.
25    /// Only an automatic target that supports session termination can honour it.
26    #[serde(
27        rename = "terminateSessions",
28        alias = "TerminateSessions",
29        skip_serializing_if = "Option::is_none"
30    )]
31    pub terminate_sessions: Option<bool>,
32    /// The scheduled-rotation cadence, as a Quartz 6-field cron expression evaluated in UTC. Null
33    /// clears the schedule, leaving the config to rotate on demand and/or on access end only.
34    #[serde(
35        rename = "scheduleCron",
36        alias = "ScheduleCron",
37        skip_serializing_if = "Option::is_none"
38    )]
39    pub schedule_cron: Option<String>,
40    /// When true, the credential is rotated whenever an access lease on the cipher ends, whether
41    /// it expired or was revoked.
42    #[serde(
43        rename = "rotateOnAccessEnd",
44        alias = "RotateOnAccessEnd",
45        skip_serializing_if = "Option::is_none"
46    )]
47    pub rotate_on_access_end: Option<bool>,
48}
49
50impl UpdateRotationConfigRequestModel {
51    /// The body of `PUT rotation/configs/{id}` (spec `UpdateRotationConfig`), which replaces the
52    /// separate settings and account operations. Carries the config's whole updatable shape: every
53    /// field is written as sent, so a caller editing one of them must send the others as they stand
54    /// rather than omitting them.
55    pub fn new(account_identity: String) -> UpdateRotationConfigRequestModel {
56        UpdateRotationConfigRequestModel {
57            account_identity,
58            terminate_sessions: None,
59            schedule_cron: None,
60            rotate_on_access_end: None,
61        }
62    }
63}