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 full updatable shape of a rotation config (spec
16/// `UpdateRotationConfig`). Every field is written as sent, so send unchanged fields as they stand.
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
18pub struct UpdateRotationConfigRequestModel {
19    /// The config's sealed blob.
20    #[serde(rename = "sealedData", alias = "SealedData")]
21    pub sealed_data: String,
22    /// The content key of the sealed blob, wrapped by the organization key.
23    #[serde(rename = "wrappedKey", alias = "WrappedKey")]
24    pub wrapped_key: String,
25    /// A Quartz 6-field cron expression evaluated in UTC. Null clears the schedule.
26    #[serde(
27        rename = "scheduleCron",
28        alias = "ScheduleCron",
29        skip_serializing_if = "Option::is_none"
30    )]
31    pub schedule_cron: Option<String>,
32    /// When true, the credential rotates whenever a lease on the cipher ends, however it ended.
33    #[serde(
34        rename = "rotateOnAccessEnd",
35        alias = "RotateOnAccessEnd",
36        skip_serializing_if = "Option::is_none"
37    )]
38    pub rotate_on_access_end: Option<bool>,
39}
40
41impl UpdateRotationConfigRequestModel {
42    /// The full updatable shape of a rotation config (spec `UpdateRotationConfig`). Every field is
43    /// written as sent, so send unchanged fields as they stand.
44    pub fn new(sealed_data: String, wrapped_key: String) -> UpdateRotationConfigRequestModel {
45        UpdateRotationConfigRequestModel {
46            sealed_data,
47            wrapped_key,
48            schedule_cron: None,
49            rotate_on_access_end: None,
50        }
51    }
52}