Skip to main content

bitwarden_api_api/models/
pam_rotation_config_detail_response_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/// PamRotationConfigDetailResponseModel : A rotation config with its full job and attempt history.
16#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
17pub struct PamRotationConfigDetailResponseModel {
18    #[serde(
19        rename = "object",
20        alias = "Object",
21        skip_serializing_if = "Option::is_none"
22    )]
23    pub object: Option<String>,
24    #[serde(rename = "id", alias = "Id", skip_serializing_if = "Option::is_none")]
25    pub id: Option<uuid::Uuid>,
26    #[serde(
27        rename = "organizationId",
28        alias = "OrganizationId",
29        skip_serializing_if = "Option::is_none"
30    )]
31    pub organization_id: Option<uuid::Uuid>,
32    #[serde(
33        rename = "cipherId",
34        alias = "CipherId",
35        skip_serializing_if = "Option::is_none"
36    )]
37    pub cipher_id: Option<uuid::Uuid>,
38    #[serde(
39        rename = "targetSystemId",
40        alias = "TargetSystemId",
41        skip_serializing_if = "Option::is_none"
42    )]
43    pub target_system_id: Option<uuid::Uuid>,
44    #[serde(
45        rename = "targetSystemName",
46        alias = "TargetSystemName",
47        skip_serializing_if = "Option::is_none"
48    )]
49    pub target_system_name: Option<String>,
50    #[serde(
51        rename = "targetSystemMethod",
52        alias = "TargetSystemMethod",
53        skip_serializing_if = "Option::is_none"
54    )]
55    pub target_system_method: Option<models::PamTargetSystemMethod>,
56    /// The config's sealed blob.
57    #[serde(
58        rename = "sealedData",
59        alias = "SealedData",
60        skip_serializing_if = "Option::is_none"
61    )]
62    pub sealed_data: Option<String>,
63    /// The content key of the sealed blob, wrapped by the organization key.
64    #[serde(
65        rename = "wrappedKey",
66        alias = "WrappedKey",
67        skip_serializing_if = "Option::is_none"
68    )]
69    pub wrapped_key: Option<String>,
70    /// A Quartz 6-field cron expression evaluated in UTC. Null means no scheduled rotation.
71    #[serde(
72        rename = "scheduleCron",
73        alias = "ScheduleCron",
74        skip_serializing_if = "Option::is_none"
75    )]
76    pub schedule_cron: Option<String>,
77    /// When true, the credential rotates whenever a lease on the cipher ends, however it ended.
78    #[serde(
79        rename = "rotateOnAccessEnd",
80        alias = "RotateOnAccessEnd",
81        skip_serializing_if = "Option::is_none"
82    )]
83    pub rotate_on_access_end: Option<bool>,
84    /// When the config is next due: an automatic target then gets a job, a manual one becomes
85    /// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Response.
86    /// PamRotationConfigResponseModel.AwaitingManualRotation. Null means nothing is due.
87    #[serde(
88        rename = "nextRotationAt",
89        alias = "NextRotationAt",
90        skip_serializing_if = "Option::is_none"
91    )]
92    pub next_rotation_at: Option<String>,
93    /// When false, the config is paused and no rotation is offered for it.
94    #[serde(
95        rename = "enabled",
96        alias = "Enabled",
97        skip_serializing_if = "Option::is_none"
98    )]
99    pub enabled: Option<bool>,
100    /// When the last successful rotation completed. Null until the first success.
101    #[serde(
102        rename = "lastRotationAt",
103        alias = "LastRotationAt",
104        skip_serializing_if = "Option::is_none"
105    )]
106    pub last_rotation_at: Option<String>,
107    /// Whether the config has a pending or claimed job, or a timed-out one the sweep has not yet
108    /// recorded (spec `has_active_job`).
109    #[serde(
110        rename = "hasActiveJob",
111        alias = "HasActiveJob",
112        skip_serializing_if = "Option::is_none"
113    )]
114    pub has_active_job: Option<bool>,
115    /// Gets or sets whether the last job ended badly.
116    #[serde(
117        rename = "lastJobFailed",
118        alias = "LastJobFailed",
119        skip_serializing_if = "Option::is_none"
120    )]
121    pub last_job_failed: Option<bool>,
122    /// An enabled manual-target config that has come due (spec `awaiting_manual_rotation`). An
123    /// operator rotates it out of band and records that via `record-manual`.
124    #[serde(
125        rename = "awaitingManualRotation",
126        alias = "AwaitingManualRotation",
127        skip_serializing_if = "Option::is_none"
128    )]
129    pub awaiting_manual_rotation: Option<bool>,
130    #[serde(
131        rename = "creationDate",
132        alias = "CreationDate",
133        skip_serializing_if = "Option::is_none"
134    )]
135    pub creation_date: Option<String>,
136    #[serde(
137        rename = "revisionDate",
138        alias = "RevisionDate",
139        skip_serializing_if = "Option::is_none"
140    )]
141    pub revision_date: Option<String>,
142    /// Every job recorded against the config, newest first, each with its attempts oldest first.
143    #[serde(
144        rename = "jobs",
145        alias = "Jobs",
146        skip_serializing_if = "Option::is_none"
147    )]
148    pub jobs: Option<Vec<models::PamRotationJobResponseModel>>,
149}
150
151impl PamRotationConfigDetailResponseModel {
152    /// A rotation config with its full job and attempt history.
153    pub fn new() -> PamRotationConfigDetailResponseModel {
154        PamRotationConfigDetailResponseModel {
155            object: None,
156            id: None,
157            organization_id: None,
158            cipher_id: None,
159            target_system_id: None,
160            target_system_name: None,
161            target_system_method: None,
162            sealed_data: None,
163            wrapped_key: None,
164            schedule_cron: None,
165            rotate_on_access_end: None,
166            next_rotation_at: None,
167            enabled: None,
168            last_rotation_at: None,
169            has_active_job: None,
170            last_job_failed: None,
171            awaiting_manual_rotation: None,
172            creation_date: None,
173            revision_date: None,
174            jobs: None,
175        }
176    }
177}