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's detail view: the list shape flattened
16/// onto the same object, plus the config's full job/attempt history. The managed-credential surface
17/// renders its header from the config fields and the history section from
18/// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Response.
19/// PamRotationConfigDetailResponseModel.Jobs, so both arrive in one response -- the same shape
20/// Bit.Services.Pam.AccessConnector.Api.Models.Response.PamAccessConnectorDetailResponseModel
21/// returns for an access connector.
22#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
23pub struct PamRotationConfigDetailResponseModel {
24    #[serde(
25        rename = "object",
26        alias = "Object",
27        skip_serializing_if = "Option::is_none"
28    )]
29    pub object: Option<String>,
30    /// The rotation config's unique identifier.
31    #[serde(rename = "id", alias = "Id", skip_serializing_if = "Option::is_none")]
32    pub id: Option<uuid::Uuid>,
33    /// The organization this config belongs to.
34    #[serde(
35        rename = "organizationId",
36        alias = "OrganizationId",
37        skip_serializing_if = "Option::is_none"
38    )]
39    pub organization_id: Option<uuid::Uuid>,
40    /// The organization cipher holding the credential this config rotates.
41    #[serde(
42        rename = "cipherId",
43        alias = "CipherId",
44        skip_serializing_if = "Option::is_none"
45    )]
46    pub cipher_id: Option<uuid::Uuid>,
47    /// The target system the rotated account lives on.
48    #[serde(
49        rename = "targetSystemId",
50        alias = "TargetSystemId",
51        skip_serializing_if = "Option::is_none"
52    )]
53    pub target_system_id: Option<uuid::Uuid>,
54    /// The target system's display name, joined in rather than nested: a config list renders a row
55    /// per config, and the target's own view carries a policy and a status a row has no use for.
56    /// It is a copy, so it reflects the target as of the read.
57    #[serde(
58        rename = "targetSystemName",
59        alias = "TargetSystemName",
60        skip_serializing_if = "Option::is_none"
61    )]
62    pub target_system_name: Option<String>,
63    #[serde(
64        rename = "targetSystemMethod",
65        alias = "TargetSystemMethod",
66        skip_serializing_if = "Option::is_none"
67    )]
68    pub target_system_method: Option<models::PamTargetSystemMethod>,
69    /// The account this config rotates on the target system. Opaque to the server -- never parsed;
70    /// only the access connector interprets it.
71    #[serde(
72        rename = "accountIdentity",
73        alias = "AccountIdentity",
74        skip_serializing_if = "Option::is_none"
75    )]
76    pub account_identity: Option<String>,
77    /// When true, the access connector terminates the account's live sessions after each rotation.
78    #[serde(
79        rename = "terminateSessions",
80        alias = "TerminateSessions",
81        skip_serializing_if = "Option::is_none"
82    )]
83    pub terminate_sessions: Option<bool>,
84    /// The scheduled-rotation cadence, as a Quartz 6-field cron expression evaluated in UTC. Null
85    /// means no scheduled rotation.
86    #[serde(
87        rename = "scheduleCron",
88        alias = "ScheduleCron",
89        skip_serializing_if = "Option::is_none"
90    )]
91    pub schedule_cron: Option<String>,
92    /// When true, the credential is rotated whenever an access lease on the cipher ends, whether
93    /// it expired or was revoked.
94    #[serde(
95        rename = "rotateOnAccessEnd",
96        alias = "RotateOnAccessEnd",
97        skip_serializing_if = "Option::is_none"
98    )]
99    pub rotate_on_access_end: Option<bool>,
100    /// When the config is next due (UTC). On an automatic target the sweep offers a job once this
101    /// is reached; on a manual target it instead marks the config
102    /// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Response.
103    /// PamRotationConfigResponseModel.AwaitingManualRotation. Null means nothing is due.
104    #[serde(
105        rename = "nextRotationAt",
106        alias = "NextRotationAt",
107        skip_serializing_if = "Option::is_none"
108    )]
109    pub next_rotation_at: Option<String>,
110    /// When false, the config is inactive and no rotation is offered for it.
111    #[serde(
112        rename = "enabled",
113        alias = "Enabled",
114        skip_serializing_if = "Option::is_none"
115    )]
116    pub enabled: Option<bool>,
117    /// When the last rotation for this config completed successfully (UTC). Null until the first
118    /// success.
119    #[serde(
120        rename = "lastRotationAt",
121        alias = "LastRotationAt",
122        skip_serializing_if = "Option::is_none"
123    )]
124    pub last_rotation_at: Option<String>,
125    /// Whether the config has a job in an active status -- spec `has_active_job`.
126    #[serde(
127        rename = "hasActiveJob",
128        alias = "HasActiveJob",
129        skip_serializing_if = "Option::is_none"
130    )]
131    pub has_active_job: Option<bool>,
132    /// A manual-target config whose schedule has come due -- spec `awaiting_manual_rotation`.
133    /// There is no job to claim; an operator must record the out-of-band rotation via `POST
134    /// rotation/configs/{id}/record-manual`.
135    #[serde(
136        rename = "awaitingManualRotation",
137        alias = "AwaitingManualRotation",
138        skip_serializing_if = "Option::is_none"
139    )]
140    pub awaiting_manual_rotation: Option<bool>,
141    /// When the config was created (UTC).
142    #[serde(
143        rename = "creationDate",
144        alias = "CreationDate",
145        skip_serializing_if = "Option::is_none"
146    )]
147    pub creation_date: Option<String>,
148    /// When the config was last modified (UTC).
149    #[serde(
150        rename = "revisionDate",
151        alias = "RevisionDate",
152        skip_serializing_if = "Option::is_none"
153    )]
154    pub revision_date: Option<String>,
155    /// Every job recorded against the config, newest first, each carrying its own attempts (oldest
156    /// first).
157    #[serde(
158        rename = "jobs",
159        alias = "Jobs",
160        skip_serializing_if = "Option::is_none"
161    )]
162    pub jobs: Option<Vec<models::PamRotationJobResponseModel>>,
163}
164
165impl PamRotationConfigDetailResponseModel {
166    /// A rotation config's detail view: the list shape flattened onto the same object, plus the
167    /// config's full job/attempt history. The managed-credential surface renders its header from
168    /// the config fields and the history section from
169    /// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Response.
170    /// PamRotationConfigDetailResponseModel.Jobs, so both arrive in one response -- the same shape
171    /// Bit.Services.Pam.AccessConnector.Api.Models.Response.PamAccessConnectorDetailResponseModel
172    /// returns for an access connector.
173    pub fn new() -> PamRotationConfigDetailResponseModel {
174        PamRotationConfigDetailResponseModel {
175            object: None,
176            id: None,
177            organization_id: None,
178            cipher_id: None,
179            target_system_id: None,
180            target_system_name: None,
181            target_system_method: None,
182            account_identity: None,
183            terminate_sessions: None,
184            schedule_cron: None,
185            rotate_on_access_end: None,
186            next_rotation_at: None,
187            enabled: None,
188            last_rotation_at: None,
189            has_active_job: None,
190            awaiting_manual_rotation: None,
191            creation_date: None,
192            revision_date: None,
193            jobs: None,
194        }
195    }
196}