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